This commit is contained in:
@@ -82,7 +82,7 @@ namespace AyaNova.DataList
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListBase dataListBase)
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListProcessingBase dataListBase)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
//ClientCriteria MUST be CustomerId
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace AyaNova.DataList
|
||||
//Instantiate list object specified
|
||||
//this is safe as it's only attempting to load assemblies in the AyaNova.DataList namespace so can't attempt to instantiate some random object or nefarious object
|
||||
//returns null if doesn't exist
|
||||
internal static IDataList GetAyaDataList(string ListKey)
|
||||
internal static IDataListProcessing GetAyaDataList(string ListKey)
|
||||
{
|
||||
System.Reflection.Assembly ass = System.Reflection.Assembly.GetEntryAssembly();
|
||||
return ass.CreateInstance($"AyaNova.DataList.{ListKey}") as IDataList;
|
||||
return ass.CreateInstance($"AyaNova.DataList.{ListKey}") as IDataListProcessing;
|
||||
}
|
||||
|
||||
//List all the datalist types available
|
||||
@@ -27,7 +27,7 @@ namespace AyaNova.DataList
|
||||
|
||||
foreach (System.Reflection.TypeInfo ti in ass.DefinedTypes)
|
||||
{
|
||||
if (!ti.IsAbstract && ti.ImplementedInterfaces.Contains(typeof(IDataList)))
|
||||
if (!ti.IsAbstract && ti.ImplementedInterfaces.Contains(typeof(IDataListProcessing)))
|
||||
{
|
||||
ret.Add(ti.Name);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ namespace AyaNova.DataList
|
||||
if (!userRoles.HasAnyFlags(DataList.AllowedRoles))
|
||||
throw new System.UnauthorizedAccessException("User roles insufficient for this datalist");
|
||||
|
||||
|
||||
//turn the DataListTableRequest into a
|
||||
|
||||
DataList.SetListOptionDefaultsIfNecessary(dataListTableOptions);
|
||||
|
||||
|
||||
@@ -258,7 +261,7 @@ namespace AyaNova.DataList
|
||||
// if (string.IsNullOrWhiteSpace(listView))
|
||||
// listView = DataList.DefaultListView;
|
||||
|
||||
DataList.SetListOptionDefaultsIfNecessary(dataListSelectionOptions);
|
||||
DataList.ProcessRequest(dataListSelectionOptions);
|
||||
|
||||
// //parse the list view
|
||||
// var ListViewArray = JArray.Parse(listView);
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace AyaNova.DataList
|
||||
/// <summary>
|
||||
/// DataList object base class
|
||||
/// </summary>
|
||||
internal abstract class DataListProcessingBase : IDataList
|
||||
internal abstract class DataListProcessingBase : IDataListProcessing
|
||||
{
|
||||
//CoreBizObject add here
|
||||
//well, not here exactly but add a new DATALIST class if it will be displayed as a list anywhere in the UI or reported on
|
||||
@@ -40,7 +40,7 @@ namespace AyaNova.DataList
|
||||
public Dictionary<string, string> DefaultSortBy { get; set; }
|
||||
|
||||
//set defaults if not provided in listOptions
|
||||
public void SetListOptionDefaultsIfNecessary(DataListBase listOptions)
|
||||
public void ProcessRequest(Models.DataListProcessingBase listOptions)
|
||||
{
|
||||
//columns, filter and sortby could all be null
|
||||
if (listOptions.Filter == null)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace AyaNova.DataList
|
||||
{
|
||||
public static class DataListSqlFilterCriteriaBuilder
|
||||
{
|
||||
public static string DataFilterToSQLCriteria(List<DataListFieldDefinition> objectFieldsList, Models.DataListBase listOptions)
|
||||
public static string DataFilterToSQLCriteria(List<DataListFieldDefinition> objectFieldsList, Models.DataListProcessingBase listOptions)
|
||||
{
|
||||
|
||||
if (listOptions.Filter == null || listOptions.Filter.Count == 0)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace AyaNova.DataList
|
||||
{
|
||||
|
||||
|
||||
public static string DataFilterToSQLOrderBy(List<DataListFieldDefinition> objectFieldsList, Models.DataListBase listOptions)
|
||||
public static string DataFilterToSQLOrderBy(List<DataListFieldDefinition> objectFieldsList, Models.DataListProcessingBase listOptions)
|
||||
{
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace AyaNova.DataList
|
||||
//Additional criteria for security or other reasons
|
||||
//hard coded into some lists (e.g. MemoDataList so users can't get other people's memos)
|
||||
//clientCriteria is additional criteria provided by client to list to process as it sees fit (e.g. CustomerNoteDataList requires customer id from client)
|
||||
System.Collections.Generic.List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AyaNova.Biz.AuthorizationRoles userRoles, Models.DataListBase dataListBase);
|
||||
System.Collections.Generic.List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AyaNova.Biz.AuthorizationRoles userRoles, Models.DataListProcessingBase dataListBase);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal interface IDataList
|
||||
internal interface IDataListProcessing
|
||||
{
|
||||
|
||||
//sql query from fragment with table joins et
|
||||
@@ -23,7 +23,7 @@ namespace AyaNova.DataList
|
||||
List<string> DefaultColumns { get; set; }
|
||||
Dictionary<string, string> DefaultSortBy { get; set; }
|
||||
|
||||
void SetListOptionDefaultsIfNecessary(Models.DataListBase listOptions);
|
||||
void ProcessRequest(Models.DataListProcessingBase listOptions);
|
||||
|
||||
Newtonsoft.Json.Linq.JArray GenerateReturnListColumns(List<string> columns);
|
||||
// List<string> GetFieldListFromListView(JArray listViewArray);
|
||||
@@ -115,7 +115,7 @@ namespace AyaNova.DataList
|
||||
});
|
||||
}
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListBase dataListBase)
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListProcessingBase dataListBase)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace AyaNova.DataList
|
||||
|
||||
}
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListBase dataListBase)
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListProcessingBase dataListBase)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace AyaNova.DataList
|
||||
});
|
||||
}
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListBase dataListBase)
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListProcessingBase dataListBase)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace AyaNova.DataList
|
||||
|
||||
}
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListBase dataListBase)
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListProcessingBase dataListBase)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace AyaNova.DataList
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListBase dataListBase)
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListProcessingBase dataListBase)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace AyaNova.DataList
|
||||
}
|
||||
|
||||
//Ensure only current user can fetch their reminders
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListBase dataListBase)
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListProcessingBase dataListBase)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace AyaNova.DataList
|
||||
// return "[]";//this means effectively don't process this at all
|
||||
// }
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListBase dataListBase)
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, Models.DataListProcessingBase dataListBase)
|
||||
{
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
bool HasSupervisorRole =
|
||||
|
||||
Reference in New Issue
Block a user