From 852a2e7f2bd2592469ace2780c0909bf18f803ca Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sat, 6 Jan 2024 15:49:48 -0500 Subject: [PATCH] major updates, we can now properly iterate through BEMs --- .../libraryparser/YAMLLibraryParser.py | 105 +++---- .../000-EntityDefinitions/002-Attributes.yaml | 4 +- .../003-Relationships.yaml | 15 +- .../005-MethodClasses.yaml | 4 +- .../007-TaskClasses.yaml | 6 +- .../000-EntityDefinitions/008-Elements.yaml | 5 +- .../016-TaskCategories.yaml | 3 + .../003-Classes/00001-Class.yaml | 4 + .../003-Classes/00003-Relationship.yaml | 16 ++ .../003-Classes/00004-TextAttribute.yaml | 3 + .../003-Classes/00005-BooleanAttribute.yaml | 8 +- .../003-Classes/00006-Element.yaml | 4 + .../003-Classes/00016-BEMProcess.yaml | 24 +- .../003-Classes/00017-Instance.yaml | 20 ++ .../003-Classes/00029-BuildElementMethod.yaml | 51 ++++ .../00040-GetSpecifiedInstancesMethod.yaml | 44 +++ .../003-Classes/00056-ElementContent.yaml | 18 ++ .../003-Classes/00393-GetInstancesMethod.yaml | 51 ++++ .../003-Classes/02993-Task.yaml | 20 ++ .../003-Classes/02994-HardcodedTask.yaml | 7 +- .../003-Classes/02997-SequenceTask.yaml | 24 +- .../003-Classes/03001-RedirectTask.yaml | 4 +- .../003-Classes/3004-TaskCategory.yaml | 8 +- .../Elements/000001-ViewElementContent.yaml | 8 + .../Elements/113789-UserList.yaml | 44 +++ .../Elements/113800-ElementTests.yaml | 68 ++++- .../005-UserInterface/Tasks/EditClass.yaml | 3 +- .../Tasks/IntegrationIDs.yaml | 21 ++ .../Tasks/ShowDefinitionInCodeEditor.yaml | 9 +- .../005-UserInterface/Tasks/ViewClass.yaml | 9 +- php/mocha/include/BeforeLaunchEvent.inc.php | 151 +--------- php/mocha/include/mochacommon.inc.php | 159 +++++++++++ .../lib/mocha/core/KnownClassGuids.inc.php | 3 + .../lib/mocha/core/KnownInstanceGuids.inc.php | 2 + .../mocha/core/KnownRelationshipGuids.inc.php | 8 +- .../lib/mocha/oms/MySQLDatabaseOms.inc.php | 34 ++- php/mocha/lib/mocha/oms/Oms.inc.php | 120 +++++++- .../mocha/ui/controls/InstanceBrowser.inc.php | 27 +- .../ui/renderers/html/HTMLRenderer.inc.php | 145 ++++++++-- php/mocha/scripts/mcx_elementcontent.js | 5 + php/mocha/scripts/mcx_instancekey.js | 22 ++ php/mocha/scripts/mcx_messages.js | 15 + php/mocha/scripts/mcx_moniker.js | 270 ++++++++++++++---- .../avondale/uwt-actionpreviewbutton.less | 13 +- php/mocha/themes/avondale/uwt-listview.less | 39 ++- php/mocha/themes/avondale/uwt-menu.less | 5 + .../common/styles/mobile/uwt-window.less | 10 + .../themes/common/styles/mobile/uwt.less | 1 + .../styles/uwt-actionpreviewbutton.less | 4 + php/mocha/themes/common/styles/uwt-alert.less | 1 + .../themes/common/styles/uwt-listview.less | 18 +- php/mocha/themes/common/styles/uwt-menu.less | 12 +- .../themes/common/styles/uwt-window.less | 10 + php/mocha/themes/common/styles/uwt.less | 2 + php/mocha/themes/mocha/mcx-colors.less | 25 ++ .../themes/mocha/mcx-instancebrowser.less | 145 ++++++++++ .../styles/mochahacks.less => mocha/uwt.less} | 59 ++-- php/mocha/themes/pleasanton/uwt-button.less | 33 +++ php/mocha/themes/pleasanton/uwt.less | 7 + php/mocha/ui/masterPages/Blank.phpx | 3 + php/mocha/ui/masterPages/Blank.phpx.php | 41 ++- php/mocha/ui/masterPages/Blank2.phpx | 17 ++ php/mocha/ui/masterPages/Blank2.phpx.php | 31 ++ php/mocha/ui/pages/HomePage.phpx.php | 2 + php/mocha/ui/pages/InstancePage.phpx.php | 9 +- php/mocha/ui/pages/InvalidURLPage.phpx | 2 +- php/mocha/ui/pages/InvalidURLPage.phpx.php | 18 ++ php/mocha/ui/pages/LoginPage.phpx.php | 14 +- .../ui/pages/RelatedTaskListPage.phpx.php | 136 ++++++--- php/mocha/ui/pages/RelatedTaskPage.phpx.php | 6 +- php/mocha/ui/pages/SUVPage.phpx | 2 +- php/mocha/ui/pages/SUVPage.phpx.php | 36 +-- php/mocha/ui/pages/SearchPage.phpx | 5 + php/mocha/ui/pages/SearchPage.phpx.php | 19 ++ .../mocha_get_related_instances.sql | 2 +- 75 files changed, 1854 insertions(+), 444 deletions(-) create mode 100644 common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00017-Instance.yaml create mode 100644 common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00029-BuildElementMethod.yaml create mode 100644 common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00040-GetSpecifiedInstancesMethod.yaml create mode 100644 common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00393-GetInstancesMethod.yaml create mode 100644 common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113789-UserList.yaml create mode 100644 common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/IntegrationIDs.yaml create mode 100644 php/mocha/include/mochacommon.inc.php create mode 100644 php/mocha/scripts/mcx_instancekey.js create mode 100644 php/mocha/scripts/mcx_messages.js create mode 100644 php/mocha/themes/common/styles/mobile/uwt-window.less create mode 100644 php/mocha/themes/common/styles/mobile/uwt.less create mode 100644 php/mocha/themes/mocha/mcx-colors.less create mode 100644 php/mocha/themes/mocha/mcx-instancebrowser.less rename php/mocha/themes/{common/styles/mochahacks.less => mocha/uwt.less} (80%) create mode 100644 php/mocha/themes/pleasanton/uwt-button.less create mode 100644 php/mocha/themes/pleasanton/uwt.less create mode 100644 php/mocha/ui/masterPages/Blank2.phpx create mode 100644 php/mocha/ui/masterPages/Blank2.phpx.php create mode 100644 php/mocha/ui/pages/InvalidURLPage.phpx.php create mode 100644 php/mocha/ui/pages/SearchPage.phpx create mode 100644 php/mocha/ui/pages/SearchPage.phpx.php diff --git a/common/admin/mocha-libexec/internal/librarymanager/libraryparser/YAMLLibraryParser.py b/common/admin/mocha-libexec/internal/librarymanager/libraryparser/YAMLLibraryParser.py index ea3f3e8..12e6a05 100644 --- a/common/admin/mocha-libexec/internal/librarymanager/libraryparser/YAMLLibraryParser.py +++ b/common/admin/mocha-libexec/internal/librarymanager/libraryparser/YAMLLibraryParser.py @@ -64,6 +64,54 @@ class YAMLLibraryParser (LibraryParser): self.apply_template(elem, template, instanceId) + def assign_relationship_value(self, instanceId, rel, rel_iid, relationshipValue): + if (isinstance(relationshipValue, str)): + # single instance, this should be a GUID or entityref + # we should only need to refer to existing instance in this case + relationshipValueInst = Guid(self.manager.expand_entity_references(relationshipValue)) + if "instance" in rel: + self.manager.assign_relationship(instanceId, Guid(self.manager.expand_entity_references(rel["instance"])), relationshipValueInst) + else: + print("no relationship instance specified for relationship sugar") + + else: + # dynamically created instance + #FIXME: this 'instance' isn't always the tag name, this can be subject to customTagName as well!and should be processed accordingly + (relinst_key, relinst_iid) = self.find_custom_tag_name(relationshipValue) + if relinst_key is not None: + # for example, 'relinst_key' is 'elementContent' and 'relinst_iid' is '{8ECA14A4...}' + + if rel_iid is not None: + print("found customTagName '" + str(relinst_key) + "' with value '" + str(relinst_iid.get_value()) + "'") + + # relval = Guid(self.manager.expand_entity_references(elem[customTagName])) + # we need to create the new instance and assign relationship + self.manager.assign_relationship(instanceId, rel_iid, relinst_iid) + else: + if "globalIdentifier" in relationshipValue: + globalIdentifier = Guid(relationshipValue["globalIdentifier"]) + else: + globalIdentifier = Guid.create() + + print("creating new instance for relationship '%s' with globalid '%s'" % (rel_iid, globalIdentifier.get_value())) + if "customTagNameCreatesInstanceOf" in rel: + createsInstanceOf = Guid(self.manager.expand_entity_references(rel["customTagNameCreatesInstanceOf"])) + + # create the new instance + self.manager.add_instance(createsInstanceOf, globalIdentifier, None, None) + + # assign relationships + self.manager.assign_relationship(instanceId, rel_iid, globalIdentifier) + # self.manager.assign_relationship(globalIdentifier, relationshipInstanceId, instanceId) + + # FIXME: apply relationships from the parent class template + if createsInstanceOf.get_value() in self.templates: + print("applying template for createsInstanceOf '%s'" % (createsInstanceOf.get_value())) + createsInstanceOfTemplate = self.templates[createsInstanceOf.get_value()] + self.apply_template(relationshipValue, createsInstanceOfTemplate, globalIdentifier) + else: + print("no template registered for createsInstanceOf '%s'" % (createsInstanceOf.get_value())) + def apply_template(self, elem, template, instanceId): if "value" in elem: @@ -94,61 +142,16 @@ class YAMLLibraryParser (LibraryParser): customTagName = rel["customTagName"] if customTagName in elem: relationshipValue = elem[customTagName] + if relationshipValue is None: + continue if isinstance(relationshipValue, list): # multiple instances for v in relationshipValue: - #FIXME: this 'instance' isn't always the tag name, this can be subject to customTagName as well!and should be processed accordingly - (relinst_key, relinst_iid) = self.find_custom_tag_name(v) - if relinst_key is not None: - # for example, 'relinst_key' is 'elementContent' and 'relinst_iid' is '{8ECA14A4...}' - - if rel_iid is not None: - print("found customTagName '" + str(relinst_key) + "' with value '" + str(relinst_iid.get_value()) + "'") - - # relval = Guid(self.manager.expand_entity_references(elem[customTagName])) - # we need to create the new instance and assign relationship - self.manager.assign_relationship(instanceId, Guid(self.manager.expand_entity_references(rel_iid)), relinst_iid) - else: - print("HELLO!!! NO RELATIONSHIP SUGAR!!! CREATE THE INSTANCE!!!") + self.assign_relationship_value(instanceId, rel, Guid(self.manager.expand_entity_references(rel_iid)), v) else: - - if (isinstance(relationshipValue, str)): - # single instance, this should be a GUID or entityref - # we should only need to refer to existing instance in this case - relationshipValueInst = Guid(self.manager.expand_entity_references(relationshipValue)) - if "instance" in rel: - self.manager.assign_relationship(instanceId, Guid(self.manager.expand_entity_references(rel["instance"])), relationshipValueInst) - else: - print("no relationship instance specified for relationship sugar") - - else: - # dynamically created instance - if "globalIdentifier" in relationshipValue: - globalIdentifier = relationshipValue["globalIdentifier"] - else: - globalIdentifier = Guid.create() - - print("creating new instance for relationship '%s' with globalid '%s'" % (rel_iid, globalIdentifier.get_value())) - if "customTagNameCreatesInstanceOf" in rel: - createsInstanceOf = Guid(self.manager.expand_entity_references(rel["customTagNameCreatesInstanceOf"])) - - # create the new instance - self.manager.add_instance(createsInstanceOf, globalIdentifier, None, None) - - # assign relationships - self.manager.assign_relationship(instanceId, Guid(self.manager.expand_entity_references(rel_iid)), globalIdentifier) - # self.manager.assign_relationship(globalIdentifier, relationshipInstanceId, instanceId) - - # FIXME: apply relationships from the parent class template - if createsInstanceOf.get_value() in self.templates: - print("applying template for createsInstanceOf '%s'" % (createsInstanceOf.get_value())) - createsInstanceOfTemplate = self.templates[createsInstanceOf.get_value()] - self.apply_template(relationshipValue, createsInstanceOfTemplate, globalIdentifier) - else: - print("no template registered for createsInstanceOf '%s'" % (createsInstanceOf.get_value())) - + self.assign_relationship_value(instanceId, rel, Guid(self.manager.expand_entity_references(rel_iid)), relationshipValue) def get_instance_sugar_for_elem(self, elem): if "instance" in elem: @@ -219,7 +222,8 @@ class YAMLLibraryParser (LibraryParser): creatorKey = None if "instance" in elem: if "templateOnly" in elem and elem["templateOnly"] == True: - instanceId = None + # instanceId = None + instanceId = Guid(self.manager.expand_entity_references(elem["instance"])) else: instanceId = Guid(self.manager.expand_entity_references(elem["instance"])) @@ -240,6 +244,7 @@ class YAMLLibraryParser (LibraryParser): if classId is None and instanceId is not None: classId = instanceId # HACK HACK + print("WARNING: class hack used for instanceId " + instanceId.get_value()) if instanceId is not None: self.manager.add_instance(classId, instanceId, classIndex, index) 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 0244d62..ab67fd1 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 @@ -62,4 +62,6 @@ - IDA_AllowAny: '{af02b1d7-b261-4eaf-9f99-37356c74e237}' - IDA_UserNameOrPasswordIncorrectMessage: '{7a63f087-f47c-4b49-9043-94d6d59ac6c4}' - IDA_LoginPageInstructions: '{dc11f905-335d-4e9b-8f03-55551a184dc3}' - - IDA_OpenInNewWindow: '{4a211f11-c5c3-4b58-a7f4-ed62538c5a3d}' \ No newline at end of file + - 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 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 cb4a9b5..5a76294 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 @@ -50,6 +50,7 @@ - IDR_Class__instance_labeled_by__String: "{F52FC851-D655-48A9-B526-C5FE0D7A29D2}" - IDR_Class__has_summary__Report_Field: "{D11050AD-7376-4AB7-84DE-E8D0336B74D2}" - IDR_Class__has_related__Task: "{4D8670E1-2AF1-4E7C-9C87-C910BD7B319B}" + - IDR_Task__related_for__Class: "{F6D05235-AAA8-4DC0-8D3A-A0F336B39F01}" - IDR_Report_Object__has__Report_Field: "{0af62656-42bc-40a5-b0bc-dbba67c347f6}" - IDR_Report_Field__for__Report_Object: "{b46c8caa-3f46-465f-ba11-7d6f385425a2}" @@ -108,7 +109,10 @@ - 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_Specific_Instances_Method__has__Instance: "{dea1aa0b-2bef-4bac-b4f9-0ce8cf7006fc}" + - 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}" + - IDR_Get_Specified_Instances_Method__uses__Instance: "{dea1aa0b-2bef-4bac-b4f9-0ce8cf7006fc}" + - IDR_Instance__used_by__Get_Specified_Instances_Method: "{13978b33-dd35-4d96-9414-4cb929b549e9}" - IDR_Evaluate_Boolean_Expression_Method__has_source_attribute__Method: "{45d76d56-01ed-4641-9f68-cfe0c7d0d265}" - IDR_Evaluate_Boolean_Expression_Method__equal_to_attribute__Method: "{0646df91-7e3e-4d59-be71-b978a22ced8e}" @@ -352,4 +356,11 @@ - IDR_Assign_Attribute_Method__assigns__Attribute: '{74061875-8a27-403b-9456-02e52cfd13b2}' - IDR_Attribute__assigned_by__Assign_Attribute_Method: '{d3b540e8-0f52-4595-bf52-1968637da59a}' - \ No newline at end of file + - IDR_BEM_Process__uses_loop__Executable_returning_Instance_Set: '{0fb2b538-eacb-418a-b7d8-43a584b85952}' + - IDR_Executable_returning_Instance_Set__loop_used_by__BEM_Process: '{903e0a4b-f93b-420c-a11d-f34be76d0479}' + + - IDR_Build_Element_Method__has__BEM_Process: '{6f1811b0-4e58-4e66-8318-083b62aac5de}' + - 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 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 7515073..a86e0a9 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 @@ -35,7 +35,7 @@ - IDC_GetReferencedElementMethod: "{7b46b5d7-0130-44c9-9c7a-89e693369cc7}" # 1$197 - 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_ConditionalSelectAttributeMethod: "{d534a369-321e-4c32-bd7f-8ff2017f191e}" # 1$13038 - - IDC_ConditionalSelectFromInstanceSetMethod: "{ffea8e52-06e5-4e95-8c40-da3ba54ce95f}" # 1$13039 - \ No newline at end of file + - 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 9ae5e0b..d17db7e 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 @@ -1,6 +1,10 @@ - entityDefinitions: + - IDI_Task_ViewElement: '{64e9c8f6-c3d7-4915-98c8-83b91c211a8d}' - IDI_Task_ViewElementContent: '{9c90e09a-2efc-4ebd-92e6-c0767ac3fbfd}' - IDI_Task_ViewClass: '{cd9366be-08d7-4b32-8963-3c42753fa8d9}' #- IDC_SequenceTask: "{74c26737-000e-4bda-a1af-ad6d59bcc4b2}" #- IDC_ConvenienceTask: "{8a9fb632-6d04-49ff-8271-1f41dce1f254}" - - IDI_SequenceTask_TestMethodBinding: '{3e55af17-00a9-418d-ae6f-7e52ec11148e}' \ No newline at end of file + - 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 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/008-Elements.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/008-Elements.yaml index 2ce3166..556333c 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/008-Elements.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/008-Elements.yaml @@ -3,4 +3,7 @@ - IDE_LoginPageSubedit: '{2b7d4481-b7c2-4e26-a917-e3ff7c367a8a}' - IDE_HomePage: '{3c1f92a5-09a0-4b52-9269-46c386b0c905}' - IDE_ViewElementContent: '{e68bb6c4-29eb-4c77-908a-1b3793c952bc}' - - IDE_ViewElementContent_Summary: '{a639e587-f8a5-4503-afb6-08e98cb40a09}' \ No newline at end of file + - IDE_ViewElementContent_Summary: '{a639e587-f8a5-4503-afb6-08e98cb40a09}' + + - IDE_ViewElement: '{f39280f4-a62a-4fb3-9f58-3a4abe57cee9}' + - IDE_ElementStart: '{3abffca7-b904-4988-9583-cf7f4fc4146e}' \ 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 9625c3f..2549f6c 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 @@ -4,3 +4,6 @@ - IDI_TaskCategory_Instance: '{5303969f-dafc-4c1f-916c-f1079c3b19b5}' - IDI_TaskCategory_MethodBinding: '{871cec9e-faf3-4996-b873-57e78c988b11}' - IDI_TaskCategory_ReturnedWorkData: '{57443af8-65f2-4e9b-97c7-f36a4b635760}' + - IDI_TaskCategory_Debugging: '{8f6e81be-9663-4226-85c3-253588126ea2}' + - IDI_TaskCategory_IntegrationIDs: '{79449821-89d6-4f83-b3dd-0e780b0a9fef}' + - IDI_TaskCategory_Element: '{7ac1d803-7007-4b3d-b06e-886d62f758c9}' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00001-Class.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00001-Class.yaml index 9e683d6..a047648 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00001-Class.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00001-Class.yaml @@ -12,6 +12,8 @@ customTagName: 'inherits' - instance: '&IDR_Class__has_default__Task;' customTagName: 'defaultTask' + - instance: '&IDR_Class__has_related__Task;' + customTagName: 'relatedTasks' translations: - relationship: '&IDR_Class__has_title__Translation;' values: @@ -22,3 +24,5 @@ name: Class index: 1 defaultTask: '&IDI_Task_ViewClass;' + relatedTasks: + - instance: '&IDI_Task_ViewClass;' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00003-Relationship.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00003-Relationship.yaml index 9f42f0f..41c19dd 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00003-Relationship.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00003-Relationship.yaml @@ -267,4 +267,20 @@ type: 'for' destinationClassId: '&IDC_Task;' siblingRelationshipId: '&IDR_Task__has__Task_Category;' + singular: no + + - relationship: '&IDR_Class__has_related__Task;' + index: 7948 # was: Related Menu Item.uses object of Class + sourceClassId: '&IDC_Class;' + type: 'has related' + destinationClassId: '&IDC_Task;' + siblingRelationshipId: '&IDR_Task__related_for__Class;' + singular: no + + - relationship: '&IDR_Task__related_for__Class;' + index: 7949 # was: Related Menu Item.for UI Task + sourceClassId: '&IDC_Task;' + type: 'related for' + destinationClassId: '&IDC_Class;' + siblingRelationshipId: '&IDR_Class__has_related__Task;' singular: no \ 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 caf4fa3..58e8b2c 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 @@ -35,6 +35,9 @@ - textAttribute: '&IDA_Comment;' name: Comment index: 6 + - textAttribute: '&IDA_Order;' + name: 'Order' + index: 7 - textAttribute: '&IDA_RelationshipType;' name: 'Relationship Type' index: 8 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00005-BooleanAttribute.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00005-BooleanAttribute.yaml index 1619f22..b148080 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00005-BooleanAttribute.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00005-BooleanAttribute.yaml @@ -59,6 +59,9 @@ - instance: '&IDA_UseAnyCondition;' name: Use Any Condition index: 18 + - instance: '&IDA_LongRunning;' + name: Long Running + index: 19 - instance: '&IDA_IncludeMIs;' name: Include MIs index: 20 @@ -69,6 +72,9 @@ name: Allow Any index: 22 - instance: '&IDA_OpenInNewWindow;' - name: Open in New Winow + name: Open in New Window index: 23 + - instance: '&IDA_SuppressRIHints;' + name: Suppress RI Hints + index: 24 \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00006-Element.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00006-Element.yaml index 186cf8a..b27c14b 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00006-Element.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00006-Element.yaml @@ -5,6 +5,9 @@ name: Element index: 6 customTagName: 'element' + defaultTask: '&IDI_Task_ViewElement;' + relatedTasks: + - instance: '&IDI_Task_ViewElement;' attributes: - instance: '&IDA_Name;' customTagName: 'name' @@ -13,6 +16,7 @@ relationships: - instance: '&IDR_Element__has__Element_Content;' customTagName: 'elementContents' + customTagNameCreatesInstanceOf: '&IDC_ElementContent;' - instance: '&IDR_Element__processed_by__Process_Related_Updates_Method;' customTagName: 'processedByPRUMethod' instances: diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00016-BEMProcess.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00016-BEMProcess.yaml index 21175d1..509c857 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00016-BEMProcess.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00016-BEMProcess.yaml @@ -4,15 +4,35 @@ - class: '&IDC_BEMProcess;' name: BEM Process index: 16 + customTagName: 'bemProcess' + registerForTemplate: yes translations: - relationship: '&IDR_Class__has_title__Translation;' values: - languageInstanceId: '&IDI_Language_English;' value: 'BEM Process' + relationships: + - instance: '&IDR_BEM_Process__uses_loop__Executable_returning_Instance_Set;' + customTagName: 'loopExecutableReturningInstanceSet' - instances: - - instance: '&IDBEM_1;' + - bemProcess: '&IDBEM_1;' + - relationship: '&IDR_BEM_Process__uses_loop__Executable_returning_Instance_Set;' + index: 44 + sourceClassId: '&IDC_BEMProcess;' + type: 'uses loop' + destinationClassId: '&IDC_ExecutableReturningInstanceSet;' + siblingRelationshipId: '&IDR_Executable_returning_Instance_Set__loop_used_by__BEM_Process;' + singular: yes + + - relationship: '&IDR_Executable_returning_Instance_Set__loop_used_by__BEM_Process;' + index: 45 + sourceClassId: '&IDC_ExecutableReturningInstanceSet;' + type: 'loop used by' + destinationClassId: '&IDC_BEMProcess;' + siblingRelationshipId: '&IDR_BEM_Process__uses_loop__Executable_returning_Instance_Set;' + singular: no + - relationship: '&IDR_Element_Content__built_from__BEM_Process;' index: 105 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00017-Instance.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00017-Instance.yaml new file mode 100644 index 0000000..bc23036 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00017-Instance.yaml @@ -0,0 +1,20 @@ +--- +- library: '&IDL_MochaBaseSystem;' + instances: + - class: '&IDC_Instance;' + name: Instance + index: 17 + translations: + - relationship: '&IDR_Class__has_title__Translation;' + values: + - languageInstanceId: '&IDI_Language_English;' + value: 'Instance' + relatedTasks: + # !FIXME: there should be a better way to do this, like specifying an Instance Set + # ! containing multiple related tasks that can be reused across different class definitions + - instance: '&IDI_Task_ShowDefinitionInCodeEditor;' + - instance: '&IDI_Task_DeleteInstance;' + - instance: '&IDI_Task_ViewIntegrationIDs;' + - instance: '{42bdbbc9-214f-4d81-b91f-36a177e5087b}' + - instance: '{643a3780-250b-4575-be50-50dc346137c0}' + - instance: '{5aafc3a1-8490-4860-866d-717a4c2c77e2}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00029-BuildElementMethod.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00029-BuildElementMethod.yaml new file mode 100644 index 0000000..302fff2 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00029-BuildElementMethod.yaml @@ -0,0 +1,51 @@ +--- +- library: '&IDL_MochaBaseSystem;' + instances: + - class: '&IDC_BuildElementMethod;' + inherits: '&IDC_Method;' + name: BEM - Build Element Method + index: 29 + customTagName: buildElementMethod + attributes: + - instance: '&IDA_Verb;' + customTagName: 'verb' + - instance: '&IDA_Name;' + customTagName: 'name' + relationships: + - instance: '&IDR_Build_Element_Method__has__BEM_Process;' + customTagName: 'hasBemProcess' + customTagNameCreatesInstanceOf: '&IDC_BEMProcess;' + - instance: '&IDR_Build_Element_Method__returns__Element;' + customTagName: 'returnsElement' + + - relationship: '&IDR_Build_Element_Method__has__BEM_Process;' + index: 52 + sourceClassId: '&IDC_BuildElementMethod;' + type: 'returns' + destinationClassId: '&IDC_BEMProcess;' + siblingRelationshipId: '&IDR_BEM_Process__for__Build_Element_Method;' + singular: yes + + - relationship: '&IDR_BEM_Process__for__Build_Element_Method;' + index: 53 + sourceClassId: '&IDC_BEMProcess;' + type: 'for' + destinationClassId: '&IDC_BuildElementMethod;' + siblingRelationshipId: '&IDR_Build_Element_Method__has__BEM_Process;' + singular: no + + - relationship: '&IDR_Build_Element_Method__returns__Element;' + index: 54 + sourceClassId: '&IDC_BuildAttributeMethod;' + type: 'returns' + destinationClassId: '&IDC_BuildElementMethod;' + siblingRelationshipId: '&IDR_Element__returned_by__Build_Element_Method;' + singular: no + + - relationship: '&IDR_Element__returned_by__Build_Element_Method;' + index: 55 + sourceClassId: '&IDC_Element;' + type: 'returned by' + destinationClassId: '&IDC_BuildElementMethod;' + siblingRelationshipId: '&IDR_Build_Element_Method__returns__Element;' + singular: no diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00040-GetSpecifiedInstancesMethod.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00040-GetSpecifiedInstancesMethod.yaml new file mode 100644 index 0000000..dd565a2 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00040-GetSpecifiedInstancesMethod.yaml @@ -0,0 +1,44 @@ +- library: '&IDL_MochaBaseSystem;' + instances: + - class: '&IDC_GetSpecifiedInstancesMethod;' + name: GSI - Get Specified Instances Method + index: 40 + inherits: '&IDC_Method;' + customTagName: getSpecifiedInstancesMethod + relationships: + - instance: '&IDR_Get_Specified_Instances_Method__returns__Work_Set;' + customTagName: 'returnsWorkSet' + - instance: '&IDR_Get_Specified_Instances_Method__uses__Instance;' + customTagName: 'selectsInstances' + + - relationship: '&IDR_Get_Specified_Instances_Method__returns__Work_Set;' + index: 74 + sourceClassId: '&IDC_GetSpecifiedInstancesMethod;' + type: 'returns' + destinationClassId: '&IDC_WorkSet;' + siblingRelationshipId: '&IDR_Work_Set__returned_by__Get_Specified_Instances_Method;' + singular: yes + + - relationship: '&IDR_Work_Set__returned_by__Get_Specified_Instances_Method;' + index: 75 + sourceClassId: '&IDC_WorkSet;' + type: 'returned by' + destinationClassId: '&IDC_GetSpecifiedInstancesMethod;' + siblingRelationshipId: '&IDR_Get_Specified_Instances_Method__returns__Work_Set;' + singular: no + + - relationship: '&IDR_Get_Specified_Instances_Method__uses__Instance;' + index: 76 + sourceClassId: '&IDC_GetSpecifiedInstancesMethod;' + type: 'uses' + destinationClassId: '&IDC_Instance;' + siblingRelationshipId: '&IDR_Instance__used_by__Get_Specified_Instances_Method;' + singular: yes + + - relationship: '&IDR_Instance__used_by__Get_Specified_Instances_Method;' + index: 77 + sourceClassId: '&IDC_Instance;' + type: 'used by' + destinationClassId: '&IDC_GetSpecifiedInstancesMethod;' + siblingRelationshipId: '&IDR_Get_Specified_Instances_Method__uses__Instance;' + singular: no diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00056-ElementContent.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00056-ElementContent.yaml index 6f1c287..b080198 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00056-ElementContent.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00056-ElementContent.yaml @@ -38,6 +38,7 @@ name: Element Content index: 56 customTagName: 'elementContent' + registerForTemplate: yes defaultTask: '&IDI_Task_ViewElementContent;' attributes: - instance: '&IDA_Order;' @@ -53,6 +54,8 @@ customTagName: 'layout' - instance: '&IDR_Element_Content__built_from__BEM_Process;' customTagName: 'builtFromBEMProcess' + - instance: '&IDR_Derived_Element_Content__update_with__Executable_returning_Work_Data;' + customTagName: 'value' instances: - instance: '&IDI_Element_AddMetadataInstance;' name: add metadata instance @@ -71,4 +74,19 @@ type: 'for' destinationClassId: '&IDC_ElementContent;' siblingRelationshipId: '&IDR_Element_Content__has__Element_Content_Display_Option;' + singular: no + + - relationship: '&IDR_Derived_Element_Content__update_with__Executable_returning_Work_Data;' + index: 2165 + sourceClassId: '&IDC_ElementContent;' + type: 'update with' + destinationClassId: '&IDC_ExecutableReturningWorkData;' + siblingRelationshipId: '&IDR_Executable_returning_Work_Data__used_by__Derived_Element_Content;' + singular: no + - relationship: '&IDR_Executable_returning_Work_Data__used_by__Derived_Element_Content;' + index: 2166 + sourceClassId: '&IDC_ExecutableReturningWorkData;' + type: 'used by' + destinationClassId: '&IDC_ElementContent;' + siblingRelationshipId: '&IDR_Derived_Element_Content__update_with__Executable_returning_Work_Data;' singular: no \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00393-GetInstancesMethod.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00393-GetInstancesMethod.yaml new file mode 100644 index 0000000..99ddbb7 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00393-GetInstancesMethod.yaml @@ -0,0 +1,51 @@ +--- +- entityDefinitions: + - IDR_Get_Instances_Method__returns__Work_Set: '{7d0f93b1-8c93-464e-a44d-d674f910b589}' + - IDR_Work_Set__returned_by__Get_Instances_Method: '{6a5873ac-13f8-4688-96ac-3d43403dc291}' + - IDR_Get_Instances_Method__selects_instances_of__Class: '{c0b85d90-de8c-44c2-9420-c5e724ccdf2c}' + - IDR_Class__instances_selected_by__Get_Instances_Method: '{7a20a467-fdb3-4932-8372-f93f0fc8f77f}' + +- library: '&IDL_MochaBaseSystem;' + instances: + - class: '&IDC_GetInstancesMethod;' + inherits: '&IDC_Method;' + name: GI - Get Instances Method + index: 393 + customTagName: getInstancesMethod + relationships: + - instance: '&IDR_Get_Instances_Method__returns__Work_Set;' + customTagName: 'returnsWorkSet' + - instance: '&IDR_Get_Instances_Method__selects_instances_of__Class;' + customTagName: 'selectsInstancesOfClass' + + - relationship: '&IDR_Get_Instances_Method__returns__Work_Set;' + index: 915 + sourceClassId: '&IDC_GetInstancesMethod;' + type: 'returns' + destinationClassId: '&IDC_WorkSet;' + siblingRelationshipId: '&IDR_Work_Set__returned_by__Get_Instances_Method;' + singular: yes + + - relationship: '&IDR_Work_Set__returned_by__Get_Instances_Method;' + index: 916 + sourceClassId: '&IDC_WorkSet;' + type: 'returned by' + destinationClassId: '&IDC_GetInstancesMethod;' + siblingRelationshipId: '&IDR_Get_Instances_Method__returns__Work_Set;' + singular: no + + - relationship: '&IDR_Get_Instances_Method__selects_instances_of__Class;' + index: 918 + sourceClassId: '&IDC_GetInstancesMethod;' + type: 'selects instances of' + destinationClassId: '&IDC_Class;' + siblingRelationshipId: '&IDR_Class__instances_selected_by__Get_Instances_Method;' + singular: yes + + - relationship: '&IDR_Class__instances_selected_by__Get_Instances_Method;' + index: 920 + sourceClassId: '&IDC_Class;' + type: 'instances selected by' + destinationClassId: '&IDC_GetInstancesMethod;' + siblingRelationshipId: '&IDR_Get_Instances_Method__selects_instances_of__Class;' + singular: no diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02993-Task.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02993-Task.yaml index 6c81446..433fdcc 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02993-Task.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02993-Task.yaml @@ -7,3 +7,23 @@ relationships: - instance: '&IDR_Task__related_action_for__Instance;' customTagName: relatedActionForInstanceId + +# BUIR - Build UI Response Method.uses Executable returning Element +# the BUIR is referenced via a Build Response Method Binding [BRMB] on the CT +# the CT is in turn referenced by the Task + + - relationship: '&IDR_Task__has_initiating__Element;' + index: 89 + sourceClassId: '&IDC_Task;' + type: 'has initiating' + destinationClassId: '&IDC_Element;' + siblingRelationshipId: '&IDR_Element__initiates_for__Task;' + singular: yes + + - relationship: '&IDR_Element__initiates_for__Task;' + index: 90 + sourceClassId: '&IDC_Element;' + type: 'initiates for' + destinationClassId: '&IDC_Task;' + siblingRelationshipId: '&IDR_Task__has_initiating__Element;' + singular: no diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02994-HardcodedTask.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02994-HardcodedTask.yaml index 825ea73..c264fc2 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02994-HardcodedTask.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02994-HardcodedTask.yaml @@ -10,10 +10,9 @@ customTagName: 'name' - instance: '&IDA_ClassName;' customTagName: 'className' - - - hardcodedTask: '&IDI_Task_ViewClass;' - name: 'View Class' - className: 'Mocha\\UI\\Tasks\\ViewClass' + relationships: + - instance: '&IDR_Task__has__Task_Category;' + customTagName: 'taskCategory' - hardcodedTask: '&IDI_Task_ViewElementContent;' name: 'View Element Content' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02997-SequenceTask.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02997-SequenceTask.yaml index f80fb3e..dee06ac 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02997-SequenceTask.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02997-SequenceTask.yaml @@ -7,6 +7,8 @@ superclasses: - '&IDC_Task;' attributes: + - instance: '&IDA_Name;' #!FIXME: inherit from class 'inherits' attribute + customTagName: 'name' - instance: '&IDA_Schedulable' customTagName: schedulable - instance: '&IDA_LongRunning;' @@ -19,4 +21,24 @@ relationships: - instance: '&IDR_Task__has_initiating__Element;' customTagName: initiatingElementId - \ No newline at end of file + - instance: '&IDR_Task__has__Task_Category;' + customTagName: taskCategory + + - sequenceTask: '&IDI_Task_ViewElement;' + name: 'View Element' + schedulable: no + longRunning: no + suppressRIHints: no + stepName: View Element + showSpreadsheetButonOnSelection: no + taskCategory: '&IDI_TaskCategory_Element;' + initiatingElementId: '&IDE_ElementStart;' + + - element: '&IDE_ElementStart;' + name: 'Element Start' + elementContents: + - elementContent: '{2b534e53-b0ef-429d-b9a4-4eba9e36a455}' + defaultDataType: '&IDC_Element;' + order: a + - elementContent: '{3dd3c7f6-9da6-48bc-8fe5-a6d03dcd1d9e}' + defaultDataType: '&IDA_Name;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03001-RedirectTask.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03001-RedirectTask.yaml index ac56750..60a9499 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03001-RedirectTask.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03001-RedirectTask.yaml @@ -9,9 +9,9 @@ attributes: - instance: '&IDA_Name;' customTagName: name - - instance: '&IDA_OpenInNewWindow' + - instance: '&IDA_OpenInNewWindow;' customTagName: openInNewWindow - - instance: '&IDA_TargetURL' + - instance: '&IDA_TargetURL;' customTagName: targetUrl relationships: diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/3004-TaskCategory.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/3004-TaskCategory.yaml index 26d6f61..4752d44 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/3004-TaskCategory.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/3004-TaskCategory.yaml @@ -5,7 +5,7 @@ name: Task Category customTagName: taskCategory attributes: - - instance: '&IDA_Name' + - instance: '&IDA_Name;' customTagName: name # ents defined in ../000-EntityDefinitions/016-TaskCategories.yaml @@ -18,4 +18,8 @@ - taskCategory: '&IDI_TaskCategory_MethodBinding;' name: 'Method Binding' - taskCategory: '&IDI_TaskCategory_ReturnedWorkData;' - name: 'Returned Work Data' \ No newline at end of file + name: 'Returned Work Data' + - taskCategory: '&IDI_TaskCategory_Debugging;' + name: 'Debugging' + - taskCategory: '&IDI_TaskCategory_Element;' + name: 'Element' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000001-ViewElementContent.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000001-ViewElementContent.yaml index d77e30f..4983b6a 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000001-ViewElementContent.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000001-ViewElementContent.yaml @@ -18,6 +18,7 @@ module: '&IDI_Module_MochaBaseSystem;' elementContents: - instance: '{bce8db21-66e1-4cfb-b398-9f010747c225}' + - instance: '{22eb6d52-6ad9-4b6f-8f59-d7c896cae8ac}' - elementContent: '{bce8db21-66e1-4cfb-b398-9f010747c225}' defaultDataType: '&IDR_Element_Content__for__Element;' @@ -25,3 +26,10 @@ order: a displayOptions: - instance: '&IDI_DisplayOption_NotEnterable;' + + - elementContent: '{22eb6d52-6ad9-4b6f-8f59-d7c896cae8ac}' + defaultDataType: '&IDA_Order;' + label: 'Order' + order: b + displayOptions: + - instance: '&IDI_DisplayOption_NotEnterable;' 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 new file mode 100644 index 0000000..4ba0cae --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113789-UserList.yaml @@ -0,0 +1,44 @@ +--- +- entityDefinitions: + - IDE_UserList: '{ceccad4f-a1c2-4945-831a-a34ee2c502ea}' + - IDBEM_UserList: '{0c202bb4-6afb-4f34-8a29-55723dc61ae1}' + - IDBEMP_UserList: '{ca4361b5-c336-4c6d-8f44-95487879fca4}' + - IDI_GetInstances_User: '{7415d0de-ec70-4542-8885-f4c6319f08a8}' + +- library: '&IDL_MochaBaseSystem;' + instances: + - getInstancesMethod: '&IDI_GetInstances_User;' + returnsWorkSet: null + selectsInstancesOfClass: '&IDC_User;' + + - buildElementMethod: '&IDBEM_UserList;' + hasBemProcess: '&IDBEMP_UserList;' + + - bemProcess: '&IDBEMP_UserList;' + loopExecutableReturningInstanceSet: '&IDI_GetInstances_User;' # the GSI, below + + - element: '&IDE_UserList;' + name: user list + index: 113789 + processedByPRUMethod: null + elementContents: + - globalIdentifier: '{ce9eff84-034f-49ab-a976-adff7c402f00}' + order: 'a' + label: 'User' + defaultDataType: '&IDC_User;' + # builtFromBEMProcess: '&IDBEM_1;' + - globalIdentifier: '{f24ec140-7f6c-4efc-920d-076352f257ae}' + order: 'b' + label: 'User Name' + defaultDataType: '&IDA_UserName;' + # builtFromBEMProcess: '&IDBEM_1;' + - globalIdentifier: '{82b0a709-eedc-4af2-9ffa-b91648b6e53f}' + order: 'c' + label: 'Nonce' + defaultDataType: '&IDA_PasswordSalt;' + # builtFromBEMProcess: '&IDBEM_1;' + - globalIdentifier: '{52dadfbd-79d7-409b-9b3e-710c13a7aefc}' + order: 'd' + label: 'SHA-512 Hash' + defaultDataType: '&IDA_PasswordHash;' + # builtFromBEMProcess: '&IDBEM_1;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113800-ElementTests.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113800-ElementTests.yaml index 1ce4818..9709339 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113800-ElementTests.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113800-ElementTests.yaml @@ -7,11 +7,21 @@ processedByPRUMethod: '{2aa20384-4132-49d3-a661-ae7d9a2e2feb}' elementContents: - instance: '{91b1a767-08ac-47f0-9f30-620de6374d12}' - - instance: '{628550d8-673d-4156-8983-447ea2ee6d1b}' + - elementContent: '{628550d8-673d-4156-8983-447ea2ee6d1b}' + layout: '&IDI_ButtonLayout_DefaultButtonGroup;' + label: 'Test Method Binding' + value: + - taskId: '{d44b1278-4e29-44f4-b1ca-2e6bde40377e}' + - elementContent: '{dafb235b-ba1a-4b1a-8f9b-84cd987553e4}' + layout: '&IDI_ButtonLayout_DefaultButtonGroup;' + label: 'Edit Class' + value: + - taskId: '{9dbdb202-e9f8-49ca-bbc2-0b63df651246}' - instance: '{8c69fd8c-28fa-4f3c-a283-5d0006c1027d}' - instance: '{535b1507-68ed-4981-8cd4-e8e843a24916}' - instance: '{d74123b5-9fde-4c2a-bd28-8cd00ce86734}' - instance: '{d5653b81-a5e2-4f77-92f8-bcbae09f0d71}' + - instance: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}' - class: '{cce471d6-5fe7-4202-b678-9fcab20fd864}' name: 'Element Tests Testing Class 1' @@ -26,13 +36,42 @@ - ettc: '{98e038eb-ad55-4259-a4c5-8e82c221270c}' twml: 'hi world' rqft: 'test test' + + - ettc: '{d1a0e1d2-e380-4056-8c4f-f893c554527f}' + twml: 'second ETTC test' + rqft: 'another value for testing required' + + - workSet: '{36af925a-93f5-4cb8-986e-19ac239af253}' + validClasses: + - instance: '{cce471d6-5fe7-4202-b678-9fcab20fd864}' # ETTC 1 + + - buildElementMethod: '{7a1add0d-1789-430f-95aa-203fe6991fcd}' + hasBemProcess: { + globalIdentifier: '{d1326df7-d897-46de-bad1-4d1e6f85b042}', + loopExecutableReturningInstanceSet: '{ce3a9fcc-f5a1-45a6-9d9f-6e805906bb1f}' # the GSI, below + } + + # `Element Tests Testing Class 1@get Instances for Element Tests Testing (GSI)*P*S` + - getSpecifiedInstancesMethod: '{ce3a9fcc-f5a1-45a6-9d9f-6e805906bb1f}' + forClass: '{cce471d6-5fe7-4202-b678-9fcab20fd864}' # ETTC 1 + verb: 'get' + name: 'Instances for Element Tests Testing' + returnsWorkSet: '{36af925a-93f5-4cb8-986e-19ac239af253}' + selectsInstances: + - instance: '{98e038eb-ad55-4259-a4c5-8e82c221270c}' + - instance: '{d1a0e1d2-e380-4056-8c4f-f893c554527f}' - processRelatedUpdatesMethod: '{2aa20384-4132-49d3-a661-ae7d9a2e2feb}' name: 'PRU for Element Tests Class 1' processesForClass: '{cce471d6-5fe7-4202-b678-9fcab20fd864}' usesExecutableForPUMB: + - instance: '{0063c073-28be-4e81-a9bc-b551a17e75e0}' - instance: '{d6aea527-d0a8-4070-9332-9101ee14c656}' + - assignAttributeMethod: '{0063c073-28be-4e81-a9bc-b551a17e75e0}' + usesExecutableReturningAttribute: '{1a907d6e-b3fd-4f8e-a170-550aeb2faea5}' # EC + assignsAttribute: '{1a907d6e-b3fd-4f8e-a170-550aeb2faea5}' # req field test + - assignAttributeMethod: '{d6aea527-d0a8-4070-9332-9101ee14c656}' usesExecutableReturningAttribute: '{d53d7283-92a2-4a62-b8f2-cf0a0b975634}' # EC assignsAttribute: '{d53d7283-92a2-4a62-b8f2-cf0a0b975634}' # req field test @@ -40,12 +79,6 @@ - buttonLayout: '&IDI_ButtonLayout_DefaultButtonGroup;' executesTask: '&IDI_SequenceTask_TestMethodBinding;' - - elementContent: '{628550d8-673d-4156-8983-447ea2ee6d1b}' - layout: '&IDI_ButtonLayout_DefaultButtonGroup;' - label: 'Test Method Binding' - value: - - taskId: '{d44b1278-4e29-44f4-b1ca-2e6bde40377e}' - - textAttribute: '{1a907d6e-b3fd-4f8e-a170-550aeb2faea5}' name: 'Test_With_MaxLength_20' maximumLength: 20 @@ -102,10 +135,19 @@ index: 113803 #processedByPRUMethod: '{2aa20384-4132-49d3-a661-ae7d9a2e2feb}' elementContents: + - instance: '{c87a8626-0b3c-4ef2-97b0-f5064f6b09d9}' - instance: '{482845f5-c9cc-4c7b-ad5b-5aecbce3b086}' - instance: '{c38d8498-005e-4046-8150-e3def3c091ca}' - instance: '{a3032fd2-e149-4b00-b702-17862254adc2}' + - elementContent: '{c87a8626-0b3c-4ef2-97b0-f5064f6b09d9}' + order: 'a' + label: 'Test Class Again' + defaultDataType: '{cce471d6-5fe7-4202-b678-9fcab20fd864}' + value: '{98e038eb-ad55-4259-a4c5-8e82c221270c}' + #displayOptions: + #- instance: '&IDI_DisplayOption_DoNotShow;' + - elementContent: '{482845f5-c9cc-4c7b-ad5b-5aecbce3b086}' label: 'Not Enterable Again' defaultDataType: '{dd33bb2a-1e10-4090-a846-89a225103c07}' @@ -128,8 +170,14 @@ order: 'e' label: 'Test Horizontal EC with Grid Layout' defaultDataType: '{0f95606c-3653-4e40-af4e-34c501b669af}' - # builtFromBEMProcess: '&IDBEM_1;' + builtFromBEMProcess: '{d1326df7-d897-46de-bad1-4d1e6f85b042}' # displayOptions: # - instance: '&IDI_DisplayOption_Required;' - parameters: - - instance: '{a8c306ed-9eb6-49c8-a6dc-357617e493d5}' \ No newline at end of file + + - elementContent: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}' + order: 'f' + label: 'Users On This SUV' + defaultDataType: '&IDE_UserList;' + builtFromBEMProcess: '&IDBEMP_UserList;' + displayOptions: + - instance: '&IDI_DisplayOption_NotEnterable;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/EditClass.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/EditClass.yaml index bd7dfeb..39f7564 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/EditClass.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/EditClass.yaml @@ -7,4 +7,5 @@ - sequenceTask: '{9dbdb202-e9f8-49ca-bbc2-0b63df651246}' name: 'Edit Class' - relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;' \ No newline at end of file + relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;' + taskCategory: '&IDI_TaskCategory_Class;' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/IntegrationIDs.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/IntegrationIDs.yaml new file mode 100644 index 0000000..d19a308 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/IntegrationIDs.yaml @@ -0,0 +1,21 @@ +- library: '&IDL_MochaBaseSystem;' + instances: + - taskCategory: '&IDI_TaskCategory_IntegrationIDs;' + name: 'Integration IDs' + + - sequenceTask: '&IDI_Task_ViewIntegrationIDs;' + name: 'View Integration IDs' + relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;' + taskCategory: '&IDI_TaskCategory_IntegrationIDs;' + - sequenceTask: '{42bdbbc9-214f-4d81-b91f-36a177e5087b}' + name: 'Edit External IDs' + relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;' + taskCategory: '&IDI_TaskCategory_IntegrationIDs;' + - sequenceTask: '{643a3780-250b-4575-be50-50dc346137c0}' + name: 'Edit Reference ID' + relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;' + taskCategory: '&IDI_TaskCategory_IntegrationIDs;' + - sequenceTask: '{5aafc3a1-8490-4860-866d-717a4c2c77e2}' + name: 'Maintain Reference IDs' + relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;' + taskCategory: '&IDI_TaskCategory_IntegrationIDs;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ShowDefinitionInCodeEditor.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ShowDefinitionInCodeEditor.yaml index 36f8bcb..d3c40a6 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ShowDefinitionInCodeEditor.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ShowDefinitionInCodeEditor.yaml @@ -1,7 +1,12 @@ - library: '&IDL_MochaBaseSystem;' instances: - - redirectTask: '{4f8a0e8e-e139-4cc6-b8cf-a32e67bd192d}' - name: 'ViewInCodeEditor' + - redirectTask: '&IDI_Task_ShowDefinitionInCodeEditor;' + name: 'Show Definition in Code Editor' + openInNewWindow: yes + taskCategory: '&IDI_TaskCategory_Debugging;' + targetUrl: 'https://localhost:47071/?hi' + - redirectTask: '&IDI_Task_DeleteInstance;' + name: 'Delete Instance' openInNewWindow: yes taskCategory: '&IDI_TaskCategory_Instance;' targetUrl: 'https://localhost:47071/?hi' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewClass.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewClass.yaml index 612e4b0..4071f74 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewClass.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewClass.yaml @@ -1,5 +1,10 @@ -# - library: '&IDL_MochaBaseSystem;' -# instances: +- library: '&IDL_MochaBaseSystem;' + instances: + - hardcodedTask: '&IDI_Task_ViewClass;' + name: 'View Class' + className: 'Mocha\\UI\\Tasks\\ViewClass' + taskCategory: '&IDI_TaskCategory_Class;' + # - task: '&IDI_Task_ViewClass;' # name: View Class # module: '&IDI_Module_MochaBaseSystem;' diff --git a/php/mocha/include/BeforeLaunchEvent.inc.php b/php/mocha/include/BeforeLaunchEvent.inc.php index dc8d5f1..5ded99a 100644 --- a/php/mocha/include/BeforeLaunchEvent.inc.php +++ b/php/mocha/include/BeforeLaunchEvent.inc.php @@ -1,95 +1,8 @@ GetControlByID("literalSpotTimer"); - - if (file_exists("/etc/mocha/suvstart")) - { - $suv_start_time = trim(file_get_contents("/etc/mocha/suvstart")); - $suv_start_time_d = new \DateTime($suv_start_time); - $suv_start_time_d->setTimezone(new \DateTimeZone("UTC")); - - // this can be adjusted? - $suv_end_time_d = $suv_start_time_d->add(new \DateInterval("PT10H")); - $suv_end_time_d->setTimezone(new \DateTimeZone("UTC")); - - $suv_end_time = $suv_end_time_d->format('Y-m-d\TH:i:s\Z'); - - $suv_current_time_d = new \DateTime(); - $interval = $suv_end_time_d->diff($suv_current_time_d); - - $literalSpotTimer->Content = $interval->h . ":" . $interval->i; - - $spotTimerInitializationScript = $pg->Page->GetControlByID("spotTimerInitializationScript"); - $spotTimerInitializationScript->Content = << - var spot_end_time = new Date('$suv_end_time'); - window.datediff = function(earlierDate, laterDate) - { - var interval = { }; - var a = earlierDate, b = laterDate; - - console.log(earlierDate); - console.log(laterDate); - - const _MS_PER_DAY = 1000 * 60 * 60 * 24; - // Discard the time and time-zone information. - const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds()); - const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate(), b.getHours(), b.getMinutes(), b.getSeconds()); - - console.log(utc2); - console.log(utc1); - - var diffMS = (utc2 - utc1); - - console.log(diffMS); - - var secs = (diffMS / 1000) % 60; - var mins = (diffMS / (1000 * 60)) % 60; - var hrs = (diffMS / (1000 * 60 * 60)) % 24; - - interval = - { - "raw": diffMS, - "seconds": Math.floor(secs), - "minutes": Math.floor(mins), - "hours": Math.floor(hrs) - }; - return interval; - }; - window.spot_timer_tick = function() - { - var spot_cur_time = new Date(); - var diff = datediff(spot_cur_time, spot_end_time); - console.log(diff); - document.getElementById('spot_timer').innerHTML = diff.hours + ':' + diff.minutes.toString().padStart(2, '0'); - - window.setTimeout(spot_timer_tick, 60000); - }; - window.addEventListener("load", function() - { - spot_timer_tick(); - }); - - EOT; - } -} +require_once("mochacommon.inc.php"); System::$BeforeGetTenantNameHandler = function() { @@ -129,10 +42,10 @@ function requiresLogin($path) System::$BeforeLaunchEventHandler = function($path) { /** - * @var MySQLDatabaseOms + * @var \Mocha\Oms\MySQLDatabaseOms */ $oms = mocha_get_oms(); - + if (count($path) >= 1) { if ($path[0] == "suv") @@ -196,64 +109,6 @@ System::$BeforeLaunchEventHandler = function($path) { $oms->setTenant($currentTenant); } - - $currentUser = null; - if (isset($_SESSION["user_token_" . $currentTenant->ID])) - { - // SELECT FROM `Users` WHERE `Token` = $_SESSION["user_token"] - $insts = $oms->getInstancesByAttributes(array - ( - KnownAttributeGuids::Token => $_SESSION["user_token_" . $currentTenant->ID] - )); - - $currentUser = null; - $loginEntry = null; - if (count($insts) == 1) - { - $loginEntry = $insts[0]; - - if ($loginEntry != null) - { - $users = $oms->getRelatedInstances($loginEntry, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::User_Login__has__User)); - if (count($users) == 1) - { - $currentUser = $users[0]; - } - } - - if ($currentUser === null) - { - echo("returned null"); - die(); - } - } - } - - $page = null; - $pathVars = null; - System::ParsePathVariablesIntoPage($page, $pathVars); - - if ($currentUser === null) - { - if (count($path) >= 4) - { - if ($path[0] == "madi" && $path[1] == "authgwy") - { - return true; - } - } - - if ($page != null) - { - if (requiresLogin($page->FileName)) - { - echo($page->FileName); - $_SESSION["login_return"] = $path; - System::RedirectToLoginPage(true); - return false; - } - } - } return true; }; diff --git a/php/mocha/include/mochacommon.inc.php b/php/mocha/include/mochacommon.inc.php new file mode 100644 index 0000000..514b8c2 --- /dev/null +++ b/php/mocha/include/mochacommon.inc.php @@ -0,0 +1,159 @@ +setCurrentUser(mocha_get_current_user()); + return $oms; +} +function mocha_get_current_user() : ?InstanceReference +{ + /** + * @var MySQLDatabaseOms + */ + global $oms; //! WE CANNOT CALL mocha_get_oms() HERE! + + $currentTenant = $oms->getTenant(); + if (isset($_SESSION["user_token_" . $currentTenant->ID])) + { + // SELECT FROM `Users` WHERE `Token` = $_SESSION["user_token"] + $insts = $oms->getInstancesByAttributes(array + ( + KnownAttributeGuids::Token => $_SESSION["user_token_" . $currentTenant->ID] + )); + + $currentUser = null; + $loginEntry = null; + if (count($insts) == 1) + { + $loginEntry = $insts[0]; + + if ($loginEntry != null) + { + $users = $oms->getRelatedInstances($loginEntry, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::User_Login__has__User)); + if (count($users) == 1) + { + $currentUser = $users[0]; + } + } + + if ($currentUser === null) + { + echo("returned null"); + die(); + } + return $currentUser; + } + } + return null; +} +/** + * Initializes the SPOT timer into the specified WebPage. + * + * @return bool true if the spot timer was initialized successfully; false otherwise. + */ +function mocha_init_spot_timer($pg) : bool +{ + if ($pg === null) + return false; + + $literalSpotTimer = $pg->GetControlByID("literalSpotTimer"); + $spotTimerInitializationScript = $pg->GetControlByID("spotTimerInitializationScript"); + if ($literalSpotTimer === null || $spotTimerInitializationScript === null) + return false; + + $spotTimerContent = ""; + $spotTimerScript = ""; + mocha_get_spot_timer_script($spotTimerContent, $spotTimerScript); + + $literalSpotTimer->Content = $spotTimerContent; + $spotTimerInitializationScript->Content = $spotTimerScript; + return true; +} +function mocha_get_spot_timer_script(&$spotTimerContent, &$spotTimerScript) +{ + $spotTimerContent = ""; + $spotTimerScript = ""; + + if (file_exists("/etc/mocha/suvstart")) + { + $suv_start_time = trim(file_get_contents("/etc/mocha/suvstart")); + $suv_start_time_d = new \DateTime($suv_start_time); + $suv_start_time_d->setTimezone(new \DateTimeZone("UTC")); + + // this can be adjusted? + $suv_end_time_d = $suv_start_time_d->add(new \DateInterval("PT10H")); + $suv_end_time_d->setTimezone(new \DateTimeZone("UTC")); + + $suv_end_time = $suv_end_time_d->format('Y-m-d\TH:i:s\Z'); + + $suv_current_time_d = new \DateTime(); + $interval = $suv_end_time_d->diff($suv_current_time_d); + + $spotTimerContent = $interval->h . ":" . $interval->i; + + $spotTimerScript = << + var spot_end_time = new Date('$suv_end_time'); + window.datediff = function(earlierDate, laterDate) + { + var interval = { }; + var a = earlierDate, b = laterDate; + + console.log(earlierDate); + console.log(laterDate); + + const _MS_PER_DAY = 1000 * 60 * 60 * 24; + // Discard the time and time-zone information. + const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds()); + const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate(), b.getHours(), b.getMinutes(), b.getSeconds()); + + console.log(utc2); + console.log(utc1); + + var diffMS = (utc2 - utc1); + + console.log(diffMS); + + var secs = (diffMS / 1000) % 60; + var mins = (diffMS / (1000 * 60)) % 60; + var hrs = (diffMS / (1000 * 60 * 60)) % 24; + + interval = + { + "raw": diffMS, + "seconds": Math.floor(secs), + "minutes": Math.floor(mins), + "hours": Math.floor(hrs) + }; + return interval; + }; + window.spot_timer_tick = function() + { + var spot_cur_time = new Date(); + var diff = datediff(spot_cur_time, spot_end_time); + console.log(diff); + document.getElementById('spot_timer').innerHTML = diff.hours + ':' + diff.minutes.toString().padStart(2, '0'); + + window.setTimeout(spot_timer_tick, 60000); + }; + window.addEventListener("load", function() + { + spot_timer_tick(); + }); + + EOT; + } +} +?> \ No newline at end of file diff --git a/php/mocha/lib/mocha/core/KnownClassGuids.inc.php b/php/mocha/lib/mocha/core/KnownClassGuids.inc.php index 9c095d3..254c7a8 100644 --- a/php/mocha/lib/mocha/core/KnownClassGuids.inc.php +++ b/php/mocha/lib/mocha/core/KnownClassGuids.inc.php @@ -130,6 +130,9 @@ class KnownClassGuids const ButtonLayout = "6f6338db68e04cc7b257d1b97cf3cb92"; const ImageLayout = "4b1bb7c6168e4ce0b4f876dd5069a80b"; + const GetInstancesMethod = "{0a379314-9d0f-432d-ae59-63194ab32dd3}"; + + const GetSpecifiedInstancesMethod = "{7794c7d0-b15d-4b23-aa40-63bb3d1f53ac}"; const ProcessRelatedUpdatesMethod = "2953e69803c54752a1ebcbbfa8f13905"; } ?> \ No newline at end of file diff --git a/php/mocha/lib/mocha/core/KnownInstanceGuids.inc.php b/php/mocha/lib/mocha/core/KnownInstanceGuids.inc.php index e157556..f302383 100644 --- a/php/mocha/lib/mocha/core/KnownInstanceGuids.inc.php +++ b/php/mocha/lib/mocha/core/KnownInstanceGuids.inc.php @@ -39,5 +39,7 @@ class KnownInstanceGuids const Alignment__Near = "35ea407a45e1462fa923a526d12fbc47"; const Alignment__Center = "{63179b92-9a6a-495b-a823-f45e353be9d8}"; const Alignment__Far = "f19d16c799ff48a3b86a7db8f400d869"; + + const WorkSet__RelatedInstance = "{d9634929-0bb4-482a-85cc-9c8f1251556f}"; } ?> \ No newline at end of file diff --git a/php/mocha/lib/mocha/core/KnownRelationshipGuids.inc.php b/php/mocha/lib/mocha/core/KnownRelationshipGuids.inc.php index c5e11c1..0c1ed56 100644 --- a/php/mocha/lib/mocha/core/KnownRelationshipGuids.inc.php +++ b/php/mocha/lib/mocha/core/KnownRelationshipGuids.inc.php @@ -100,7 +100,7 @@ class KnownRelationshipGuids const Get_Referenced_Attribute_Method__has__Attribute = "87f90fe95ec64b098f51b8a4d1544cae"; const Get_Referenced_Attribute_Method__loop_on__Instance_Set = "c7ecd4986d054e07b1bcf7127d0d6666"; - const Get_Specific_Instances_Method__has__Instance = "dea1aa0b2bef4bacb4f90ce8cf7006fc"; + const Get_Specified_Instances_Method__uses__Instance = "dea1aa0b2bef4bacb4f90ce8cf7006fc"; const Evaluate_Boolean_Expression_Method__has_source_attribute__Method = "45d76d5601ed46419f68cfe0c7d0d265"; const Evaluate_Boolean_Expression_Method__equal_to_attribute__Method = "0646df917e3e4d59be71b978a22ced8e"; @@ -237,6 +237,10 @@ class KnownRelationshipGuids const Element_Content__has__Layout = "1ab7412005ea4acab6d3c7e0133e0c4f"; + const Element_Content__built_from__BEM_Process = "{3d7094ff-33e5-4800-9e4e-93dde0d1d331}"; + + const BEM_Process__uses_loop__Executable_returning_Instance_Set = "{0fb2b538-eacb-418a-b7d8-43a584b85952}"; + const Layout__has__Style = "{e684bb26-7e78-4a21-b8b4-5a550f3053d5}"; const Element_Content__has__Element_Content_Display_Option = "f070dfa762604488a779fae291903f2d"; @@ -289,5 +293,7 @@ class KnownRelationshipGuids const Assign_Attribute_Method__uses__Executable_returning_Attribute = "{9313f96e-58af-416f-852e-ef83725057fc}"; const Assign_Attribute_Method__assigns__Attribute = "{74061875-8a27-403b-9456-02e52cfd13b2}"; + const Get_Instances_Method__selects_instances_of__Class = "{c0b85d90-de8c-44c2-9420-c5e724ccdf2c}"; + } ?> \ No newline at end of file diff --git a/php/mocha/lib/mocha/oms/MySQLDatabaseOms.inc.php b/php/mocha/lib/mocha/oms/MySQLDatabaseOms.inc.php index 303fdd4..4c81df3 100644 --- a/php/mocha/lib/mocha/oms/MySQLDatabaseOms.inc.php +++ b/php/mocha/lib/mocha/oms/MySQLDatabaseOms.inc.php @@ -11,6 +11,16 @@ { private \PDO $PDO; + private ?InstanceReference $_currentUser = null; + public function setCurrentUser(?InstanceReference $userInstance) + { + $this->_currentUser = $userInstance; + } + public function getCurrentUser() : ?InstanceReference + { + return $this->_currentUser; + } + /** * Raised when the tenant is changed via setTenant. */ @@ -275,13 +285,13 @@ ); $result = $stmt->execute($parms); - trigger_error($query, \E_USER_NOTICE); - trigger_error("source inst id: " . $sourceInstance->InstanceKey, \E_USER_NOTICE); - trigger_error("relationship inst id: " . $relationshipInstance->InstanceKey, \E_USER_NOTICE); - foreach ($parms as $key => $value) - { - trigger_error($key . ": '" . $value . "'", \E_USER_NOTICE); - } + // trigger_error($query, \E_USER_NOTICE); + // trigger_error("source inst id: " . $sourceInstance->InstanceKey, \E_USER_NOTICE); + // trigger_error("relationship inst id: " . $relationshipInstance->InstanceKey, \E_USER_NOTICE); + // foreach ($parms as $key => $value) + // { + // trigger_error($key . ": '" . $value . "'", \E_USER_NOTICE); + // } if ($result === false) { @@ -333,6 +343,14 @@ } public function setAttributeValueInternal(InstanceReference $sourceInstance, InstanceReference $attributeInstance, mixed $value, ?\DateTime $effectiveDate = null) { + $currentUser = $this->getCurrentUser(); + + $cudbid = null; + if ($currentUser !== null) + { + $cudbid = $currentUser->DatabaseId; + } + $query = "CALL mocha_set_attribute_value(:src_inst_id, :attr_inst_id, :attr_value, :user_inst_id, :eff_date)"; $stmt = $this->PDO->prepare($query); $result = $stmt->execute(array @@ -340,7 +358,7 @@ "src_inst_id" => $this->getDbId($sourceInstance), "attr_inst_id" => $this->getDbId($attributeInstance), "attr_value" => $value, - "user_inst_id" => null, + "user_inst_id" => $cudbid, "eff_date" => $effectiveDate )); } diff --git a/php/mocha/lib/mocha/oms/Oms.inc.php b/php/mocha/lib/mocha/oms/Oms.inc.php index a2a4e13..e53e78d 100644 --- a/php/mocha/lib/mocha/oms/Oms.inc.php +++ b/php/mocha/lib/mocha/oms/Oms.inc.php @@ -20,7 +20,7 @@ { $this->_tenant = null; } - + /** * Gets the instance with the specified global identifier. */ @@ -29,6 +29,19 @@ return null; } + /** + * Indices are 1-based + */ + public function getNthInstanceOf(InstanceReference|string|InstanceKey $sourceInstance, int $index, $defaultValue = null) + { + $insts = $this->getRelatedInstances($sourceInstance, KnownRelationshipGuids::Class__has__Instance); + if (count($insts) > 0) + { + return $insts[$index - 1]; + } + return $defaultValue; + } + public function getRelatedInstances(InstanceReference|string|InstanceKey $sourceInstance, InstanceReference|string|InstanceKey|null $relationshipInstance, \DateTime $effectiveDate = null) : ?array { $tenant = $this->getTenant(); @@ -169,6 +182,19 @@ return null; } + public function printInstanceKeys(array $instanceReferences, string $separator = ":") + { + $ct = count($instanceReferences); + for($i = 0; $i < $ct; $i++) + { + echo($instanceReferences[$i]->InstanceKey); + if ($i < $ct - 1) + { + echo ($separator); + } + } + } + public function instanceSetContains(array /**/ $haystack, InstanceReference $needle) { foreach ($haystack as $v) @@ -181,12 +207,34 @@ return false; } - public function executeMethodReturningInstanceSet(InstanceReference $method, array $parms) + public function getInstancesOf(InstanceReference $classInstance) + { + $instances = $this->getRelatedInstances($classInstance, KnownRelationshipGuids::Class__has__Instance); + return $instances; + } + + public function executeMethodReturningInstanceSet(InstanceReference $method, array $parms) : ?array { $parentClass = $this->getParentClass($method); - echo("parent class of method"); - print_r($parentClass); - die(); + if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::ReturnInstanceSetMethodBinding))) + { + //return $this->executeMethodReturningInstanceSet($methodBindingHasMethod, $parms); + } + else if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::GetSpecifiedInstancesMethod))) + { + $instances = $this->getRelatedInstances($method, KnownRelationshipGuids::Get_Specified_Instances_Method__uses__Instance); + return $instances; + } + else if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::GetInstancesMethod))) + { + $selectsOfClass = $this->getRelatedInstance($method, KnownRelationshipGuids::Get_Instances_Method__selects_instances_of__Class); + return $this->getInstancesOf($selectsOfClass); + } + else + { + echo("zq: executeMethod: unknown parent class '" . $parentClass->GlobalIdentifier . "' [" . $parentClass->InstanceKey . "]"); + die(); + } return null; } @@ -251,6 +299,44 @@ } + public function getRelatedTasks(InstanceReference $inst) + { + $instParent = $this->getParentClass($inst); + + $relatedTasks = []; + + $instInstance = $this->getInstanceByGlobalIdentifier(KnownClassGuids::Instance); + $relatedTasks0 = $this->getRelatedInstances($instInstance, KnownRelationshipGuids::Class__has_related__Task); + foreach ($relatedTasks0 as $task) + { + $relatedTasks[] = $task; + } + + $relatedTasks1 = $this->getRelatedInstances($instParent, KnownRelationshipGuids::Class__has_related__Task); + foreach ($relatedTasks1 as $task) + { + $relatedTasks[] = $task; + } + + $superclasses = $this->getRelatedInstances($instParent, KnownRelationshipGuids::Class__has_super__Class); + foreach ($superclasses as $superclass) + { + $relatedTasks2 = $this->getRelatedInstances($superclass, KnownRelationshipGuids::Class__has_related__Task); + foreach ($relatedTasks2 as $task) + { + $relatedTasks[] = $task; + } + } + return $relatedTasks; + } + + public function getNthRelatedInstance(InstanceReference $inst, InstanceReference|string|InstanceKey|array $rel, int $index) + { + $rel = $this->normalizeInstanceReference($rel); + $relInsts = $this->getRelatedInstances($inst, $rel); + return $relInsts[$index]; + } + public function executeMethod(OmsContext $context, InstanceReference $methodInstance) { $methodInstanceClass = $this->getParentClass($methodInstance); @@ -261,8 +347,15 @@ $classForPRU = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Process_Related_Updates_Method__processes_for__Class); if ($classForPRU !== null) { - echo("current work data for '" . $classForPRU->GlobalIdentifier . "' = '" . $context->getWorkData($classForPRU->GlobalIdentifier->__toString()) . "'"); } + + //!HACK! + $instForPRU = $this->getNthInstanceOf($classForPRU, 1); + if ($instForPRU !== null) + { + //echo("current work data for '" . $instForPRU->GlobalIdentifier . "' = '" . $context->getWorkData($instForPRU->GlobalIdentifier->__toString()) . "'"); + } + $instExecutablesForPUMB = $this->getRelatedInstances($methodInstance, KnownRelationshipGuids::Process_Related_Updates_Method__uses__Executable_for_PUMB); foreach ($instExecutablesForPUMB as $instExecutableForPUMB) { @@ -271,9 +364,18 @@ $assignsAttribute = $this->getRelatedInstance($instExecutableForPUMB, KnownRelationshipGuids::Assign_Attribute_Method__assigns__Attribute); $usesExecutableReturningAttribute = $this->getRelatedInstance($instExecutableForPUMB, KnownRelationshipGuids::Assign_Attribute_Method__uses__Executable_returning_Attribute); - $context->setWorkData($assignsAttribute->GlobalIdentifier->__toString(), $usesExecutableReturningAttribute); - echo ("assigning attribute '" . $assignsAttribute->GlobalIdentifier . "' the value from executable '" . $usesExecutableReturningAttribute->GlobalIdentifier . "'"); - //echo ("the value from work data is '" . $context->getWorkData($usesExecutableReturningAttribute->GlobalIdentifier) . "'"); + //$context->setWorkData($assignsAttribute->GlobalIdentifier->__toString(), $usesExecutableReturningAttribute); + //echo ("assigning attribute '" . $assignsAttribute->GlobalIdentifier . "' the value from executable '" . $usesExecutableReturningAttribute->GlobalIdentifier . "'"); + + $value = $context->getWorkData($usesExecutableReturningAttribute->GlobalIdentifier->__toString()); + if ($value instanceof InstanceReference) + { + //echo ("the value from work data is ##IS#'" . $value->GlobalIdentifier . "'##"); + } + else + { + $this->setAttributeValue($instForPRU, $assignsAttribute, $value); + } } else { diff --git a/php/mocha/lib/mocha/ui/controls/InstanceBrowser.inc.php b/php/mocha/lib/mocha/ui/controls/InstanceBrowser.inc.php index adbe80f..081f71b 100644 --- a/php/mocha/lib/mocha/ui/controls/InstanceBrowser.inc.php +++ b/php/mocha/lib/mocha/ui/controls/InstanceBrowser.inc.php @@ -3,6 +3,8 @@ use Mocha\Core\InstanceKey; use Mocha\Core\InstanceReference; + use Mocha\Core\KnownInstanceGuids; + use Mocha\Core\KnownRelationshipGuids; use Mocha\Oms\MySQLDatabaseOms; use Phast\HTMLControl; @@ -17,6 +19,11 @@ { public $Name; + public bool $Editable; + public bool $MultiSelect; + public bool $DisplayAsCount; + public bool $DisableLink; + public array $SelectedInstances; public array $ValidClasses; @@ -27,6 +34,10 @@ $this->Name = null; $this->TagName = "div"; $this->ClassList[] = "mcx-instancebrowser"; + $this->Editable = false; + $this->MultiSelect = false; + $this->DisplayAsCount = false; + $this->DisableLink = false; $this->ValidClasses = array(); if ($instanceReferences === null) @@ -152,6 +163,21 @@ $adw->Attributes[] = new WebControlAttribute("data-instance-id", $inst->InstanceKey); $adw->ClassList[] = "mcx-moniker"; $adw->ClassTitle = $parentClassName; + + $adw->ShowURL = false; + $instDefaultTask = $oms->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())) + { + $adw->TargetURL = System::ExpandRelativePath("~/d/inst/" . $instParent->InstanceKey . "/" . $inst->InstanceKey . ".htmld"); + $adw->ShowURL = true; + } + } $adw->Text = $oms->getInstanceText($inst); /* @@ -179,7 +205,6 @@ )) ); */ - $adw->TargetURL = System::ExpandRelativePath("~/d/inst/" . $inst->InstanceKey . ".htmld"); $li->Controls[] = $adw; $ul->Controls[] = $li; 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 d068c59..3627d08 100644 --- a/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php +++ b/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php @@ -47,6 +47,8 @@ public bool $IsPostback; public string $SubmitButtonText; + private $__renderingNotEnterable; + public function __construct(OmsContext $context) { $this->Context = $context; @@ -55,6 +57,7 @@ $this->IsPostback = false; $this->StyleClasses = []; $this->SubmitButtonText = "Save Changes"; + $this->__renderingNotEnterable = false; } /** * Thanks https://stackoverflow.com/a/31107425 @@ -154,11 +157,30 @@ private function updateWorkDataWithElementContents() { - echo ("updating work datas from element contents...
"); - echo ("current work data:
"); - print_r($this->Context->workData); - echo ("

