diff --git a/common/admin/mocha-libexec/mocha-oms b/common/admin/mocha-libexec/mocha-oms index 9ca2bd4..3ab7c1a 100755 --- a/common/admin/mocha-libexec/mocha-oms +++ b/common/admin/mocha-libexec/mocha-oms @@ -298,6 +298,8 @@ elif [ "$1" == "attribute" ]; then elif [ "$2" == "set" ]; then if [ "$4" == "for" ]; then + + # usage: `mocha oms attribute set (att) for (inst) (value)` ATT_ID=$3 INST_ID=$5 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/001-Classes.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/001-Classes.yaml index 8d3d6eb..fbf7f92 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/001-Classes.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/001-Classes.yaml @@ -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}' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/002-Attributes.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/002-Attributes.yaml index ab67fd1..71939d0 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/002-Attributes.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/002-Attributes.yaml @@ -64,4 +64,7 @@ - IDA_LoginPageInstructions: '{dc11f905-335d-4e9b-8f03-55551a184dc3}' - IDA_OpenInNewWindow: '{4a211f11-c5c3-4b58-a7f4-ed62538c5a3d}' - IDA_LongRunning: '{c03aa999-83bc-49db-a27e-70fee477b9fb}' - - IDA_SuppressRIHints: '{43328aec-6a5d-4955-8d04-a96dcf98ab02}' \ No newline at end of file + - IDA_SuppressRIHints: '{43328aec-6a5d-4955-8d04-a96dcf98ab02}' + + - IDA_GivenName: '{94a3ab09-3db7-4207-9e66-9526eb738669}' + - IDA_FamilyName: '{b84f602d-6bfc-4898-9d44-4d49af44cbb4}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/003-Relationships.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/003-Relationships.yaml index ed46bdd..f0ffade 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/003-Relationships.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/003-Relationships.yaml @@ -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}' @@ -369,4 +380,7 @@ - IDR_BEM_Process__for__Build_Element_Method: '{da991add-0a67-428c-9568-efba5633c91a}' - IDR_Build_Element_Method__returns__Element: '{4d13d021-7363-4131-b74a-241698c3f1d0}' - - IDR_Element__returned_by__Build_Element_Method: '{ae6a82f0-950b-44c0-a1e6-53d8a7e9e46d}' \ No newline at end of file + - 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}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/005-MethodClasses.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/005-MethodClasses.yaml index a86e0a9..3b61223 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/005-MethodClasses.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/005-MethodClasses.yaml @@ -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 \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/007-TaskClasses.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/007-TaskClasses.yaml index d17db7e..f8711cb 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/007-TaskClasses.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/007-TaskClasses.yaml @@ -7,4 +7,5 @@ - IDI_SequenceTask_TestMethodBinding: '{3e55af17-00a9-418d-ae6f-7e52ec11148e}' - IDI_Task_ShowDefinitionInCodeEditor: '{4f8a0e8e-e139-4cc6-b8cf-a32e67bd192d}' - IDI_Task_DeleteInstance: '{276c5933-89a9-4a22-8fe3-cd9fda5377a8}' - - IDI_Task_ViewIntegrationIDs: '{8a2a0ef3-a145-4026-9c55-4d0133eff929}' \ No newline at end of file + - IDI_Task_ViewIntegrationIDs: '{8a2a0ef3-a145-4026-9c55-4d0133eff929}' + - IDI_SequenceTask_ViewSystemUser: '{5fd32c2b-7169-4db7-9379-6d8cb479c60e}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/009-MethodBindings.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/009-MethodBindings.yaml index 835ff8a..31ac63b 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/009-MethodBindings.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/009-MethodBindings.yaml @@ -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}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml index db875c1..743e342 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml @@ -1,2 +1,3 @@ - entityDefinitions: - IDI_WorkSet_ClassForEditClassTask: '{b56ac9b9-efce-4a40-8c04-ffdf90174285}' + - IDI_WorkSet_PreferredDisplayName: '{86149123-6d32-4f48-b128-8f773cdb2b0e}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/016-TaskCategories.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/016-TaskCategories.yaml index 2549f6c..fd4384d 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/016-TaskCategories.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/016-TaskCategories.yaml @@ -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}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00004-TextAttribute.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00004-TextAttribute.yaml index 58e8b2c..ddad504 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00004-TextAttribute.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00004-TextAttribute.yaml @@ -87,3 +87,8 @@ - textAttribute: '&IDA_CSSValue;' index: 57 + + - textAttribute: '&IDA_GivenName;' + name: 'Given Name' + - textAttribute: '&IDA_FamilyName;' + name: 'Family Name' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00018-GetReferencedAttributeMethod.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00018-GetReferencedAttributeMethod.yaml new file mode 100644 index 0000000..2461dc3 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00018-GetReferencedAttributeMethod.yaml @@ -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 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00026-GetReferencedInstanceSetMethod.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00026-GetReferencedInstanceSetMethod.yaml new file mode 100644 index 0000000..2248892 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00026-GetReferencedInstanceSetMethod.yaml @@ -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 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml index 274155c..f0888b9 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml @@ -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 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00402-PersonName.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00402-PersonName.yaml new file mode 100644 index 0000000..90257f0 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00402-PersonName.yaml @@ -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' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02663-InstanceOpMethod.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02663-InstanceOpMethod.yaml new file mode 100644 index 0000000..055236b --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02663-InstanceOpMethod.yaml @@ -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 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03004-TaskCategory.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03004-TaskCategory.yaml index 4752d44..5372bac 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03004-TaskCategory.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03004-TaskCategory.yaml @@ -22,4 +22,6 @@ - taskCategory: '&IDI_TaskCategory_Debugging;' name: 'Debugging' - taskCategory: '&IDI_TaskCategory_Element;' - name: 'Element' \ No newline at end of file + name: 'Element' + - taskCategory: '&IDI_TaskCategory_SystemUser;' + name: 'System User' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/CommonText/Common_Text__get__Forward_Slash.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/CommonText/Common_Text__get__Forward_Slash.yaml index 44d3985..e80d48c 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/CommonText/Common_Text__get__Forward_Slash.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/CommonText/Common_Text__get__Forward_Slash.yaml @@ -2,6 +2,7 @@ instances: - buildAttributeMethod: '&IDM_Common_Text__get__Forward_Slash;' forClassId: '&IDC_CommonText;' + returnsAttributeId: '&IDA_Value;' verb: 'get' name: 'Forward Slash' initialValue: '/' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/CommonText/Common_Text__get__Single_Space.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/CommonText/Common_Text__get__Single_Space.yaml index 1808376..37ee114 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/CommonText/Common_Text__get__Single_Space.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/CommonText/Common_Text__get__Single_Space.yaml @@ -2,6 +2,7 @@ instances: - buildAttributeMethod: '&IDM_Common_Text__get__Single_Space;' forClassId: '&IDC_CommonText;' + returnsAttributeId: '&IDA_Value;' verb: 'get' name: 'Single Space' initialValue: ' ' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/Translation@get Translation Value.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/Translation@get Translation Value.yaml index 0502e22..fe83fa4 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/Translation@get Translation Value.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/Translation@get Translation Value.yaml @@ -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 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/User/System_User__get__Preferred_Display_Name.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/User/System_User__get__Preferred_Display_Name.yaml index d92b09f..762aeea 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/User/System_User__get__Preferred_Display_Name.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/User/System_User__get__Preferred_Display_Name.yaml @@ -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;' - \ No newline at end of file + - 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;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/User/System_User__get__User_Name_with_Full_Name.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/User/System_User__get__User_Name_with_Full_Name.yaml index ff336a4..9e58017 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/User/System_User__get__User_Name_with_Full_Name.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/004-Methods/User/System_User__get__User_Name_with_Full_Name.yaml @@ -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;' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113789-UserList.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113789-UserList.yaml index 4ba0cae..1cfda96 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113789-UserList.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113789-UserList.yaml @@ -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;' \ No newline at end of file + # builtFromBEMProcess: '&IDBEM_1;' + displayOptions: + - instance: '&IDI_DisplayOption_DoNotShow;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewSystemUser.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewSystemUser.yaml new file mode 100644 index 0000000..1c0ac38 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewSystemUser.yaml @@ -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 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/009-Users/zq-developer.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/009-Users/zq-developer.yaml index 5b6aa60..242e381 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/009-Users/zq-developer.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/009-Users/zq-developer.yaml @@ -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' diff --git a/php/mocha/lib/mocha/core/KnownClassGuids.inc.php b/php/mocha/lib/mocha/core/KnownClassGuids.inc.php index 3a8c5e6..9d88d6d 100644 --- a/php/mocha/lib/mocha/core/KnownClassGuids.inc.php +++ b/php/mocha/lib/mocha/core/KnownClassGuids.inc.php @@ -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"; diff --git a/php/mocha/lib/mocha/core/KnownRelationshipGuids.inc.php b/php/mocha/lib/mocha/core/KnownRelationshipGuids.inc.php index ef4d0c1..007ee0d 100644 --- a/php/mocha/lib/mocha/core/KnownRelationshipGuids.inc.php +++ b/php/mocha/lib/mocha/core/KnownRelationshipGuids.inc.php @@ -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"; diff --git a/php/mocha/lib/mocha/core/OmsContext.inc.php b/php/mocha/lib/mocha/core/OmsContext.inc.php index 695a540..9b55274 100644 --- a/php/mocha/lib/mocha/core/OmsContext.inc.php +++ b/php/mocha/lib/mocha/core/OmsContext.inc.php @@ -33,15 +33,37 @@ } return $defaultValue; } - public function setWorkData(string $parmId, $value) + public function setWorkData(string|InstanceReference $parmId, $value) { - $this->workData[$parmId] = $value; - } - public function getWorkData(string $parmId, $defaultValue = null) - { - if (array_key_exists($parmId, $this->workData)) + /** + * @var \Mocha\Oms\MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + $key = $parmId; + if ($key instanceof InstanceReference) { - return $this->workData[$parmId]; + $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); + } + } + $this->workData[$key] = $value; + } + public function getWorkData(string|InstanceReference $parmId, $defaultValue = null) + { + $key = $parmId; + if ($key instanceof InstanceReference) + { + $key = $key->GlobalIdentifier->__toString(); + } + if (array_key_exists($key, $this->workData)) + { + return $this->workData[$key]; } return $defaultValue; } diff --git a/php/mocha/lib/mocha/oms/Oms.inc.php b/php/mocha/lib/mocha/oms/Oms.inc.php index 399d9f3..894982d 100644 --- a/php/mocha/lib/mocha/oms/Oms.inc.php +++ b/php/mocha/lib/mocha/oms/Oms.inc.php @@ -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; + } + } + else + { + trigger_error("executeMethod did not return properly - called method: " . $buildsWithAttribute->GlobalIdentifier . " [" . $buildsWithAttribute->InstanceKey . "]"); } } - return $value; + $context->setWorkData($returnsAttribute, $value); + return $returnsAttribute; } else if ($methodInstanceClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::ProcessRelatedUpdatesMethod))) { diff --git a/php/mocha/lib/mocha/ui/controls/InstanceBrowser.inc.php b/php/mocha/lib/mocha/ui/controls/InstanceBrowser.inc.php index 081f71b..ad3b28c 100644 --- a/php/mocha/lib/mocha/ui/controls/InstanceBrowser.inc.php +++ b/php/mocha/lib/mocha/ui/controls/InstanceBrowser.inc.php @@ -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->ShowURL = true; - } + $adw->TargetURL = $defaultTaskUrl; + $adw->ShowURL = true; + } + else + { + $adw->ShowURL = false; } $adw->Text = $oms->getInstanceText($inst); diff --git a/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php b/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php index f7dee27..39f3b03 100644 --- a/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php +++ b/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php @@ -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; } /** @@ -99,6 +103,49 @@ } return $defaultValue; } + + public function renderPageHeader(InstanceReference|string $title, InstanceReference|string $subtitle) + { + echo ("