This commit is contained in:
@@ -20,7 +20,7 @@ namespace AyaNova.PickList
|
|||||||
}
|
}
|
||||||
|
|
||||||
public string SQLFrom { get; set; }
|
public string SQLFrom { get; set; }
|
||||||
public List<AyaPickListFieldDefinition> FieldDefinitions { get; set; }
|
public List<AyaPickListFieldDefinition> ColumnDefinitions { get; set; }
|
||||||
public AuthorizationRoles AllowedRoles { get; set; }
|
public AuthorizationRoles AllowedRoles { get; set; }
|
||||||
public AyaType DefaultListObjectType { get; set; }
|
public AyaType DefaultListObjectType { get; set; }
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ namespace AyaNova.PickList
|
|||||||
|
|
||||||
foreach (string s in ListViewFieldKeys)
|
foreach (string s in ListViewFieldKeys)
|
||||||
{
|
{
|
||||||
AyaPickListFieldDefinition o = FieldDefinitions.FirstOrDefault(x => x.FieldKey == s);
|
AyaPickListFieldDefinition o = ColumnDefinitions.FirstOrDefault(x => x.FieldKey == s);
|
||||||
#if (DEBUG)
|
#if (DEBUG)
|
||||||
//Developers little helper
|
//Developers little helper
|
||||||
if (o == null)
|
if (o == null)
|
||||||
@@ -125,7 +125,7 @@ namespace AyaNova.PickList
|
|||||||
Dictionary<string, int> ret = new Dictionary<string, int>();
|
Dictionary<string, int> ret = new Dictionary<string, int>();
|
||||||
List<string> typesProcessed = new List<string>();
|
List<string> typesProcessed = new List<string>();
|
||||||
//custom fields handling
|
//custom fields handling
|
||||||
foreach (AyaPickListFieldDefinition d in this.FieldDefinitions)
|
foreach (AyaPickListFieldDefinition d in this.ColumnDefinitions)
|
||||||
{
|
{
|
||||||
if (d.IsCustomField)
|
if (d.IsCustomField)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace AyaNova.PickList
|
|||||||
string SQLFrom { get; set; }
|
string SQLFrom { get; set; }
|
||||||
|
|
||||||
//List of fields for this object
|
//List of fields for this object
|
||||||
List<AyaPickListFieldDefinition> FieldDefinitions { get; set; }
|
List<AyaPickListFieldDefinition> ColumnDefinitions { get; set; }
|
||||||
|
|
||||||
//allowed roles to access this list
|
//allowed roles to access this list
|
||||||
AuthorizationRoles AllowedRoles { get; set; }
|
AuthorizationRoles AllowedRoles { get; set; }
|
||||||
|
|||||||
@@ -44,16 +44,16 @@ namespace AyaNova.PickList
|
|||||||
Template = t.Template;
|
Template = t.Template;
|
||||||
}
|
}
|
||||||
|
|
||||||
//parse the list view
|
//parse the template
|
||||||
var ListViewArray = JArray.Parse(Template);
|
var jTemplate = JArray.Parse(Template);
|
||||||
|
|
||||||
|
|
||||||
//Get the field key names in a list from the listview
|
//Get the field key names in a list from the template
|
||||||
List<string> ListViewFieldList = PickList.GetFieldListFromTemplate(ListViewArray);
|
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
|
//Build the SELECT portion of a list query based on the ListView fields
|
||||||
internal static string Build(List<AyaPickListFieldDefinition> objectFieldsList, List<string> listViewFieldList)
|
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
|
//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
|
//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);
|
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
|
//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, });
|
//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",
|
LtKey = "WidgetName",
|
||||||
FieldKey = "widgetname",
|
FieldKey = "widgetname",
|
||||||
@@ -44,7 +44,7 @@ namespace AyaNova.PickList
|
|||||||
IsRowId = true
|
IsRowId = true
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
LtKey = "WidgetSerial",
|
LtKey = "WidgetSerial",
|
||||||
FieldKey = "widgetserial",
|
FieldKey = "widgetserial",
|
||||||
@@ -52,7 +52,7 @@ namespace AyaNova.PickList
|
|||||||
SqlValueColumnName = "awidget.serial"
|
SqlValueColumnName = "awidget.serial"
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
FieldKey = "username",
|
FieldKey = "username",
|
||||||
LtKey = "User",
|
LtKey = "User",
|
||||||
@@ -62,7 +62,7 @@ namespace AyaNova.PickList
|
|||||||
SqlValueColumnName = "auser.name"
|
SqlValueColumnName = "auser.name"
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaPickListFieldDefinition
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
LtKey = "Tags",
|
LtKey = "Tags",
|
||||||
FieldKey = "widgettags",
|
FieldKey = "widgettags",
|
||||||
|
|||||||
Reference in New Issue
Block a user