"); - echo ("proposed changes:
"); + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + // echo ("updating work datas from element contents...
"); + // echo ("current work data:
"); + // print_r($this->Context->workData); + + foreach ($_POST as $key => $value) + { + if (str_starts_with($key, "ec_")) + { + $ecid = substr($key, 3); + $inst_ec = $oms->getInstanceByKey(InstanceKey::Parse($ecid)); + + $value = $this->Context->getElementParm($inst_ec, $inst_ec->GlobalIdentifier->__toString()); + + $targetInst = $oms->getRelatedInstance($inst_ec, KnownRelationshipGuids::Element_Content__has__Instance); + + //? this feels like a hack... + $this->Context->setWorkData($targetInst->GlobalIdentifier->__toString(), $value); + } + } } @@ -212,7 +234,7 @@ else { $this->updateWorkDataWithElementContents(); - + $pru = $oms->getRelatedInstance($element, KnownRelationshipGuids::Element__processed_by__Process_Related_Updates_Method); if ($pru !== null) { @@ -471,7 +493,7 @@ return $str; } - public function renderElementContent(InstanceReference $elementContent) + public function renderElementContent(InstanceReference $elementContent, InstanceReference $relatedInstanceParm = null) { /** * @var MySQLDatabaseOms @@ -479,6 +501,7 @@ $oms = mocha_get_oms(); $ecInst = $oms->getRelatedInstance($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Instance)); + $relatedInstance = $this->Context->getWorkData(KnownInstanceGuids::WorkSet__RelatedInstance); echo (""); @@ -565,7 +588,26 @@ } else if ($oms->is_a($ecInst, KnownClassGuids::TextAttribute)) { - $value = $oms->getAttributeValue($this->TargetInstance, $ecInst); + // fill in the value from the target instance + $targetInstance = $relatedInstance; + if ($relatedInstanceParm !== null) + { + $targetInstance = $relatedInstanceParm; + } + if ($targetInstance === null) + { + $targetInstance = $this->TargetInstance; + + $firstElementContent = $oms->getNthRelatedInstance($this->__renderingElement, KnownRelationshipGuids::Element__has__Element_Content, 0); + $firstElementContentInst = $oms->getRelatedInstance($firstElementContent, KnownRelationshipGuids::Element_Content__has__Instance); + + $targetInstance = $oms->getNthInstanceOf($firstElementContentInst, 1); + } + if ($targetInstance !== null) + { + $value = $oms->getAttributeValue($targetInstance, $ecInst); + } + if ($value === null) { $value = $oms->getAttributeValue($ecInst, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::Value)); @@ -573,21 +615,27 @@ if ($this->IsPostback && isset($_POST["ec_" . strval($elementContent->InstanceKey)])) { + // fill in the value from the postback $value = $_POST["ec_" . strval($elementContent->InstanceKey)]; } - if (!$oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__NotEnterable))) + if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__NotEnterable)) || $this->__renderingNotEnterable) { - $this->renderTextAttribute($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value); + echo($value); } else { - echo($value); + $this->renderTextAttribute($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value); } } else { - $adw = new InstanceBrowser(array($ecInst)); + $targetInstance = $relatedInstanceParm; + if ($targetInstance === null) + { + $targetInstance = $ecInst; + } + $adw = new InstanceBrowser(array($targetInstance)); $adw->Render(); // echo ("unknown pclass ident " . $oms->getParentClass($ecInst)->GlobalIdentifier . ""); } @@ -603,6 +651,7 @@ * @var MySQLDatabaseOms */ $oms = mocha_get_oms(); + $displayOptions = $oms->getRelatedInstances($ec, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option)); $ecid = $ec->InstanceKey; @@ -695,7 +744,20 @@ $this->renderBeginTag("title"); echo($title); $this->renderEndTag("title"); - echo(""); + + $this->renderTag("link", array + ( + "rel" => "stylesheet", + "type" => "text/css", + "href" => System::ExpandRelativePath("~/themes/" . System::GetConfigurationValue("Application.ThemeName") . "/theme.css", false, true) + )); + $this->renderTag("link", array + ( + "rel" => "stylesheet", + "type" => "text/css", + "href" => System::ExpandRelativePath("~/themes/mocha/theme.css", false, true) + )); + $this->renderTag("script", array("type" => "text/javascript", "src" => System::ExpandRelativePath("~/scripts/phast/System.js.php", false, true))); $this->renderTag("script", array("type" => "text/javascript", "src" => System::ExpandRelativePath("~/scripts/mocha.js.php", false, true))); $this->renderBeginTag("script", array("type" => "text/javascript")); @@ -715,9 +777,12 @@ } $this->renderBeginTag("body", null, $bodyClasses); - $this->renderBeginTag("div", [ ], [ "uwt-page-header" ] ); - - $this->renderEndTag("div"); + $spotTimerContent = ""; $spotTimerScript = ""; + \mocha_get_spot_timer_script($spotTimerContent, $spotTimerScript); + echo(<<

