vast improvements to methods, GRA and GRS work now, yay
This commit is contained in:
parent
eb3bc62854
commit
70ce315f51
@ -299,6 +299,8 @@ elif [ "$1" == "attribute" ]; then
|
||||
|
||||
if [ "$4" == "for" ]; then
|
||||
|
||||
# usage: `mocha oms attribute set (att) for (inst) (value)`
|
||||
|
||||
ATT_ID=$3
|
||||
INST_ID=$5
|
||||
ATT_VALUE=$6
|
||||
|
||||
@ -107,6 +107,8 @@
|
||||
- IDC_UserLogin: '{64F4BCDB-38D0-4373-BA30-8AE99AF1A5F7}'
|
||||
- IDC_UserPreferences: '{d455a1d5-ae47-4d94-ac55-debe5760d682}'
|
||||
|
||||
- IDC_PersonName: '{56cedd2a-59d4-41be-b861-33dc892cfff9}'
|
||||
|
||||
- IDC_MenuItemCommand: '{9D3EDE23-6DB9-4664-9145-ABCBD3A0A2C2}'
|
||||
- IDC_MenuItemSeparator: '{798DECAB-5119-49D7-B0AD-D4BF45807188}'
|
||||
- IDC_MenuItemHeader: '{1F148873-8A97-4409-A79B-C19D5D380CA4}'
|
||||
|
||||
@ -65,3 +65,6 @@
|
||||
- IDA_OpenInNewWindow: '{4a211f11-c5c3-4b58-a7f4-ed62538c5a3d}'
|
||||
- IDA_LongRunning: '{c03aa999-83bc-49db-a27e-70fee477b9fb}'
|
||||
- IDA_SuppressRIHints: '{43328aec-6a5d-4955-8d04-a96dcf98ab02}'
|
||||
|
||||
- IDA_GivenName: '{94a3ab09-3db7-4207-9e66-9526eb738669}'
|
||||
- IDA_FamilyName: '{b84f602d-6bfc-4898-9d44-4d49af44cbb4}'
|
||||
@ -106,11 +106,19 @@
|
||||
- IDR_Get_Attribute_Method__returns__Attribute: "{5eca9b3f-be75-4f6e-8495-781480774833}"
|
||||
- IDR_Attribute__returned_by__Get_Attribute_Method: "{e82ace2e-84b7-4912-89ed-7b8efd63bb5d}"
|
||||
|
||||
- IDR_Get_Referenced_Instance_Set_Method__loop_on__Instance_Set: "{2978238f-7cb0-4ba3-8c6f-473df782cfef}"
|
||||
- IDR_Get_Referenced_Instance_Set_Method__has_relationship__Method: "{6a65819e-c8cb-4575-9af8-ee221364049b}"
|
||||
- IDR_Get_Referenced_Instance_Set_Method__returns__Work_Set: "{72057f5b-9b49-497d-852f-cd7e5e258d6c}"
|
||||
- IDR_Work_Set__returned_by__Get_Referenced_Instance_Set_Method: "{ac6092e6-e098-40a3-a9fb-f27312cffa7c}"
|
||||
- IDR_Get_Referenced_Instance_Set_Method__uses_reference__Executable_returning_Instance_Set: "{2978238f-7cb0-4ba3-8c6f-473df782cfef}" # Loop on Instance Set
|
||||
- IDR_Executable_returning_Instance_Set__reference_used_by__Get_Referenced_Instance_Set_Method: "{22756055-ea78-4893-9404-2f3704fce188}"
|
||||
- IDR_Get_Referenced_Instance_Set_Method__uses_answer__Executable_returning_Instance_Set: "{6a65819e-c8cb-4575-9af8-ee221364049b}" # IDR_Get_Referenced_Instance_Set_Method__has_relationship__Method
|
||||
- IDR_Executable_returning_Instance_Set__answer_used_by__Get_Referenced_Instance_Set_Method: "{3e01a160-429e-40eb-b342-f3c18da86ae3}"
|
||||
|
||||
- IDR_Get_Referenced_Attribute_Method__has__Attribute: "{87f90fe9-5ec6-4b09-8f51-b8a4d1544cae}"
|
||||
- IDR_Get_Referenced_Attribute_Method__loop_on__Instance_Set: "{c7ecd498-6d05-4e07-b1bc-f7127d0d6666}"
|
||||
- IDR_Get_Referenced_Attribute_Method__returns__Attribute: "{87f90fe9-5ec6-4b09-8f51-b8a4d1544cae}"
|
||||
- IDR_Attribute__returned_by__Get_Referenced_Attribute_Method: "{80e4ffd8-77d8-4835-a4e0-73a176e7f646}"
|
||||
- IDR_Get_Referenced_Attribute_Method__uses_reference__Executable_returning_Instance_Set: "{c7ecd498-6d05-4e07-b1bc-f7127d0d6666}"
|
||||
- IDR_Executable_returning_Instance_Set__reference_used_by__Get_Referenced_Attribute_Method: "{b9a44398-e6c5-48f9-8ec5-a8b158a7adf5}"
|
||||
- IDR_Get_Referenced_Attribute_Method__uses_answer__Executable_returning_Attribute: "{022ccde3-2b9e-4573-a8fc-e7568f420cd3}"
|
||||
- IDR_Executable_returning_Attribute__answer_used_by__Get_Referenced_Attribute_Method: "{738ff9a4-eb71-476e-a0a4-524f1de56add}"
|
||||
|
||||
- IDR_Get_Specified_Instances_Method__returns__Work_Set: "{27796f3d-0cbd-42c5-a840-791d3af6c16d}"
|
||||
- IDR_Work_Set__returned_by__Get_Specified_Instances_Method: "{3a0080c7-7061-42a4-9814-cd3f6efaaa16}"
|
||||
@ -321,6 +329,9 @@
|
||||
- IDR_System_Account__has__User_Preferences: "{ada4deb2-adfd-409f-b13a-9856fabd5522}"
|
||||
- IDR_User_Preferences__for__System_Account: "{ab2372a5-a4c7-488a-89f6-67e5834f8c83}"
|
||||
|
||||
- IDR_System_Account__has_preferred_display__Person_Name: "{fb389a4e-4b0e-4742-a7b4-1408403eebc9}"
|
||||
- IDR_Person_Name__preferred_display_for__System_Account: "{13f8bedd-34b6-4343-bf86-6d33171cbc27}"
|
||||
|
||||
- IDR_Instance__has__Instance_Source: '{B62F9B81-799B-4ABE-A4AF-29B45347DE54}'
|
||||
- IDR_Instance_Source__for__Instance: '{FBB9391D-C4A2-4326-9F85-7801F377253C}'
|
||||
|
||||
@ -370,3 +381,6 @@
|
||||
|
||||
- IDR_Build_Element_Method__returns__Element: '{4d13d021-7363-4131-b74a-241698c3f1d0}'
|
||||
- IDR_Element__returned_by__Build_Element_Method: '{ae6a82f0-950b-44c0-a1e6-53d8a7e9e46d}'
|
||||
|
||||
- IDR_Instance_Op_Method__returns__Work_Set: '{aadc223e-e300-4914-ad29-62d497afcc36}'
|
||||
- IDR_Work_Set__returned_by__Instance_Op_Method: '{5e15f42f-e634-45ee-9ecc-fbde4fd0c38f}'
|
||||
@ -36,6 +36,6 @@
|
||||
- IDC_GetRelationshipMethod: "{d53c9232-89ef-4cca-8520-261da6787450}" # 1$207
|
||||
- IDC_InvokeWebServiceMethod: "{26d9e733-50a0-49f7-9b2c-2142934e3952}" # 1$208
|
||||
- IDC_GetInstancesMethod: '{0a379314-9d0f-432d-ae59-63194ab32dd3}' # 1$393
|
||||
- IDC_InstanceOpMethod: "{4c814982-938f-4116-bdc1-827bae6a5f71}"
|
||||
- IDC_InstanceOpMethod: "{4c814982-938f-4116-bdc1-827bae6a5f71}" # 1$2663
|
||||
- IDC_ConditionalSelectAttributeMethod: "{d534a369-321e-4c32-bd7f-8ff2017f191e}" # 1$13038
|
||||
- IDC_ConditionalSelectFromInstanceSetMethod: "{ffea8e52-06e5-4e95-8c40-da3ba54ce95f}" # 1$13039
|
||||
@ -8,3 +8,4 @@
|
||||
- IDI_Task_ShowDefinitionInCodeEditor: '{4f8a0e8e-e139-4cc6-b8cf-a32e67bd192d}'
|
||||
- IDI_Task_DeleteInstance: '{276c5933-89a9-4a22-8fe3-cd9fda5377a8}'
|
||||
- IDI_Task_ViewIntegrationIDs: '{8a2a0ef3-a145-4026-9c55-4d0133eff929}'
|
||||
- IDI_SequenceTask_ViewSystemUser: '{5fd32c2b-7169-4db7-9379-6d8cb479c60e}'
|
||||
@ -12,5 +12,13 @@
|
||||
- IDM_User__get__Preferred_Display_Name: '{2febf91e-df60-4615-a15b-fbbe80b148c5}'
|
||||
- IDMB_User__get__Preferred_Display_Name: '{12cd3f67-095f-488c-9886-c3a0df97d42c}'
|
||||
|
||||
- IDM_User__get__Preferred_Display_Name_Formatted: '{e5e0ac88-378f-4f2b-97c1-7dd022f8f6f1}'
|
||||
- IDMB_User__get__Preferred_Display_Name_Formatted: '{84a7c1af-b07d-4a58-b7f3-8420836a5038}'
|
||||
|
||||
- IDM_Common_Text__get__Forward_Slash: '{b727d9f4-42e5-4be2-9411-0f794bfe773e}'
|
||||
- IDM_Common_Text__get__Single_Space: '{94297e64-f210-4777-bd94-a4a19e5fed2c}'
|
||||
|
||||
- IDM_User__get__Preferred_Display_Name_-_Given_Name: '{f33cb57c-5162-46b3-9271-3e8f610984fd}'
|
||||
- IDMB_User__get__Preferred_Display_Name_-_Given_Name: '{12a1ce0e-2eb8-4e55-8539-d092c89d293b}'
|
||||
- IDM_User__get__Preferred_Display_Name_-_Family_Name: '{3dc5bfc9-8f9c-49ff-a36c-4eb904e09773}'
|
||||
- IDMB_User__get__Preferred_Display_Name_-_Family_Name: '{0fb4c89e-360c-4a23-9fba-da65b73849ca}'
|
||||
@ -1,2 +1,3 @@
|
||||
- entityDefinitions:
|
||||
- IDI_WorkSet_ClassForEditClassTask: '{b56ac9b9-efce-4a40-8c04-ffdf90174285}'
|
||||
- IDI_WorkSet_PreferredDisplayName: '{86149123-6d32-4f48-b128-8f773cdb2b0e}'
|
||||
@ -7,3 +7,4 @@
|
||||
- IDI_TaskCategory_Debugging: '{8f6e81be-9663-4226-85c3-253588126ea2}'
|
||||
- IDI_TaskCategory_IntegrationIDs: '{79449821-89d6-4f83-b3dd-0e780b0a9fef}'
|
||||
- IDI_TaskCategory_Element: '{7ac1d803-7007-4b3d-b06e-886d62f758c9}'
|
||||
- IDI_TaskCategory_SystemUser: '{c425d5cb-82b2-41d1-ab3c-db446e3b1b8e}'
|
||||
@ -87,3 +87,8 @@
|
||||
|
||||
- textAttribute: '&IDA_CSSValue;'
|
||||
index: 57
|
||||
|
||||
- textAttribute: '&IDA_GivenName;'
|
||||
name: 'Given Name'
|
||||
- textAttribute: '&IDA_FamilyName;'
|
||||
name: 'Family Name'
|
||||
@ -0,0 +1,65 @@
|
||||
---
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- class: '&IDC_GetReferencedAttributeMethod;'
|
||||
inherits: '&IDC_Method;'
|
||||
name: GRA - Get Referenced Attribute Method
|
||||
index: 18
|
||||
customTagName: getReferencedAttributeMethod
|
||||
relationships:
|
||||
- instance: '&IDR_Method__for__Class;'
|
||||
customTagName: 'forClassId'
|
||||
- instance: '&IDR_Get_Referenced_Attribute_Method__returns__Attribute;'
|
||||
customTagName: 'returnsAttributeId'
|
||||
- instance: '&IDR_Get_Referenced_Attribute_Method__uses_reference__Executable_returning_Instance_Set;'
|
||||
customTagName: 'referenceInstanceSet'
|
||||
- instance: '&IDR_Get_Referenced_Attribute_Method__uses_answer__Executable_returning_Attribute;'
|
||||
customTagName: 'answerAttribute'
|
||||
|
||||
- relationship: '&IDR_Get_Referenced_Attribute_Method__returns__Attribute;'
|
||||
index: 28
|
||||
sourceClassId: '&IDC_GetReferencedAttributeMethod;'
|
||||
type: 'returns'
|
||||
destinationClassId: '&IDC_Attribute;'
|
||||
siblingRelationshipId: '&IDR_Attribute__returned_by__Get_Referenced_Attribute_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Attribute__returned_by__Get_Referenced_Attribute_Method;'
|
||||
index: 29
|
||||
sourceClassId: '&IDC_Attribute;'
|
||||
type: 'returned by'
|
||||
destinationClassId: '&IDC_GetReferencedAttributeMethod;'
|
||||
siblingRelationshipId: '&IDR_Get_Referenced_Attribute_Method__returns__Attribute;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Get_Referenced_Attribute_Method__uses_reference__Executable_returning_Instance_Set;'
|
||||
index: 40
|
||||
sourceClassId: '&IDC_GetReferencedAttributeMethod;'
|
||||
type: 'uses reference'
|
||||
destinationClassId: '&IDC_ExecutableReturningInstanceSet;'
|
||||
siblingRelationshipId: '&IDR_Executable_returning_Instance_Set__reference_used_by__Get_Referenced_Attribute_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Executable_returning_Instance_Set__reference_used_by__Get_Referenced_Attribute_Method;'
|
||||
index: 47
|
||||
sourceClassId: '&IDC_ExecutableReturningInstanceSet;'
|
||||
type: 'reference used by'
|
||||
destinationClassId: '&IDC_GetReferencedAttributeMethod;'
|
||||
siblingRelationshipId: '&IDR_Get_Referenced_Attribute_Method__uses_reference__Executable_returning_Instance_Set;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Get_Referenced_Attribute_Method__uses_answer__Executable_returning_Attribute;'
|
||||
index: 41
|
||||
sourceClassId: '&IDC_GetReferencedAttributeMethod;'
|
||||
type: 'uses answer'
|
||||
destinationClassId: '&IDC_ExecutableReturningAttribute;'
|
||||
siblingRelationshipId: '&IDR_Executable_returning_Attribute__answer_used_by__Get_Referenced_Attribute_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Executable_returning_Attribute__answer_used_by__Get_Referenced_Attribute_Method;'
|
||||
index: 48
|
||||
sourceClassId: '&IDC_ExecutableReturningAttribute;'
|
||||
type: 'answer used by'
|
||||
destinationClassId: '&IDC_GetReferencedAttributeMethod;'
|
||||
siblingRelationshipId: '&IDR_Get_Referenced_Attribute_Method__uses_answer__Executable_returning_Attribute;'
|
||||
singular: no
|
||||
@ -0,0 +1,65 @@
|
||||
---
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- class: '&IDC_GetReferencedInstanceSetMethod;'
|
||||
inherits: '&IDC_Method;'
|
||||
name: GRS - Get Referenced Instance Set Method
|
||||
index: 26
|
||||
customTagName: getReferencedInstanceSetMethod
|
||||
relationships:
|
||||
- instance: '&IDR_Method__for__Class;'
|
||||
customTagName: 'forClassId'
|
||||
- instance: '&IDR_Get_Referenced_Instance_Set_Method__returns__Work_Set;'
|
||||
customTagName: 'returnsWorkSetId'
|
||||
- instance: '&IDR_Get_Referenced_Instance_Set_Method__uses_reference__Executable_returning_Instance_Set;'
|
||||
customTagName: 'referenceInstanceSet'
|
||||
- instance: '&IDR_Get_Referenced_Instance_Set_Method__uses_answer__Executable_returning_Instance_Set;'
|
||||
customTagName: 'answerInstanceSet'
|
||||
|
||||
- relationship: '&IDR_Get_Referenced_Instance_Set_Method__returns__Work_Set;'
|
||||
index: 26
|
||||
sourceClassId: '&IDC_GetReferencedInstanceSetMethod;'
|
||||
type: 'returns'
|
||||
destinationClassId: '&IDC_WorkSet;'
|
||||
siblingRelationshipId: '&IDR_Work_Set__returned_by__Get_Referenced_Instance_Set_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Work_Set__returned_by__Get_Referenced_Instance_Set_Method;'
|
||||
index: 27
|
||||
sourceClassId: '&IDC_WorkSet;'
|
||||
type: 'returned by'
|
||||
destinationClassId: '&IDC_GetReferencedInstanceSetMethod;'
|
||||
siblingRelationshipId: '&IDR_Get_Referenced_Instance_Set_Method__returns__Work_Set;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Get_Referenced_Instance_Set_Method__uses_reference__Executable_returning_Instance_Set;'
|
||||
index: 38
|
||||
sourceClassId: '&IDC_GetReferencedInstanceSetMethod;'
|
||||
type: 'uses reference'
|
||||
destinationClassId: '&IDC_ExecutableReturningInstanceSet;'
|
||||
siblingRelationshipId: '&IDR_Executable_returning_Instance_Set__reference_used_by__Get_Referenced_Instance_Set_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Executable_returning_Instance_Set__reference_used_by__Get_Referenced_Instance_Set_Method;'
|
||||
index: 45
|
||||
sourceClassId: '&IDC_ExecutableReturningInstanceSet;'
|
||||
type: 'reference used by'
|
||||
destinationClassId: '&IDC_GetReferencedInstanceSetMethod;'
|
||||
siblingRelationshipId: '&IDR_Get_Referenced_Instance_Set_Method__uses_reference__Executable_returning_Instance_Set;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Get_Referenced_Instance_Set_Method__uses_answer__Executable_returning_Instance_Set;'
|
||||
index: 39
|
||||
sourceClassId: '&IDC_GetReferencedInstanceSetMethod;'
|
||||
type: 'uses answer'
|
||||
destinationClassId: '&IDC_ExecutableReturningInstanceSet;'
|
||||
siblingRelationshipId: '&IDR_Executable_returning_Instance_Set__answer_used_by__Get_Referenced_Instance_Set_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Executable_returning_Instance_Set__answer_used_by__Get_Referenced_Instance_Set_Method;'
|
||||
index: 46
|
||||
sourceClassId: '&IDC_ExecutableReturningInstanceSet;'
|
||||
type: 'answer used by'
|
||||
destinationClassId: '&IDC_GetReferencedInstanceSetMethod;'
|
||||
siblingRelationshipId: '&IDR_Get_Referenced_Instance_Set_Method__uses_answer__Executable_returning_Instance_Set;'
|
||||
singular: no
|
||||
@ -4,6 +4,7 @@
|
||||
name: System User
|
||||
index: 39
|
||||
customTagName: 'user'
|
||||
defaultTask: '&IDI_SequenceTask_ViewSystemUser;'
|
||||
instancesLabeledByRAMB: '&IDMB_User__get__User_Name_with_Full_Name;'
|
||||
attributes:
|
||||
- instance: '&IDA_UserName;'
|
||||
@ -15,6 +16,11 @@
|
||||
relationships:
|
||||
- instance: '&IDR_System_Account__has__User_Preferences;'
|
||||
customTagName: 'hasUserPreferences'
|
||||
- instance: '&IDR_System_Account__has_preferred_display__Person_Name;'
|
||||
customTagName: 'preferredDisplayName'
|
||||
customTagNameCreatesInstanceOf: '&IDC_PersonName;'
|
||||
relatedTasks:
|
||||
- instance: '&IDI_SequenceTask_ViewSystemUser;'
|
||||
|
||||
- class: '&IDC_UserLogin;'
|
||||
name: System Account Signon
|
||||
@ -36,3 +42,19 @@
|
||||
# destinationClassId: '&IDC_UserLogin;'
|
||||
# siblingRelationshipId: '&IDR_User_Login__has__User;'
|
||||
# singular: no
|
||||
|
||||
- relationship: '&IDR_System_Account__has_preferred_display__Person_Name;'
|
||||
index: 963
|
||||
sourceClassId: '&IDC_User;'
|
||||
type: 'has preferred display'
|
||||
destinationClassId: '&IDC_PersonName;'
|
||||
# siblingRelationshipId: '&IDR_User__for__User_Login;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Person_Name__preferred_display_for__System_Account;'
|
||||
index: 964
|
||||
sourceClassId: '&IDC_User;'
|
||||
type: 'preferred display for'
|
||||
destinationClassId: '&IDC_User;'
|
||||
# siblingRelationshipId: '&IDR_User__for__User_Login;'
|
||||
singular: no
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- class: '&IDC_PersonName;'
|
||||
name: Person Name
|
||||
index: 402
|
||||
customTagName: 'personName'
|
||||
registerForTemplate: yes
|
||||
attributes:
|
||||
- instance: '&IDA_GivenName;'
|
||||
customTagName: 'givenName'
|
||||
- instance: '&IDA_FamilyName;'
|
||||
customTagName: 'familyName'
|
||||
@ -0,0 +1,24 @@
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- class: '&IDC_InstanceOpMethod;'
|
||||
name: 'IOP - Instance Op Method'
|
||||
index: 2663
|
||||
relationships:
|
||||
- instance: '&IDR_Instance_Op_Method__returns__Work_Set;'
|
||||
customTagName: returnsWorkSetId
|
||||
|
||||
- relationship: '&IDR_Instance_Op_Method__returns__Work_Set;'
|
||||
index: 6842
|
||||
sourceClassId: '&IDC_InstanceOpMethod;'
|
||||
type: 'returns'
|
||||
destinationClassId: '&IDC_WorkSet;'
|
||||
siblingRelationshipId: '&IDR_Work_Set__returned_by__Instance_Op_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Work_Set__returned_by__Instance_Op_Method;'
|
||||
index: 6843
|
||||
sourceClassId: '&IDC_WorkSet;'
|
||||
type: 'returned by'
|
||||
destinationClassId: '&IDC_InstanceOpMethod;'
|
||||
siblingRelationshipId: '&IDR_Instance_Op_Method__returns__Work_Set;'
|
||||
singular: no
|
||||
@ -23,3 +23,5 @@
|
||||
name: 'Debugging'
|
||||
- taskCategory: '&IDI_TaskCategory_Element;'
|
||||
name: 'Element'
|
||||
- taskCategory: '&IDI_TaskCategory_SystemUser;'
|
||||
name: 'System User'
|
||||
@ -2,6 +2,7 @@
|
||||
instances:
|
||||
- buildAttributeMethod: '&IDM_Common_Text__get__Forward_Slash;'
|
||||
forClassId: '&IDC_CommonText;'
|
||||
returnsAttributeId: '&IDA_Value;'
|
||||
verb: 'get'
|
||||
name: 'Forward Slash'
|
||||
initialValue: '/'
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
instances:
|
||||
- buildAttributeMethod: '&IDM_Common_Text__get__Single_Space;'
|
||||
forClassId: '&IDC_CommonText;'
|
||||
returnsAttributeId: '&IDA_Value;'
|
||||
verb: 'get'
|
||||
name: 'Single Space'
|
||||
initialValue: ' '
|
||||
|
||||
@ -1,30 +1,30 @@
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- getReferencedAttributeMethod: '&IDM_Translation__get__Translation_Value;'
|
||||
description: 'Returns Translation Value Text Attribute for the given Translation and Language parms'
|
||||
forClassId: '&IDC_Translation;'
|
||||
verb: 'get'
|
||||
name: 'Translation Value'
|
||||
moduleId: '&IDI_Module_MochaBaseSystem;'
|
||||
methodAccess: '&IDI_MethodAccess_Public;'
|
||||
static: yes
|
||||
final: no
|
||||
parameters:
|
||||
# Date And Time [DT(ms)]
|
||||
- instance: '&IDI_WorkSet_Translation;'
|
||||
required: yes
|
||||
nullable: no
|
||||
- instance: '&IDI_WorkSet_Language;'
|
||||
required: yes
|
||||
nullable: yes # defaults to User@get preferred Language
|
||||
comment: ''
|
||||
tags: []
|
||||
docs:
|
||||
- title: GRA method documentation
|
||||
- iid: null
|
||||
returnsAttributeId: '&IDA_Value;'
|
||||
# - library: '&IDL_MochaBaseSystem;'
|
||||
# instances:
|
||||
# - getReferencedAttributeMethod: '&IDM_Translation__get__Translation_Value;'
|
||||
# description: 'Returns Translation Value Text Attribute for the given Translation and Language parms'
|
||||
# forClassId: '&IDC_Translation;'
|
||||
# verb: 'get'
|
||||
# name: 'Translation Value'
|
||||
# moduleId: '&IDI_Module_MochaBaseSystem;'
|
||||
# methodAccess: '&IDI_MethodAccess_Public;'
|
||||
# static: yes
|
||||
# final: no
|
||||
# parameters:
|
||||
# # Date And Time [DT(ms)]
|
||||
# - instance: '&IDI_WorkSet_Translation;'
|
||||
# required: yes
|
||||
# nullable: no
|
||||
# - instance: '&IDI_WorkSet_Language;'
|
||||
# required: yes
|
||||
# nullable: yes # defaults to User@get preferred Language
|
||||
# comment: ''
|
||||
# tags: []
|
||||
# docs:
|
||||
# - title: GRA method documentation
|
||||
# - iid: null
|
||||
# returnsAttributeId: '&IDA_Value;'
|
||||
|
||||
# method implementation
|
||||
loopOnInstanceSetId: '&IDMB_Translation__get__Translation_Value_Instance_for_Translation_and_Language;'
|
||||
getAttributeId: '&IDMB_Translation_Value__get__Value;'
|
||||
accumulationFunctionId: null
|
||||
# # method implementation
|
||||
# referenceInstanceSet: '&IDMB_Translation__get__Translation_Value_Instance_for_Translation_and_Language;'
|
||||
# answerAttribute: '&IDMB_Translation_Value__get__Value;'
|
||||
# accumulationFunctionId: null
|
||||
|
||||
@ -1,12 +1,57 @@
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- returnAttributeMethodBinding: '&IDMB_User__get__Preferred_Display_Name;'
|
||||
executesMethod: '&IDM_User__get__Preferred_Display_Name;'
|
||||
- returnAttributeMethodBinding: '&IDMB_User__get__Preferred_Display_Name_Formatted;'
|
||||
executesMethod: '&IDM_User__get__Preferred_Display_Name_Formatted;'
|
||||
|
||||
- buildAttributeMethod: '&IDM_User__get__Preferred_Display_Name;'
|
||||
# - buildAttributeMethod: '&IDM_User__get__Preferred_Display_Name;'
|
||||
# forClassId: '&IDC_User;'
|
||||
# returnsAttributeId: '&IDA_Value;'
|
||||
# verb: 'get'
|
||||
# name: 'Preferred Display Name'
|
||||
# initialValue: 'Testing Preferred Display Name'
|
||||
|
||||
- workSet: '&IDI_WorkSet_PreferredDisplayName;'
|
||||
name: 'Preferred Display Name'
|
||||
validClasses:
|
||||
- instance: '&IDC_PersonName;'
|
||||
|
||||
- getReferencedInstanceSetMethod: '&IDMB_User__get__Preferred_Display_Name;'
|
||||
forClassId: '&IDC_User;'
|
||||
returnsWorkSetId: '&IDI_WorkSet_PreferredDisplayName;'
|
||||
verb: 'get'
|
||||
name: 'Preferred Display Name'
|
||||
initialValue: 'Testing Preferred Display Name'
|
||||
referenceInstanceSet: '&IDC_User;'
|
||||
answerInstanceSet: '&IDR_System_Account__has_preferred_display__Person_Name;'
|
||||
|
||||
- getReferencedAttributeMethod: '&IDM_User__get__Preferred_Display_Name_-_Given_Name;'
|
||||
forClassId: '&IDC_User;'
|
||||
returnsAttributeId: '&IDA_Value;'
|
||||
verb: 'get'
|
||||
name: 'Preferred Display Name - Given Name'
|
||||
referenceInstanceSet: '&IDMB_User__get__Preferred_Display_Name;'
|
||||
answerAttribute: '&IDA_GivenName;'
|
||||
|
||||
- returnAttributeMethodBinding: '&IDMB_User__get__Preferred_Display_Name_-_Given_Name;'
|
||||
executesMethod: '&IDM_User__get__Preferred_Display_Name_-_Given_Name;'
|
||||
|
||||
- getReferencedAttributeMethod: '&IDM_User__get__Preferred_Display_Name_-_Family_Name;'
|
||||
forClassId: '&IDC_User;'
|
||||
returnsAttributeId: '&IDA_Value;'
|
||||
verb: 'get'
|
||||
name: 'Preferred Display Name - Family Name'
|
||||
referenceInstanceSet: '&IDMB_User__get__Preferred_Display_Name;'
|
||||
answerAttribute: '&IDA_FamilyName;'
|
||||
|
||||
- returnAttributeMethodBinding: '&IDMB_User__get__Preferred_Display_Name_-_Family_Name;'
|
||||
executesMethod: '&IDM_User__get__Preferred_Display_Name_-_Family_Name;'
|
||||
|
||||
- buildAttributeMethod: '&IDM_User__get__Preferred_Display_Name_Formatted;'
|
||||
forClassId: '&IDC_User;'
|
||||
verb: 'get'
|
||||
name: 'Preferred Display Name (Formatted)'
|
||||
returnsAttributeId: '&IDA_Value;'
|
||||
initialValue: ''
|
||||
buildsWithAttributes:
|
||||
- instance: '&IDMB_User__get__Preferred_Display_Name_-_Given_Name;'
|
||||
- instance: '&IDM_Common_Text__get__Single_Space;'
|
||||
- instance: '&IDMB_User__get__Preferred_Display_Name_-_Family_Name;'
|
||||
@ -10,10 +10,11 @@
|
||||
forClassId: '&IDC_User;'
|
||||
verb: 'get'
|
||||
name: 'User Name with Full Name'
|
||||
returnsAttributeId: '&IDA_Value;'
|
||||
initialValue: ''
|
||||
buildsWithAttributes:
|
||||
- instance: '&IDMB_User__get__User_Name;'
|
||||
- instance: '&IDM_Common_Text__get__Single_Space;'
|
||||
- instance: '&IDM_Common_Text__get__Forward_Slash;'
|
||||
- instance: '&IDM_Common_Text__get__Single_Space;'
|
||||
- instance: '&IDMB_User__get__Preferred_Display_Name;'
|
||||
- instance: '&IDMB_User__get__Preferred_Display_Name_Formatted;'
|
||||
|
||||
@ -32,13 +32,22 @@
|
||||
label: 'User Name'
|
||||
defaultDataType: '&IDA_UserName;'
|
||||
# builtFromBEMProcess: '&IDBEM_1;'
|
||||
- globalIdentifier: '{82b0a709-eedc-4af2-9ffa-b91648b6e53f}'
|
||||
- globalIdentifier: '{da51a173-0838-4936-87e0-ec4eebbb4275}'
|
||||
order: 'c'
|
||||
label: 'Preferred Display Name'
|
||||
defaultDataType: '&IDMB_User__get__Preferred_Display_Name;'
|
||||
# builtFromBEMProcess: '&IDBEM_1;'
|
||||
- globalIdentifier: '{82b0a709-eedc-4af2-9ffa-b91648b6e53f}'
|
||||
order: 'd'
|
||||
label: 'Nonce'
|
||||
defaultDataType: '&IDA_PasswordSalt;'
|
||||
# builtFromBEMProcess: '&IDBEM_1;'
|
||||
displayOptions:
|
||||
- instance: '&IDI_DisplayOption_DoNotShow;'
|
||||
- globalIdentifier: '{52dadfbd-79d7-409b-9b3e-710c13a7aefc}'
|
||||
order: 'd'
|
||||
order: 'e'
|
||||
label: 'SHA-512 Hash'
|
||||
defaultDataType: '&IDA_PasswordHash;'
|
||||
# builtFromBEMProcess: '&IDBEM_1;'
|
||||
displayOptions:
|
||||
- instance: '&IDI_DisplayOption_DoNotShow;'
|
||||
@ -0,0 +1,21 @@
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- sequenceTask: '&IDI_SequenceTask_ViewSystemUser;'
|
||||
name: 'View System User'
|
||||
initialElement: '{14e32ff2-1dd7-44d7-ab21-4c96b213a1ca}'
|
||||
taskCategory: '&IDI_TaskCategory_SystemUser;'
|
||||
|
||||
- element: '{14e32ff2-1dd7-44d7-ab21-4c96b213a1ca}'
|
||||
elementContents:
|
||||
- instance: '{dcc2aef3-2041-4787-a46b-4becc054b797}'
|
||||
|
||||
- elementContent: '{dcc2aef3-2041-4787-a46b-4becc054b797}'
|
||||
label: 'Test Parms'
|
||||
# TODO: implement get element contents from method (maybe Get Element from Parameters Method?)
|
||||
|
||||
# Test Parms gets its contents from `Method Binding.has Parameter Assignment`
|
||||
|
||||
# Test Context has:
|
||||
# Effective Moment [DT]
|
||||
# Effective Local Date Time [DT]
|
||||
# Effective Date Time Zone [DT]+TZ
|
||||
@ -2,12 +2,20 @@
|
||||
instances:
|
||||
- user: '{B066A54B-B160-4510-A805-436D3F90C2E6}'
|
||||
username: zq-environments
|
||||
preferredDisplayName:
|
||||
- globalIdentifier: '{ab08cff9-4e80-4213-9d6b-5d97dcf3993a}'
|
||||
givenName: 'ZeQuaL Environment Automation'
|
||||
familyName: ''
|
||||
|
||||
- user: '{098DDA82-CD04-4B53-8C75-89D420EA6902}'
|
||||
username: zq-developer
|
||||
passwordHash: f4f166c4d578cb5ca942e07851d7c09de07d417463f2d8e5165a779f768d14b370cd1e82826a94b617b6c6359253e8c12ea8285cba1e6e69e2e13f2bdc0425d0
|
||||
passwordSalt: 7e893ba949b041bab73c6f4f0bcb9413
|
||||
hasUserPreferences: '{d7e9b412-c916-42e7-b788-3bbfac92822c}'
|
||||
preferredDisplayName:
|
||||
- globalIdentifier: '{1778ea77-6ab0-4deb-a95b-e3ba2972a92a}'
|
||||
givenName: 'Developer Generic User'
|
||||
familyName: ''
|
||||
|
||||
- userPreferences: '{d7e9b412-c916-42e7-b788-3bbfac92822c}'
|
||||
favoriteInstances:
|
||||
@ -17,21 +25,45 @@
|
||||
username: superuser
|
||||
passwordHash: 0bdbeeecd24e93a0d84ff2946c519761d4db2c52d9449d2de5bf3b74a8bcdfbee9d72bb88121a63700d09554983e7f881021ecf493f83dec19e8f7e465529c34
|
||||
passwordSalt: 5e28b86839ed4ca9838c112723aeaa27
|
||||
preferredDisplayName:
|
||||
- globalIdentifier: '{9b86e8fc-8fde-4016-ae62-70918296b03d}'
|
||||
givenName: 'Super User'
|
||||
familyName: ''
|
||||
|
||||
- user: '{232A8CBF-0D2B-4BDA-BE86-3E2FA25A3FB5}'
|
||||
username: zq-support
|
||||
preferredDisplayName:
|
||||
- globalIdentifier: '{320b5678-0cee-49cb-a1ad-ee7b3d337945}'
|
||||
givenName: 'ZeQuaL Support'
|
||||
familyName: ''
|
||||
|
||||
- user: '{FB20A79C-EAA2-4A98-A1DA-BDC351854694}'
|
||||
username: zq-configurator
|
||||
preferredDisplayName:
|
||||
- globalIdentifier: '{897ca97a-ab7a-415b-9296-961eec90b5eb}'
|
||||
givenName: 'ZeQuaL Configurator'
|
||||
familyName: ''
|
||||
|
||||
- user: '{63F2EF51-DC73-48EC-856A-6FBBEDE01A8A}'
|
||||
username: zq-implementer
|
||||
preferredDisplayName:
|
||||
- globalIdentifier: '{1a2b943d-0f5a-457d-b786-1bd177bd9c48}'
|
||||
givenName: 'ZeQuaL Implementer'
|
||||
familyName: ''
|
||||
|
||||
- user: '{739C26BC-740F-4CB0-BCB1-2A28FA570E7D}'
|
||||
username: admin
|
||||
preferredDisplayName:
|
||||
- globalIdentifier: '{aed506e0-7062-4786-a464-52a45d3d971e}'
|
||||
givenName: 'Administrator'
|
||||
familyName: ''
|
||||
|
||||
- user: '{9235065b-761f-43ab-9696-bc3f1c93cd74}'
|
||||
username: btrevino
|
||||
# password: W0rkd@yruleZ!
|
||||
passwordHash: e52c91700614cea617b9b557f2b04e397854c7670f1564c81dc453f891e9fbbcb6a7ea624749a248c19e797093dfcd2148ebe1475ca53523ac22409494c90eb0
|
||||
passwordSalt: d8f400c74def4e2781c25a7c0c4f92e0
|
||||
preferredDisplayName:
|
||||
- globalIdentifier: '{863cb364-6c59-4cdf-9450-0946f34fc731}'
|
||||
givenName: 'Brooke'
|
||||
familyName: 'Trevino'
|
||||
|
||||
@ -83,6 +83,8 @@ class KnownClassGuids
|
||||
const TaskCategory = "e8d8060fa20c442f838403488b63247f";
|
||||
const Task = "D4F2564B2D114A5C8AA9AF52D4EACC13";
|
||||
const UITask = "BFD07772178C4885A6CEC85076C8461C";
|
||||
|
||||
const SequenceTask = "{2dfd0c4b-3bc7-4fa3-b369-61441f94e88a}";
|
||||
const HardcodedTask = "df1fe350767047d991a016dafdfbf98d";
|
||||
|
||||
const Tenant = "703F9D65C5844D9FA656D0E3C247FF1F";
|
||||
@ -133,6 +135,8 @@ class KnownClassGuids
|
||||
const BuildAttributeMethod = "{e5879955-0093-48c8-8042-813168578af2}";
|
||||
const GetAttributeMethod = "{c3ecf8c9-597f-417b-ad65-fae0401719c6}";
|
||||
const GetInstancesMethod = "{0a379314-9d0f-432d-ae59-63194ab32dd3}";
|
||||
const GetReferencedAttributeMethod = "{9205c54e-921a-484c-9be2-3d3deb877474}";
|
||||
const GetReferencedInstanceSetMethod = "{bcfd0d64-3eba-4a97-9622-f3a960877d24}";
|
||||
|
||||
const GetSpecifiedInstancesMethod = "{7794c7d0-b15d-4b23-aa40-63bb3d1f53ac}";
|
||||
const ProcessRelatedUpdatesMethod = "2953e69803c54752a1ebcbbfa8f13905";
|
||||
|
||||
@ -98,11 +98,13 @@ class KnownRelationshipGuids
|
||||
const Build_Attribute_Method__builds_with__Executable_returning_Attribute = "{bb64cd83-85c2-4c20-82eb-2a5a5ead31f1}";
|
||||
const Get_Attribute_Method__has__Attribute = "5eca9b3fbe754f6e8495781480774833";
|
||||
|
||||
const Get_Referenced_Instance_Set_Method__loop_on__Instance_Set = "2978238f7cb04ba38c6f473df782cfef";
|
||||
const Get_Referenced_Instance_Set_Method__has_relationship__Method = "6a65819ec8cb45759af8ee221364049b";
|
||||
const Get_Referenced_Instance_Set_Method__returns__Work_Set = "{72057f5b-9b49-497d-852f-cd7e5e258d6c}";
|
||||
const Get_Referenced_Instance_Set_Method__uses_reference__Executable_returning_Instance_Set = "{2978238f-7cb0-4ba3-8c6f-473df782cfef}";
|
||||
const Get_Referenced_Instance_Set_Method__uses_answer__Executable_returning_Instance_Set = "{6a65819e-c8cb-4575-9af8-ee221364049b}";
|
||||
|
||||
const Get_Referenced_Attribute_Method__has__Attribute = "87f90fe95ec64b098f51b8a4d1544cae";
|
||||
const Get_Referenced_Attribute_Method__loop_on__Instance_Set = "c7ecd4986d054e07b1bcf7127d0d6666";
|
||||
const Get_Referenced_Attribute_Method__returns__Attribute = "87f90fe95ec64b098f51b8a4d1544cae";
|
||||
const Get_Referenced_Attribute_Method__uses_reference__Executable_returning_Instance_Set = "{c7ecd498-6d05-4e07-b1bc-f7127d0d6666}";
|
||||
const Get_Referenced_Attribute_Method__uses_answer__Executable_returning_Attribute = "{022ccde3-2b9e-4573-a8fc-e7568f420cd3}";
|
||||
|
||||
const Get_Specified_Instances_Method__uses__Instance = "dea1aa0b2bef4bacb4f90ce8cf7006fc";
|
||||
|
||||
|
||||
@ -33,15 +33,37 @@
|
||||
}
|
||||
return $defaultValue;
|
||||
}
|
||||
public function setWorkData(string $parmId, $value)
|
||||
public function setWorkData(string|InstanceReference $parmId, $value)
|
||||
{
|
||||
$this->workData[$parmId] = $value;
|
||||
/**
|
||||
* @var \Mocha\Oms\MySQLDatabaseOms
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
$key = $parmId;
|
||||
if ($key instanceof InstanceReference)
|
||||
{
|
||||
$key = $key->GlobalIdentifier->__toString();
|
||||
|
||||
$expectedDataType = "";
|
||||
$actualDataType = "";
|
||||
if (!$oms->validateWorkDataType($parmId, $value, $expectedDataType, $actualDataType))
|
||||
{
|
||||
//echo("invalid work data (expected: " . $expectedDataType . ", got: " . $actualDataType . ") for attribute " . $parmId->InstanceKey . " @ " . $parmId->GlobalIdentifier);
|
||||
}
|
||||
public function getWorkData(string $parmId, $defaultValue = null)
|
||||
}
|
||||
$this->workData[$key] = $value;
|
||||
}
|
||||
public function getWorkData(string|InstanceReference $parmId, $defaultValue = null)
|
||||
{
|
||||
if (array_key_exists($parmId, $this->workData))
|
||||
$key = $parmId;
|
||||
if ($key instanceof InstanceReference)
|
||||
{
|
||||
return $this->workData[$parmId];
|
||||
$key = $key->GlobalIdentifier->__toString();
|
||||
}
|
||||
if (array_key_exists($key, $this->workData))
|
||||
{
|
||||
return $this->workData[$key];
|
||||
}
|
||||
return $defaultValue;
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
use Mocha\Core\OmsContext;
|
||||
use Mocha\Core\TenantReference;
|
||||
|
||||
use Phast\System;
|
||||
use Phast\UUID;
|
||||
|
||||
abstract class Oms
|
||||
@ -124,6 +125,23 @@
|
||||
}
|
||||
protected abstract function setAttributeValueInternal(InstanceReference $sourceInstance, InstanceReference $attributeInstance, mixed $value, ?\DateTime $effectiveDate = null);
|
||||
|
||||
public function getDefaultTaskUrl(InstanceReference $inst) : ?string
|
||||
{
|
||||
$instParent = $this->getParentClass($inst);
|
||||
$instDefaultTask = $this->getRelatedInstance($instParent, KnownRelationshipGuids::Class__has_default__Task);
|
||||
if ($instDefaultTask != null)
|
||||
{
|
||||
// !FIXME: check to see if the task is authorized for the current user
|
||||
// (e.g. this can be by if `User .has Security Domain` any in `Securable.has Security Domain`)
|
||||
// e.g. if User has `Administrator` and Task has `Administrator`, return true
|
||||
|
||||
if (true) // ($oms->isTaskAuthorizedForUser($instDefaultTask, $oms->getCurrentUser()))
|
||||
{
|
||||
return System::ExpandRelativePath("~/d/inst/" . $instParent->InstanceKey . "/" . $inst->InstanceKey . ".htmld");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public function getInstanceText($inst)
|
||||
{
|
||||
$parentClass = $this->getParentClass($inst);
|
||||
@ -132,7 +150,8 @@
|
||||
{
|
||||
$context = new OmsContext();
|
||||
$context->setWorkData($parentClass->GlobalIdentifier->__toString(), $inst);
|
||||
$text = $this->executeMethod($context, $instancesLabeledByRAMB);
|
||||
$textAttr = $this->executeMethod($context, $instancesLabeledByRAMB);
|
||||
$text = $context->getWorkData($textAttr);
|
||||
return $text;
|
||||
}
|
||||
return $this->getAttributeValue($inst, $this->getInstanceByGlobalIdentifier(KnownAttributeGuids::Name));
|
||||
@ -346,6 +365,69 @@
|
||||
return $relInsts[$index];
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to ensure the given value is of the appropriate type for the specified work data.
|
||||
*
|
||||
* @return bool true if the given value is of the appropriate type; false otherwise.
|
||||
*/
|
||||
public function validateWorkDataType(InstanceReference $instWorkData, mixed $value, &$expectedTypeName, &$actualTypeName)
|
||||
{
|
||||
$actualTypeName = gettype($value);
|
||||
if (is_string($value))
|
||||
{
|
||||
$expectedTypeName = "Text Attribute";
|
||||
if ($this->is_a($instWorkData, KnownClassGuids::TextAttribute))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (is_int($value) || is_float($value))
|
||||
{
|
||||
$expectedTypeName = "Numeric Attribute";
|
||||
// int and float should only be assigned to Numeric Attribute
|
||||
if ($this->is_a($instWorkData, KnownClassGuids::NumericAttribute))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ($value instanceof InstanceReference)
|
||||
{
|
||||
// instance references can be assigned to Work Sets and all sorts of other stuff
|
||||
if ($this->is_a($instWorkData, KnownClassGuids::WorkSet))
|
||||
{
|
||||
$expectedTypeName = "Work Set";
|
||||
// but if our Work Set declares a `Work Set.has valid Class` then we should validate that
|
||||
$workDataHasValidClasses = $this->getRelatedInstances($instWorkData, KnownRelationshipGuids::Work_Set__has_valid__Class);
|
||||
if ($workDataHasValidClasses !== null && count($workDataHasValidClasses) > 0)
|
||||
{
|
||||
// loop through all valid classes and check them
|
||||
foreach ($workDataHasValidClasses as $validClass)
|
||||
{
|
||||
if ($this->is_a($instWorkData, $validClass))
|
||||
{
|
||||
$expectedTypeName = $this->getAttributeValue($validClass, KnownAttributeGuids::Name);
|
||||
// our work set declares a valid class, and it passes
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// none of the valid classes pass validation for $instWorkData
|
||||
$actualTypeName = $this->getAttributeValue($this->getParentClass($instWorkData), KnownAttributeGuids::Name);
|
||||
$expectedTypeName = $this->getAttributeValue($validClass, KnownAttributeGuids::Name);
|
||||
return false;
|
||||
}
|
||||
|
||||
// this work set doesn't care whether or not $instWorkData passes validation
|
||||
return true;
|
||||
}
|
||||
|
||||
// we are not a work set, so we can't validate anything
|
||||
return true;
|
||||
}
|
||||
|
||||
// none of our validations pass
|
||||
return false;
|
||||
}
|
||||
|
||||
public function executeMethod(OmsContext $context, InstanceReference $methodInstance)
|
||||
{
|
||||
$methodInstanceClass = $this->getParentClass($methodInstance);
|
||||
@ -354,7 +436,10 @@
|
||||
if ($methodInstanceClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::ReturnAttributeMethodBinding)))
|
||||
{
|
||||
$methodBindingExecutesMethod = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Method_Binding__executes__Method);
|
||||
|
||||
if ($methodBindingExecutesMethod === null)
|
||||
{
|
||||
echo ("RAMB executes method not found for " . $methodInstance->InstanceKey);die();
|
||||
}
|
||||
//echo ("RAMB stack: " . $methodInstance->InstanceKey . ":" . $methodBindingExecutesMethod->InstanceKey);
|
||||
return $this->executeMethod($context, $methodBindingExecutesMethod);
|
||||
}
|
||||
@ -364,7 +449,37 @@
|
||||
$returnsAttribute = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Get_Attribute_Method__has__Attribute);
|
||||
|
||||
$targetInstance = $context->workData[$forClass->GlobalIdentifier->__toString()];
|
||||
return $this->getAttributeValue($targetInstance, $returnsAttribute);
|
||||
$value = $this->getAttributeValue($targetInstance, $returnsAttribute);
|
||||
$context->workData[$returnsAttribute->GlobalIdentifier->__toString()] = $value;
|
||||
return $returnsAttribute;
|
||||
}
|
||||
else if ($methodInstanceClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::GetReferencedAttributeMethod)))
|
||||
{
|
||||
$forClass = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Method__for__Class);
|
||||
$returnsAttribute = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Get_Referenced_Attribute_Method__returns__Attribute);
|
||||
$loopOnInstanceSet = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Get_Referenced_Attribute_Method__uses_reference__Executable_returning_Instance_Set);
|
||||
$answer = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Get_Referenced_Attribute_Method__uses_answer__Executable_returning_Attribute);
|
||||
|
||||
$targetInstance = $context->workData[$forClass->GlobalIdentifier->__toString()];
|
||||
|
||||
$refISRel = $this->executeMethod($context, $loopOnInstanceSet);
|
||||
$refIS = $context->getWorkData($refISRel);
|
||||
//$refIS = $this->getRelatedInstance($targetInstance, $loopOnInstanceSet);
|
||||
$value = $this->getAttributeValue($refIS, $answer);
|
||||
$context->setWorkData($returnsAttribute, $value);
|
||||
return $returnsAttribute;
|
||||
}
|
||||
else if ($methodInstanceClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::GetReferencedInstanceSetMethod)))
|
||||
{
|
||||
$forClass = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Method__for__Class);
|
||||
$returnsWorkSet = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Get_Referenced_Instance_Set_Method__returns__Work_Set);
|
||||
$loopOnInstanceSet = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Get_Referenced_Instance_Set_Method__uses_reference__Executable_returning_Instance_Set);
|
||||
$relationship = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Get_Referenced_Instance_Set_Method__uses_answer__Executable_returning_Instance_Set);
|
||||
|
||||
$targetInstance = $context->workData[$forClass->GlobalIdentifier->__toString()];
|
||||
$value = $this->getRelatedInstance($targetInstance, $relationship);
|
||||
$context->setWorkData($returnsWorkSet, $value);
|
||||
return $returnsWorkSet;
|
||||
}
|
||||
else if ($methodInstanceClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::BuildAttributeMethod)))
|
||||
{
|
||||
@ -375,12 +490,26 @@
|
||||
$value = $initialValue;
|
||||
foreach ($buildsWithAttributes as $buildsWithAttribute)
|
||||
{
|
||||
if ($buildsWithAttribute !== null)
|
||||
$attr = $this->executeMethod($context, $buildsWithAttribute);
|
||||
if ($attr !== null)
|
||||
{
|
||||
$value .= $this->executeMethod($context, $buildsWithAttribute);
|
||||
$val = $context->getWorkData($attr);
|
||||
if (is_string($val))
|
||||
{
|
||||
$value .= $val;
|
||||
}
|
||||
else
|
||||
{
|
||||
$value .= $val->InstanceKey;
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
else
|
||||
{
|
||||
trigger_error("executeMethod did not return properly - called method: " . $buildsWithAttribute->GlobalIdentifier . " [" . $buildsWithAttribute->InstanceKey . "]");
|
||||
}
|
||||
}
|
||||
$context->setWorkData($returnsAttribute, $value);
|
||||
return $returnsAttribute;
|
||||
}
|
||||
else if ($methodInstanceClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::ProcessRelatedUpdatesMethod)))
|
||||
{
|
||||
|
||||
@ -164,19 +164,15 @@
|
||||
$adw->ClassList[] = "mcx-moniker";
|
||||
$adw->ClassTitle = $parentClassName;
|
||||
|
||||
$adw->ShowURL = false;
|
||||
$instDefaultTask = $oms->getRelatedInstance($instParent, KnownRelationshipGuids::Class__has_default__Task);
|
||||
if ($instDefaultTask != null)
|
||||
$defaultTaskUrl = $oms->getDefaultTaskUrl($inst);
|
||||
if ($defaultTaskUrl !== null)
|
||||
{
|
||||
// !FIXME: check to see if the task is authorized for the current user
|
||||
// (e.g. this can be by if `User .has Security Domain` any in `Securable.has Security Domain`)
|
||||
// e.g. if User has `Administrator` and Task has `Administrator`, return true
|
||||
|
||||
if (true) // ($oms->isTaskAuthorizedForUser($instDefaultTask, $oms->getCurrentUser()))
|
||||
{
|
||||
$adw->TargetURL = System::ExpandRelativePath("~/d/inst/" . $instParent->InstanceKey . "/" . $inst->InstanceKey . ".htmld");
|
||||
$adw->TargetURL = $defaultTaskUrl;
|
||||
$adw->ShowURL = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$adw->ShowURL = false;
|
||||
}
|
||||
|
||||
$adw->Text = $oms->getInstanceText($inst);
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
use Phast\System;
|
||||
use Phast\Utilities\Stopwatch;
|
||||
use Phast\UUID;
|
||||
use Phast\WebControls\Button;
|
||||
|
||||
class HTMLRenderer
|
||||
{
|
||||
@ -47,6 +48,8 @@
|
||||
public bool $IsPostback;
|
||||
public string $SubmitButtonText;
|
||||
|
||||
public bool $IncludeTopNavigationBar;
|
||||
|
||||
private $__renderingNotEnterable;
|
||||
|
||||
public function __construct(OmsContext $context)
|
||||
@ -57,6 +60,7 @@
|
||||
$this->IsPostback = false;
|
||||
$this->StyleClasses = [];
|
||||
$this->SubmitButtonText = "Save Changes";
|
||||
$this->IncludeTopNavigationBar = true;
|
||||
$this->__renderingNotEnterable = false;
|
||||
}
|
||||
/**
|
||||
@ -100,6 +104,49 @@
|
||||
return $defaultValue;
|
||||
}
|
||||
|
||||
public function renderPageHeader(InstanceReference|string $title, InstanceReference|string $subtitle)
|
||||
{
|
||||
echo ("<div class=\"uwt-page-header\">");
|
||||
echo ("<h1>");
|
||||
if (is_string($title))
|
||||
{
|
||||
echo ($title);
|
||||
}
|
||||
else if ($title instanceof InstanceReference)
|
||||
{
|
||||
$adw = new InstanceBrowser(array($title));
|
||||
$adw->Render();
|
||||
}
|
||||
echo ("</h1>");
|
||||
|
||||
echo ("<h2>");
|
||||
if (is_string($subtitle))
|
||||
{
|
||||
echo ($subtitle);
|
||||
}
|
||||
else if ($subtitle instanceof InstanceReference)
|
||||
{
|
||||
$adw = new InstanceBrowser(array($subtitle));
|
||||
$adw->Render();
|
||||
}
|
||||
echo ("</h2>");
|
||||
echo ("</div>");
|
||||
}
|
||||
|
||||
private function renderTopNavigationBar()
|
||||
{
|
||||
$this->renderBeginTag("div", [ ], [ "uwt-header" ]);
|
||||
|
||||
$this->renderBeginTag("div", [ ], [ "uwt-header-item", "uwt-applicationmenu" ]);
|
||||
|
||||
$button = new Button();
|
||||
$button->Render();
|
||||
|
||||
$this->renderEndTag("div");
|
||||
|
||||
$this->renderEndTag("div");
|
||||
}
|
||||
|
||||
public function renderTask(InstanceReference $task, InstanceReference $relatedInstance)
|
||||
{
|
||||
/**
|
||||
@ -107,21 +154,20 @@
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
$parentClass = $oms->getParentClass($task);
|
||||
if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::HardcodedTask)))
|
||||
{
|
||||
echo ("<!-- task: " . $task->InstanceKey . " {" . $task->GlobalIdentifier . "} -->");
|
||||
|
||||
$taskName = $oms->getAttributeValue($task, KnownAttributeGuids::Name);
|
||||
|
||||
echo ("<div class=\"uwt-page-header\">");
|
||||
echo ("<h1> " .$taskName . "</h1>");
|
||||
echo ("<h2>");
|
||||
$adw = new InstanceBrowser(array($relatedInstance));
|
||||
$adw->Render();
|
||||
echo ("</h2>");
|
||||
echo ("</div>");
|
||||
$this->renderBeginPage($taskName);
|
||||
|
||||
$this->renderPageHeader($taskName, $relatedInstance);
|
||||
echo ("<!-- task: " . $task->InstanceKey . " {" . $task->GlobalIdentifier . "} -->");
|
||||
|
||||
$parentClass = $oms->getParentClass($task);
|
||||
if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::SequenceTask)))
|
||||
{
|
||||
echo("Sequence Task not done yet!");
|
||||
}
|
||||
else if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::HardcodedTask)))
|
||||
{
|
||||
$className = $oms->getAttributeValue($task, KnownAttributeGuids::ClassName);
|
||||
$taskClass = null;
|
||||
try
|
||||
@ -153,6 +199,11 @@
|
||||
echo("could not find hardcoded task class '" . $className . "'");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo ("could not find task executor for task type `" . $oms->getInstanceText($parentClass) . "`, " . $parentClass->InstanceKey . " " . $parentClass->GlobalIdentifier);
|
||||
}
|
||||
$this->renderEndPage();
|
||||
}
|
||||
|
||||
private function updateWorkDataWithElementContents()
|
||||
@ -586,8 +637,52 @@
|
||||
$adw->Render();
|
||||
}
|
||||
}
|
||||
// Executable returning Attribute
|
||||
else if ($oms->is_a($ecInst, KnownClassGuids::TextAttribute))
|
||||
{
|
||||
$this->renderExecutableReturningAttribute($elementContent, $ecInst, $relatedInstance, $relatedInstanceParm);
|
||||
}
|
||||
// Executable returning Attribute
|
||||
else if ($oms->is_a($ecInst, KnownClassGuids::ReturnAttributeMethodBinding))
|
||||
{
|
||||
// I *THINK* Return Attribute Method Bindings aren't supposed to return
|
||||
// just strings, they're supposed to actually return *attributes* that
|
||||
// can then be edited in the Element Content.
|
||||
$context = new OmsContext();
|
||||
$rambAttribute = $oms->executeMethod($context, $ecInst);
|
||||
$this->renderTextAttribute($context, $rambAttribute);
|
||||
}
|
||||
else if ($oms->is_a($ecInst, KnownClassGuids::Clasz))
|
||||
{
|
||||
$targetInstance = $relatedInstanceParm;
|
||||
if ($targetInstance === null)
|
||||
{
|
||||
$targetInstance = $ecInst;
|
||||
}
|
||||
$adw = new InstanceBrowser(array($targetInstance));
|
||||
$adw->Render();
|
||||
}
|
||||
else
|
||||
{
|
||||
$adw = new InstanceBrowser(array($ecInst));
|
||||
$adw->Render();
|
||||
// echo ("<span class=\"mcx-value\">unknown pclass ident " . $oms->getParentClass($ecInst)->GlobalIdentifier . "</span>");
|
||||
}
|
||||
echo ("</td>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function renderExecutableReturningAttribute(InstanceReference $elementContent, InstanceReference $ecInst, ?InstanceReference $relatedInstance, ?InstanceReference $relatedInstanceParm)
|
||||
{
|
||||
/**
|
||||
* @var MySQLDatabaseOms
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
$displayOptions = $oms->getRelatedInstances($elementContent, KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option);
|
||||
|
||||
// fill in the value from the target instance
|
||||
$targetInstance = $relatedInstance;
|
||||
if ($relatedInstanceParm !== null)
|
||||
@ -625,27 +720,18 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->renderTextAttribute($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$targetInstance = $relatedInstanceParm;
|
||||
if ($targetInstance === null)
|
||||
{
|
||||
$targetInstance = $ecInst;
|
||||
}
|
||||
$adw = new InstanceBrowser(array($targetInstance));
|
||||
$adw->Render();
|
||||
// echo ("<span class=\"mcx-value\">unknown pclass ident " . $oms->getParentClass($ecInst)->GlobalIdentifier . "</span>");
|
||||
}
|
||||
echo ("</td>");
|
||||
}
|
||||
}
|
||||
$this->renderTextAttributeEC($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value);
|
||||
}
|
||||
}
|
||||
|
||||
public function renderTextAttribute(InstanceReference $ec, InstanceReference $inst, $password = false, $value = null)
|
||||
public function renderTextAttribute(OmsContext $context, InstanceReference $attr)
|
||||
{
|
||||
// $adw = new InstanceBrowser(array($rambAttribute));
|
||||
// $adw->Render();
|
||||
echo($context->getWorkData($attr));
|
||||
}
|
||||
|
||||
public function renderTextAttributeEC(InstanceReference $ec, InstanceReference $inst, $password = false, $value = null)
|
||||
{
|
||||
/**
|
||||
* @var MySQLDatabaseOms
|
||||
@ -766,7 +852,7 @@
|
||||
echo("System.TenantName = '" . $oms->getTenantName() . "';");
|
||||
$this->renderEndTag("script");
|
||||
$this->renderEndTag("head");
|
||||
$bodyClasses = [ "uwt-header-visible" ];
|
||||
$bodyClasses = [ "uwt-header-visible", "uwt-header-inverse" ];
|
||||
foreach ($this->StyleClasses as $className)
|
||||
{
|
||||
$bodyClasses[] = $className;
|
||||
@ -783,6 +869,11 @@
|
||||
<div class="mocha-ams-spot-popup" id="spot_popup"><h1>SPOT:</h1><h3>Stop in: <label id="spot_timer">$spotTimerContent</label></h3></div>
|
||||
MSG_EOF);
|
||||
$this->renderTag("script", [ ], [ ], $spotTimerScript);
|
||||
|
||||
if ($this->IncludeTopNavigationBar)
|
||||
{
|
||||
$this->renderTopNavigationBar();
|
||||
}
|
||||
}
|
||||
public function renderEndPage()
|
||||
{
|
||||
@ -1101,6 +1192,8 @@ MSG_EOF);
|
||||
$this->renderBeginTag("thead");
|
||||
$this->renderBeginTag("tr");
|
||||
foreach ($contents as $content)
|
||||
{
|
||||
if ($this->shouldRenderElementContent($content))
|
||||
{
|
||||
$inst = $oms->getRelatedInstance($content, KnownRelationshipGuids::Element_Content__has__Instance);
|
||||
$this->renderBeginTag("th");
|
||||
@ -1113,6 +1206,7 @@ MSG_EOF);
|
||||
// $this->renderEndTag("div");
|
||||
$this->renderEndTag("th");
|
||||
}
|
||||
}
|
||||
|
||||
$this->renderEndTag("tr");
|
||||
$this->renderEndTag("thead");
|
||||
@ -1128,6 +1222,8 @@ MSG_EOF);
|
||||
$this->renderBeginTag("tr", [ ], [ "uwt-listview-item" ]);
|
||||
//$this->renderBeginTag("div", [ ], [ "uwt-listview-item" ]);
|
||||
foreach ($contents as $content)
|
||||
{
|
||||
if ($this->shouldRenderElementContent($content))
|
||||
{
|
||||
$this->renderBeginTag("td");
|
||||
//$this->renderBeginTag("div", [], [ "mcx-elementcontent", "uwt-listview-item-column" ]);
|
||||
@ -1135,6 +1231,7 @@ MSG_EOF);
|
||||
//$this->renderEndTag("div");
|
||||
$this->renderEndTag("td");
|
||||
}
|
||||
}
|
||||
$this->renderEndTag("tr");
|
||||
//$this->renderEndTag("div");
|
||||
|
||||
|
||||
@ -1,6 +1,13 @@
|
||||
body
|
||||
{
|
||||
margin: 0px;
|
||||
&.uwt-header-visible
|
||||
{
|
||||
&> div.uwt-header + *
|
||||
{
|
||||
margin-top: 64px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1000px)
|
||||
|
||||
@ -90,6 +90,7 @@
|
||||
$context = new OmsContext();
|
||||
|
||||
$renderer = new HTMLRenderer($context);
|
||||
$renderer->IncludeTopNavigationBar = false;
|
||||
|
||||
# $contents = $pageElement->getRelatedInstances($oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content));
|
||||
$renderer->ProcessUpdatesFunction = function($sender, $element)
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Mocha\UI\Pages;
|
||||
use Mocha\Core\InstanceKey;
|
||||
use Mocha\Core\KnownInstanceGuids;
|
||||
use Mocha\Core\OmsContext;
|
||||
use Mocha\UI\Renderers\HTML\HTMLRenderer;
|
||||
use Phast\RenderingEventArgs;
|
||||
use Phast\WebPage;
|
||||
|
||||
@ -11,13 +15,35 @@
|
||||
{
|
||||
parent::OnRendering($re);
|
||||
|
||||
/**
|
||||
* @var \Mocha\Oms\MySQLDatabaseOms
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
//mocha_init_spot_timer($this->Page);
|
||||
|
||||
$instIdCtl = $this->Page->GetControlByID("instId");
|
||||
$taskInstIdCtl = $this->Page->GetControlByID("taskInstId");
|
||||
$instanceKey = InstanceKey::Parse($this->Page->GetPathVariableValue("instid"));
|
||||
$relatedTaskKey = InstanceKey::Parse($this->Page->GetPathVariableValue("reltaskid"));
|
||||
|
||||
$instIdCtl->Content = $this->Page->GetPathVariableValue("instid");
|
||||
$taskInstIdCtl->Content = $this->Page->GetPathVariableValue("reltaskid");
|
||||
$instance = $oms->getInstanceByKey($instanceKey);
|
||||
$relatedTaskInstance = $oms->getInstanceByKey($relatedTaskKey);
|
||||
|
||||
$context = new OmsContext();
|
||||
|
||||
$context->setWorkData(KnownInstanceGuids::WorkSet__RelatedInstance, $instance);
|
||||
|
||||
$taskRenderer = new HTMLRenderer($context);
|
||||
$taskRenderer->TargetInstance = $instance;
|
||||
$taskRenderer->IsPostback = $this->Page->IsPostback;
|
||||
if ($this->IsPostback)
|
||||
{
|
||||
//$taskRenderer->processPostback($defaultTask);
|
||||
}
|
||||
else
|
||||
{
|
||||
$taskRenderer->renderTask($relatedTaskInstance, $instance);
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user