This commit is contained in:
@@ -81,7 +81,7 @@ namespace AyaNova.Api.Controllers
|
||||
foreach (AyaType t in values)
|
||||
{
|
||||
string name = t.ToString();
|
||||
if (t.HasAttribute(typeof(AttachableAttribute)))
|
||||
if (t.HasAttribute(typeof(CoreBizObjectAttribute)))
|
||||
{
|
||||
name += " [Attachable]";
|
||||
}
|
||||
|
||||
@@ -11,10 +11,12 @@ namespace AyaNova.PickList
|
||||
//Instantiate list object specified from type
|
||||
internal static IAyaPickList GetAyaPickList(AyaType ayaType)
|
||||
{
|
||||
switch(ayaType){
|
||||
case AyaType.Widget:
|
||||
return new WidgetPickList() as IAyaDataList;
|
||||
}
|
||||
switch (ayaType)
|
||||
{
|
||||
case AyaType.Widget:
|
||||
return new WidgetPickList() as IAyaPickList;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//List all the datalist types available
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
/// <summary>
|
||||
/// Marker attribute indicating that an object supports attachments
|
||||
/// Used in <see cref="AyaType"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class AttachableAttribute : Attribute
|
||||
{
|
||||
//No code required, it's just a marker
|
||||
//https://docs.microsoft.com/en-us/dotnet/standard/attributes/writing-custom-attributes
|
||||
}
|
||||
}//eons
|
||||
@@ -1,27 +1,26 @@
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// All AyaNova types and their attributes indicating what features that type will support (tagging, attachments etc)
|
||||
/// </summary>
|
||||
public enum AyaType : int
|
||||
{
|
||||
//COREBIZOBJECT attribute must be set on objects that are:
|
||||
//Attachable objects can have attachments,
|
||||
//wikiable objects can have a wiki
|
||||
//reviewable objects can have a review which is basically the same as a Reminder but with an object attached (was follow up schedmarker in v7)
|
||||
//PIckList-able (has picklist template)
|
||||
//Pretty much everything that represents some kind of real world object is wikiable or attachable as long as it has an ID and a type
|
||||
//exceptions would be utility type objects like datalistview, formcustom etc that are not
|
||||
|
||||
NoType = 0,
|
||||
Global = 1,
|
||||
|
||||
[Attachable]
|
||||
[CoreBizObject]
|
||||
Widget = 2,//attachable, wikiable, reviewable
|
||||
|
||||
[Attachable]
|
||||
[CoreBizObject]
|
||||
User = 3,//attachable, wikiable, reviewable
|
||||
|
||||
ServerState = 4,
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace AyaNova.Biz
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ObjectType.HasAttribute(typeof(AttachableAttribute));
|
||||
return this.ObjectType.HasAttribute(typeof(CoreBizObjectAttribute));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
server/AyaNova/biz/CoreBizObjectAttribute.cs
Normal file
22
server/AyaNova/biz/CoreBizObjectAttribute.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
/// <summary>
|
||||
/// Marker attribute indicating that an object is a core business object
|
||||
/// In other words a real world business relevant object and not a utility or internal type of object
|
||||
/// something that would be worked with by users in the UI for business purposes
|
||||
/// This is used to indicate that an object supports these features:
|
||||
/// PickList selectable (has picklist)
|
||||
/// Attachable (can attach to it)
|
||||
/// Reviewable (can set a review on it)
|
||||
/// ETC
|
||||
/// Used in <see cref="AyaType"/>
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class CoreBizObjectAttribute : Attribute
|
||||
{
|
||||
//No code required, it's just a marker
|
||||
//https://docs.microsoft.com/en-us/dotnet/standard/attributes/writing-custom-attributes
|
||||
}
|
||||
}//eons
|
||||
Reference in New Issue
Block a user