SPOT:

Stop in:

+MSG_EOF); + $this->renderTag("script", [ ], [ ], $spotTimerScript); } public function renderEndPage() { @@ -859,13 +924,21 @@ return $title; } + private InstanceReference $__renderingElement; + public function renderElement(InstanceReference $element, array $displayOptions) { /** * @var MySQLDatabaseOms */ $oms = mocha_get_oms(); + + $this->__renderingElement = $element; + $parentElementContent = $oms->getRelatedInstance($element, KnownRelationshipGuids::Instance__for__Element_Content); + $renderingNotEnterable = $this->__renderingNotEnterable; + $this->__renderingNotEnterable = $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__NotEnterable)); + if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ShowSubelementsVertically))) { echo(""); @@ -886,6 +959,10 @@ { $mcx_classes = [ "mcx-element" ]; } + if (!$this->shouldRenderElementContentLabel($elementContent)) + { + $mcx_classes[] = "mcx-hidden-label"; + } if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Required))) { @@ -895,6 +972,10 @@ { $mcx_classes[] = "mcx-failed-validation"; } + if (!$this->shouldRenderElementContentLabel($elementContent)) + { + $mcx_classes[] = "mcx-hidden-label"; + } // $this->renderBeginTag("tr", [ "data-instance-id" => $ecInst->InstanceKey, "data-ecid" => $elementContent->InstanceKey ], $mcx_classes); $this->renderBeginTag("div", [ "data-instance-id" => $ecInst->InstanceKey, "data-ecid" => $elementContent->InstanceKey ], $mcx_classes); @@ -908,10 +989,6 @@ if ($this->shouldRenderElementContentLabel($elementContent)) { // $this->renderBeginTag("td"); - if (!$oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__DoNotShowLabel))) - { - echo (""); - } // $this->renderEndTag("td"); // $this->renderBeginTag("td"); } @@ -919,6 +996,7 @@ { // $this->renderBeginTag("td", [ "colspan" => "2" ]); } + echo (""); $this->renderBeginTag("div"); $this->renderElementContent($elementContent); @@ -954,7 +1032,26 @@ } $contents = $oms->getRelatedInstances($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content)); - $rowCount = 5; + + $instances = []; + // $bem = $oms->getRelatedInstance($element, KnownRelationshipGuids::Element__returned_by__Build_Element_Method); + //$bemProcess = $oms->getRelatedInstance($bem, KnownRelationshipGuids::Build_Element_Method__has__BEM_Process); + if ($parentElementContent !== null) + { + $bemProcess = $oms->getRelatedInstance($parentElementContent, KnownRelationshipGuids::Element_Content__built_from__BEM_Process); + if ($bemProcess != null) + { + // execute the `Executable returning Instance Set` to get the rows to display (Primary Instances) + $instanceExecutable = $oms->getRelatedInstance($bemProcess, KnownRelationshipGuids::BEM_Process__uses_loop__Executable_returning_Instance_Set); + if ($instanceExecutable !== null) + { + //! FIXME: this array should be put into teh specified `returns Work Set` variable + // ... BUT this works the way it's supposed to , for right now! + $instances = $oms->executeMethodReturningInstanceSet($instanceExecutable, array()); + } + } + } + $rowCount = count($instances); echo(""); // $this->renderBeginTag("table", [ "data-instance-id" => $element->InstanceKey ], [ "uwt-listview", "mcx-element" ]); @@ -1018,13 +1115,14 @@ for ($i = 0; $i < $rowCount; $i++) { + $rowInst = $instances[$i]; $this->renderBeginTag("div", [ ], [ "uwt-listview-item" ]); foreach ($contents as $content) { // $this->renderBeginTag("td"); $this->renderBeginTag("div", [], [ "mcx-elementcontent", "uwt-listview-item-column" ]); - $this->renderElementContent($content); + $this->renderElementContent($content, $rowInst); $this->renderEndTag("div"); // $this->renderEndTag("td"); } @@ -1041,7 +1139,10 @@ $this->renderEndTag("div"); } } + + $this->__renderingNotEnterable = $renderingNotEnterable; } + } ?> \ No newline at end of file diff --git a/php/mocha/scripts/mcx_elementcontent.js b/php/mocha/scripts/mcx_elementcontent.js index 84624c8..950efbc 100644 --- a/php/mocha/scripts/mcx_elementcontent.js +++ b/php/mocha/scripts/mcx_elementcontent.js @@ -97,4 +97,9 @@ window.addEventListener("load", function() console.log(items[i]); items[i].McxNativeObject = new McxElementContent(items[i]); } + var items = document.getElementsByClassName("mcx-element"); + for (var i = 0; i < items.length; i++) + { + items[i].McxNativeObject = new McxElementContent(items[i]); + } }); \ No newline at end of file diff --git a/php/mocha/scripts/mcx_instancekey.js b/php/mocha/scripts/mcx_instancekey.js new file mode 100644 index 0000000..626b6b2 --- /dev/null +++ b/php/mocha/scripts/mcx_instancekey.js @@ -0,0 +1,22 @@ +function InstanceKey() +{ + this.ClassIndex = 0; + this.InstanceIndex = 0; + + this.toString = function() + { + return this.ClassIndex + "$" + this.InstanceIndex; + }; +} + +InstanceKey.parse = function(value) +{ + var split = value.split("$"); + var classIndex = parseInt(split[0]); + var instanceIndex = parseInt(split[1]); + + var ik = new InstanceKey(); + ik.ClassIndex = classIndex; + ik.InstanceIndex = instanceIndex; + return ik; +}; \ No newline at end of file diff --git a/php/mocha/scripts/mcx_messages.js b/php/mocha/scripts/mcx_messages.js new file mode 100644 index 0000000..13ca993 --- /dev/null +++ b/php/mocha/scripts/mcx_messages.js @@ -0,0 +1,15 @@ +var mochaMessages = { + "MXRES.CONTEXTMENUITEM.ViewPrintableVersion": "View Printable Version", + "MXRES.CONTEXTMENUITEM.ExportToSpreadsheet": "Export to Spreadsheet", + "MXRES.MONIKER.CONTEXTMENUITEM.CopyInstanceID": "Copy Instance ID ({0})", + "MXRES.MONIKER.CONTEXTMENUITEM.CopyText": "Copy Text", + "MXRES.MONIKER.CONTEXTMENUITEM.CopyTextAndInstanceID": "Copy Text and Instance ID", + "MXRES.MONIKER.CONTEXTMENUITEM.CopyURL": "Copy URL", + "MXRES.MONIKER.CONTEXTMENUITEM.EditInNewWindow": "Edit in New Window", + "MXRES.MONIKER.CONTEXTMENUITEM.EditInstance": "Edit Instance", + "MXRES.MONIKER.CONTEXTMENUITEM.SearchInstanceID": "Search Instance ID ({0})", + "MXRES.MONIKER.CONTEXTMENUITEM.SearchInstanceIDInMaster": "Search Instance ID ({0}) in Master", + "MXRES.MONIKER.CONTEXTMENUITEM.SearchInstanceIDInNewWindow": "Search Instance ID ({0}) in New Window", + "MXRES.MONIKER.CONTEXTMENUITEM.SeeInNewWindow": "See in New Tab", + "MXRES.MONIKER.CONTEXTMENUITEM.SeeRelatedInstances": "See Related Instances" +}; diff --git a/php/mocha/scripts/mcx_moniker.js b/php/mocha/scripts/mcx_moniker.js index 550de9d..8b6aead 100644 --- a/php/mocha/scripts/mcx_moniker.js +++ b/php/mocha/scripts/mcx_moniker.js @@ -5,6 +5,137 @@ function McxMoniker(parentElement) this.ButtonElement = this.ParentElement.children[1]; this.PopupElement = this.ParentElement.children[2]; + this.ParentElement.addEventListener("contextmenu", function(e) + { + var cm = new ContextMenu(); + cm.Data = this.McxNativeObject; + var ecid = this.NativeObject.ECID; + var iid = this.McxNativeObject.ParentElement.getAttribute("data-instance-id"); + cm.Items = [ + { + "ClassName": "MenuItemCommand", + "Title": mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.SeeInNewWindow"], + "Visible": function() + { + return this.Menu.Data.LabelElement.tagName == "A"; + }, + "Execute": function() + { + var ik = InstanceKey.parse(iid); + var castClassId = "1$" + ik.ClassIndex; + var relativeUrl = System.ExpandRelativePath("~/" + System.TenantName + "/d/inst/" + castClassId + "/" + iid + ".htmld"); + var url = new URL(relativeUrl, document.baseURI).href; + window.open(relativeUrl); + } + }, + { + "ClassName": "MenuItemSeparator", + "Visible": function() + { + return this.Menu.Data.LabelElement.tagName == "A"; + } + }, + { + "ClassName": "MenuItemCommand", + "Title": mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.CopyURL"], + "Visible": true, + "Execute": function() + { + var ik = InstanceKey.parse(iid); + var castClassId = "1$" + ik.ClassIndex; + var relativeUrl = System.ExpandRelativePath("~/" + System.TenantName + "/d/inst/" + castClassId + "/" + iid + ".htmld"); + var url = new URL(relativeUrl, document.baseURI).href; + Clipboard.setText(url); + } + }, + { + "ClassName": "MenuItemCommand", + "Title": mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.CopyText"], + "Visible": true, + "Execute": function() + { + Clipboard.setText(this.Menu.Data.LabelElement.innerText); + } + }, + { + "ClassName": "MenuItemSeparator", + "Visible": true + }, + { + "ClassName": "MenuItemCommand", + "Title": String.format(mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.CopyInstanceID"], iid), + "Visible": true, + "Execute": function() + { + Clipboard.setText(iid); + } + }, + { + "ClassName": "MenuItemCommand", + "Title": mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.CopyTextAndInstanceID"], + "Visible": true, + "Execute": function() + { + Clipboard.setText(this.Menu.Data.LabelElement.innerText); + } + }, + { + "ClassName": "MenuItemSeparator", + "Visible": true + }, + { + "ClassName": "MenuItemCommand", + "Title": mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.EditInstance"], + "Visible": true, + "TargetURL": function() + { + var ik = InstanceKey.parse(iid); + var castClassId = "1$" + ik.ClassIndex; + var relativeUrl = System.ExpandRelativePath("~/" + System.TenantName + "/d/inst/" + castClassId + "/" + iid + ".htmld"); + var url = new URL(relativeUrl, document.baseURI).href; + return url; + } + }, + { + "ClassName": "MenuItemCommand", + "Title": String.format(mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.SearchInstanceID"], iid), + "Visible": true, + "TargetURL": function() + { + return System.ExpandRelativePath("~/" + System.TenantName + "/d/search.htmld?q=" + iid + "&branch=true"); + } + }, + { + "ClassName": "MenuItemSeparator", + "Visible": true + }, + { + "ClassName": "MenuItemCommand", + "Title": mochaMessages["MXRES.CONTEXTMENUITEM.ViewPrintableVersion"], + "Visible": true, + "Execute": function() + { + Window.ShowDialog("The method or operation is not implemented", "Not Implemented"); + } + }, + { + "ClassName": "MenuItemCommand", + "Title": mochaMessages["MXRES.CONTEXTMENUITEM.ExportToSpreadsheet"], + "Visible": true, + "Execute": function() + { + Window.ShowDialog("The method or operation is not implemented", "Not Implemented"); + } + } + ]; + cm.Show(e.clientX, e.clientY, this); + + + e.preventDefault(); + e.stopPropagation(); + return false; + }); + this.ActionsMenuElement = this.PopupElement.children[0].children[1]; this.ClassTitleElement = this.PopupElement.children[1].children[0].children[0].children[0]; this.InstanceTitleElement = this.PopupElement.children[1].children[0].children[0].children[1]; @@ -32,6 +163,7 @@ function McxMoniker(parentElement) var url = System.ExpandRelativePath("~/" + System.TenantName + "/inst/" + this.McxNativeObject.InstanceID + "/rel-tasks.htmld"); var xhr = new XMLHttpRequest(); + xhr.timeout = 5000; xhr.open("GET", url); xhr.thiss = this.McxNativeObject; xhr.onreadystatechange = function(e) @@ -39,73 +171,93 @@ function McxMoniker(parentElement) var xhr = e.target; if (xhr.readyState == 4) { - var json = JSON.parse(xhr.responseText); - console.log(json); - - if (json.instance) + if (xhr.status == 200) { - if (json.instance.label) - { - // xhr.thiss.setClassTitle("Return Attribute Method Binding"); - xhr.thiss.setClassTitle(json.instance.label); - } - if (json.instance.title) - { - // xhr.thiss.setInstanceTitle("Common Text@get Concatenated Date and Time Format (BA)*P*S(public)[ramb]"); - xhr.thiss.setInstanceTitle(json.instance.title); - } - } - if (json.taskGroups) - { - System.ClassList.Remove(xhr.thiss.ActionsMenuElement.parentElement, "uwt-empty"); + var json = JSON.parse(xhr.responseText); + console.log(json); - xhr.thiss.ActionsMenuElement.innerHTML = ""; - for (var i = 0; i < json.taskGroups.length; i++) + if (json.result == "failure" && json.responseCode == 403) { - var tgprimary = json.taskGroups[i].taskGroups[0]; - var label = tgprimary.label; - - var li = document.createElement("li"); - li.className = "uwt-menu-item-command uwt-menu-item-popup uwt-visible"; - - var a = document.createElement("a"); - a.href = "#"; - - var span = document.createElement("span"); - span.className = "uwt-title"; - span.innerText = label; - a.appendChild(span); - - li.appendChild(a); + Alert.show(json.message, json.title, "uwt-color-danger"); + return; + } - var ulMenuChild = document.createElement("ul"); - ulMenuChild.className = "uwt-menu uwt-popup"; - - for (var j = 0; j < tgprimary.taskGroups.length; j++) + if (json.instance) + { + if (json.instance.label) { - var tgsecondary = tgprimary.taskGroups[j].tasks[0]; - var li2 = document.createElement("li"); - li2.className = "uwt-menu-item-command uwt-visible"; - - var a2 = document.createElement("a"); - a2.href = tgsecondary.uri; - - var span2 = document.createElement("span"); - span2.className = "uwt-title"; - span2.innerText = tgsecondary.label; - a2.appendChild(span2); - - li2.appendChild(a2); - ulMenuChild.appendChild(li2); + // xhr.thiss.setClassTitle("Return Attribute Method Binding"); + xhr.thiss.setClassTitle(json.instance.label); + } + if (json.instance.title) + { + // xhr.thiss.setInstanceTitle("Common Text@get Concatenated Date and Time Format (BA)*P*S(public)[ramb]"); + xhr.thiss.setInstanceTitle(json.instance.title); } - - li.appendChild(ulMenuChild); - - xhr.thiss.ActionsMenuElement.appendChild(li); } + if (json.taskGroups) + { + System.ClassList.Remove(xhr.thiss.ActionsMenuElement.parentElement, "uwt-empty"); + + xhr.thiss.ActionsMenuElement.innerHTML = ""; + for (var i = 0; i < json.taskGroups.length; i++) + { + var tgprimary = json.taskGroups[i].taskGroups[0]; + if (tgprimary.taskGroups.length === 0) + continue; + + var label = tgprimary.label; + + var li = document.createElement("li"); + li.className = "uwt-menu-item-command uwt-menu-item-popup uwt-visible"; + + var a = document.createElement("a"); + a.href = "#"; + + var span = document.createElement("span"); + span.className = "uwt-title"; + span.innerText = label; + a.appendChild(span); + + li.appendChild(a); + + var ulMenuChild = document.createElement("ul"); + ulMenuChild.className = "uwt-menu uwt-popup"; + + for (var j = 0; j < tgprimary.taskGroups.length; j++) + { + var tgsecondary = tgprimary.taskGroups[j].tasks[0]; + var li2 = document.createElement("li"); + li2.className = "uwt-menu-item-command uwt-visible"; + + var a2 = document.createElement("a"); + a2.href = tgsecondary.uri; + + var span2 = document.createElement("span"); + span2.className = "uwt-title"; + span2.innerText = tgsecondary.label; + a2.appendChild(span2); + + li2.appendChild(a2); + ulMenuChild.appendChild(li2); + } + + li.appendChild(ulMenuChild); + + xhr.thiss.ActionsMenuElement.appendChild(li); + } + } + + System.ClassList.Remove(xhr.thiss.PopupElement, "uwt-loading"); + } + else if (xhr.status == 403) + { + + } + else if (xhr.status == 0) + { + Alert.show("Please check your connection and try again", "Connection lost", "uwt-color-danger", 5000); } - - System.ClassList.Remove(xhr.thiss.PopupElement, "uwt-loading"); } }; xhr.send(null); diff --git a/php/mocha/themes/avondale/uwt-actionpreviewbutton.less b/php/mocha/themes/avondale/uwt-actionpreviewbutton.less index c2c1abb..4078d87 100644 --- a/php/mocha/themes/avondale/uwt-actionpreviewbutton.less +++ b/php/mocha/themes/avondale/uwt-actionpreviewbutton.less @@ -48,7 +48,7 @@ div.apb-preview } &> div.apb-actions { - background: #eeeeee; + background: #eeeeee; // #ccaaff - we could use this for Sydne; border-right: solid 1px #ccc; &> h2 { @@ -61,15 +61,13 @@ div.apb-preview { &> a { + /* &> span.uwt-title { font-size: 12pt; font-weight: 300; } - } - &:hover > a - { - background-color: #ddd; + */ } &.uwt-menu-item-popup { @@ -88,11 +86,6 @@ div.apb-preview background-color: #fff; border: solid 1px #ccc; box-shadow: 2px 2px 4px #ccc; - &> li > a > span.uwt-title - { - font-size: 12pt; - font-weight: 300; - } } } } diff --git a/php/mocha/themes/avondale/uwt-listview.less b/php/mocha/themes/avondale/uwt-listview.less index 38515b1..dca55c9 100644 --- a/php/mocha/themes/avondale/uwt-listview.less +++ b/php/mocha/themes/avondale/uwt-listview.less @@ -19,10 +19,18 @@ div.uwt-listview > .uwt-content } .uwt-listview { + &:not(.uwt-gridlines) + { + &> thead, &> .uwt-content > .uwt-listview-column-headers + { + border-bottom: solid 2px; + border-bottom-color: @TableGridLineColor; + } + } &> thead, &> .uwt-content > .uwt-listview-column-headers { - border-bottom: solid 2px; - border-bottom-color: @TableGridLineColor; + //border-bottom: solid 2px; + //border-bottom-color: @TableGridLineColor; &> tr { &> th @@ -118,9 +126,32 @@ div.uwt-listview > .uwt-content } &.uwt-gridlines { - &> .uwt-content > .uwt-listview-column-headers > .uwt-listview-column-header, &> .uwt-listview-items > .uwt-listview-item > .uwt-listview-item-column + &> .uwt-content, &> .uwt-content > .uwt-listview-column-headers { - border: solid 1px @TableGridLineColor; + border: 1px solid rgba(0,0,0,0.2); + } + &> .uwt-content > .uwt-listview-column-headers > .uwt-listview-column-header + { + border: 1px solid @TableGridLineColor; + /* + &:not(:first-child) + { + border-left: 1px solid rgba(0,0,0,0.1); + } + &:not(:last-child) + { + border-right: 1px solid rgba(0,0,0,0.1); + } + */ + font-weight: bold; + } + &> .uwt-content > .uwt-listview-items > .uwt-listview-item > .uwt-listview-item-column + { + border: 1px solid rgba(0,0,0,0.05); + } + &> .uwt-content > .uwt-listview-items > .uwt-listview-item + { + border-bottom: none; } } &.uwt-hottracking diff --git a/php/mocha/themes/avondale/uwt-menu.less b/php/mocha/themes/avondale/uwt-menu.less index f6e35c7..f927328 100644 --- a/php/mocha/themes/avondale/uwt-menu.less +++ b/php/mocha/themes/avondale/uwt-menu.less @@ -15,8 +15,13 @@ ul.uwt-menu { &> a { + /* font-size: 12px; font-weight: 600; + */ + font-size: 12pt; + font-weight: 300; + padding: 0.309375rem 0.9375rem; &:not(:hover) > span.uwt-description diff --git a/php/mocha/themes/common/styles/mobile/uwt-window.less b/php/mocha/themes/common/styles/mobile/uwt-window.less new file mode 100644 index 0000000..17bdf62 --- /dev/null +++ b/php/mocha/themes/common/styles/mobile/uwt-window.less @@ -0,0 +1,10 @@ +@media (max-width: 1000px) +{ + div.uwt-window + { + left: 0px !important; + top: 0px !important; + right: 0px !important; + bottom: 0px !important; + } +} \ No newline at end of file diff --git a/php/mocha/themes/common/styles/mobile/uwt.less b/php/mocha/themes/common/styles/mobile/uwt.less new file mode 100644 index 0000000..509cc4c --- /dev/null +++ b/php/mocha/themes/common/styles/mobile/uwt.less @@ -0,0 +1 @@ +@import "uwt-window.less"; diff --git a/php/mocha/themes/common/styles/uwt-actionpreviewbutton.less b/php/mocha/themes/common/styles/uwt-actionpreviewbutton.less index 3913f37..3ff6937 100644 --- a/php/mocha/themes/common/styles/uwt-actionpreviewbutton.less +++ b/php/mocha/themes/common/styles/uwt-actionpreviewbutton.less @@ -23,6 +23,10 @@ div.uwt-actionpreviewbutton content: "..."; font-family: inherit; font-weight: bold; + + display: block; + margin-top: -3px; + height: 0px; } } &:hover, &:focus-within diff --git a/php/mocha/themes/common/styles/uwt-alert.less b/php/mocha/themes/common/styles/uwt-alert.less index 41c106e..5f22471 100644 --- a/php/mocha/themes/common/styles/uwt-alert.less +++ b/php/mocha/themes/common/styles/uwt-alert.less @@ -10,6 +10,7 @@ body > div.uwt-alert-container div.uwt-alert { + margin-bottom: 8px; position: relative; transition: all 1s; right: 0px; diff --git a/php/mocha/themes/common/styles/uwt-listview.less b/php/mocha/themes/common/styles/uwt-listview.less index 008ddd9..2b4b0eb 100644 --- a/php/mocha/themes/common/styles/uwt-listview.less +++ b/php/mocha/themes/common/styles/uwt-listview.less @@ -12,16 +12,14 @@ font-weight: bold; padding-right: 8px; } - &> span.uwt-listview-item-count - { - } - &> span.uwt-listview-item-count-label + &> span.uwt-listview-item-count, &> span.uwt-listview-item-count-label { + color: var(--uwt-color-secondary); } &> .uwt-listview-controlbox { margin-left: auto; - padding: 8px; + padding-right: 8px; } } @@ -31,6 +29,16 @@ { border-collapse: collapse; margin-top: 10px; + &> .uwt-listview-items + { + &> .uwt-listview-item + { + &> .uwt-listview-item-column + { + word-wrap: break-word; + } + } + } } &.uwt-expand { diff --git a/php/mocha/themes/common/styles/uwt-menu.less b/php/mocha/themes/common/styles/uwt-menu.less index eda91ba..3dde943 100644 --- a/php/mocha/themes/common/styles/uwt-menu.less +++ b/php/mocha/themes/common/styles/uwt-menu.less @@ -25,14 +25,14 @@ ul.uwt-menu display: block; &.uwt-title { - font-weight: bold; + //font-weight: bold; } } - &:hover - { - background-color: var(--uwt-dropdown-menu-highlight-background); - color: var(--uwt-dropdown-menu-highlight-foreground); - } + } + &:hover > a + { + background-color: rgba(0, 0, 0, 0.05); // var(--uwt-dropdown-menu-highlight-background); + color: var(--uwt-dropdown-menu-highlight-foreground); } &.uwt-separator { diff --git a/php/mocha/themes/common/styles/uwt-window.less b/php/mocha/themes/common/styles/uwt-window.less index 7cb2907..09df67a 100644 --- a/php/mocha/themes/common/styles/uwt-window.less +++ b/php/mocha/themes/common/styles/uwt-window.less @@ -1,8 +1,18 @@ div.uwt-window { + position: fixed; + &> div.uwt-header { -moz-user-select: none; + &> div.uwt-controlbox + { + float: right; + } + } + &> div.uwt-footer + { + text-align: right; } &.uwt-footer-hidden > div.uwt-footer diff --git a/php/mocha/themes/common/styles/uwt.less b/php/mocha/themes/common/styles/uwt.less index f0505f3..439c309 100644 --- a/php/mocha/themes/common/styles/uwt.less +++ b/php/mocha/themes/common/styles/uwt.less @@ -48,6 +48,8 @@ @import "uwt-window.less"; @import "uwt-wunderbar.less"; +@import "mobile/uwt.less"; + @import "../fonts/awesome/css/all.min.less"; html diff --git a/php/mocha/themes/mocha/mcx-colors.less b/php/mocha/themes/mocha/mcx-colors.less new file mode 100644 index 0000000..1b524ec --- /dev/null +++ b/php/mocha/themes/mocha/mcx-colors.less @@ -0,0 +1,25 @@ +.uwt-button:not(.uwt-toolbar > .uwt-button) +{ + background-color: #9c6516; + border-color: #804b00; + border-radius: 24px; + color: #ffffff; + &:hover + { + background-color: #dea147; + border-color: #9c6516; + } +} +.uwt-toolbar > .uwt-button +{ + &:hover + { + background-color: #efc381; + border-color: #9c6516; + } + &:active, &.uwt-selected + { + background-color: #dea147; + border-color: #9c6516; + } +} \ No newline at end of file diff --git a/php/mocha/themes/mocha/mcx-instancebrowser.less b/php/mocha/themes/mocha/mcx-instancebrowser.less new file mode 100644 index 0000000..c759975 --- /dev/null +++ b/php/mocha/themes/mocha/mcx-instancebrowser.less @@ -0,0 +1,145 @@ +div.mcx-instancebrowser +{ + &> ul + { + list-style-type: none; + margin: 0px; + padding: 0px; + } +} +/* +div.mcx-instancebrowser +{ + display: inline-block; + position: relative; + + &:not(.mcx-display-as-count):not(.mcx-editable).mcx-empty + { + &::after + { + content: "(empty)"; + color: #aaaaaa; + } + } + + &:not(.mcx-editable) > input + { + display: none; + } + &> input + { + &:not(:focus) + { + cursor: default; + } + } + + &.mcx-editable + { + &> input + { + padding-right: 32px; + } + &::before + { + content: "\f0c9"; + position: absolute; + right: 10px; + top: 7px; + pointer-events: none; + + font-family: FontAwesome; + font-size: 16px; + color: #999; + } + &> ul + { + border: solid 1px #ccc; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + margin-top: -1px; + padding: 4px; + } + } + &.mcx-editable:hover::before, &.mcx-active::before + { + color: #00ACAC; + } + + &> ul + { + margin: 0px; + padding: 0px; + + &> li + { + list-style-type: none; + &+ li + { + padding-top: 8px; + } + + &> a.mcx-count-link + { + cursor: pointer; + &::after + { + content: "\f0d7"; + font-family: "FontAwesome"; + padding-left: 4px; + } + } + } + } + &> div.uwt-popup > div.uwt-dropdown-content > ul.uwt-menu + { + width: max-content; + min-width: 100%; + max-width: 400px; + + &> li + { + &> a + { + &> span.uwt-subtitle, &> span.uwt-content + { + display: none; + } + } + } + } + + &:not(.uwt-loading) > div.uwt-popup > div.uwt-spinner + { + display: none; + } + &.uwt-loading > div.uwt-popup > div.uwt-dropdown-content + { + display: none; + } +} + +div.apb-preview.uwt-collapsed +{ + height: 10px; + overflow: hidden; + &> div.apb-actions, &> div.apb-content > div > div.uwt-content + { + visibility: hidden; + } + &> div.apb-content > div > div.apb-title + { + position: absolute; + left: 4px; + top: 0px; + &> h1, h2 + { + display: inline-block; + font-size: 16pt; + font-weight: bold; + margin: 0px; + margin-right: 8px; + } + } +} +*/ \ No newline at end of file diff --git a/php/mocha/themes/common/styles/mochahacks.less b/php/mocha/themes/mocha/uwt.less similarity index 80% rename from php/mocha/themes/common/styles/mochahacks.less rename to php/mocha/themes/mocha/uwt.less index 19f235d..23a246a 100644 --- a/php/mocha/themes/common/styles/mochahacks.less +++ b/php/mocha/themes/mocha/uwt.less @@ -1,3 +1,5 @@ +@import "mcx-colors.less"; +@import "mcx-instancebrowser.less"; html { @@ -80,6 +82,9 @@ div.mocha-ams-spot-popup text-align: center; z-index: 5000; + position: fixed; + top: 0px; + &> h1 { font-weight: 600; @@ -210,28 +215,44 @@ div.mcx-element font-weight: normal; } -.uwt-button:not(.uwt-toolbar > .uwt-button) + + +// these styles override the previous ones earlier defined +div.mcx-element { - background-color: #9c6516 !important; - border-color: #804b00 !important; - border-radius: 24px !important; - color: #ffffff !important; - &:hover + display: block; +} +div.mcx-element > label, div.mcx-elementcontent > label +{ + display: table-cell; + padding: 8px; + padding-right: 32px; +} + +div.mcx-elementcontent +{ + &:not(.uwt-listview-item-column) { - background-color: #dea147 !important; - border-color: #9c6516 !important; + display: table-row; + } + &.uwt-listview-item-column + { + display: table-cell; + } + &.mcx-hidden-label + { + display: block; + &> label + { + display: none; + } } } -.uwt-toolbar > .uwt-button + +div.mcx-moniker > span.apb-text:empty::after { - &:hover - { - background-color: #efc381 !important; - border-color: #9c6516 !important; - } - &:active, &.uwt-selected - { - background-color: #dea147 !important; - border-color: #9c6516 !important; - } + display: inline-block; + font-weight: bold; + content: "\f002"; + font-family: var(--fa-style-family,"Font Awesome 6 Pro"); } \ No newline at end of file diff --git a/php/mocha/themes/pleasanton/uwt-button.less b/php/mocha/themes/pleasanton/uwt-button.less new file mode 100644 index 0000000..d47c1ae --- /dev/null +++ b/php/mocha/themes/pleasanton/uwt-button.less @@ -0,0 +1,33 @@ +.uwt-button +{ + border: 1px solid #ccc; + border-radius: 3px; + font-weight: bold; + + padding: 4px 8px; + + /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#ffffff+0,f1f1f3+100 */ + background: #ffffff; /* Old browsers */ + background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f3 100%); /* FF3.6-15 */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f1f1f3)); /* Chrome4-9,Safari4-5 */ + background: -webkit-linear-gradient(top, #ffffff 0%,#f1f1f3 100%); /* Chrome10-25,Safari5.1-6 */ + background: -o-linear-gradient(top, #ffffff 0%,#f1f1f3 100%); /* Opera 11.10-11.50 */ + background: -ms-linear-gradient(top, #ffffff 0%,#f1f1f3 100%); /* IE10 preview */ + background: linear-gradient(to bottom, #ffffff 0%,#f1f1f3 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f1f1f3',GradientType=0 ); /* IE6-9 */ + + &.uwt-color-success + { + border-color: #719a56; + + /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#9acd70+0,8cc759+49,87c651+51,78bf45+100 */ + background: #9acd70; /* Old browsers */ + background: -moz-linear-gradient(top, #9acd70 0%, #8cc759 49%, #87c651 51%, #78bf45 100%); /* FF3.6-15 */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9acd70), color-stop(49%,#8cc759), color-stop(51%,#87c651), color-stop(100%,#78bf45)); /* Chrome4-9,Safari4-5 */ + background: -webkit-linear-gradient(top, #9acd70 0%,#8cc759 49%,#87c651 51%,#78bf45 100%); /* Chrome10-25,Safari5.1-6 */ + background: -o-linear-gradient(top, #9acd70 0%,#8cc759 49%,#87c651 51%,#78bf45 100%); /* Opera 11.10-11.50 */ + background: -ms-linear-gradient(top, #9acd70 0%,#8cc759 49%,#87c651 51%,#78bf45 100%); /* IE10 preview */ + background: linear-gradient(to bottom, #9acd70 0%,#8cc759 49%,#87c651 51%,#78bf45 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9acd70', endColorstr='#78bf45',GradientType=0 ); /* IE6-9 */ + } +} \ No newline at end of file diff --git a/php/mocha/themes/pleasanton/uwt.less b/php/mocha/themes/pleasanton/uwt.less new file mode 100644 index 0000000..68b7b03 --- /dev/null +++ b/php/mocha/themes/pleasanton/uwt.less @@ -0,0 +1,7 @@ +@import "Fonts/SourceSansPro/SourceSansPro.css"; + +@import "../common/styles/uwt.less"; + +@import "uwt-button.less"; + +@import "../common/styles/mochahacks.less"; diff --git a/php/mocha/ui/masterPages/Blank.phpx b/php/mocha/ui/masterPages/Blank.phpx index 68fb3eb..2b4822c 100644 --- a/php/mocha/ui/masterPages/Blank.phpx +++ b/php/mocha/ui/masterPages/Blank.phpx @@ -4,6 +4,9 @@