This commit is contained in:
@@ -20,7 +20,7 @@ namespace AyaNova.PickList
|
||||
}
|
||||
|
||||
public string SQLFrom { get; set; }
|
||||
public List<AyaPickListFieldDefinition> FieldDefinitions { get; set; }
|
||||
public List<AyaPickListFieldDefinition> ColumnDefinitions { get; set; }
|
||||
public AuthorizationRoles AllowedRoles { get; set; }
|
||||
public AyaType DefaultListObjectType { get; set; }
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace AyaNova.PickList
|
||||
|
||||
foreach (string s in ListViewFieldKeys)
|
||||
{
|
||||
AyaPickListFieldDefinition o = FieldDefinitions.FirstOrDefault(x => x.FieldKey == s);
|
||||
AyaPickListFieldDefinition o = ColumnDefinitions.FirstOrDefault(x => x.FieldKey == s);
|
||||
#if (DEBUG)
|
||||
//Developers little helper
|
||||
if (o == null)
|
||||
@@ -125,7 +125,7 @@ namespace AyaNova.PickList
|
||||
Dictionary<string, int> ret = new Dictionary<string, int>();
|
||||
List<string> typesProcessed = new List<string>();
|
||||
//custom fields handling
|
||||
foreach (AyaPickListFieldDefinition d in this.FieldDefinitions)
|
||||
foreach (AyaPickListFieldDefinition d in this.ColumnDefinitions)
|
||||
{
|
||||
if (d.IsCustomField)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace AyaNova.PickList
|
||||
string SQLFrom { get; set; }
|
||||
|
||||
//List of fields for this object
|
||||
List<AyaPickListFieldDefinition> FieldDefinitions { get; set; }
|
||||
List<AyaPickListFieldDefinition> ColumnDefinitions { get; set; }
|
||||
|
||||
//allowed roles to access this list
|
||||
AuthorizationRoles AllowedRoles { get; set; }
|
||||
|
||||
@@ -44,16 +44,16 @@ namespace AyaNova.PickList
|
||||
Template = t.Template;
|
||||
}
|
||||
|
||||
//parse the list view
|
||||
var ListViewArray = JArray.Parse(Template);
|
||||
//parse the template
|
||||
var jTemplate = JArray.Parse(Template);
|
||||
|
||||
|
||||
//Get the field key names in a list from the listview
|
||||
List<string> ListViewFieldList = PickList.GetFieldListFromTemplate(ListViewArray);
|
||||
//Get the field key names in a list from the template
|
||||
List<string> TemplateColumnNames = PickList.GetFieldListFromTemplate(jTemplate);
|
||||
|
||||
//BUILD THE QUERY
|
||||
//BUILD THE QUERY
|
||||
|
||||
var q = PickListSqlBuilder.Build(PickList.FieldDefinitions, ListViewFieldList);
|
||||
var q = PickListSqlBuilder.Build(PickList.ColumnDefinitions, TemplateColumnNames);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace AyaNova.PickList
|
||||
//Build the SELECT portion of a list query based on the ListView fields
|
||||
internal static string Build(List<AyaPickListFieldDefinition> objectFieldsList, List<string> listViewFieldList)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
|
||||
|
||||
TODO: build a sql select and order by and a where clause that searches appropriately in each field (tags)
|
||||
//TODO: build a sql select and order by and a where clause that searches appropriately in each field (tags)
|
||||
//it should return results based on the query where there is a single name (display) column and an id column for rowid
|
||||
//and the fields should be combined in a standard way separated by spaces "Widget widgetserial username" for compactness
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace AyaNova.PickList
|
||||
base.DefaultTemplate = dTemplate.ToString(Newtonsoft.Json.Formatting.None);
|
||||
|
||||
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely
|
||||
FieldDefinitions = new List<AyaPickListFieldDefinition>();
|
||||
ColumnDefinitions = new List<AyaPickListFieldDefinition>();
|
||||
//DEPRECATED: FieldDefinitions.Add(new AyaPickListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id", IsFilterable = false, IsSortable = false, });
|
||||
|
||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
LtKey = "WidgetName",
|
||||
FieldKey = "widgetname",
|
||||
@@ -44,7 +44,7 @@ namespace AyaNova.PickList
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
LtKey = "WidgetSerial",
|
||||
FieldKey = "widgetserial",
|
||||
@@ -52,7 +52,7 @@ namespace AyaNova.PickList
|
||||
SqlValueColumnName = "awidget.serial"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
FieldKey = "username",
|
||||
LtKey = "User",
|
||||
@@ -62,7 +62,7 @@ namespace AyaNova.PickList
|
||||
SqlValueColumnName = "auser.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
LtKey = "Tags",
|
||||
FieldKey = "widgettags",
|
||||
|
||||
Reference in New Issue
Block a user