diff --git a/common/admin/mocha-libexec/internal/librarymanager/Guid.py b/common/admin/mocha-libexec/internal/librarymanager/Guid.py index 190679c..c506b40 100644 --- a/common/admin/mocha-libexec/internal/librarymanager/Guid.py +++ b/common/admin/mocha-libexec/internal/librarymanager/Guid.py @@ -6,3 +6,10 @@ class Guid: def get_value(self) -> str: return self.value + @staticmethod + def create(): + + from uuid import uuid4 + u = uuid4() + g = Guid(str(u)) + return g diff --git a/common/admin/mocha-libexec/internal/librarymanager/LibraryManager.py b/common/admin/mocha-libexec/internal/librarymanager/LibraryManager.py index 0a2c8a9..c918d29 100644 --- a/common/admin/mocha-libexec/internal/librarymanager/LibraryManager.py +++ b/common/admin/mocha-libexec/internal/librarymanager/LibraryManager.py @@ -26,7 +26,7 @@ class MochaLibraryManager: def commit(self): for (class_gid, inst_gid, classIndex, index) in self._instances: - op = PrepareInstanceOperation(Guid(inst_gid), classIndex, index) + op = PrepareInstanceOperation(Guid(class_gid), Guid(inst_gid), classIndex, index) op.execute(self.db) for op in self._operations: @@ -34,9 +34,23 @@ class MochaLibraryManager: for op in self._relOps: op.execute(self.db) + hasSiblingRelationships = dict() + for op in self._relOps: + if op.relationshipInstanceId.get_value() == "{656110FF-4502-48B8-A7F3-D07F017AEA3F}": + # Relationship.has sibling Relationship + hasSiblingRelationships[op.instanceId.get_value()] = op.targetInstanceId + + for op in self._relOps: + if op.relationshipInstanceId.get_value() in hasSiblingRelationships: + siblingOp = AssignRelationshipOperation(op.targetInstanceId, hasSiblingRelationships[op.relationshipInstanceId.get_value()], op.instanceId) + print ("assigning sibling relationship " + siblingOp.instanceId.get_value() + " . " + siblingOp.relationshipInstanceId.get_value() + " = " + siblingOp.instanceId.get_value() + "\n") + siblingOp.execute(self.db) + cur = self.db.cursor() - cur.execute("SELECT * FROM mocha_instances") - rows = cur.fetchall() + # cur.execute("UPDATE mocha_instances SET user_inst_id = mocha_get_instance_by_global_identifier(mocha_normalize_uuid('{B066A54B-B160-4510-A805-436D3F90C2E6}'))") + cur.execute("UPDATE mocha_attributes SET usr_inst_id = mocha_get_instance_by_global_identifier(mocha_normalize_uuid('{B066A54B-B160-4510-A805-436D3F90C2E6}'))") + cur.execute("UPDATE mocha_relationships SET user_inst_id = mocha_get_instance_by_global_identifier(mocha_normalize_uuid('{B066A54B-B160-4510-A805-436D3F90C2E6}'))") + # rows = cur.fetchall() # print(rows) # print ("ok , applying `Class.has Instance`...") @@ -85,40 +99,7 @@ class MochaLibraryManager: cur = self.db.cursor() cur.execute("CALL mocha_release_tenant()") self.print_error(cur) - - def create_instance(self, instanceGlobalId : Guid, classIndex : int, instanceIndex : int): - #self._operations.append(CreateInstanceOperation(instanceGlobalId, classIndex, instanceIndex)) - # cur = self.db.cursor() - - # strInstanceGlobalId = "NULL" - # if instanceGlobalId != None: - # strInstanceGlobalId = "mocha_normalize_uuid('" + instanceGlobalId + "')" - - # query = "CALL mocha_create_instance(" + strInstanceGlobalId + ", " + str(classIndex) + ", " + str(instanceIndex) + ", NULL, NULL, @q_assigned_inst_id)" - # print(query) - # cur.execute(query) - # self.print_error(cur) - pass - - def create_class(self, instanceGlobalId : Guid, classIndex): - #self._operations.append(CreateClassOperation(instanceGlobalId, classIndex)) - pass - - def create_instance_of(self, classGlobalId : Guid, instanceGlobalId : Guid, classIndex : int, instanceIndex : int): - pass - #self._operations.append(CreateInstanceOperation(instanceGlobalId, classIndex, instanceIndex)) - # cur = self.db.cursor() - - # strInstanceGlobalId = "NULL" - # if instanceGlobalId != None: - # strInstanceGlobalId = "mocha_normalize_uuid('" + instanceGlobalId + "')" - - # query = "CALL mocha_create_instance_of(mocha_get_instance_by_global_identifier('" + classGlobalId + "'), " + strInstanceGlobalId + ", NULL, NULL, @q_assigned_inst_id)" - # print(query) - # cur.execute(query) - # self.print_error(cur) - def assign_relationship(self, instanceId : Guid, relationshipInstanceId : Guid, targetInstanceId : Guid): print("-- assigning relationship " + relationshipInstanceId.get_value() + " = '" + targetInstanceId.get_value() + "'") self._relOps.append(AssignRelationshipOperation(instanceId, relationshipInstanceId, targetInstanceId)) diff --git a/common/admin/mocha-libexec/internal/librarymanager/libraryparser/YAMLLibraryParser.py b/common/admin/mocha-libexec/internal/librarymanager/libraryparser/YAMLLibraryParser.py index 3542924..4b7ec19 100644 --- a/common/admin/mocha-libexec/internal/librarymanager/libraryparser/YAMLLibraryParser.py +++ b/common/admin/mocha-libexec/internal/librarymanager/libraryparser/YAMLLibraryParser.py @@ -69,6 +69,10 @@ class YAMLLibraryParser (LibraryParser): (parentCreatorKey, parentInstanceId) = self.find_custom_tag_name(template) (creatorKey, instanceId) = self.find_custom_tag_name(elem) + self.apply_template(elem, template, instanceId) + + def apply_template(self, elem, template, instanceId): + if "attributes" in template: attrs = template["attributes"] if isinstance(attrs, list): @@ -83,6 +87,12 @@ class YAMLLibraryParser (LibraryParser): if "relationships" in template: rels = template["relationships"] for rel in rels: + if "instance" in rel: + rel_iid = rel["instance"] # the globalId of the relationship instance + else: + print("no relationship instance specified for relationship sugar") + continue + if "customTagName" in rel: customTagName = rel["customTagName"] if customTagName in elem: @@ -96,36 +106,46 @@ class YAMLLibraryParser (LibraryParser): if relinst_key is not None: # for example, 'relinst_key' is 'elementContent' and 'relinst_iid' is '{8ECA14A4...}' - if "instance" in rel: - rel_iid = rel["instance"] # the globalId of the relationship instance - + 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("no relationship instance specified for relationship sugar") + else: + print("HELLO!!! NO RELATIONSHIP SUGAR!!! CREATE THE INSTANCE!!!") else: - # 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) + + 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: - print("no relationship instance specified for relationship sugar") - - - - - - - - + # 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 + self.apply_template(elem, createsInstanceOfTemplate, globalIdentifier) def get_instance_sugar_for_elem(self, elem): @@ -191,7 +211,11 @@ class YAMLLibraryParser (LibraryParser): instanceId = None creatorKey = None if "instance" in elem: - instanceId = Guid(self.manager.expand_entity_references(elem["instance"])) + if "templateOnly" in elem and elem["templateOnly"] == True: + instanceId = None + else: + instanceId = Guid(self.manager.expand_entity_references(elem["instance"])) + creatorKey = 'instance' else: for key in self.yamlIds: @@ -213,7 +237,7 @@ class YAMLLibraryParser (LibraryParser): if instanceId is not None: self.manager.add_instance(classId, instanceId, classIndex, index) - if creatorKey == 'class': + if creatorKey == 'class': #FIXME: remove this special-case behavior print("creating class " + instanceId.get_value()) # assign relationship `Instance.for Class` diff --git a/common/admin/mocha-libexec/internal/librarymanager/operations/PrepareInstanceOperation.py b/common/admin/mocha-libexec/internal/librarymanager/operations/PrepareInstanceOperation.py index c6d0c36..dbcb776 100644 --- a/common/admin/mocha-libexec/internal/librarymanager/operations/PrepareInstanceOperation.py +++ b/common/admin/mocha-libexec/internal/librarymanager/operations/PrepareInstanceOperation.py @@ -5,7 +5,8 @@ from ..SQLFunctionCall import SQLFunctionCall class PrepareInstanceOperation(StoredProcedureOperation): - def __init__(self, globalIdentifier : Guid, classIndex : int, instanceIndex : int): + def __init__(self, classGlobalIdentifier : Guid, globalIdentifier : Guid, classIndex : int, instanceIndex : int): + self.classGlobalIdentifier = classGlobalIdentifier self.globalIdentifier = globalIdentifier self.classIndex = classIndex self.instanceIndex = instanceIndex @@ -20,14 +21,16 @@ class PrepareInstanceOperation(StoredProcedureOperation): if self.globalIdentifier is not None: globalId = self.globalIdentifier + classGlobalId = None + if self.classGlobalIdentifier is not None: + classGlobalId = self.classGlobalIdentifier + strCid = None if self.classIndex is not None: strCid = self.classIndex - else: - strCid = 1 strIid = None if self.instanceIndex is not None: strIid = self.instanceIndex - return [strCid, strIid, globalId, None, None, SQLParameter("p_assigned_inst_id")] + return [strCid, strIid, classGlobalId, globalId, None, None, SQLParameter("p_assigned_inst_id")] diff --git a/common/admin/mocha-libexec/mocha-oms b/common/admin/mocha-libexec/mocha-oms index c9ad947..9ca2bd4 100755 --- a/common/admin/mocha-libexec/mocha-oms +++ b/common/admin/mocha-libexec/mocha-oms @@ -64,6 +64,11 @@ elif [ "$1" == "tenant" ]; then $MOCHA_MYSQL -e "CALL mocha_create_tenant('$3', NULL)" $MOCHA_MYSQL -e "CALL mocha_build_tenant_from_template(mocha_get_tenant_by_name('$3'), 1);" + OLDTENANT=$(mocha oms tenant) + mocha oms tenant select $3 + mocha oms install library /usr/share/mocha/libraries/net.alcetech.Mocha.System/ + mocha oms tenant select $OLDTENANT + elif [ "$2" == "delete" ]; then @@ -99,6 +104,12 @@ elif [ "$1" == "tenant" ]; then rm ~/.config/mocha/tenant echo "current tenant: (none)" + elif [ "$2" == "" ]; then + + if [ -f ~/.config/mocha/tenant ]; then + echo $(cat ~/.config/mocha/tenant) + fi + fi elif [ "$1" == "user" ]; then @@ -275,18 +286,25 @@ elif [ "$1" == "attribute" ]; then elif [ "$2" == "get" ]; then - if [ "$3" == "by-gid" ]; then + if [ "$4" == "for" ]; then - # thanks https://stackoverflow.com/a/911213 - if [ -t 1 ]; then + ATT_ID=$3 + INST_ID=$5 - $MOCHA_MYSQL -e "CALL mocha_select_tenant(mocha_get_tenant_by_name('$CURRENT_TENANT'));" -e "SELECT * FROM mocha_instances WHERE tenant_id = mocha_get_tenant_by_name('$CURRENT_TENANT') AND global_identifier = mocha_normalize_uuid('$4');" -e "CALL mocha_release_tenant();" + $MOCHA_MYSQL -N -s -e "CALL mocha_select_tenant(mocha_get_tenant_by_name('$CURRENT_TENANT'));" -e "CALL mocha_get_attribute_value($INST_ID, $ATT_ID, NULL);" -e "CALL mocha_release_tenant();" + + fi - else + elif [ "$2" == "set" ]; then - $MOCHA_MYSQL -N -e "SELECT id FROM mocha_instances WHERE tenant_id = mocha_get_tenant_by_name('$CURRENT_TENANT') AND global_identifier = mocha_normalize_uuid('$4');" + if [ "$4" == "for" ]; then - fi + ATT_ID=$3 + INST_ID=$5 + ATT_VALUE=$6 + + $MOCHA_MYSQL -e "CALL mocha_select_tenant(mocha_get_tenant_by_name('$CURRENT_TENANT'));" -e "CALL mocha_set_attribute_value($INST_ID, $ATT_ID, '$ATT_VALUE', NULL, NULL);" -e "CALL mocha_release_tenant();" + fi fi diff --git a/common/admin/vagrant/templates/default/default.Vagrantfile b/common/admin/vagrant/templates/default/default.Vagrantfile index 4637bdc..47bda12 100644 --- a/common/admin/vagrant/templates/default/default.Vagrantfile +++ b/common/admin/vagrant/templates/default/default.Vagrantfile @@ -220,9 +220,9 @@ Vagrant.configure("2") do |config| SHELL end - config.trigger.after :up do |trigger| - trigger.info = "Open newly provisioned SUV in firefox" - trigger.run = {inline: "bash -c 'firefox https://@@MOCHA_SUV_HOSTNAME@@/super/d/home.htmld' &"} - end + #config.trigger.after :up do |trigger| + # trigger.info = "Open newly provisioned SUV in firefox" + # trigger.run = {inline: "bash -c 'firefox https://@@MOCHA_SUV_HOSTNAME@@/super/d/home.htmld' &"} + #end end diff --git a/common/images/logo-error.svg b/common/images/logo-error.svg new file mode 100644 index 0000000..b7e7111 --- /dev/null +++ b/common/images/logo-error.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/images/logo.svg b/common/images/logo.svg new file mode 100644 index 0000000..dab81bb --- /dev/null +++ b/common/images/logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/common/libraries/yaml/com.mochapowered.VehiclesForHire/000-EntityDefinitions/000-Module.yaml b/common/libraries/yaml/com.mochapowered.VehiclesForHire/000-EntityDefinitions/000-Module.yaml new file mode 100644 index 0000000..719c969 --- /dev/null +++ b/common/libraries/yaml/com.mochapowered.VehiclesForHire/000-EntityDefinitions/000-Module.yaml @@ -0,0 +1 @@ +- IDI_Module_MochaPowered_VehiclesForHire: '{bb1d56b4-c063-4232-a789-93c8419e2d31}' \ No newline at end of file diff --git a/common/libraries/yaml/com.mochapowered.VehiclesForHire/000-EntityDefinitions/001-Classes.yaml b/common/libraries/yaml/com.mochapowered.VehiclesForHire/000-EntityDefinitions/001-Classes.yaml new file mode 100644 index 0000000..6f55c58 --- /dev/null +++ b/common/libraries/yaml/com.mochapowered.VehiclesForHire/000-EntityDefinitions/001-Classes.yaml @@ -0,0 +1 @@ +- module: '&IDI_Module_MochaPowered_VehiclesForHire;' diff --git a/common/libraries/yaml/com.mochapowered.VehiclesForHire/001-Module.yaml b/common/libraries/yaml/com.mochapowered.VehiclesForHire/001-Module.yaml new file mode 100644 index 0000000..f872704 --- /dev/null +++ b/common/libraries/yaml/com.mochapowered.VehiclesForHire/001-Module.yaml @@ -0,0 +1,2 @@ +- module: '&IDI_Module_MochaPowered_VehiclesForHire;' + defaultObjectSource: '&IDI_ObjectSource_Delivered;' \ No newline at end of file diff --git a/common/libraries/yaml/com.mochapowered.VehiclesForHire/brooke-trevino.yaml b/common/libraries/yaml/com.mochapowered.VehiclesForHire/brooke-trevino.yaml new file mode 100644 index 0000000..aa9f2c4 --- /dev/null +++ b/common/libraries/yaml/com.mochapowered.VehiclesForHire/brooke-trevino.yaml @@ -0,0 +1,2 @@ +- entityDefinitions: + - IDI_Person_BrookeTrevino: '' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/001-Classes.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/001-Classes.yaml index 6da8988..bc81df4 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/001-Classes.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/001-Classes.yaml @@ -18,6 +18,16 @@ - IDC_Element: '{91929595-3dbd-4eae-8add-6120a49797c7}' - IDC_ElementContent: '{f85d4f5e-c69f-4498-9913-7a8554e233a4}' + - IDC_Person: '{d3f2529d-6daf-4789-93da-8be5348d3aec}' + + - IDC_BEMProcess: '{a4c5ffb4-bf37-49f3-9190-dc329d035b46}' + - IDBEM_1: '{8c625250-5c11-44d8-8002-80217e220137}' + + - IDC_Layout: '{e10e5978-0943-4971-89ba-ef9932fb3769}' + - IDC_GroupLayout: '{108605af-c20d-42eb-af4f-35b2ff701921}' + - IDC_ButtonLayout: '{6f6338db-68e0-4cc7-b257-d1b97cf3cb92}' + - IDC_ImageLayout: '{4b1bb7c6-168e-4ce0-b4f8-76dd5069a80b}' + - IDC_Language: '{61102B47-9B2F-4CF3-9840-D168B84CF1E5}' - IDC_Translation: '{04A53CC8-3206-4A97-99C5-464DB8CAA6E6}' - IDC_TranslationValue: '{6D38E757-EC18-43AD-9C35-D15BB446C0E1}' @@ -80,12 +90,21 @@ - IDC_TaskCategory: '{e8d8060f-a20c-442f-8384-03488b63247f}' - IDC_Task: '{D4F2564B-2D11-4A5C-8AA9-AF52D4EACC13}' + - IDC_HardcodedTask: '{df1fe350-7670-47d9-91a0-16dafdfbf98d}' + - IDC_SequenceTask: '{2dfd0c4b-3bc7-4fa3-b369-61441f94e88a}' + - IDC_ConvenienceTask: '{83e67c9e-c36b-4275-a35f-e8f60ac4fc44}' + - IDC_RedirectTask: '{170746fc-3ba8-4eb5-b3d9-23813b259e52}' - IDC_UITask: '{BFD07772-178C-4885-A6CE-C85076C8461C}' + - IDC_SystemTask: '{1db33f14-3010-437c-a37d-594fdb052c52}' + - IDC_ReferencedTask: '{8a02dc7a-b38c-4f44-b05e-21625b08cc2e}' + + - IDC_File: '{5D081079-E136-406A-A728-7472937A6E5E}' # {04284dae-2966-4675-b3da-af3cbed745ea} - IDC_Tenant: '{703F9D65-C584-4D9F-A656-D0E3C247FF1F}' - IDC_User: '{9C6871C1-9A7F-4A3A-900E-69D1D9E24486}' - IDC_UserLogin: '{64F4BCDB-38D0-4373-BA30-8AE99AF1A5F7}' + - IDC_UserPreferences: '{d455a1d5-ae47-4d94-ac55-debe5760d682}' - IDC_MenuItemCommand: '{9D3EDE23-6DB9-4664-9145-ABCBD3A0A2C2}' - IDC_MenuItemSeparator: '{798DECAB-5119-49D7-B0AD-D4BF45807188}' @@ -96,6 +115,9 @@ - IDC_StyleRule: '{C269A1F3-E014-4230-B78D-38EAF6EA8A81}' - IDC_StyleClass: '{a725f089-7763-4887-af37-da52358c378c}' + - IDC_Measurement: '{9FAED5A9-040D-4718-92C0-FBE2385F2A97}' + - IDC_MeasurementUnit: '{62693026-B7A0-40B5-92AE-038A2B264F33}' + - IDC_Page: '{D9626359-48E3-4840-A089-CD8DA6731690}' - IDC_ContainerPageComponent: '{6AD6BD1C-7D1C-4AC9-9642-FEBC61E9D6FF}' - IDC_ButtonPageComponent: '{F480787D-F51E-498A-8972-72128D808AEB}' @@ -130,3 +152,18 @@ - IDC_OMS: '{1ddf9a56-ebb8-4992-ab68-1820acf6bfc8}' - IDC_SystemInstanceSetRoutine: '{d17a6d27-da03-4b5d-9256-f67f978f403d}' + + + - IDI_Tenant_Singleton: '{F2C9D4A9-9EFB-4263-84DB-66A9DA65AD00}' + + - IDC_ElementContentTestClass: "{184f60c5-ec07-4003-b13d-ddb171bb2902}" + - IDI_ElementContentTestClass_1: "{b325b8ad-93f9-4aea-987e-8489dbbffa09}" + + - IDC_InstanceSource: '{8EE7024D-ED87-4D99-BF21-10E09AF5566D}' + + - IDC_ProcessUpdatesMethod: '{91583cc3-6007-40e5-a789-d08c0ff975e6}' + - IDC_ExecuteUpdateMethodBinding: '{b831bdaf-72d8-4585-a9a8-8341ab1005cb}' + - IDC_PUMProcess: '{2cdb2169-7c26-4adb-bc26-e9e75ab1b246}' + - IDC_ProcessRelatedUpdatesMethod: '{6590dd01-6cb9-4440-94b9-d165b9e94a88}' + + - IDC_Search: '{7010f26c-df11-4302-a14f-a45b8da28e83}' \ No newline at end of file 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 4c94d22..9e5ae30 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 @@ -4,10 +4,21 @@ - IDA_Verb: '{61345a5d-3397-4a96-8797-8863f03a476c}' - IDA_Singular: '{F1A06573-C447-4D85-B4E7-54A438C4A960}' - IDA_Value: '{041DD7FD-2D9C-412B-8B9D-D7125C166FE0}' + - IDA_DisplayID: '{5c54acdd-bd00-4003-96d7-37921b885b1c}' + - IDA_ClassName: '{c7e8d78e-cfac-4dac-ae24-2ac67a0ba9d3}' + - IDA_Expression: '{1289868e-add8-4be0-995b-ea3ba5a4bc87}' + - IDA_ContentType: '{34142FCB-172C-490A-AF03-FF8451D00CAF}' # '{c6bd9f95-c39b-4eb4-b0a9-b8cbd9d6b97d}' + - IDA_Encoding: '{a82f3c46-055e-4e12-9c5d-e40447134389}' + - IDA_Comment: '{a70cbe2b-9e17-45d0-a109-e250b5d500f1}' + - IDA_MethodName: '{de275bb8-5281-48ab-9919-6fa2d790549e}' + - IDA_MaximumLength: '{6d69fee2-f220-4aad-ab89-01bfa491dae1}' + - IDA_MinimumValueNumeric: '{bc90ffdf-9b6e-444a-a484-f9d06d7f3c31}' + - IDA_MaximumValueNumeric: '{b9353b1c-2597-4097-96eb-449a6fafcdab}' - IDA_Order: '{49423f66-8837-430d-8cac-7892ebdcb1fe}' - IDA_CSSValue: '{C0DD4A42-F503-4EB3-8034-7C428B1B8803}' - IDA_RelationshipType: '{71106B12-1934-4834-B0F6-D894637BAEED}' - IDA_TargetURL: '{970F79A0-9EFE-4E7D-9286-9908C6F06A67}' + - IDA_Label: '{69cdf8af-fcf2-4477-b75d-71593e7dbb22}' - IDA_UserName: '{960FAF02-5C59-40F7-91A7-20012A99D9ED}' - IDA_Password: '{f3ef81b9-70c1-4830-a5f1-f567bc2e4f66}' - IDA_PasswordHash: '{F377FC29-4DF1-4AFB-9643-4191F37A00A9}' 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 3a3685e..f6f80cb 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 @@ -17,6 +17,7 @@ - IDR_Attribute__for__Class: "{FFC8E435-B9F8-4495-8C85-4DDA67F7E2A8}" - IDR_Class__has_default__Task: "{CF396DAA-75EA-4148-8468-C66A71F2262D}" + - IDR_Task__default_for__Class: "{da4ddf49-1f14-4ba5-a309-e07d8901ce1f}" - IDR_Class__has_owner__User: "{D1A25625-C90F-4A73-A6F2-AFB530687705}" - IDR_User__owner_for__Class: "{04DD2E6B-EA57-4840-8DD5-F0AA943C37BB}" @@ -28,7 +29,9 @@ - IDR_Object_Source__for__Class: "{FBB9391D-C4A2-4326-9F85-7801F377253C}" - IDR_Relationship__has_source__Class: "{7FB5D234-042E-45CB-B11D-AD72F8D45BD3}" + - IDR_Class__source_for__Relationship: "{3de784b9-4561-42f0-946f-b1e90d80029e}" - IDR_Relationship__has_destination__Class: "{F220F1C2-0499-4E87-A32E-BDBF80C1F8A4}" + - IDR_Class__destination_for__Relationship: "{b5f59216-a1f1-4979-8642-a4845e59daa8}" - IDR_Relationship__has_sibling__Relationship: "{656110FF-4502-48B8-A7F3-D07F017AEA3F}" - IDR_Relationship__is_sibling__Relationship: "{FA08B2A4-71E2-44CB-9252-8CE336E2E1AD}" @@ -36,6 +39,9 @@ - IDR_Translation__has__Translation_Value: "{F9B60C00-FF1D-438F-AC74-6EDFA8DD7324}" - IDR_Translation_Value__has__Language: "{3655AEC2-E2C9-4DDE-8D98-0C4D3CE1E569}" + - IDR_Element_Content__built_from__BEM_Process: '{3d7094ff-33e5-4800-9e4e-93dde0d1d331}' + - IDR_BEM_Process__builds__Element_Content: '{9d3220a3-6919-4ebe-97be-49bb9c304c2d}' + - IDR_String__has__String_Component: "{3B6C4C25-B7BC-4242-8ED1-BA6D01B834BA}" - IDR_Extract_Single_Instance_String_Component__has__Relationship: "{5E499753-F50F-4A9E-BF53-DC013820499C}" - IDR_Instance_Attribute_String_Component__has__Attribute: "{E15D4277-69FB-4F19-92DB-8D087F361484}" @@ -55,8 +61,8 @@ - IDR_Task__executes__Method_Call: "{D8C0D4D4-F8C6-4B92-A2C1-8BF16B16203D}" - IDR_Task__has_preview_action_title__Translation: "{3f65ce02-11dd-4829-a46b-b9ea1b43e56a}" - - IDR_Prompt__has__Report_Field: "{922CCB05-61EA-441D-96E0-63D58231D202}" # 3de784b9-4561-42f0-946f-b1e90d80029e - - IDR_Report_Field__for__Prompt: "{5DED3DB4-6864-45A9-A5FF-8E5A35AD6E6F}" # b5f59216-a1f1-4979-8642-a4845e59daa8 + - IDR_Prompt__has__Report_Field: "{922CCB05-61EA-441D-96E0-63D58231D202}" + - IDR_Report_Field__for__Prompt: "{5DED3DB4-6864-45A9-A5FF-8E5A35AD6E6F}" - IDR_Instance_Prompt__has_valid__Class: "{D5BD754B-F401-4FD8-A707-82684E7E25F0}" @@ -230,6 +236,18 @@ - IDR_Element_Content__has__Instance: "{315b71ba-953d-45fc-87e5-4f0a268242a9}" - IDR_Instance__for__Element_Content: "{c3959f84-248d-4ede-a3f2-f262917c7b56}" + - IDR_Element_Content__has__Layout: "{1ab74120-05ea-4aca-b6d3-c7e0133e0c4f}" + - IDR_Layout__for__Element_Content: "{efdce6d8-c6aa-4019-a6e4-fff5db1224aa}" + + - IDR_Layout__has__Style: '{e684bb26-7e78-4a21-b8b4-5a550f3053d5}' + - IDR_Style__for__Layout: '{7588a2f7-823d-4e00-ae37-10547c8d06e4}' + + - IDR_Button_Layout__executes_task_from__Instance_Set: '{04d104fa-a6c4-425e-a6cd-56d847c63e9d}' + - IDR_Instance_Set__has_task_executed_by__Button_Layout: '{c17171be-9d7a-4df9-8903-2b9d5cc26742}' + + - IDR_Measurement__has__Measurement_Unit: '{C9720082-1F40-406D-80B7-81C1B690354D}' + - IDR_Measurement_Unit__for__Measurement: '{3117CB16-6860-48B6-8E21-3655A121E695}' + - IDR_Element_Content__has__Element_Content_Display_Option: "{f070dfa7-6260-4488-a779-fae291903f2d}" - IDR_Element_Content_Display_Option__for__Element_Content: "{12fe7923-b3d2-4152-96c7-a901410b3466}" @@ -261,6 +279,12 @@ - IDR_Style__implements__Style: "{99b1c16a-f2cb-4cc5-a3bb-82a96335aa39}" - IDR_Style__implemented_for__Style: "{271ef816-1e94-4f02-a805-4f9536c28dca}" + - IDR_Style__has_width__Measurement: "{4930ca87-641a-426d-9d67-cda6d5f22303}" + - IDR_Measurement__width_for__Style: "{304981bc-8747-48e0-8b54-fd7ffa2e1e4e}" + + - IDR_Style__has_height__Measurement: "{978e6de0-af73-45a0-bb56-aaf451615b06}" + - IDR_Measurement__height_for__Style: "{ab43f0d4-3099-4f4c-9001-6a1270f6e2fa}" + - IDR_Control_Transaction_Method__processes__Element: "{24bc1dc0-d6cc-44ff-86ba-1360ebd59f3a}" - IDR_Element__processed_by__Control_Transaction_Method: "{0f182291-6784-47b3-a8d3-d2f6ebf3950c}" @@ -272,3 +296,40 @@ - IDR_Get_Instance_Set_By_System_Routine_Method__uses__System_Instance_Set_Routine: "{085bd706-eece-4604-ac04-b7af114d1d21}" - IDR_System_Instance_Set_Routine__used_by__Get_Instance_Set_By_System_Routine_Method: "{6fb6534c-2a46-4d6d-b9df-fd581f19efed}" + + - IDR_Derived_Element_Content__has__Derived_EC_Parameter: "{985189a7-fc9e-4eb6-8db2-7362fb60b5d1}" + - IDR_Derived_EC_Parameter__for__Derived_Element_Content: "{2687dd17-3891-4835-8cd7-7b488c51c4bc}" + + - IDR_Derived_EC_Parameter__assigns__Work_Data: "{540b7a0a-6dff-4601-a796-c451963e912a}" + - IDR_Work_Data__assigned_by__Derived_EC_Parameter: "{e7ce127d-6b17-4795-abf4-cbcf29a0bf68}" + + - IDR_Derived_Element_Content__update_with__Executable_returning_Work_Data: "{4151911a-485c-4488-8e19-1560f489d411}" + - IDR_Executable_returning_Work_Data__used_by__Derived_Element_Content: "{75fdacf8-163c-45ac-86eb-80677ff738ad}" + + - IDR_System_Account__has__User_Preferences: "{ada4deb2-adfd-409f-b13a-9856fabd5522}" + - IDR_User_Preferences__for__System_Account: "{ab2372a5-a4c7-488a-89f6-67e5834f8c83}" + + - IDR_Instance__has__Instance_Source: '{B62F9B81-799B-4ABE-A4AF-29B45347DE54}' + - IDR_Instance_Source__for__Instance: '{FBB9391D-C4A2-4326-9F85-7801F377253C}' + + - IDR_Element__processed_by__Process_Related_Updates_Method: '{ed9c836a-04a4-4505-8953-3c567e841c66}' + - IDR_Process_Related_Updates_Method__processes__Element: '{bb281665-7000-4144-994e-ffb40f6b4d2d}' + + - IDR_PUM_Process__invokes__Execute_Update_Method_Binding: '{d3e83c17-fd38-46a0-a055-66281eabe9b0}' + - IDR_Execute_Update_Method_Binding__invoked_by__PUM_Process: '{8f22f056-12c7-4fa2-93fb-b07821bd3946}' + + - IDR_PUM_Process__invokes__Process_Related_Updates_Method: '{ec39cc23-661a-4677-86e7-21cbf309af1a}' + - IDR_Process_Related_Updates_Method__invoked_by__PUM_Process: '{5d7d09f8-399e-4b49-a63b-2834a1f49f69}' + + - IDR_Process_Updates_Method__has__PUM_Process: '{0ffaf08e-dbb5-49d0-8de9-d253ce6cbe7c}' + - IDR_PUM_Process__for__Process_Updates_Method: '{12c9b11b-c56b-4ca4-aaa0-2c3d4474e6a3}' + + - IDR_System_Account__has__User_Preferences: '{327f1242-6a51-470b-8115-d05ec285a1fa}' + - IDR_User_Preferences__for__System_Account: '{da20aab7-155e-4e06-8377-ef58b14f9979}' + + - IDR_User_Preferences__has_favorite__Instance: '{a3de0c1c-31f5-4871-a135-98fd87595932}' + - IDR_Instance__favorite_for__User_Preferences: '{3dab8340-0cb9-450d-85ce-c6db5aedbdd5}' + + - IDR_User_Preferences__has_recent__Search: '{2166fcf2-fc8d-4190-95ff-e7c8eaa31321}' + - IDR_Search__recent_for__User_Preferences: '{3f7506c0-0cc0-4612-91b6-94558c91f14b}' + \ 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 9e6938a..9ae5e0b 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,3 +1,6 @@ - entityDefinitions: - - IDC_SequenceTask: "{74c26737-000e-4bda-a1af-ad6d59bcc4b2}" - - IDC_ConvenienceTask: "{8a9fb632-6d04-49ff-8271-1f41dce1f254}" \ No newline at end of file + - 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 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 26239a7..2ce3166 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 @@ -2,3 +2,5 @@ - IDE_LoginPage: '{9E272BC3-0358-4EB7-8B3B-581964A59634}' - 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 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/011-Layouts.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/011-Layouts.yaml new file mode 100644 index 0000000..fb0bfce --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/011-Layouts.yaml @@ -0,0 +1,2 @@ +- entityDefinitions: + - IDI_ButtonLayout_DefaultButtonGroup: '{af72c9a1-7f71-4cc7-af83-fa32b641b293}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/012-ObjectSources.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/012-ObjectSources.yaml new file mode 100644 index 0000000..333fc79 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/012-ObjectSources.yaml @@ -0,0 +1,4 @@ +- entityDefinitions: + - IDI_InstanceSource_System: '{9547EB35-07FB-4B64-B82C-6DA1989B9165}' + - IDI_InstanceSource_Delivered: '{062B57B5-D728-4DF8-903A-AD79D843B5CA}' + - IDI_InstanceSource_Custom: '{63D91CCD-D196-4C3A-8609-6DF371E2406F}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml new file mode 100644 index 0000000..db875c1 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/013-WorkSets.yaml @@ -0,0 +1,2 @@ +- entityDefinitions: + - IDI_WorkSet_ClassForEditClassTask: '{b56ac9b9-efce-4a40-8c04-ffdf90174285}' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/014-Files.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/014-Files.yaml new file mode 100644 index 0000000..5ea250c --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/014-Files.yaml @@ -0,0 +1,2 @@ +- entityDefinitions: + - IDI_File_SignonLogo: '{c4f31b1a-aede-4e91-9fa0-511537f098a5}' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/015-MeasurementUnits.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/015-MeasurementUnits.yaml new file mode 100644 index 0000000..4cdf3d8 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/000-EntityDefinitions/015-MeasurementUnits.yaml @@ -0,0 +1,11 @@ +- entityDefinitions: + - IDI_MeasurementUnit_Centimeter: '{BBBB1E24-8C0F-48B5-8529-7BB522415D35}' + - IDI_MeasurementUnit_Em: '{D55BF6E0-D6DB-43CA-909E-C66E25328F4E}' + - IDI_MeasurementUnit_Ex: '{912A40FE-778C-4004-9685-1F2BF8618026}' + - IDI_MeasurementUnit_Inch: '{6D670E0D-536C-46DF-801A-2DFFA086350F}' + - IDI_MeasurementUnit_Millimeter: '{180B1276-BD0D-43A6-BD3D-8A0D4043FFCE}' + - IDI_MeasurementUnit_Percentage: '{5DF5DE6A-819F-4880-9F48-098CB7F67FA2}' + - IDI_MeasurementUnit_Pica: '{D0A462FC-683C-4C14-945F-F8F0B02C472F}' + - IDI_MeasurementUnit_Pixel: '{A945C259-06AC-428C-BE8B-7B54B1911A2A}' + - IDI_MeasurementUnit_Point: '{33027987-0466-439A-B53B-1950FD65EA03}' + - IDI_MeasurementUnit_Twip: '{70e2638a-3521-41eb-8c26-2828c0343812}' \ No newline at end of file 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 e01a08f..3721bff 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 @@ -1,7 +1,6 @@ --- #definitions for YAML - instance: '&IDC_Class;' - name: Class - index: 1 + templateOnly: yes customTagName: 'class' attributes: - instance: '&IDA_Name;' @@ -9,9 +8,15 @@ relationships: - instance: '&IDR_Class__has_super__Class;' customTagName: 'inherits' + - instance: '&IDR_Class__has_default__Task;' + customTagName: 'defaultTask' translations: - relationship: '&IDR_Class__has_title__Translation;' values: - language: '&IDI_Language_English;' - value: 'Class' +- class: '&IDC_Class;' + name: Class + index: 1 + defaultTask: '&IDI_Task_ViewClass;' \ No newline at end of file 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 ca0dc06..2f52b32 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 @@ -186,6 +186,55 @@ # siblingRelationshipId: '&IDR_Method__implements__Method;' # singular: no +- relationship: '&IDR_Class__has_default__Task;' + index: 87 + sourceClassId: '&IDC_Class;' + type: 'has default' + destinationClassId: '&IDC_Task;' + siblingRelationshipId: '&IDR_Task__default_for__Class;' + singular: yes + +- relationship: '&IDR_Task__default_for__Class;' + index: 88 + sourceClassId: '&IDC_Task;' + type: 'default for' + destinationClassId: '&IDC_Class;' + siblingRelationshipId: '&IDR_Class__has_default__Task;' + singular: no + + +- relationship: '&IDR_Relationship__has_source__Class;' + index: 157 + sourceClassId: '&IDC_Relationship;' + type: 'has source' + destinationClassId: '&IDC_Class;' + siblingRelationshipId: '&IDR_Class__source_for__Relationship;' + singular: yes + +- relationship: '&IDR_Class__source_for__Relationship;' + index: 158 + sourceClassId: '&IDC_Class;' + type: 'source for' + destinationClassId: '&IDC_Relationship;' + siblingRelationshipId: '&IDR_Relationship__has_source__Class;' + singular: no + +- relationship: '&IDR_Relationship__has_destination__Class;' + index: 159 + sourceClassId: '&IDC_Relationship;' + type: 'has destination' + destinationClassId: '&IDC_Class;' + siblingRelationshipId: '&IDR_Class__destination_for__Relationship;' + singular: yes + +- relationship: '&IDR_Class__destination_for__Relationship;' + index: 160 + sourceClassId: '&IDC_Class;' + type: 'destination for' + destinationClassId: '&IDC_Relationship;' + siblingRelationshipId: '&IDR_Relationship__has_destination__Class;' + singular: no + - relationship: '&IDR_Class__has__Instance;' index: 249 sourceClassId: '&IDC_Class;' 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 be99893..420b1df 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 @@ -10,6 +10,8 @@ customTagName: 'name' - instance: '&IDA_Value;' customTagName: 'value' + - instance: '&IDA_MaximumLength;' + customTagName: 'maximumLength' # YAML definition for Instances of Boolean Attribute, 1$5 @@ -19,24 +21,36 @@ - textAttribute: '&IDA_Value;' name: Value index: 2 -# - textAttribute: '&IDA_DisplayID;' -# name: Display ID -# index: 3 -# - textAttribute: '&IDA_ClassName;' -# name: Class Name -# index: 4 -# - textAttribute: '&IDA_Expression;' -# name: Expression -# index: 5 -# - textAttribute: '&IDA_Comment;' -# name: Comment -# index: 6 +- textAttribute: '&IDA_DisplayID;' + name: Display ID + index: 3 +- textAttribute: '&IDA_ClassName;' + name: Class Name + index: 4 +- textAttribute: '&IDA_Expression;' + name: Expression + index: 5 +- textAttribute: '&IDA_Comment;' + name: Comment + index: 6 - textAttribute: '&IDA_RelationshipType;' name: 'Relationship Type' index: 8 +- textAttribute: '&IDA_MethodName;' + name: 'Method Name' + index: 9 - textAttribute: '&IDA_UserName;' name: 'UserName' index: 11 +- textAttribute: '&IDA_ContentType;' + name: 'Content Type' + index: 16 +- textAttribute: '&IDA_Encoding;' + name: 'Content Encoding' + index: 18 +- textAttribute: '&IDA_Label;' + name: 'Label' + index: 22 - textAttribute: '&IDA_Token;' name: 'Token' index: 33 @@ -50,16 +64,9 @@ - language: '&IDI_Language_English;' - value: 'User Name or Password Incorrect Message' -- textAttribute: '&IDA_LoginPageInstructions;' - name: 'Login Page Instructions' - index: 1034 - value: 'Please enter your user name and password to log in to this system.' - translations: - - relationship: '&IDR_Translatable__has__Translation;' - values: - - language: '&IDI_Language_English;' - - value: 'Login Page Instructions' - +- textAttribute: '&IDA_IPAddress;' + index: 51 + - textAttribute: '&IDA_Verb;' name: Verb index: 35 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 3612091..de517eb 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 @@ -6,14 +6,34 @@ attributes: - instance: '&IDA_Name;' customTagName: 'name' + - instance: '&IDA_Label;' + customTagName: 'label' relationships: - instance: '&IDR_Element__has__Element_Content;' customTagName: 'elementContents' + - instance: '&IDR_Element__processed_by__Process_Related_Updates_Method;' + customTagName: 'processedByPRUMethod' instances: - instance: '&IDI_Element_AddMetadataInstance;' name: add metadata instance index: 1 +- relationship: '&IDR_Element__processed_by__Process_Related_Updates_Method;' + index: 98 + sourceClassId: '&IDC_Element;' + type: 'processed by' + destinationClassId: '&IDC_ProcessRelatedUpdatesMethod;' + siblingRelationshipId: '&IDR_Element_Content__for__Element;' + singular: no + +- relationship: '&IDR_Process_Related_Updates_Method__processes__Element;' + index: 99 + sourceClassId: '&IDC_ProcessRelatedUpdatesMethod;' + type: 'processes' + destinationClassId: '&IDC_Element;' + siblingRelationshipId: '&IDR_Element__processed_by__Process_Related_Updates_Method;' + singular: no + - relationship: '&IDR_Element__has__Element_Content;' index: 101 sourceClassId: '&IDC_Element;' @@ -29,19 +49,4 @@ destinationClassId: '&IDC_Element;' siblingRelationshipId: '&IDR_Element__has__Element_Content;' singular: no - -- relationship: '&IDR_Element_Content__has__Instance;' - index: 103 - sourceClassId: '&IDC_ElementContent;' - type: 'has' - destinationClassId: '&IDC_Instance;' - siblingRelationshipId: '&IDR_Instance__for__Element_Content;' - singular: no - -- relationship: '&IDR_Instance__for__Element_Content;' - index: 104 - sourceClassId: '&IDC_Instance;' - type: 'for' - destinationClassId: '&IDC_ElementContent;' - siblingRelationshipId: '&IDR_Element_Content__has__Instance;' - singular: no \ No newline at end of file + \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00011-ProcessUpdatesMethod.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00011-ProcessUpdatesMethod.yaml new file mode 100644 index 0000000..e674f53 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00011-ProcessUpdatesMethod.yaml @@ -0,0 +1,12 @@ +--- +- class: '&IDC_ProcessUpdatesMethod;' + name: PU - Process Updates Method + index: 11 + abstract: no + inherits: '&IDC_Method;' + customTagName: 'processUpdatesMethod' + translations: + - relationship: '&IDR_Class__has_title__Translation;' + values: + - languageInstanceId: '&IDI_Language_English;' + value: 'PU - Process Updates Method' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00015-WorkSet.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00015-WorkSet.yaml new file mode 100644 index 0000000..6b7d1f8 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00015-WorkSet.yaml @@ -0,0 +1,27 @@ +--- +- class: '&IDC_WorkSet;' + name: Work Set + index: 15 + customTagName: workSet + attributes: + - instance: '&IDA_Name;' + customTagName: 'name' + relationships: + - instance: '&IDR_Work_Set__has_valid__Class;' + customTagName: 'validClasses' + +- relationship: '&IDR_Work_Set__has_valid__Class;' + index: 9 + sourceClassId: '&IDC_WorkSet;' + type: 'has valid' + destinationClassId: '&IDC_Class;' + siblingRelationshipId: '&IDR_Class__valid_for__Work_Set;' + singular: no + +- relationship: '&IDR_Class__valid_for__Work_Set;' + index: 10 + sourceClassId: '&IDC_Class;' + type: 'valid for' + destinationClassId: '&IDC_WorkSet;' + siblingRelationshipId: '&IDR_Work_Set__has_valid__Class;' + singular: no 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 new file mode 100644 index 0000000..d866544 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00016-BEMProcess.yaml @@ -0,0 +1,30 @@ +--- +- class: '&IDC_BEMProcess;' + name: BEM Process + index: 16 + translations: + - relationship: '&IDR_Class__has_title__Translation;' + values: + - languageInstanceId: '&IDI_Language_English;' + value: 'BEM Process' + + instances: + - instance: '&IDBEM_1;' + + +- relationship: '&IDR_Element_Content__built_from__BEM_Process;' + index: 105 + sourceClassId: '&IDC_ElementContent;' + type: 'built from' + destinationClassId: '&IDC_BEMProcess;' + siblingRelationshipId: '&IDR_BEM_Process__builds__Element_Content;' + singular: yes + +- relationship: '&IDR_BEM_Process__builds__Element_Content;' + index: 106 + sourceClassId: '&IDC_BEMProcess;' + type: 'builds' + destinationClassId: '&IDC_ElementContent;' + siblingRelationshipId: '&IDR_Element_Content__built_from__BEM_Process;' + singular: no + \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00020-NumericAttribute.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00020-NumericAttribute.yaml new file mode 100644 index 0000000..e43fb62 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00020-NumericAttribute.yaml @@ -0,0 +1,26 @@ +--- +# YAML definition for Numeric Attribute +- class: '&IDC_NumericAttribute;' + inherits: '&IDC_Attribute;' + name: Numeric Attribute + index: 20 + customTagName: 'numericAttribute' + attributes: + - instance: '&IDA_Name;' + customTagName: 'name' + - instance: '&IDA_Value;' + customTagName: 'value' + - instance: '&IDA_MaximumValueNumeric;' + customTagName: 'maximumValue' + - instance: '&IDA_MinimumValueNumeric;' + customTagName: 'minimumValue' + +- numericAttribute: '&IDA_MaximumLength;' + name: 'Maximum Length' + index: 4 + +- numericAttribute: '&IDA_MaximumValueNumeric;' + name: 'Maximum Value' + +- numericAttribute: '&IDA_MinimumValueNumeric;' + name: 'Minimum Value' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00033-Person.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00033-Person.yaml new file mode 100644 index 0000000..04314dd --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00033-Person.yaml @@ -0,0 +1,11 @@ +--- +- class: '&IDC_Person;' + name: Person + index: 33 + relationships: + - instance: '&IDR_Person__has__Person_Name;' + customTagName: 'names' + instances: + - instance: '&IDI_Element_AddMetadataInstance;' + name: add metadata instance + index: 1 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml index 690b540..888132d 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00039-SystemUser.yaml @@ -9,15 +9,19 @@ customTagName: 'passwordHash' - instance: '&IDA_PasswordSalt;' customTagName: 'passwordSalt' + relationships: + - instance: '&IDR_System_Account__has__User_Preferences;' + customTagName: 'hasUserPreferences' - class: '&IDC_UserLogin;' - name: User Login - index: 46 + name: System Account Signon + index: 4328 +# System Account Signon.for System User (3$12257) - relationship: '&IDR_User_Login__has__User;' - index: 87 + index: 12257 sourceClassId: '&IDC_UserLogin;' - type: 'has' + type: 'for' destinationClassId: '&IDC_User;' # siblingRelationshipId: '&IDR_User__for__User_Login;' singular: no diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00041-Layout.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00041-Layout.yaml new file mode 100644 index 0000000..04df810 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00041-Layout.yaml @@ -0,0 +1,4 @@ +- class: '&IDC_Layout;' + name: Layout + index: 41 + abstract: yes diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00042-WorkData.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00042-WorkData.yaml new file mode 100644 index 0000000..6c8e179 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00042-WorkData.yaml @@ -0,0 +1,5 @@ +--- +- class: '&IDC_WorkData;' + name: Work Data + index: 42 + abstract: yes diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00047-ElementContentTestClass.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00047-ElementContentTestClass.yaml new file mode 100644 index 0000000..0b76550 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00047-ElementContentTestClass.yaml @@ -0,0 +1,7 @@ +- class: '&IDC_ElementContentTestClass;' + index: 47 + description: the Element Content test class is the target to be abused by EC attribute submit update tests + customTagName: elementContentTestClass + +- elementContentTestClass: '&IDI_ElementContentTestClass_1;' + index: 1 \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00054-ProcessRelatedUpdatesMethod.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00054-ProcessRelatedUpdatesMethod.yaml new file mode 100644 index 0000000..7c3e589 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00054-ProcessRelatedUpdatesMethod.yaml @@ -0,0 +1,15 @@ +--- +- class: '&IDC_ProcessRelatedUpdatesMethod;' + name: PRU - Process Related Updates Method + index: 54 + abstract: no + inherits: '&IDC_Method;' + customTagName: 'processRelatedUpdatesMethod' + attributes: + - instance: '&IDA_Name;' + customTagName: 'name' + translations: + - relationship: '&IDR_Class__has_title__Translation;' + values: + - languageInstanceId: '&IDI_Language_English;' + value: 'PRU - Process Related Updates Method' 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 c69946c..b204e6e 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 @@ -1,16 +1,56 @@ --- +- relationship: '&IDR_Element_Content__has__Instance;' + index: 103 + sourceClassId: '&IDC_ElementContent;' + type: 'has' + destinationClassId: '&IDC_Instance;' + siblingRelationshipId: '&IDR_Instance__for__Element_Content;' + singular: no + +- relationship: '&IDR_Instance__for__Element_Content;' + index: 104 + sourceClassId: '&IDC_Instance;' + type: 'for' + destinationClassId: '&IDC_ElementContent;' + siblingRelationshipId: '&IDR_Element_Content__has__Instance;' + singular: no + + +- relationship: '&IDR_Element_Content__has__Layout;' + index: 105 + sourceClassId: '&IDC_ElementContent;' + type: 'has' + destinationClassId: '&IDC_Layout;' + siblingRelationshipId: '&IDR_Layout__for__Element_Content;' + singular: no + +- relationship: '&IDR_Layout__for__Element_Content;' + index: 106 + sourceClassId: '&IDC_Layout;' + type: 'for' + destinationClassId: '&IDC_ElementContent;' + siblingRelationshipId: '&IDR_Element_Content__has__Layout;' + singular: no + - class: '&IDC_ElementContent;' name: Element Content index: 56 customTagName: 'elementContent' + defaultTask: '&IDI_Task_ViewElementContent;' attributes: - instance: '&IDA_Order;' customTagName: 'order' + - instance: '&IDA_Label;' + customTagName: 'label' relationships: - instance: '&IDR_Element_Content__has__Instance;' customTagName: 'defaultDataType' - instance: '&IDR_Element_Content__has__Element_Content_Display_Option;' customTagName: 'displayOptions' + - instance: '&IDR_Element_Content__has__Layout;' + customTagName: 'layout' + - instance: '&IDR_Element_Content__built_from__BEM_Process;' + customTagName: 'builtFromBEMProcess' instances: - instance: '&IDI_Element_AddMetadataInstance;' name: add metadata instance diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00083-ExecuteUpdateMethodBinding.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00083-ExecuteUpdateMethodBinding.yaml new file mode 100644 index 0000000..b209670 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00083-ExecuteUpdateMethodBinding.yaml @@ -0,0 +1,5 @@ +--- +- class: '&IDC_ExecuteUpdateMethodBinding;' + index: 83 + name: Execute Update Method Binding + inherits: '&IDC_MethodBinding;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00109-InstanceSource.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00109-InstanceSource.yaml new file mode 100644 index 0000000..6bfc253 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00109-InstanceSource.yaml @@ -0,0 +1,30 @@ +--- +- class: '&IDC_InstanceSource;' + name: Instance Source + index: 109 + attributes: + - instance: '&IDA_Name;' + customTagName: 'name' + instances: + - instance: '&IDI_InstanceSource_System;' + name: 'System' + - instance: '&IDI_InstanceSource_Delivered;' + name: 'Delivered' + - instance: '&IDI_InstanceSource_Custom;' + name: 'Custom' + +- relationship: '&IDR_Instance__has__Instance_Source;' + index: 209 + sourceClassId: '&IDC_Instance;' + type: 'has' + destinationClassId: '&IDC_InstanceSource;' + siblingRelationshipId: '&IDR_Instance_Source__for__Instance;' + singular: yes + +- relationship: '&IDR_Instance_Source__for__Instance;' + index: 210 + sourceClassId: '&IDC_InstanceSource;' + type: 'for' + destinationClassId: '&IDC_Instance;' + siblingRelationshipId: '&IDR_Instance__has__Instance_Source;' + singular: no \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00361-Tenant.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00361-Tenant.yaml index 7a0222f..701c9c8 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00361-Tenant.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00361-Tenant.yaml @@ -5,6 +5,6 @@ sealed: yes customTagName: 'tenant' -- tenant: '&IDI_Language_English;' +- tenant: '&IDI_Tenant_Singleton;' index: 1 \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00371-PUMProcess.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00371-PUMProcess.yaml new file mode 100644 index 0000000..b94e2e1 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00371-PUMProcess.yaml @@ -0,0 +1,56 @@ +- class: '&IDC_PUMProcess;' + name: PUM Process + index: 371 + abstract: no + customTagName: pumProcess + relationships: + - instance: '&IDR_PUM_Process__invokes__Execute_Update_Method_Binding;' + customTagName: invokesExecutesUpdateMethodBindings + +- relationship: '&IDR_PUM_Process__invokes__Execute_Update_Method_Binding;' + index: 859 + sourceClassId: '&IDC_PUMProcess;' + type: 'invokes' + destinationClassId: '&IDC_ExecuteUpdateMethodBinding;' + siblingRelationshipId: '&IDR_Execute_Update_Method_Binding__invoked_by__PUM_Process;' + singular: no + +- relationship: '&IDR_Execute_Update_Method_Binding__invoked_by__PUM_Process;' + index: 860 + sourceClassId: '&IDC_ExecuteUpdateMethodBinding;' + type: 'invoked by' + destinationClassId: '&IDC_PUMProcess;' + siblingRelationshipId: '&IDR_PUM_Process__invokes__Execute_Update_Method_Binding;' + singular: no + +- relationship: '&IDR_PUM_Process__invokes__Process_Related_Updates_Method;' + index: 861 + sourceClassId: '&IDC_PUMProcess;' + type: 'invokes' + destinationClassId: '&IDC_ProcessRelatedUpdatesMethod;' + siblingRelationshipId: '&IDR_Process_Related_Updates_Method__invoked_by__PUM_Process;' + singular: no + +- relationship: '&IDR_Process_Related_Updates_Method__invoked_by__PUM_Process;' + index: 862 + sourceClassId: '&IDC_ProcessRelatedUpdatesMethod;' + type: 'invoked by' + destinationClassId: '&IDC_PUMProcess;' + siblingRelationshipId: '&IDR_PUM_Process__invokes__Process_Related_Updates_Method;' + singular: no + +- relationship: '&IDR_Process_Updates_Method__has__PUM_Process;' + index: 863 + sourceClassId: '&IDC_ProcessUpdatesMethod;' + type: 'has' + destinationClassId: '&IDC_PUMProcess;' + siblingRelationshipId: '&IDR_PUM_Process__for__Process_Updates_Method;' + singular: yes + +- relationship: '&IDR_PUM_Process__for__Process_Updates_Method;' + index: 864 + sourceClassId: '&IDC_PUMProcess;' + type: 'for' + destinationClassId: '&IDC_ProcessUpdatesMethod;' + siblingRelationshipId: '&IDR_Process_Updates_Method__has__PUM_Process;' + singular: no diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00496-Search.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00496-Search.yaml new file mode 100644 index 0000000..02e1afc --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/00496-Search.yaml @@ -0,0 +1,3 @@ +- class: '&IDC_Search;' + name: Search + index: 496 diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01599-GroupLayout.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01599-GroupLayout.yaml new file mode 100644 index 0000000..228959f --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01599-GroupLayout.yaml @@ -0,0 +1,3 @@ +- class: '&IDC_GroupLayout;' + index: 1599 + customTagName: 'groupLayout' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01604-ImageLayout.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01604-ImageLayout.yaml new file mode 100644 index 0000000..0224ad7 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01604-ImageLayout.yaml @@ -0,0 +1,8 @@ +- class: '&IDC_ImageLayout;' + index: 1604 + customTagName: 'imageLayout' + inherits: '&IDC_Layout;' + relationships: + - instance: '&IDR_Layout__has__Style;' + customTagName: 'style' + customTagNameCreatesInstanceOf: '&IDC_Style;' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01605-Style.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01605-Style.yaml new file mode 100644 index 0000000..9caad74 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01605-Style.yaml @@ -0,0 +1,62 @@ +- class: '&IDC_Style;' + index: 1605 + customTagName: 'style' + registerForTemplate: yes + attributes: + - instance: '&IDA_Name;' + customTagName: 'name' + relationships: + - instance: '&IDR_Style__has_width__Measurement;' + customTagName: 'width' + customTagNameCreatesInstanceOf: '&IDC_Measurement;' + - instance: '&IDR_Style__has_height__Measurement;' + customTagName: 'height' + customTagNameCreatesInstanceOf: '&IDC_Measurement;' + +- relationship: '&IDR_Style__has_width__Measurement;' + index: 24610 + sourceClassId: '&IDC_Style;' + type: 'has width' + destinationClassId: '&IDC_Measurement;' + siblingRelationshipId: '&IDR_Measurement__width_for__Style;' + singular: yes + +- relationship: '&IDR_Measurement__width_for__Style;' + index: 24611 + sourceClassId: '&IDC_Measurement;' + type: 'width for' + destinationClassId: '&IDC_Style;' + siblingRelationshipId: '&IDR_Style__has_width__Measurement;' + singular: no + +- relationship: '&IDR_Style__has_height__Measurement;' + index: 24612 + sourceClassId: '&IDC_Style;' + type: 'has height' + destinationClassId: '&IDC_Measurement;' + siblingRelationshipId: '&IDR_Measurement__height_for__Style;' + singular: yes + +- relationship: '&IDR_Measurement__height_for__Style;' + index: 24613 + sourceClassId: '&IDC_Measurement;' + type: 'height for' + destinationClassId: '&IDC_Style;' + siblingRelationshipId: '&IDR_Style__has_height__Measurement;' + singular: no + +- relationship: '&IDR_Layout__has__Style;' + index: 24620 + sourceClassId: '&IDC_Layout;' + type: 'has' + destinationClassId: '&IDC_Style;' + siblingRelationshipId: '&IDR_Style__for__Layout;' + singular: no + +- relationship: '&IDR_Style__for__Layout;' + index: 24621 + sourceClassId: '&IDC_Style;' + type: 'for' + destinationClassId: '&IDC_Layout;' + siblingRelationshipId: '&IDR_Layout__has__Style;' + singular: no diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01606-Masurement.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01606-Masurement.yaml new file mode 100644 index 0000000..5ab4f8a --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01606-Masurement.yaml @@ -0,0 +1,10 @@ +- class: '&IDC_Measurement;' + index: 1606 + name: 'Measurement' + customTagName: 'measurement' + attributes: + - instance: '&IDA_Value;' + customTagName: value + relationships: + - instance: '&IDR_Measurement__has__Measurement_Unit;' + customTagName: unit diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01607-MeasurementUnit.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01607-MeasurementUnit.yaml new file mode 100644 index 0000000..65b01a6 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01607-MeasurementUnit.yaml @@ -0,0 +1,46 @@ +- class: '&IDC_MeasurementUnit;' + name: 'Measurement Unit' + # zq-yaml: this attribute on the instance should be interpreted as an alias for that global identifier + # so if we write ... { width: { value: 4, unit: em } } it should refer to {D55B...} + instanceReferenceAliasTagName: 'symbol' + instances: + - instance: '&IDI_MeasurementUnit_Centimeter;' + name: 'Centimeter' + symbol: 'cm' + description: 'Measurement is in centimeters.' + - instance: '&IDI_MeasurementUnit_Em;' + name: 'Em' + symbol: 'em' + description: "Measurement is relative to the height of the parent element's font." + - instance: '&IDI_MeasurementUnit_Ex;' + name: 'Ex' + symbol: 'ex' + description: "Measurement is relative to the height of the lowercase letter x of the parent element's font." + - instance: '&IDI_MeasurementUnit_Inch;' + name: 'Inch' + symbol: 'in' + description: "Measurement is in inches." + - instance: "&IDI_MeasurementUnit_Millimeter;" + name: "Millimeter" + symbol: 'mm' + description: "Measurement is in millimeters." + - instance: "&IDI_MeasurementUnit_Percentage;" + name: "Percentage" + symbol: '%' + description: "Measurement is a percentage relative to the parent element." + - instance: "&IDI_MeasurementUnit_Pica;" + name: "Pica" + symbol: 'pc' + description: "Measurement is in picas. A pica represents 12 points." + - instance: "&IDI_MeasurementUnit_Pixel;" + name: "Pixel" + symbol: "px" + description: "Measurement is in pixels." + - instance: "&IDI_MeasurementUnit_Point;" + name: "Point" + symbol: "pt" + description: "Measurement is in points. A point represents 1/72 of an inch." + - instance: "&IDI_MeasurementUnit_Twip;" + name: "Twip" + symbol: null + description: "Measurement is in twips. A twip is 1/20th of a point. This is not natively supported by CSS." diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01614-File.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01614-File.yaml new file mode 100644 index 0000000..2caa3b1 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/01614-File.yaml @@ -0,0 +1,12 @@ +- class: '&IDC_File;' + customTagName: 'file' + index: 1614 + attributes: + - instance: '&IDA_Name;' + customTagName: 'name' + - instance: '&IDA_Value;' + customTagName: 'data' + - instance: '&IDA_ContentType;' + customTagName: 'contentType' + - instance: '&IDA_Encoding;' + customTagName: 'contentEncoding' \ No newline at end of file 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 new file mode 100644 index 0000000..36836be --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/02994-HardcodedTask.yaml @@ -0,0 +1,16 @@ +- class: '&IDC_HardcodedTask;' + name: 'Hardcoded Task' + index: 2994 + inherits: '&IDC_Task;' + customTagName: 'hardcodedTask' + attributes: + - instance: '&IDA_ClassName;' + customTagName: 'className' + +- hardcodedTask: '&IDI_Task_ViewClass;' + name: 'View Class' + className: 'Mocha\\UI\\Tasks\\ViewClass' + +- hardcodedTask: '&IDI_Task_ViewElementContent;' + name: 'View Element Content' + className: 'Mocha\\UI\\Tasks\\ViewElementContent' diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03009-ButtonLayout.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03009-ButtonLayout.yaml new file mode 100644 index 0000000..456becb --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/03009-ButtonLayout.yaml @@ -0,0 +1,25 @@ +- class: '&IDC_ButtonLayout;' + index: 3009 + name: Button Layout + customTagName: buttonLayout + superclasses: + - instance: '&IDC_Layout;' + relationships: + - instance: '&IDR_Button_Layout__executes_task_from__Instance_Set;' + customTagName: 'executesTask' + +- relationship: '&IDR_Button_Layout__executes_task_from__Instance_Set;' + index: 9232 + sourceClassId: '&IDC_ButtonLayout;' + type: 'executes task from' + destinationClassId: '&IDC_InstanceSet;' + siblingRelationshipId: '&IDR_Instance_Set__has_task_executed_by__Button_Layout;' + singular: yes + +- relationship: '&IDR_Instance_Set__has_task_executed_by__Button_Layout;' + index: 9233 + sourceClassId: '&IDC_InstanceSet;' + type: 'has task executed by' + destinationClassId: '&IDC_ButtonLayout;' + siblingRelationshipId: '&IDR_Button_Layout__executes_task_from__Instance_Set;' + singular: no diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/04307-UserPreferences.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/04307-UserPreferences.yaml new file mode 100644 index 0000000..7ea13d8 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/003-Classes/04307-UserPreferences.yaml @@ -0,0 +1,56 @@ +- class: '&IDC_UserPreferences;' + index: 4307 + customTagName: userPreferences + relationships: + - instance: '&IDR_User_Preferences__has_favorite__Instance;' + customTagName: 'favoriteInstances' + - instance: '&IDR_User_Preferences__has_recent__Search;' + customTagName: 'recentSearches' + +- relationship: '&IDR_System_Account__has__User_Preferences;' + index: 12211 + sourceClassId: '&IDC_User;' + type: 'has' + destinationClassId: '&IDC_UserPreferences;' + siblingRelationshipId: '&IDR_User_Preferences__for__System_Account;' + singular: yes + +- relationship: '&IDR_User_Preferences__for__System_Account;' + index: 12212 + sourceClassId: '&IDC_UserPreferences;' + type: 'for' + destinationClassId: '&IDC_User;' + siblingRelationshipId: '&IDR_System_Account__has__User_Preferences;' + singular: yes + +- relationship: '&IDR_User_Preferences__has_favorite__Instance;' + index: 12213 + sourceClassId: '&IDC_UserPreferences;' + type: 'has' + destinationClassId: '&IDC_Instance;' + siblingRelationshipId: '&IDR_Instance__favorite_for__User_Preferences;' + singular: no + +- relationship: '&IDR_Instance__favorite_for__User_Preferences;' + index: 12214 + sourceClassId: '&IDC_Instance;' + type: 'for' + destinationClassId: '&IDC_UserPreferences;' + siblingRelationshipId: '&IDR_User_Preferences__has_favorite__Instance;' + singular: no + +- relationship: '&IDR_User_Preferences__has_recent__Search;' + index: 12215 + sourceClassId: '&IDC_UserPreferences;' + type: 'has recent' + destinationClassId: '&IDC_Search;' + siblingRelationshipId: '&IDR_Search__recent_for__User_Preferences;' + singular: no + +- relationship: '&IDR_Search__recent_for__User_Preferences;' + index: 12216 + sourceClassId: '&IDC_Search;' + type: 'recent for' + destinationClassId: '&IDC_UserPreferences;' + siblingRelationshipId: '&IDR_User_Preferences__has_recent__Search;' + singular: no \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/LoginPage.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000000-LoginPage.yaml similarity index 89% rename from common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/LoginPage.yaml rename to common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000000-LoginPage.yaml index bbfc6b5..268c164 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/LoginPage.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000000-LoginPage.yaml @@ -1,6 +1,7 @@ --- - element: '&IDE_LoginPage;' name: login page + label: Log In # elementContents: # - elementContent: '&IDE_LoginPageSubedit;' # displayOptions: diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000000-LoginPageSubedit.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000000-LoginPageSubedit.yaml new file mode 100644 index 0000000..7054182 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000000-LoginPageSubedit.yaml @@ -0,0 +1,76 @@ +- element: '&IDE_LoginPageSubedit;' + name: login page subedit + module: '&IDI_Module_MochaBaseSystem;' + elementContents: + - instance: '{13997179-656c-4034-b12f-046a7925bc3b}' + - instance: '{4a827e38-e07a-4b8b-a19f-9217299f5c45}' + - inst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c3Nzc3Nzc3Nzc3NjY3Nzc3Njc3Nzc3Nzc3NzY2Njc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3NzY3Nzc3MiLz4KICA8L2c+Cjwvc3ZnPg==' + contentType: 'image/svg+xml' + contentEncoding: 'base64' + # emits "background-image: url('data:image/svg+xml;base64,$data');" + +- imageLayout: '{b50f8614-07bf-4c35-829b-aafbb3d67fab}' + style: '{444d06f7-a356-469d-bc92-4fb51db5a236}' + # style: { + # # globalIdentifier: '{131a0bc8-d4f9-43c3-a380-4d4e33743638}', + # width: { value: 256, unit: '&IDI_MeasurementUnit_Pixel;' }, + # height: { value: 256, unit: '&IDI_MeasurementUnit_Pixel;' } + # } + # # horizontalAlignment: '&IDI_HorizontalAlignment_Center;' + +- style: '{444d06f7-a356-469d-bc92-4fb51db5a236}' + width: { value: 256, unit: '&IDI_MeasurementUnit_Pixel;' } + height: { value: 256, unit: '&IDI_MeasurementUnit_Pixel;' } + +- elementContent: '{13997179-656c-4034-b12f-046a7925bc3b}' + defaultDataType: '&IDI_File_SignonLogo;' + order: a + layout: '{b50f8614-07bf-4c35-829b-aafbb3d67fab}' + displayOptions: + - instance: '&IDI_DisplayOption_DoNotShowLabel;' + +- textAttribute: '&IDA_LoginPageInstructions;' + name: 'Login Page Instructions' + index: 1034 + value: 'Please enter your user name and password to log in to this system.' + translations: + - relationship: '&IDR_Translatable__has__Translation;' + values: + - language: '&IDI_Language_English;' + - value: 'Login Page Instructions' + +- elementContent: '{4a827e38-e07a-4b8b-a19f-9217299f5c45}' + defaultDataType: '&IDA_LoginPageInstructions;' + order: b + displayOptions: + - instance: '&IDI_DisplayOption_DoNotShowLabel;' + - instance: '&IDI_DisplayOption_NotEnterable;' + - instance: '&IDI_DisplayOption_WideText;' + +- elementContent: '{c67f305e-bd4d-4628-816b-55fb85ea1b67}' + defaultDataType: '&IDA_UserName;' + order: c + displayOptions: + - instance: '&IDI_DisplayOption_Required;' + +- elementContent: '{51b51be3-44fd-48f1-971f-682aee0a6132}' + defaultDataType: '&IDA_Password;' + order: d + displayOptions: + - instance: '&IDI_DisplayOption_Required;' + - instance: '&IDI_DisplayOption_ObscuredText;' + +- elementContent: '{684f1e03-9ecd-43d5-8aca-dcf5b84c71f8}' + defaultDataType: '&IDA_UserNameOrPasswordIncorrectMessage;' + order: e + displayOptions: + - instance: '&IDI_DisplayOption_DoNotShowLabel;' + - instance: '&IDI_DisplayOption_DoNotShow;' + - instance: '&IDI_DisplayOption_NotEnterable;' + - instance: '&IDI_DisplayOption_WideText;' 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 new file mode 100644 index 0000000..32dbd48 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/000001-ViewElementContent.yaml @@ -0,0 +1,25 @@ +- element: '&IDE_ViewElementContent;' + name: view element content + module: '&IDI_Module_MochaBaseSystem;' + elementContents: + - instance: '{4004bfb2-0f81-4e52-a88b-646ba564be3b}' + +- elementContent: '{4004bfb2-0f81-4e52-a88b-646ba564be3b}' + defaultDataType: '&IDE_ViewElementContent_Summary;' + order: a + displayOptions: + - instance: '&IDI_DisplayOption_Singular;' + - instance: '&IDI_DisplayOption_ShowSubelementsVertically;' + +- element: '&IDE_ViewElementContent_Summary;' + name: view element content summary + module: '&IDI_Module_MochaBaseSystem;' + elementContents: + - instance: '{bce8db21-66e1-4cfb-b398-9f010747c225}' + +- elementContent: '{bce8db21-66e1-4cfb-b398-9f010747c225}' + defaultDataType: '&IDR_Element_Content__for__Element;' + label: 'For Element' + order: a + displayOptions: + - instance: '&IDI_DisplayOption_NotEnterable;' 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 new file mode 100644 index 0000000..f4a1f15 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113800-ElementTests.yaml @@ -0,0 +1,81 @@ +--- +- element: '{29694806-1882-4cf9-b1c9-aaeee2d729a5}' + name: Element Tests + index: 113800 + processedByPRUMethod: '{2aa20384-4132-49d3-a661-ae7d9a2e2feb}' + elementContents: + - instance: '{91b1a767-08ac-47f0-9f30-620de6374d12}' + - instance: '{628550d8-673d-4156-8983-447ea2ee6d1b}' + - instance: '{8c69fd8c-28fa-4f3c-a283-5d0006c1027d}' + - instance: '{535b1507-68ed-4981-8cd4-e8e843a24916}' + - instance: '{d74123b5-9fde-4c2a-bd28-8cd00ce86734}' + +- class: '{cce471d6-5fe7-4202-b678-9fcab20fd864}' + name: 'Element Tests Testing Class 1' + processedByPRUMethod: '{2aa20384-4132-49d3-a661-ae7d9a2e2feb}' + +- processRelatedUpdatesMethod: '{2aa20384-4132-49d3-a661-ae7d9a2e2feb}' + name: 'PRU for Element Tests Class 1' + +- 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 + +- textAttribute: '{d53d7283-92a2-4a62-b8f2-cf0a0b975634}' + name: 'Test_for_Required_Field' + +- textAttribute: '{dd33bb2a-1e10-4090-a846-89a225103c07}' + name: 'Not Enterable Text Attribute Test' + value: 'This element content is `Not Enterable`, and will always have its default value' + +- elementContent: '{91b1a767-08ac-47f0-9f30-620de6374d12}' + order: 'a' + label: 'Element Content Test Class' + defaultDataType: '&IDI_ElementContentTestClass_1;' + displayOptions: + - instance: '&IDI_DisplayOption_DoNotShow;' + +- elementContent: '{535b1507-68ed-4981-8cd4-e8e843a24916}' + order: 'b' + label: 'Label Override for Not Enterable' + defaultDataType: '{dd33bb2a-1e10-4090-a846-89a225103c07}' + builtFromBEMProcess: '&IDBEM_1;' + displayOptions: + - instance: '&IDI_DisplayOption_NotEnterable;' + +- derivedECParameter: '{08563151-04c7-40d1-adff-a3dc2e12be2b}' + assignsToParm: '{1a907d6e-b3fd-4f8e-a170-550aeb2faea5}' + # contextType: null + # specificWorkData: null + # onMultipleSelection: null + +- elementContent: '{8c69fd8c-28fa-4f3c-a283-5d0006c1027d}' + order: 'c' + label: 'Test with MaxLength 20' + defaultDataType: '{1a907d6e-b3fd-4f8e-a170-550aeb2faea5}' + builtFromBEMProcess: '&IDBEM_1;' + parameters: + - instance: '{08563151-04c7-40d1-adff-a3dc2e12be2b}' + +# Test for Required Field +- derivedECParameter: '{a8c306ed-9eb6-49c8-a6dc-357617e493d5}' + assignsToParm: '{d53d7283-92a2-4a62-b8f2-cf0a0b975634}' + +- elementContent: '{d74123b5-9fde-4c2a-bd28-8cd00ce86734}' + order: 'd' + label: 'This field is required' + defaultDataType: '{d53d7283-92a2-4a62-b8f2-cf0a0b975634}' + builtFromBEMProcess: '&IDBEM_1;' + displayOptions: + - instance: '&IDI_DisplayOption_Required;' + parameters: + - instance: '{a8c306ed-9eb6-49c8-a6dc-357617e493d5}' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113859-HomePage.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113859-HomePage.yaml index 7309898..35fac20 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113859-HomePage.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/113859-HomePage.yaml @@ -1,17 +1,38 @@ --- - element: '&IDE_HomePage;' name: Home Page + label: Home Page index: 113859 - # elementContents: - # - elementContent: '&IDE_LoginPageSubedit;' - # displayOptions: - # - instance: '&IDI_DisplayOption_ShowSubelementsVertically;' - # - instance: '&IDI_DisplayOption_Singular;' - #elementContents: - #- instance: '{f2f77680-37ca-48fa-b4b3-5f8a382e5d8c}' + elementContents: + - instance: '{16c0571e-b025-4a8f-afdd-4443d0a06831}' + - instance: '{cc15510f-6230-4e29-b7b8-b887bc5f3ff0}' -# - elementContent: '{f2f77680-37ca-48fa-b4b3-5f8a382e5d8c}' -# defaultDataType: '&IDE_LoginPageSubedit;' -# displayOptions: -# - instance: '&IDI_DisplayOption_ShowSubelementsVertically;' -# - instance: '&IDI_DisplayOption_Singular;' \ No newline at end of file +- element: '{5e66e253-e19b-4ae5-8c5c-6775f5881e2a}' + name: Home Page Welcome + index: 113860 + #processedByPRUMethod: '{2aa20384-4132-49d3-a661-ae7d9a2e2feb}' + elementContents: + - instance: '{572e3060-025b-4dff-a352-23dd8bfcfa0a}' + +- elementContent: '{572e3060-025b-4dff-a352-23dd8bfcfa0a}' + defaultDataType: '{e3549308-76b9-4602-98fc-012cccf37f74}' + displayOptions: + - instance: '&IDI_DisplayOption_NotEnterable;' + - instance: '&IDI_DisplayOption_DoNotShowLabel;' + - instance: '&IDI_DisplayOption_WideText;' + +- textAttribute: '{e3549308-76b9-4602-98fc-012cccf37f74}' + name: 'Home Page Welcome Text' + value: 'Welcome to Mocha' + +- elementContent: '{16c0571e-b025-4a8f-afdd-4443d0a06831}' + defaultDataType: '{5e66e253-e19b-4ae5-8c5c-6775f5881e2a}' + displayOptions: + - instance: '&IDI_DisplayOption_ShowSubelementsVertically;' + - instance: '&IDI_DisplayOption_Singular;' + +- elementContent: '{cc15510f-6230-4e29-b7b8-b887bc5f3ff0}' + defaultDataType: '{29694806-1882-4cf9-b1c9-aaeee2d729a5}' + displayOptions: + - instance: '&IDI_DisplayOption_ShowSubelementsVertically;' + - instance: '&IDI_DisplayOption_Singular;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/LoginPageSubedit.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/LoginPageSubedit.yaml deleted file mode 100644 index 69e32f3..0000000 --- a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Elements/LoginPageSubedit.yaml +++ /dev/null @@ -1,38 +0,0 @@ -- element: '&IDE_LoginPageSubedit;' - name: login page subedit - module: '&IDI_Module_MochaBaseSystem;' - elementContents: - - instance: '{4a827e38-e07a-4b8b-a19f-9217299f5c45}' - - instance: '{c67f305e-bd4d-4628-816b-55fb85ea1b67}' - - instance: '{51b51be3-44fd-48f1-971f-682aee0a6132}' - - instance: '{684f1e03-9ecd-43d5-8aca-dcf5b84c71f8}' - -- elementContent: '{4a827e38-e07a-4b8b-a19f-9217299f5c45}' - defaultDataType: '&IDA_LoginPageInstructions;' - order: a - displayOptions: - - instance: '&IDI_DisplayOption_DoNotShowLabel;' - - instance: '&IDI_DisplayOption_NotEnterable;' - - instance: '&IDI_DisplayOption_WideText;' - -- elementContent: '{c67f305e-bd4d-4628-816b-55fb85ea1b67}' - defaultDataType: '&IDA_UserName;' - order: b - displayOptions: - - instance: '&IDI_DisplayOption_Required;' - -- elementContent: '{51b51be3-44fd-48f1-971f-682aee0a6132}' - defaultDataType: '&IDA_Password;' - order: c - displayOptions: - - instance: '&IDI_DisplayOption_Required;' - - instance: '&IDI_DisplayOption_ObscuredText;' - -- elementContent: '{684f1e03-9ecd-43d5-8aca-dcf5b84c71f8}' - defaultDataType: '&IDA_UserNameOrPasswordIncorrectMessage;' - order: d - displayOptions: - - instance: '&IDI_DisplayOption_DoNotShowLabel;' - - instance: '&IDI_DisplayOption_DoNotShow;' - - instance: '&IDI_DisplayOption_NotEnterable;' - - instance: '&IDI_DisplayOption_WideText;' 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 new file mode 100644 index 0000000..b5448b9 --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/EditClass.yaml @@ -0,0 +1,8 @@ +- workSet: '&IDI_WorkSet_ClassForEditClassTask;' + name: 'Class for Edit Class Task' + validClasses: + - instance: '&IDC_Class;' + +- sequenceTask: '{9dbdb202-e9f8-49ca-bbc2-0b63df651246}' + name: 'Edit Class' + relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/TestMethodBinding.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/TestMethodBinding.yaml new file mode 100644 index 0000000..d5f86cb --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/TestMethodBinding.yaml @@ -0,0 +1,20 @@ +- sequenceTask: '&IDI_SequenceTask_TestMethodBinding;' + index: 312 + name: 'Test Method Binding' + + initialElement: '{2696449c-a517-48cc-9348-03abca291cf0}' + +- element: '{2696449c-a517-48cc-9348-03abca291cf0}' + elementContents: + - instance: '{fda2b13e-4495-4b35-bde2-40d2ab57b977}' + +- elementContent: '{fda2b13e-4495-4b35-bde2-40d2ab57b977}' + label: 'Test Parms' + # TODO: implement get element contents from method (maybe Get Element from Parameters Method?) + + # Test Parms gets its contents from `Method Binding.has Parameter Assignment` + + # Test Context has: + # Effective Moment [DT] + # Effective Local Date Time [DT] + # Effective Date Time Zone [DT]+TZ diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewClass.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewClass.yaml new file mode 100644 index 0000000..1b4d04f --- /dev/null +++ b/common/libraries/yaml/net.alcetech.Mocha.System/005-UserInterface/Tasks/ViewClass.yaml @@ -0,0 +1,21 @@ +# - task: '&IDI_Task_ViewClass;' +# name: View Class +# module: '&IDI_Module_MochaBaseSystem;' +# schedulable: no +# longRunning: no +# suppressRIHints: no +# stepName: View Class +# showSpreadsheetButtonOnSelection: no +# relatedAction: +# object: '&IDC_Class;' +# action: 'View' +# menuPath: 'Class > View' +# initiatingElement: '&IDI_Element_ViewClass;' +# taskDirectiveRAMB: '&IDMB_Element__get_Help_Text_for_View_Element;' # Element@get Help Text for View Element(GRA)*P*S(public)[ramb] +# enableSaveParameters: no +# enableReportGroups: no +# handledByControlTransaction: '&IDM_Element__View_Start;' # Element@ View Start(CT)*S +# respondsWithElement: '&IDE_ViewElementEdit;' +# updating: no +# targetAudience: 'ESS' +# businessProcessType: 'VIEWELEMENT' \ No newline at end of file diff --git a/common/libraries/yaml/net.alcetech.Mocha.System/009-Users/zq-developer.yaml b/common/libraries/yaml/net.alcetech.Mocha.System/009-Users/zq-developer.yaml index c407917..87178e2 100644 --- a/common/libraries/yaml/net.alcetech.Mocha.System/009-Users/zq-developer.yaml +++ b/common/libraries/yaml/net.alcetech.Mocha.System/009-Users/zq-developer.yaml @@ -5,6 +5,11 @@ username: zq-developer passwordHash: f4f166c4d578cb5ca942e07851d7c09de07d417463f2d8e5165a779f768d14b370cd1e82826a94b617b6c6359253e8c12ea8285cba1e6e69e2e13f2bdc0425d0 passwordSalt: 7e893ba949b041bab73c6f4f0bcb9413 + hasUserPreferences: '{d7e9b412-c916-42e7-b788-3bbfac92822c}' + +- userPreferences: '{d7e9b412-c916-42e7-b788-3bbfac92822c}' + favoriteInstances: + - instance: '{098DDA82-CD04-4B53-8C75-89D420EA6902}' - user: '{69e291d8-381b-4ad8-9013-f3b0a0c693fe}' username: superuser diff --git a/php/mocha/include/BeforeLaunchEvent.inc.php b/php/mocha/include/BeforeLaunchEvent.inc.php index 8346024..dc8d5f1 100644 --- a/php/mocha/include/BeforeLaunchEvent.inc.php +++ b/php/mocha/include/BeforeLaunchEvent.inc.php @@ -133,18 +133,25 @@ System::$BeforeLaunchEventHandler = function($path) */ $oms = mocha_get_oms(); - if (count($path) >= 1 && $path[0] == "suv") + if (count($path) >= 1) { - if (count($path) == 2 && ($path[1] == "suvinfo.html" || $path[1] == "phpinfo.html")) + if ($path[0] == "suv") { - // - return true; + if (count($path) == 2 && ($path[1] == "suvinfo.html" || $path[1] == "phpinfo.html")) + { + // + return true; + } + else + { + header("HTTP/1.1 404 Not Found"); + echo ("Not Found"); + return false; + } } - else + else if ($path[0] == "scripts") { - header("HTTP/1.1 404 Not Found"); - echo ("Not Found"); - return false; + return true; } } diff --git a/php/mocha/index.php b/php/mocha/index.php index 04a1915..6010cec 100644 --- a/php/mocha/index.php +++ b/php/mocha/index.php @@ -21,6 +21,8 @@ // other Phast-specific stuff) require_once("lib/phast/System.inc.php"); require_once("lib/mocha/system.inc.php"); + + require_once("ui/tasks/ViewElementContent.inc.php"); // Bring in the Phast\System and Phast\IncludeFile classes so we can simply refer // to them (in this file only) as "System" and "IncludeFile", respectively, from diff --git a/php/mocha/lib/mocha/core/InstanceKey.inc.php b/php/mocha/lib/mocha/core/InstanceKey.inc.php index aabc1fe..f041aef 100644 --- a/php/mocha/lib/mocha/core/InstanceKey.inc.php +++ b/php/mocha/lib/mocha/core/InstanceKey.inc.php @@ -6,12 +6,28 @@ public $ClassIndex; public $InstanceIndex; - public function __construct($class_id, $inst_id) + public function __construct(int $class_id, int $inst_id) { $this->ClassIndex = $class_id; $this->InstanceIndex = $inst_id; } + public static function Parse(?string $instanceKeyStr) : ?InstanceKey + { + if ($instanceKeyStr !== null) + { + $split = explode("$", $instanceKeyStr); + if (count($split) == 2) + { + if (is_numeric($split[0]) && is_numeric($split[1])) + { + return new InstanceKey(intval($split[0]), intval($split[1])); + } + } + } + return null; + } + public function __toString() { return $this->ClassIndex . "$" . $this->InstanceIndex; diff --git a/php/mocha/lib/mocha/core/InstanceReference.inc.php b/php/mocha/lib/mocha/core/InstanceReference.inc.php index 0254217..75c3709 100644 --- a/php/mocha/lib/mocha/core/InstanceReference.inc.php +++ b/php/mocha/lib/mocha/core/InstanceReference.inc.php @@ -26,6 +26,10 @@ $instances = []; return $instances; } + public function getAttributeValue($attributeInstance, $defaultValue = null, $effectiveDate = null) : ?string + { + return $this->OMS->getAttributeValue($this, $attributeInstance, $defaultValue, $effectiveDate); + } public function asMethod() { diff --git a/php/mocha/lib/mocha/core/KnownAttributeGuids.inc.php b/php/mocha/lib/mocha/core/KnownAttributeGuids.inc.php index be2d324..59e3f0f 100644 --- a/php/mocha/lib/mocha/core/KnownAttributeGuids.inc.php +++ b/php/mocha/lib/mocha/core/KnownAttributeGuids.inc.php @@ -10,6 +10,14 @@ class KnownAttributeGuids const Value = "041DD7FD2D9C412B8B9DD7125C166FE0"; const CSSValue = "C0DD4A42F5034EB380347C428B1B8803"; const RelationshipType = "71106B1219344834B0F6D894637BAEED"; + const Label = "69cdf8affcf24477b75d71593e7dbb22"; + + const ClassName = "c7e8d78ecfac4dacae242ac67a0ba9d3"; + + /** + * A Numeric Attribute specifying the maximum length of an input field. + */ + const MaximumLength = "6d69fee2f2204aadab8901bfa491dae1"; const TargetURL = "970F79A09EFE4E7D92869908C6F06A67"; @@ -17,6 +25,7 @@ class KnownAttributeGuids const PasswordHash = "F377FC294DF14AFB96434191F37A00A9"; const PasswordSalt = "8C5A99BC40ED4FA2B23FF373C1F3F4BE"; + const Encoding = "a82f3c46055e4e129c5de40447134389"; const ContentType = "34142FCB172C490AAF03FF8451D00CAF"; const BackgroundColor = "B817BE3BD0AC4A60A98A97F99E96CC89"; diff --git a/php/mocha/lib/mocha/core/KnownClassGuids.inc.php b/php/mocha/lib/mocha/core/KnownClassGuids.inc.php index 6a777b7..381ac32 100644 --- a/php/mocha/lib/mocha/core/KnownClassGuids.inc.php +++ b/php/mocha/lib/mocha/core/KnownClassGuids.inc.php @@ -19,6 +19,8 @@ class KnownClassGuids const Element = "919295953dbd4eae8add6120a49797c7"; const ElementContent = "f85d4f5ec69f449899137a8554e233a4"; + const BEMProcess = "a4c5ffb4bf3749f39190dc329d035b46"; + const Translation = "04A53CC832064A9799C5464DB8CAA6E6"; const TranslationValue = "6D38E757EC1843AD9C35D15BB446C0E1"; @@ -81,6 +83,7 @@ class KnownClassGuids const TaskCategory = "e8d8060fa20c442f838403488b63247f"; const Task = "D4F2564B2D114A5C8AA9AF52D4EACC13"; const UITask = "BFD07772178C4885A6CEC85076C8461C"; + const HardcodedTask = "df1fe350767047d991a016dafdfbf98d"; const Tenant = "703F9D65C5844D9FA656D0E3C247FF1F"; @@ -123,5 +126,8 @@ class KnownClassGuids const CommonBoolean = "5b025da3b7bd45a9b08448c4a922bf72"; const CommonInstanceSet = "3382da214fc545dcbbd1f7ba3ece1a1b"; + + const ButtonLayout = "6f6338db68e04cc7b257d1b97cf3cb92"; + const ImageLayout = "4b1bb7c6168e4ce0b4f876dd5069a80b"; } ?> \ 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 0c99111..9f1ae27 100644 --- a/php/mocha/lib/mocha/core/KnownInstanceGuids.inc.php +++ b/php/mocha/lib/mocha/core/KnownInstanceGuids.inc.php @@ -32,5 +32,7 @@ class KnownInstanceGuids const ElementContent__UserNameForLoginPage = "c67f305ebd4d4628816b55fb85ea1b67"; const ElementContent__PasswordForLoginPage = "51b51be344fd48f1971f682aee0a6132"; + + const Element__ViewElementContent = "e68bb6c429eb4c77908a1b3793c952bc"; } ?> \ 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 03400dc..1d509f4 100644 --- a/php/mocha/lib/mocha/core/KnownRelationshipGuids.inc.php +++ b/php/mocha/lib/mocha/core/KnownRelationshipGuids.inc.php @@ -227,6 +227,10 @@ class KnownRelationshipGuids const Element_Content__has__Instance = "315b71ba953d45fc87e54f0a268242a9"; const Instance__for__Element_Content = "c3959f84248d4edea3f2f262917c7b56"; + const Element_Content__has__Layout = "1ab7412005ea4acab6d3c7e0133e0c4f"; + + const Layout__has__Style = "{e684bb26-7e78-4a21-b8b4-5a550f3053d5}"; + const Element_Content__has__Element_Content_Display_Option = "f070dfa762604488a779fae291903f2d"; const Element_Content__has__Parameter_Assignment = "51214ef0458a44fa8b9df3d9d2309388"; @@ -259,5 +263,8 @@ class KnownRelationshipGuids const Get_Instance_Set_by_System_Routine_Method__uses__System_Instance_Set_Routine = "{085bd706-eece-4604-ac04-b7af114d1d21}"; const System_Instance_Set_Routine__used_by__Get_Instance_Set_By_System_Routine_Method = "{6fb6534c-2a46-4d6d-b9df-fd581f19efed}"; + + const System_Account__has__User_Preferences = "{ada4deb2-adfd-409f-b13a-9856fabd5522}"; + const User_Preferences__for__System_Account = "{ab2372a5-a4c7-488a-89f6-67e5834f8c83}"; } ?> \ No newline at end of file diff --git a/php/mocha/lib/mocha/oms/DatabaseOms.inc.php b/php/mocha/lib/mocha/oms/DatabaseOms.inc.php index 4622d32..d3efa4e 100644 --- a/php/mocha/lib/mocha/oms/DatabaseOms.inc.php +++ b/php/mocha/lib/mocha/oms/DatabaseOms.inc.php @@ -2,7 +2,7 @@ namespace Mocha\Oms; - class DatabaseOms extends Oms + abstract class DatabaseOms extends Oms { } diff --git a/php/mocha/lib/mocha/oms/MySQLDatabaseOms.inc.php b/php/mocha/lib/mocha/oms/MySQLDatabaseOms.inc.php index 2386114..39c5530 100644 --- a/php/mocha/lib/mocha/oms/MySQLDatabaseOms.inc.php +++ b/php/mocha/lib/mocha/oms/MySQLDatabaseOms.inc.php @@ -147,6 +147,53 @@ return $ir; } + public function getInstanceByKey(InstanceKey $instanceKey) : ?InstanceReference + { + $tenant = $this->getTenant(); + if ($tenant === null) + { + trigger_error("tenant cannot be null", \E_USER_ERROR); + return null; + } + + $query = "CALL mocha_get_instance_by_key(:class_id, :inst_id)"; + $stmt = $this->PDO->prepare($query); + $parms = array + ( + "class_id" => $instanceKey->ClassIndex, + "inst_id" => $instanceKey->InstanceIndex + ); + $result = $stmt->execute($parms); + + if ($result === false) + { + trigger_error("unknown database error, query was:", \E_USER_ERROR); + trigger_error($query, \E_USER_NOTICE); + return null; + } + + $values = $stmt->fetchAll(); + if (count($values) == 0) + { + trigger_error("no records found, query was:", \E_USER_NOTICE); + trigger_error($query, \E_USER_NOTICE); + foreach ($parms as $key => $value) + { + trigger_error($key . ": '" . $value . "'", \E_USER_NOTICE); + } + return null; + } + + $dbid = $values[0]["id"]; + $class_id = $values[0]["class_id"]; + $inst_id = $values[0]["inst_id"]; + $global_id = $values[0]["global_identifier"]; + + $ir = new InstanceReference($this, $dbid, new InstanceKey($class_id, $inst_id), $global_id); + return $ir; + } + + public function getInstanceByGlobalIdentifier(string $globalIdentifier) : ?InstanceReference { $tenant = $this->getTenant(); @@ -192,15 +239,8 @@ return $ir; } - public function getRelatedInstances(InstanceReference $sourceInstance, InstanceReference $relationshipInstance, \DateTime $effectiveDate = null) : ?array + protected function getRelatedInstancesInternal(InstanceReference $sourceInstance, InstanceReference $relationshipInstance, \DateTime $effectiveDate = null) : ?array { - $tenant = $this->getTenant(); - if ($tenant === null) - { - trigger_error("tenant cannot be null", \E_USER_ERROR); - return null; - } - $dt = null; if ($effectiveDate !== null) { @@ -241,15 +281,8 @@ return []; } - public function getAttributeValue($sourceInstance, $attributeInstance, $defaultValue = null, $effectiveDate = null) : ?string + protected function getAttributeValueInternal(InstanceReference $sourceInstance, InstanceReference $attributeInstance, $defaultValue = null, $effectiveDate = null) : ?string { - $tenant = $this->getTenant(); - if ($tenant === null) - { - trigger_error("tenant cannot be null", \E_USER_ERROR); - return null; - } - $query = "CALL mocha_get_attribute_value(:src_inst_id, :attr_inst_id, :eff_date)"; $stmt = $this->PDO->prepare($query); @@ -274,15 +307,8 @@ } return $defaultValue; } - public function setAttributeValue(InstanceReference $sourceInstance, InstanceReference $attributeInstance, mixed $value, ?\DateTime $effectiveDate = null) + public function setAttributeValueInternal(InstanceReference $sourceInstance, InstanceReference $attributeInstance, mixed $value, ?\DateTime $effectiveDate = null) { - $tenant = $this->getTenant(); - if ($tenant === null) - { - trigger_error("tenant cannot be null", \E_USER_ERROR); - return null; - } - $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 @@ -294,18 +320,24 @@ "eff_date" => $effectiveDate )); } - public function assignRelationship(InstanceReference $sourceInstance, InstanceReference $relationshipInstance, mixed $targetInstance, ?\DateTime $effectiveDate = null) + + protected function assignRelationshipInternal(InstanceReference $sourceInstance, InstanceReference $relationshipInstance, InstanceReference|array $targetInstances, ?\DateTime $effectiveDate = null) { - $tenant = $this->getTenant(); - if ($tenant === null) + if (is_array($targetInstances)) { - trigger_error("tenant cannot be null", \E_USER_ERROR); - return null; - } - - if (is_array($targetInstance)) - { - + foreach ($targetInstances as $targetInstance) + { + $query = "CALL mocha_assign_relationship(:src_inst_id, :rel_inst_id, :dest_inst_id, :user_inst_id, :eff_date)"; + $stmt = $this->PDO->prepare($query); + $result = $stmt->execute(array + ( + "src_inst_id" => $this->getDbId($sourceInstance), + "rel_inst_id" => $this->getDbId($relationshipInstance), + "dest_inst_id" => $this->getDbId($targetInstance), + "user_inst_id" => null, + "eff_date" => null + )); + } } else { @@ -315,7 +347,7 @@ ( "src_inst_id" => $this->getDbId($sourceInstance), "rel_inst_id" => $this->getDbId($relationshipInstance), - "dest_inst_id" => $this->getDbId($targetInstance), + "dest_inst_id" => $this->getDbId($targetInstances), "user_inst_id" => null, "eff_date" => null )); diff --git a/php/mocha/lib/mocha/oms/Oms.inc.php b/php/mocha/lib/mocha/oms/Oms.inc.php index 6018dd6..75129fd 100644 --- a/php/mocha/lib/mocha/oms/Oms.inc.php +++ b/php/mocha/lib/mocha/oms/Oms.inc.php @@ -7,7 +7,9 @@ use Mocha\Core\KnownClassGuids; use Mocha\Core\KnownInstanceGuids; use Mocha\Core\KnownAttributeGuids; + use Mocha\Core\KnownMethodBindingGuids; use Mocha\Core\KnownRelationshipGuids; + use Mocha\Core\OmsContext; use Mocha\Core\TenantReference; abstract class Oms @@ -25,11 +27,25 @@ return null; } - public function getRelatedInstances(InstanceReference $sourceInstance, InstanceReference $relationshipInstance, \DateTime $effectiveDate = null) : ?array + public function getRelatedInstances(InstanceReference|string|InstanceKey $sourceInstance, InstanceReference|string|InstanceKey|null $relationshipInstance, \DateTime $effectiveDate = null) : ?array { - return null; + $tenant = $this->getTenant(); + if ($tenant === null) + { + trigger_error("tenant cannot be null", \E_USER_ERROR); + return null; + } + + $sourceInstance = $this->normalizeInstanceReference($sourceInstance); + $relationshipInstance = $this->normalizeInstanceReference($relationshipInstance); + if ($relationshipInstance === null) + return null; + + return $this->getRelatedInstancesInternal($sourceInstance, $relationshipInstance, $effectiveDate); } - public function getRelatedInstance(InstanceReference $sourceInstance, InstanceReference $relationshipInstance, \DateTime $effectiveDate = null) : ?InstanceReference + protected abstract function getRelatedInstancesInternal(InstanceReference $sourceInstance, InstanceReference $relationshipInstance, \DateTime $effectiveDate = null) : ?array; + + public function getRelatedInstance(InstanceReference|string|InstanceKey $sourceInstance, InstanceReference|string|InstanceKey $relationshipInstance, \DateTime $effectiveDate = null) : ?InstanceReference { $insts = $this->getRelatedInstances($sourceInstance, $relationshipInstance, $effectiveDate); if ($insts === null) @@ -59,15 +75,60 @@ /** * Gets the value of the given attribute on the specified instance. */ - public function getAttributeValue($sourceInstance, $attributeInstance, $defaultValue = null, $effectiveDate = null) : ?string + public function getAttributeValue(InstanceReference|string|InstanceKey|null $sourceInstance, InstanceReference|string|InstanceKey|null $attributeInstance, $defaultValue = null, $effectiveDate = null) : ?string { - return null; + $tenant = $this->getTenant(); + if ($tenant === null) + { + trigger_error("tenant cannot be null", \E_USER_ERROR); + return null; + } + + $sourceInstance = $this->normalizeInstanceReference($sourceInstance); + $attributeInstance = $this->normalizeInstanceReference($attributeInstance); + if ($sourceInstance === null || $attributeInstance === null) + return $defaultValue; + + return $this->getAttributeValueInternal($sourceInstance, $attributeInstance, $defaultValue, $effectiveDate); } + protected abstract function getAttributeValueInternal(InstanceReference $sourceInstance, InstanceReference $attributeInstance, $defaultValue = null, $effectiveDate = null) : ?string; + + public function setAttributeValue(InstanceReference|string|InstanceKey $sourceInstance, InstanceReference|string|InstanceKey $attributeInstance, mixed $value, ?\DateTime $effectiveDate = null) + { + $tenant = $this->getTenant(); + if ($tenant === null) + { + trigger_error("tenant cannot be null", \E_USER_ERROR); + return null; + } + + $sourceInstance = $this->normalizeInstanceReference($sourceInstance); + $attributeInstance = $this->normalizeInstanceReference($attributeInstance); + $this->setAttributeValueInternal($sourceInstance, $attributeInstance, $value, $effectiveDate); + } + protected abstract function setAttributeValueInternal(InstanceReference $sourceInstance, InstanceReference $attributeInstance, mixed $value, ?\DateTime $effectiveDate = null); + public function getInstanceText($inst) { return $this->getAttributeValue($inst, $this->getInstanceByGlobalIdentifier(KnownAttributeGuids::Name)); } + public function assignRelationship(InstanceReference|string|InstanceKey $sourceInstance, InstanceReference|string|InstanceKey $relationshipInstance, InstanceReference|string|InstanceKey|array $targetInstances, ?\DateTime $effectiveDate = null) + { + $tenant = $this->getTenant(); + if ($tenant === null) + { + trigger_error("tenant cannot be null", \E_USER_ERROR); + return null; + } + + $sourceInstance = $this->normalizeInstanceReference($sourceInstance); + $relationshipInstance = $this->normalizeInstanceReference($relationshipInstance); + $targetInstances = $this->normalizeInstanceReference($targetInstances); + return $this->assignRelationshipInternal($sourceInstance, $relationshipInstance, $targetInstances, $effectiveDate); + } + protected abstract function assignRelationshipInternal(InstanceReference $sourceInstance, InstanceReference $relationshipInstance, InstanceReference|array $targetInstances, ?\DateTime $effectiveDate = null); + private $_tenant; public function getTenant() { @@ -126,5 +187,64 @@ return null; } + + /** + * Given an InstanceReference, GUID (string), or InstanceKey, return the normalized InstanceReference for that representation. + * + * @return InstanceReference|array|null + */ + public function normalizeInstanceReference(InstanceReference|string|InstanceKey|array|null $instanceReferenceOrGuidOrInstanceKey) : InstanceReference|array|null + { + if ($instanceReferenceOrGuidOrInstanceKey === null) + return null; + + if (is_array($instanceReferenceOrGuidOrInstanceKey)) + { + $arry = array(); + foreach ($instanceReferenceOrGuidOrInstanceKey as $instanceRef) + { + $arry[] = $this->normalizeInstanceReference($instanceRef); + } + return $arry; + } + else if (is_string($instanceReferenceOrGuidOrInstanceKey)) + { + // assume GUID + return $this->getInstanceByGlobalIdentifier($instanceReferenceOrGuidOrInstanceKey); + } + else if ($instanceReferenceOrGuidOrInstanceKey instanceof InstanceKey) + { + return $this->getInstanceByKey($instanceReferenceOrGuidOrInstanceKey); + } + else if ($instanceReferenceOrGuidOrInstanceKey instanceof InstanceReference) + { + return $instanceReferenceOrGuidOrInstanceKey; + } + return null; + } + + public function getTranslationValue($sourceInstance, $relationshipInstance, $defaultValue = null) + { + $sourceInstance = $this->normalizeInstanceReference($sourceInstance); + $relationshipInstance = $this->normalizeInstanceReference($relationshipInstance); + + $ctx = new OmsContext(); + $m_Translatable__get__Translation_Value_for_Relationship_parm = $this->getInstanceByGlobalIdentifier(KnownMethodGuids::Translatable__get__Translation_Value_for_Relationship_parm); + + $ctx->setWorkData(KnownClassGuids::Relationship, $relationshipInstance); + + $mb_Translatable__get__Translation_Value_for_Relationship_parm = $this->executeMethodReturningAttribute($m_Translatable__get__Translation_Value_for_Relationship_parm, $ctx); + // Translatable@get Translation Value for Relationship parm(GRA)*S(public)[ramb] + // loop on instance seTranslation Value for Relationship parm(GRA)*S(public)[ramb] + // loop on instance settTranslation Value for Relationship parm(GRA)*S(public)[ramb] + // loop on instance set: Translatable@get Translations for Effective User Language(GRS)*S[rsmb] + // ---- Translatable@get Translations for Language parm(GRS)*S[rsmb] + // ---- Language => User@get Effective Language(SSC)[rsmb] + // ---- ---- if User@get Current Language then User@get Current Language + // ---- ---- if not User@get Current Language then Tenant@get Default Language + + // get attribute: Translation@get Value(GA)[ramb] + + } } ?> diff --git a/php/mocha/lib/mocha/system.inc.php b/php/mocha/lib/mocha/system.inc.php index 2666243..608a46b 100644 --- a/php/mocha/lib/mocha/system.inc.php +++ b/php/mocha/lib/mocha/system.inc.php @@ -22,6 +22,11 @@ require("ui/DisplayOption.inc.php"); require("ui/ElementContent.inc.php"); - require("ui/renderers/HTMLRenderer.inc.php"); + require("ui/ValidationResult.inc.php"); + + require("ui/renderers/html/HTMLRenderer.inc.php"); + + require("ui/tasks/Task.inc.php"); + require("ui/tasks/HardcodedTask.inc.php"); ?> \ No newline at end of file diff --git a/php/mocha/lib/mocha/ui/ValidationResult.inc.php b/php/mocha/lib/mocha/ui/ValidationResult.inc.php new file mode 100644 index 0000000..e8a48b5 --- /dev/null +++ b/php/mocha/lib/mocha/ui/ValidationResult.inc.php @@ -0,0 +1,20 @@ +ValidationInstance = $validationInstance; + $this->Title = $title; + $this->Message = $message; + } + + } +?> \ No newline at end of file diff --git a/php/mocha/lib/mocha/ui/renderers/HTMLRenderer.inc.php b/php/mocha/lib/mocha/ui/renderers/HTMLRenderer.inc.php deleted file mode 100644 index bab5079..0000000 --- a/php/mocha/lib/mocha/ui/renderers/HTMLRenderer.inc.php +++ /dev/null @@ -1,357 +0,0 @@ -Context = $context; - } - /** - * Thanks https://stackoverflow.com/a/31107425 - * - * Generate a random string, using a cryptographically secure - * pseudorandom number generator (random_int) - * - * This function uses type hints now (PHP 7+ only), but it was originally - * written for PHP 5 as well. - * - * For PHP 7, random_int is a PHP core function - * For PHP 5.x, depends on https://github.com/paragonie/random_compat - * - * @param int $length How many characters do we want? - * @param string $keyspace A string of all possible characters - * to select from - * @return string - */ - private function random_str(int $length = 64, string $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ) : string - { - if ($length < 1) - { - throw new \RangeException("Length must be a positive integer"); - } - $pieces = []; - $max = \mb_strlen($keyspace, '8bit') - 1; - for ($i = 0; $i < $length; ++$i) - { - $pieces[] = $keyspace[\random_int(0, $max)]; - } - return \implode('', $pieces); - } - - public function getElementContentValue(InstanceReference $elementContent, $defaultValue = null) - { - if (isset($_POST["ec_" . $elementContent->InstanceKey])) - { - return $_POST["ec_" . $elementContent->InstanceKey]; - } - return $defaultValue; - } - - public function processPostback(InstanceReference $element) - { - /** - * @var MySQLDatabaseOms - */ - $oms = mocha_get_oms(); - - $ec_UserName = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::ElementContent__UserNameForLoginPage); - $ec_Password = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::ElementContent__PasswordForLoginPage); - - // $ct = $oms->getRelatedInstance($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__processed_by__Control_Transaction_Method)); - // Login Page@ Login Page Edit(CT)*S - // uses Build Response Method Binding... - // - - $userName = $this->getElementContentValue($ec_UserName); // $_POST["ec_56$4"]; - $password = $this->getElementContentValue($ec_Password); // $_POST["ec_56$5"]; - - $mbUser__get__User_for_User_Name_parm = $oms->getInstanceByGlobalIdentifier(KnownMethodBindingGuids::User__get__User_for_User_Name_parm); - if ($mbUser__get__User_for_User_Name_parm === null) - { - echo("`User@get User for User Name parm`: method not found ('" . KnownMethodBindingGuids::User__get__User_for_User_Name_parm . "')");die(); - } - $mbUser__get__User_for_User_Name_parm = $mbUser__get__User_for_User_Name_parm->asMethodBinding(); - - $instUser = $mbUser__get__User_for_User_Name_parm->executeReturningInstanceSet(array( KnownAttributeGuids::UserName => $userName )); - if ($instUser !== null) - { - $passwordSalt = $oms->getAttributeValue($instUser, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::PasswordSalt)); - $passwordHashExpected = $oms->getAttributeValue($instUser, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::PasswordHash)); - $passwordHashActual = hash('sha512', $password . $passwordSalt); - - if ($passwordHashExpected == $passwordHashActual) - { - $token = $this->random_str(); - - // create the instance of `User Login` - $instLogin = $oms->createInstanceOf($oms->getInstanceByGlobalIdentifier(KnownClassGuids::UserLogin)); - if ($instLogin !== null) - { - $oms->setAttributeValue($instLogin, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::Token), $token); - $oms->assignRelationship($instLogin, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::User_Login__has__User), $instUser); - } - $_SESSION["user_token_" . $oms->getTenant()->ID] = $token; - - System::Redirect("~/d/home.htmld"); - exit(); - } - else - { - //$this->Page->GetControlByID("literal1")->EnableRender = true; - - //System::RedirectToLoginPage(true); - } - } - $ecPasswordMsg = $oms->getInstanceByGlobalIdentifier("684f1e039ecd43d58acadcf5b84c71f8"); - $this->Context->setElementParm($ecPasswordMsg, "visible", true); - } - - public function shouldRenderElementContent(InstanceReference $elementContent) - { - /** - * @var MySQLDatabaseOms - */ - $oms = mocha_get_oms(); - if ($this->Context->getElementParm($elementContent, "visible", false)) - { - return true; - } - - $displayOptions = $oms->getRelatedInstances($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option)); - if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__DoNotShow))) - return false; - - if (!$this->Context->getElementParm($elementContent, "visible", true)) - { - return false; - } - - return true; - } - - public function renderElementContent(InstanceReference $elementContent) - { - /** - * @var MySQLDatabaseOms - */ - $oms = mocha_get_oms(); - - $ecInst = $oms->getRelatedInstance($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Instance)); - if ($ecInst === null) - { - } - else - { - if ($this->shouldRenderElementContent($elementContent)) - { - $this->renderBeginTag("tr", [ "data-instance-id" => $elementContent->InstanceKey ], [ "mcx-elementcontent" ]); - - $ecPClass = $oms->getParentClass($ecInst); - $title = $oms->getAttributeValue($ecInst, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::Name)); - - //!HACK - if ($ecInst->InstanceKey->ClassIndex == 6) - { - // ELements should not have a title - $title = ""; - } - - echo(""); - $displayOptions = $oms->getRelatedInstances($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option)); - if (!$oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__WideText))) - { - $this->renderBeginTag("td"); - if (!$oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__DoNotShowLabel))) - { - echo (""); - } - $this->renderEndTag("td"); - $this->renderBeginTag("td"); - } - else - { - $this->renderBeginTag("td", [ "colspan" => "2" ]); - } - - if (strtolower($ecPClass->GlobalIdentifier) == strtolower(KnownClassGuids::Element)) - { - $this->renderElement($ecInst, $displayOptions); - } - else if (strtolower($ecPClass->GlobalIdentifier) == strtolower(KnownClassGuids::TextAttribute)) - { - if (!$oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__NotEnterable))) - { - $this->renderTextAttribute($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText))); - } - else - { - // get the default value of the Text Attribute ( the Text Attribute `Value` on the EC text attribute ) - $value = $oms->getAttributeValue($ecInst, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::Value)); - echo($value); - } - } - else - { - echo ("unknown pclass ident " . $ecPClass->GlobalIdentifier . ""); - } - echo (""); - $this->renderEndTag("tr"); - } - } - } - - public function renderTextAttribute(InstanceReference $ec, InstanceReference $inst, $password = false) - { - $ecid = $ec->InstanceKey; - echo(""); - } - - public function renderArray(?array $array, string $separator, string $prefix = "", string $suffix = "") - { - if ($array === null) - return ""; - if (\count($array) > 0) - { - return $prefix . \implode($separator, $array) . $suffix; - } - return ""; - } - - public function renderKeyedArray(?array $array, string $separator, string $prefix = "", string $suffix = "", string $partSeparator = "", string $keyPrefix = "", string $keySuffix = "", string $valuePrefix = "", string $valueSuffix = "") - { - if ($array === null) - return ""; - - if (\count($array) > 0) - { - $str = $prefix; - foreach ($array as $key => $value) - { - $str .= $keyPrefix . $key . $keySuffix; - $str .= $partSeparator; - $str .= $valuePrefix . $value . $valueSuffix; - $str .= $separator; - } - $str .= $suffix; - return $str; - } - return ""; - } - - public function renderInitialElement(InstanceReference $element) - { - /** - * @var MySQLDatabaseOms - */ - $oms = mocha_get_oms(); - - $metaCharset = "UTF-8"; - $metaAttributes = []; - $metaAttributes["viewport"] = "width=device-width, initial-scale=1.0"; - - echo (""); - echo (""); - echo (""); - foreach ($metaAttributes as $key => $value) - { - echo (""); - } - echo (""); - echo(""); - echo(""); - echo("
"); - - $DO_Singular = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Singular); - $this->renderElement($element, [ $DO_Singular ]); - - echo("
"); - echo (""); - echo("
"); - echo ("
"); - echo(""); - } - - public function renderBeginTag($tagName, ?array $attributeList = null, ?array $classList = null) - { - echo ("<" . $tagName . $this->renderArray($classList, " ", " class=\"", "\"") . $this->renderKeyedArray($attributeList, " ", " ", "", "=", "", "", "\"", "\"") . ">"); - } - public function renderEndTag($tagName) - { - echo (""); - } - - public function renderElement(InstanceReference $element, array $displayOptions) - { - /** - * @var MySQLDatabaseOms - */ - $oms = mocha_get_oms(); - - if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ShowSubelementsVertically))) - { - $this->renderBeginTag("table", [ "data-instance-id" => $element->InstanceKey ], [ "uwt-formview", "mcx-element" ]); - - $contents = $oms->getRelatedInstances($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content)); - foreach ($contents as $content) - { - $this->renderElementContent($content); - } - $this->renderEndTag ("table"); - } - else - { - if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Singular))) - { - $contents = $oms->getRelatedInstances($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content)); - foreach ($contents as $content) - { - $this->renderElementContent($content); - } - } - else - { - $this->renderBeginTag("table", [ "data-instance-id" => $element->InstanceKey ], [ "uwt-listview", "mcx-element" ]); - - $this->renderBeginTag(""); - $contents = $oms->getRelatedInstances($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content)); - foreach ($contents as $content) - { - $this->renderBeginTag(""); - $this->renderElementContent($content); - $this->renderEndTag(""); - } - $this->renderEndTag(""); - - $this->renderEndTag("table"); - } - } - } - - } -?> \ No newline at end of file diff --git a/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php b/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php new file mode 100644 index 0000000..8fe0cee --- /dev/null +++ b/php/mocha/lib/mocha/ui/renderers/html/HTMLRenderer.inc.php @@ -0,0 +1,761 @@ +Context = $context; + $this->FailedValidations = []; + $this->FailedValidationElements = []; + $this->IsPostback = false; + $this->StyleClasses = []; + } + /** + * Thanks https://stackoverflow.com/a/31107425 + * + * Generate a random string, using a cryptographically secure + * pseudorandom number generator (random_int) + * + * This function uses type hints now (PHP 7+ only), but it was originally + * written for PHP 5 as well. + * + * For PHP 7, random_int is a PHP core function + * For PHP 5.x, depends on https://github.com/paragonie/random_compat + * + * @param int $length How many characters do we want? + * @param string $keyspace A string of all possible characters + * to select from + * @return string + */ + private function random_str(int $length = 64, string $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ) : string + { + if ($length < 1) + { + throw new \RangeException("Length must be a positive integer"); + } + $pieces = []; + $max = \mb_strlen($keyspace, '8bit') - 1; + for ($i = 0; $i < $length; ++$i) + { + $pieces[] = $keyspace[\random_int(0, $max)]; + } + return \implode('', $pieces); + } + + public function getElementContentValue(InstanceReference $elementContent, $defaultValue = null) + { + if (isset($_POST["ec_" . $elementContent->InstanceKey])) + { + return $_POST["ec_" . $elementContent->InstanceKey]; + } + return $defaultValue; + } + + public function renderTask(InstanceReference $task, InstanceReference $relatedInstance) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + $parentClass = $oms->getParentClass($task); + if ($parentClass->GlobalIdentifier == KnownClassGuids::HardcodedTask) + { + $className = $oms->getAttributeValue($task, KnownAttributeGuids::ClassName); + $taskClass = null; + try + { + $taskClass = new $className($task, $relatedInstance); + } + catch (\Error $ex) + { + } + + if ($taskClass !== null) + { + $value = $taskClass->Render(); + if ($value instanceof InstanceReference) + { + $pc = $oms->getParentClass($value); + if ($pc->GlobalIdentifier == KnownClassGuids::Element) + { + $this->renderInitialElement($value); + } + } + else if (is_string($value)) + { + echo($value); + } + } + else + { + echo("could not find hardcoded task class '" . $className . "'"); + } + } + } + + public function processPostback(InstanceReference $element) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + if (is_callable($this->ProcessPostbackFunction)) + { + // call user-defined ProcessPostbackFunction + return call_user_func($this->ProcessPostbackFunction, $this, $element); + } + else + { + $ecs = array(); + foreach ($_POST as $key => $value) + { + if (str_starts_with($key, "ec_")) + { + $ecid = substr($key, 3); + $ecs[$ecid] = $value; + } + } + + $result = null; + foreach ($ecs as $key => $value) + { + $inst_ec = $oms->getInstanceByKey(InstanceKey::Parse($key)); + if (!$this->checkValidationsForElementContent($inst_ec, $value)) + { + $result = false; + } + } + + if ($result === false) + { + return false; + } + + if (is_callable($this->ProcessUpdatesFunction)) + { + // call user-defined ProcessUpdatesFunction + return call_user_func($this->ProcessUpdatesFunction, $this, $element); + } + else + { + // process updates + foreach ($ecs as $key => $value) + { + $inst_ec = $oms->getInstanceByKey(InstanceKey::Parse($key)); + if (!$this->processUpdatesForElementContent($inst_ec, $value)) + { + return false; + } + } + } + } + } + + /** + * @return true if the validation passes; false otherwise + */ + private function checkValidationForElementContent(InstanceReference $elementContent, string $value, InstanceReference $validation) + { + return true; + } + + /** + * @return true if the validations pass (or there are no validations); false otherwise. + */ + private function checkValidationsForElementContent(InstanceReference $elementContent, string $value) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + $displayOptions = $oms->getRelatedInstances($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option)); + if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Required))) + { + // this is a required parm + if ($value == null) + { + $this->FailedValidations[] = new ValidationResult(null, "Missing required parameter", $oms->getAttributeValue($elementContent, KnownAttributeGuids::Label)); + $this->FailedValidationElements[] = $elementContent; + return false; + } + } + + $validations = $oms->getRelatedInstances($elementContent, KnownRelationshipGuids::Element_Content__has__Validation); + foreach ($validations as $validation) + { + if (!$this->checkValidationForElementContent($elementContent, $value, $validation)) + { + $this->FailedValidations[] = new ValidationResult($validation, null, null); + $this->FailedValidationElements[] = $elementContent; + return false; + } + } + return true; + } + + private function processUpdatesForElementContent(InstanceReference $elementContent, string $value) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + /* + if (!$oms->getAttributeValue($inst_ec, KnownAttributeGuids::DoNotUpdateOnSubmit)) + { + */ + $inst_target = $oms->getRelatedInstance($elementContent, KnownRelationshipGuids::Element_Content__has__Instance); + + /* + $value = $oms->getAttributeValue($this->TargetInstance, $ecInst); + if ($value === null) + { + $value = $oms->getAttributeValue($inst_target, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::Value)); + } + */ + + $oms->setAttributeValue($inst_target, KnownAttributeGuids::Value, $value); + /* + } + */ + return true; + } + + public function shouldRenderElementContentLabel(InstanceReference $elementContent) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + $displayOptions = $oms->getRelatedInstances($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option)); + + if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__WideText))) + { + return false; + } + $ecLayout = $oms->getRelatedInstance($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Layout)); + if ($ecLayout !== null) + { + $ecLayoutParentClass = $oms->getParentClass($ecLayout); + if ($ecLayoutParentClass !== null) + { + if ( + ($ecLayoutParentClass->GlobalIdentifier == KnownClassGuids::ButtonLayout) + || ($ecLayoutParentClass->GlobalIdentifier == KnownClassGuids::ImageLayout) + ) + { + return false; + } + } + } + return true; + } + + public function shouldRenderElementContent(InstanceReference $elementContent) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + if ($this->Context->getElementParm($elementContent, "visible", false)) + { + return true; + } + + $displayOptions = $oms->getRelatedInstances($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option)); + if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__DoNotShow))) + return false; + + if (!$this->Context->getElementParm($elementContent, "visible", true)) + { + return false; + } + + return true; + } + + public function buildStyleAttribute(array $constantStyles, array $stylesFromInstanceSet) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + $str = ""; + foreach ($constantStyles as $key => $value) + { + $str .= $key . ": " . $value . ";"; + } + foreach ($stylesFromInstanceSet as $ir) + { + # $styleHasStyleRule = $oms->getRelatedInstances($ir, KnownRelationshipGuids::Style__has__Style_Rule); + $styleHasWidthAttr = $oms->getAttributeValue($ir, KnownRelationshipGuids::Style__has_width__Measurement); + if ($styleHasWidthAttr !== null) + { + + } + $styleHasHeightAttr = $oms->getAttributeValue($ir, KnownRelationshipGuids::Style__has_height__Measurement); + if ($styleHasHeightAttr !== null) + { + + } + } + } + + public function renderElementContent(InstanceReference $elementContent) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + $ecInst = $oms->getRelatedInstance($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Instance)); + $ecLayout = $oms->getRelatedInstance($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Layout)); + if ($ecLayout !== null) + { + $ecStyles = $oms->getRelatedInstances($ecLayout, KnownRelationshipGuids::Layout__has__Style); + + $ecLayoutParentClass = $oms->getParentClass($ecLayout); + if ($ecLayoutParentClass !== null) + { + if ($ecLayoutParentClass->GlobalIdentifier == KnownClassGuids::ButtonLayout) + { + // override layout : button + echo (""); + // TODO: get Translatable label text from EC + $attrLabel = $oms->getAttributeValue($elementContent, KnownAttributeGuids::Label, "NO_LABEL_" . $elementContent->InstanceKey); + echo ($attrLabel); + echo (""); + } + else if ($ecLayoutParentClass->GlobalIdentifier == KnownClassGuids::ImageLayout) + { + // override layout : image + echo ("
getAttributeValue($ecInst, KnownAttributeGuids::ContentType); + $attrContentEncoding = $oms->getAttributeValue($ecInst, KnownAttributeGuids::Encoding); + $attrValue = $oms->getAttributeValue($ecInst, KnownAttributeGuids::Value); + + echo ($this->buildStyleAttribute([ + "background-image" => "url('data:" . $attrContentType . ";" . $attrContentEncoding . "," . $attrValue . "')" + ], $ecStyles)); + echo("\"> 
"); + } + } + } + else + { + // default layout + if ($ecInst === null) + { + } + else + { + if ($this->shouldRenderElementContent($elementContent)) + { + $displayOptions = $oms->getRelatedInstances($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option)); + + $ecPClass = $oms->getParentClass($ecInst); + if (strtolower($ecPClass->GlobalIdentifier) == strtolower(KnownClassGuids::Element)) + { + $this->renderElement($ecInst, $displayOptions); + } + else if (strtolower($ecPClass->GlobalIdentifier) == strtolower(KnownClassGuids::Relationship)) + { + if (!$oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__NotEnterable))) + { + //$this->renderRelationship($ecInst); + } + else + { + // get the current value of the relationship + $value = $oms->getRelatedInstances($this->TargetInstance, $ecInst); + if (count($value) > 0) + { + $this->renderBeginTag("ul"); + + $this->renderBeginTag("li"); + $this->renderEndTag("li"); + + + $this->renderEndTag("ul"); + } + else + { + echo("(empty)"); + } + } + } + else if (strtolower($ecPClass->GlobalIdentifier) == strtolower(KnownClassGuids::TextAttribute)) + { + $value = $oms->getAttributeValue($this->TargetInstance, $ecInst); + if ($value === null) + { + $value = $oms->getAttributeValue($ecInst, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::Value)); + } + + if ($this->IsPostback && isset($_POST["ec_" . strval($elementContent->InstanceKey)])) + { + $value = $_POST["ec_" . strval($elementContent->InstanceKey)]; + } + + if (!$oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__NotEnterable))) + { + $this->renderTextAttribute($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value); + } + else + { + echo($value); + } + } + else + { + echo ("unknown pclass ident " . $ecPClass->GlobalIdentifier . ""); + } + echo (""); + } + } + } + } + + public function renderTextAttribute(InstanceReference $ec, InstanceReference $inst, $password = false, $value = null) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + $displayOptions = $oms->getRelatedInstances($ec, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option)); + + $ecid = $ec->InstanceKey; + + $p = new \Phast\WebControl(); + $p->TagName = "input"; + $p->ClientID = "ec_" . $ecid; + $p->Attributes[] = new \Phast\WebControlAttribute("name", "ec_" . $ecid); + $p->Attributes[] = new \Phast\WebControlAttribute("data-ecid", $ecid); + $p->Attributes[] = new \Phast\WebControlAttribute("value", $value); + + if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Required))) + { + $p->ClassList[] = "uwt-required"; + } + if ($this->IsPostback && $oms->instanceSetContains($this->FailedValidationElements, $ec)) + { + $p->ClassList[] = "uwt-failed-validation"; + } + + $maxLength = $inst->getAttributeValue(KnownAttributeGuids::MaximumLength); + if ($maxLength !== null) + { + $p->Attributes[] = new \Phast\WebControlAttribute("maxlength", $maxLength); + } + $p->HasContent = false; + $attType = new \Phast\WebControlAttribute("type", "text"); + if ($password) + { + $attType->Value = "password"; + } + $p->Attributes[] = $attType; + $p->Render(); + } + + public function renderArray(?array $array, string $separator, string $prefix = "", string $suffix = "") + { + if ($array === null) + return ""; + if (\count($array) > 0) + { + return $prefix . \implode($separator, $array) . $suffix; + } + return ""; + } + + public function renderKeyedArray(?array $array, string $separator, string $prefix = "", string $suffix = "", string $partSeparator = "", string $keyPrefix = "", string $keySuffix = "", string $valuePrefix = "", string $valueSuffix = "") + { + if ($array === null) + return ""; + + if (\count($array) > 0) + { + $str = $prefix; + foreach ($array as $key => $value) + { + $str .= $keyPrefix . $key . $keySuffix; + $str .= $partSeparator; + $str .= $valuePrefix . $value . $valueSuffix; + $str .= $separator; + } + $str .= $suffix; + return $str; + } + return ""; + } + + public function renderInitialElement(InstanceReference $element) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + $metaCharset = "UTF-8"; + $metaAttributes = []; + $metaAttributes["viewport"] = "width=device-width, initial-scale=1.0"; + + echo (""); + $this->renderBeginTag("html", array("xmlns" => "http://www.w3.org/1999/xhtml")); + $this->renderBeginTag("head"); + echo (""); + foreach ($metaAttributes as $key => $value) + { + echo (""); + } + + $applicationTitle = "Mocha"; // TOOD: get tenant application title + $pageTitle = null; + $pageTitle = $oms->getAttributeValue($element, KnownAttributeGuids::Label); + + if ($pageTitle !== null && $applicationTitle !== null) + { + $title = $pageTitle . " - " . $applicationTitle; + } + else if ($pageTitle !== null) + { + $title = $pageTitle; + } + else if ($applicationTitle !== null) + { + $title = $applicationTitle; + } + + $this->renderBeginTag("title"); + echo($title); + $this->renderEndTag("title"); + echo(""); + $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")); + echo("System.BasePath = '" . System::GetConfigurationValue("Application.BasePath") . "';"); + echo("System.IsTenantedHostingEnabled = function() { return false; };"); + echo("System.TenantName = '" . $oms->getTenantName() . "';"); + $this->renderEndTag("script"); + $this->renderEndTag("head"); + $bodyClasses = []; + foreach ($this->StyleClasses as $className) + { + $bodyClasses[] = $className; + } + if ($this->IsPostback) + { + $bodyClasses[] = "uwt-postback"; + } + $this->renderBeginTag("body", null, $bodyClasses); + if ($this->IsPostback) + { + echo("
"); + if (count($this->FailedValidations) > 0) + { + foreach ($this->FailedValidations as $validation) + { + $ik = ""; + echo("
"); + echo("
" . $validation->Title . "
"); + echo("
" . $validation->Message . "
"); + echo("
"); + } + } + else + { + echo("
"); + echo("
Saved
"); + echo("
"); + } + echo("
"); + } + echo("
"); + + $DO_Singular = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Singular); + $this->renderElement($element, [ $DO_Singular ]); + + echo("
"); + echo (""); + echo("
"); + echo ("
"); + $this->renderEndTag("body"); + $this->renderEndTag("html"); + } + + public function renderTag($tagName, ?array $attributeList = null, ?array $classList = null) + { + $canBeEmpty = true; + if ($tagName == "script") + { + $canBeEmpty = false; + } + + if ($canBeEmpty) + { + echo ("<" . $tagName . $this->renderArray($classList, " ", " class=\"", "\"") . $this->renderKeyedArray($attributeList, " ", " ", "", "=", "", "", "\"", "\"") . " />"); + } + else + { + $this->renderBeginTag($tagName, $attributeList, $classList); + $this->renderEndTag($tagName); + } + } + + public function renderBeginTag($tagName, ?array $attributeList = null, ?array $classList = null) + { + echo ("<" . $tagName . $this->renderArray($classList, " ", " class=\"", "\"") . $this->renderKeyedArray($attributeList, " ", " ", "", "=", "", "", "\"", "\"") . ">"); + } + public function renderEndTag($tagName) + { + echo (""); + } + + public function renderElement(InstanceReference $element, array $displayOptions) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ShowSubelementsVertically))) + { + $this->renderBeginTag("table", [ "data-instance-id" => $element->InstanceKey ], [ "uwt-formview", "mcx-element" ]); + + $contents = $oms->getRelatedInstances($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content)); + foreach ($contents as $elementContent) + { + if (!$this->shouldRenderElementContent($elementContent)) + { + continue; + } + + $mcx_classes = [ "mcx-elementcontent" ]; + if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Required))) + { + $mcx_classes[] = "mcx-required"; + } + if ($this->IsPostback && $oms->instanceSetContains($this->FailedValidationElements, $elementContent)) + { + $mcx_classes[] = "mcx-failed-validation"; + } + + $ecInst = $oms->getRelatedInstance($elementContent, KnownRelationshipGuids::Element_Content__has__Instance); + $this->renderBeginTag("tr", [ "data-instance-id" => $ecInst->InstanceKey, "data-ecid" => $elementContent->InstanceKey ], $mcx_classes); + + $title = $oms->getAttributeValue($ecInst, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::Name)); + $label = $oms->getAttributeValue($elementContent, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::Label)); + + //!HACK + if ($ecInst->InstanceKey->ClassIndex == 6) + { + // ELements should not have a title + $title = ""; + } + if ($label !== null) + { + $title = $label; + } + + if ($this->shouldRenderElementContentLabel($elementContent)) + { + $this->renderBeginTag("td"); + if (!$oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__DoNotShowLabel))) + { + echo (""); + } + $this->renderEndTag("td"); + $this->renderBeginTag("td"); + } + else + { + $this->renderBeginTag("td", [ "colspan" => "2" ]); + } + + $this->renderElementContent($elementContent); + + $this->renderEndTag("td"); + + $this->renderEndTag("tr"); + } + $this->renderEndTag ("table"); + } + else + { + if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Singular))) + { + $contents = $oms->getRelatedInstances($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content)); + foreach ($contents as $content) + { + $this->renderElementContent($content); + } + } + else + { + $this->renderBeginTag("table", [ "data-instance-id" => $element->InstanceKey ], [ "uwt-listview", "mcx-element" ]); + + $this->renderBeginTag("tr"); + $contents = $oms->getRelatedInstances($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content)); + foreach ($contents as $content) + { + $this->renderBeginTag("td"); + $this->renderElementContent($content); + $this->renderEndTag("td"); + } + $this->renderEndTag("tr"); + + $this->renderEndTag("table"); + } + } + } + + } +?> \ No newline at end of file diff --git a/php/mocha/lib/mocha/ui/task/HardcodedTask.inc.php b/php/mocha/lib/mocha/ui/task/HardcodedTask.inc.php new file mode 100644 index 0000000..3757774 --- /dev/null +++ b/php/mocha/lib/mocha/ui/task/HardcodedTask.inc.php @@ -0,0 +1,38 @@ +TaskInstance = $instTask; + $this->RelatedInstance = $instRelatedInstance; + } + + protected function OnProcessUpdates() + { + + } + + protected function OnRender() + { + } + + public function Render() + { + return $this->OnRender(); + } + + public function ProcessUpdates() + { + $this->OnProcessUpdates(); + } + + } + +?> \ No newline at end of file diff --git a/php/mocha/lib/mocha/ui/task/Task.inc.php b/php/mocha/lib/mocha/ui/task/Task.inc.php new file mode 100644 index 0000000..462b638 --- /dev/null +++ b/php/mocha/lib/mocha/ui/task/Task.inc.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/php/mocha/scripts/mcx_elementcontent.js b/php/mocha/scripts/mcx_elementcontent.js new file mode 100644 index 0000000..4dd1555 --- /dev/null +++ b/php/mocha/scripts/mcx_elementcontent.js @@ -0,0 +1,89 @@ +function McxElementContent(parentElement) +{ + this.ParentElement = parentElement; + this.LabelTd = this.ParentElement.children[0]; + this.LabelElement = this.LabelTd.children[0]; + + this.InstanceID = this.ParentElement.getAttribute("data-instance-id"); + this.ECID = this.ParentElement.getAttribute("data-ecid"); + + if (this.LabelElement) + { + this.LabelElement.NativeObject = this; + this.LabelElement.addEventListener("contextmenu", function(e) + { + var cm = new ContextMenu(); + var ecid = this.NativeObject.ECID; + var iid = this.NativeObject.InstanceID; + cm.Items = [ + + { + "JJJJ": this.NativeObject, + "ClassName": "MenuItemCommand", + "Title": "Show Field Properties", + "Visible": true, + "Execute": function() + { + var popup = Popup.create(this.JJJJ.LabelTd); + + var listview = ListView.create(popup.ParentElement, { + "columns": [ + { + "id": "ecid", + "title": "ECID" + }, + { + "id": "iid", + "title": "Instance ID" + } + ], + "items": [ + { + "columns": [ + { + "id": "ecid", + "value": ecid + }, + { + "id": "iid", + "value": iid + } + ] + } + ] + }); + popup.ParentElement.appendChild(listview.ParentElement); + + popup.Show(); + } + }, + { + "ClassName": "MenuItemCommand", + "Title": "Show Field EC", + "Visible": true, + "Execute": function() + { + window.open(System.ExpandRelativePath("~/" + System.TenantName + "/d/inst/1$56/" + ecid + ".htmld")); + } + } + + ]; + cm.Show(e.clientX, e.clientY, this); + + + e.preventDefault(); + e.stopPropagation(); + return false; + }); + } +} + +window.addEventListener("load", function() +{ + + var items = document.getElementsByClassName("mcx-elementcontent"); + 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/mocha.js.php b/php/mocha/scripts/mocha.js.php new file mode 100644 index 0000000..aff0216 --- /dev/null +++ b/php/mocha/scripts/mocha.js.php @@ -0,0 +1,55 @@ + \ No newline at end of file diff --git a/php/mocha/scripts/phast b/php/mocha/scripts/phast new file mode 120000 index 0000000..97a5d91 --- /dev/null +++ b/php/mocha/scripts/phast @@ -0,0 +1 @@ +/home/beckermj/Documents/Projects/phast/lib/phast/client/scripts \ No newline at end of file diff --git a/php/mocha/themes/clearview/uwt-alert.less b/php/mocha/themes/clearview/uwt-alert.less new file mode 100644 index 0000000..05ddf11 --- /dev/null +++ b/php/mocha/themes/clearview/uwt-alert.less @@ -0,0 +1,32 @@ +div.uwt-alert +{ + padding: .75rem 1.25rem; + margin-bottom: 1rem; + border: 1px solid transparent; + border-radius: .25rem; + + &.uwt-color-success + { + background-color: #d4edda; + border-color: #c3e6cb; + color: #155724; + } + &.uwt-color-info + { + background-color: #d1ecf1; + border-color: #bee5eb; + color: #0c5460; + } + &.uwt-color-warning + { + background-color: #fff3cd; + border-color: #ffeeba; + color: #856404; + } + &.uwt-color-danger + { + background-color: #f8d7da; + border-color: #f5c6cb; + color: #721c24; + } +} \ No newline at end of file diff --git a/php/mocha/themes/clearview/uwt-button.less b/php/mocha/themes/clearview/uwt-button.less index bafa033..6b314e4 100644 --- a/php/mocha/themes/clearview/uwt-button.less +++ b/php/mocha/themes/clearview/uwt-button.less @@ -1,11 +1,21 @@ .uwt-button { background-color: #fff; - border: solid 1px #d2d2d2; + border: solid 1px rgb(231, 234, 236); + color: inherit; + padding: 6px; min-width: 80px; min-height: 24px; text-decoration: none; + transition: all 0.3s; + + &:hover + { + border-color: rgb(210, 210, 210); + color: inherit; + text-decoration: none; + } } .uwt-button.uwt-color-primary { diff --git a/php/mocha/themes/clearview/uwt-popup.less b/php/mocha/themes/clearview/uwt-popup.less new file mode 100644 index 0000000..bb70c31 --- /dev/null +++ b/php/mocha/themes/clearview/uwt-popup.less @@ -0,0 +1,44 @@ +.uwt-popup +{ + background-color: #fff; + border: medium none; + border-radius: 3px; + box-shadow: 0 0 3px rgba(86, 96, 117, 0.7); + position: fixed; + + transition: all 0.3s; + + &:not(.uwt-visible) + { + opacity: 0; + visibility: hidden; + } +} + +ul.uwt-menu +{ + list-style-type: none; + padding: 0px; + margin: 0px; + + &> li + { + &> a + { + border-radius: 3px; + color: #262626; + font-weight: normal; + display: block; + margin: 4px; + padding: 3px 20px; + text-decoration: none; + + &:hover + { + background-color: #f5f5f5; + text-decoration: none; + } + } + + } +} \ No newline at end of file diff --git a/php/mocha/themes/clearview/uwt.less b/php/mocha/themes/clearview/uwt.less index 6364d97..6f8b9e9 100644 --- a/php/mocha/themes/clearview/uwt.less +++ b/php/mocha/themes/clearview/uwt.less @@ -1,3 +1,6 @@ +@import "../common/styles/uwt.less"; + +@import "uwt-alert.less"; @import "uwt-badge.less"; @import "uwt-button.less"; @import "uwt-colors.less"; @@ -8,6 +11,7 @@ @import "uwt-listbox.less"; @import "uwt-listview.less"; @import "uwt-panel.less"; +@import "uwt-popup.less"; @import "uwt-textbox.less"; @import "uwt-toolbar.less"; @@ -20,4 +24,13 @@ @import "../common/fonts/awesome/css/all.min.css"; -@import "../common/styles/mochahacks.less"; \ No newline at end of file +@import "../common/styles/mochahacks.less"; + +body.uwt-postback +{ + input.uwt-failed-validation + { + border: solid 1px var(--uwt-color-danger) !important; + box-shadow: 0px 0px 4px var(--uwt-color-danger) !important; + } +} \ No newline at end of file diff --git a/php/mocha/themes/common/styles/mochahacks.less b/php/mocha/themes/common/styles/mochahacks.less index 2986fe0..32f9490 100644 --- a/php/mocha/themes/common/styles/mochahacks.less +++ b/php/mocha/themes/common/styles/mochahacks.less @@ -15,9 +15,27 @@ body /* overflow: hidden; */ } -body.login-page +body.mcx-loginpage { justify-content: center; + form + { + margin-top: 64px; + align-items: flex-start; + + width: 640px; + margin-left: auto; + margin-right: auto; + + background-color: #ffffff; + padding: 15px 20px 20px 20px; + border: 1px solid #e7eaec; + + &> table.uwt-formview + { + margin-top: 32px; + } + } } img.header-image @@ -25,22 +43,6 @@ img.header-image width: 128px; } -/* -div.login-container -{ - margin-top: 64px; - align-items: flex-start; - - width: 640px; - margin-left: auto; - margin-right: auto; - border: solid 1px #1ab394; -} -div.login-container > table.uwt-formview -{ - margin-top: 32px; -} -*/ @media (min-width: 1000px) { div.login-container @@ -143,4 +145,13 @@ div.mcx-element display: flex; flex-direction: column; } -} \ No newline at end of file +} + +.mcx-required label::after +{ + content: '*'; + float: right; + color: #f00; + font-size: 24pt; + font-weight: normal; +} diff --git a/php/mocha/themes/common/styles/uwt-alert.less b/php/mocha/themes/common/styles/uwt-alert.less index 37ebd50..41c106e 100644 --- a/php/mocha/themes/common/styles/uwt-alert.less +++ b/php/mocha/themes/common/styles/uwt-alert.less @@ -6,4 +6,16 @@ body > div.uwt-alert-container min-width: 320px; z-index: 100; +} + +div.uwt-alert +{ + position: relative; + transition: all 1s; + right: 0px; + + &> div.uwt-title + { + font-weight: bold; + } } \ No newline at end of file diff --git a/php/mocha/themes/common/styles/uwt-button.less b/php/mocha/themes/common/styles/uwt-button.less index 0f0bdf7..834d3ce 100644 --- a/php/mocha/themes/common/styles/uwt-button.less +++ b/php/mocha/themes/common/styles/uwt-button.less @@ -1,7 +1,7 @@ // @ButtonSelector: 'a.uwt-button, button, input[type=button], input[type=submit], input[type=reset], div.uwt-button > a'; // (~'@{ButtonSelector}') -a.uwt-button, button, input[type=button], input[type=submit], input[type=reset], div.uwt-button > a +.uwt-button /* , button, input[type=button], input[type=submit], input[type=reset], div.uwt-button > a */ { display: inline-block; font-weight: 400; @@ -19,13 +19,16 @@ a.uwt-button, button, input[type=button], input[type=submit], input[type=reset], min-width: 80px; - margin-right: 6px; + &+ .uwt-button + { + margin-right: 6px; + } } div.uwt-button-group { //(~'@{ButtonSelector}') - a.uwt-button, button, input[type=button], input[type=submit], input[type=reset], div.uwt-button > a + .uwt-button /*, button, input[type=button], input[type=submit], input[type=reset], div.uwt-button > a */ { margin-right: 0px; } diff --git a/php/mocha/themes/common/styles/uwt-footer.less b/php/mocha/themes/common/styles/uwt-footer.less index fd5fab2..707fb92 100644 --- a/php/mocha/themes/common/styles/uwt-footer.less +++ b/php/mocha/themes/common/styles/uwt-footer.less @@ -15,4 +15,4 @@ body > div.uwt-footer, body > form > div.uwt-footer padding: 16px; */ } -} \ No newline at end of file +} diff --git a/php/mocha/themes/common/styles/uwt-formview.less b/php/mocha/themes/common/styles/uwt-formview.less index e9f3fd1..89c6be9 100644 --- a/php/mocha/themes/common/styles/uwt-formview.less +++ b/php/mocha/themes/common/styles/uwt-formview.less @@ -2,10 +2,10 @@ table.uwt-formview { border-collapse: collapse; - &:not(.uwt-expand) - { - display: inline-block; - } + // &:not(.uwt-expand) + // { + // display: inline-block; + // } &> tr > td, &> thead > tr > td, &> tbody > tr > td { @@ -14,8 +14,11 @@ table.uwt-formview vertical-align: top; &:first-child { - font-weight: bold; - padding-right: 24px; + &> label + { + font-weight: bold; + padding-right: 24px; + } } } &.uwt-formview-stacked diff --git a/php/mocha/themes/common/styles/uwt-image.less b/php/mocha/themes/common/styles/uwt-image.less new file mode 100644 index 0000000..90b1ead --- /dev/null +++ b/php/mocha/themes/common/styles/uwt-image.less @@ -0,0 +1,5 @@ +div.uwt-image +{ + background-repeat: no-repeat; + background-size: 100% 100%; +} \ No newline at end of file diff --git a/php/mocha/themes/common/styles/uwt-page-footer.less b/php/mocha/themes/common/styles/uwt-page-footer.less new file mode 100644 index 0000000..8f7ab9e --- /dev/null +++ b/php/mocha/themes/common/styles/uwt-page-footer.less @@ -0,0 +1,6 @@ +div.uwt-page-footer +{ + display: flex; + flex-direction: row; + justify-content: end; +} \ No newline at end of file diff --git a/php/mocha/themes/common/styles/uwt.less b/php/mocha/themes/common/styles/uwt.less index 3e04d42..8148b85 100644 --- a/php/mocha/themes/common/styles/uwt.less +++ b/php/mocha/themes/common/styles/uwt.less @@ -13,6 +13,7 @@ @import "uwt-formview.less"; @import "uwt-gripper.less"; @import "uwt-header.less"; +@import "uwt-image.less"; @import "uwt-label.less"; @import "uwt-layout-box.less"; @import "uwt-listbox.less"; @@ -22,6 +23,7 @@ @import "uwt-meter.less"; @import "uwt-page-header.less"; @import "uwt-page.less"; +@import "uwt-page-footer.less"; @import "uwt-panel.less"; @import "uwt-popup.less"; @import "uwt-progressbar.less"; diff --git a/php/mocha/ui/pages/HomePage.phpx.php b/php/mocha/ui/pages/HomePage.phpx.php index 8028d2d..e81ff7f 100644 --- a/php/mocha/ui/pages/HomePage.phpx.php +++ b/php/mocha/ui/pages/HomePage.phpx.php @@ -9,7 +9,7 @@ use Mocha\Core\OmsContext; - use Mocha\UI\Renderers\HTMLRenderer; + use Mocha\UI\Renderers\HTML\HTMLRenderer; use Phast\RenderingEventArgs; use Phast\System; use Phast\WebPage; @@ -40,11 +40,11 @@ die(); } + $renderer->IsPostback = $this->Page->IsPostback; if ($this->Page->IsPostback) { $renderer->processPostback($pageElement); } - $renderer->renderInitialElement($pageElement); exit(); diff --git a/php/mocha/ui/pages/InstancePage.phpx b/php/mocha/ui/pages/InstancePage.phpx index 56813b8..0fdda0e 100644 --- a/php/mocha/ui/pages/InstancePage.phpx +++ b/php/mocha/ui/pages/InstancePage.phpx @@ -17,5 +17,23 @@ + + + + + + + + +

SPOT:

Stop in:

+ +
+

Test Instance

+

Cast to Class Instance ID:

+

Instance ID:

+
+
+
+
\ No newline at end of file diff --git a/php/mocha/ui/pages/InstancePage.phpx.php b/php/mocha/ui/pages/InstancePage.phpx.php index c290d79..40ba5fc 100644 --- a/php/mocha/ui/pages/InstancePage.phpx.php +++ b/php/mocha/ui/pages/InstancePage.phpx.php @@ -1,6 +1,14 @@ GetControlByID("instId"); - $taskInstIdCtl = $this->GetControlByID("taskInstId"); + $castIdCtl = $this->GetControlByID("castId"); - $instIdCtl->Content = $this->Page->GetPathVariableValue("instid"); + $instkey = InstanceKey::Parse($this->Page->GetPathVariableValue("instid")); + + $castkey = InstanceKey::Parse($this->Page->GetPathVariableValue("castinstid")); + if ($castIdCtl !== null) + { + if ($castkey === null) + { + $castIdCtl->Content = "invalid inst id " . $castkey . " (inst not found)"; + } + else + { + $castIdCtl->Content = strval($castkey); + } + } + + $inst = $oms->getInstanceByKey($instkey); + if ($inst === null) + { + $instIdCtl->Content = "invalid inst id " . $instkey . " (inst not found)"; + } + else + { + $parentClass = $oms->getParentClass($inst); + if ($castkey !== null) + { + $parentClass = $oms->getInstanceByKey($castkey); + } + + $instIdCtl->Content = strval(($inst->InstanceKey)); + $rel_Class__has_default__Task = $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Class__has_default__Task); + if ($rel_Class__has_default__Task !== null) + { + $defaultTask = $oms->getRelatedInstance($parentClass, $rel_Class__has_default__Task); + if ($defaultTask !== null) + { + $context = new OmsContext(); + + $taskRenderer = new HTMLRenderer($context); + $taskRenderer->TargetInstance = $inst; + $taskRenderer->IsPostback = $this->Page->IsPostback; + if ($this->IsPostback) + { + $taskRenderer->processPostback($defaultTask); + } + else + { + $taskRenderer->renderTask($defaultTask, $inst); + } + exit(); + } + } + } } } diff --git a/php/mocha/ui/pages/LoginPage.phpx.php b/php/mocha/ui/pages/LoginPage.phpx.php index f5fea6b..f1bcca3 100644 --- a/php/mocha/ui/pages/LoginPage.phpx.php +++ b/php/mocha/ui/pages/LoginPage.phpx.php @@ -4,11 +4,12 @@ use Mocha\Core\KnownAttributeGuids; use Mocha\Core\KnownClassGuids; use Mocha\Core\KnownInstanceGuids; + use Mocha\Core\KnownMethodBindingGuids; use Mocha\Core\KnownRelationshipGuids; use Mocha\Core\OmsContext; - use Mocha\UI\Renderers\HTMLRenderer; + use Mocha\UI\Renderers\HTML\HTMLRenderer; use Phast\RenderingEventArgs; use Phast\System; use Phast\WebPage; @@ -82,62 +83,80 @@ $renderer = new HTMLRenderer($context); + # $contents = $pageElement->getRelatedInstances($oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content)); + $renderer->ProcessUpdatesFunction = function($sender, $element) + { + /** + * @var MySQLDatabaseOms + */ + $oms = mocha_get_oms(); + + $ec_UserName = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::ElementContent__UserNameForLoginPage); + $ec_Password = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::ElementContent__PasswordForLoginPage); + + // $ct = $oms->getRelatedInstance($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__processed_by__Control_Transaction_Method)); + // Login Page@ Login Page Edit(CT)*S + // uses Build Response Method Binding... + // + + $userName = $sender->getElementContentValue($ec_UserName); // $_POST["ec_56$4"]; + $password = $sender->getElementContentValue($ec_Password); // $_POST["ec_56$5"]; + + $mbUser__get__User_for_User_Name_parm = $oms->getInstanceByGlobalIdentifier(KnownMethodBindingGuids::User__get__User_for_User_Name_parm); + if ($mbUser__get__User_for_User_Name_parm === null) + { + echo("`User@get User for User Name parm`: method not found ('" . KnownMethodBindingGuids::User__get__User_for_User_Name_parm . "')");die(); + } + $mbUser__get__User_for_User_Name_parm = $mbUser__get__User_for_User_Name_parm->asMethodBinding(); + + $instUser = $mbUser__get__User_for_User_Name_parm->executeReturningInstanceSet(array( KnownAttributeGuids::UserName => $userName )); + if ($instUser !== null) + { + $passwordSalt = $oms->getAttributeValue($instUser, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::PasswordSalt)); + $passwordHashExpected = $oms->getAttributeValue($instUser, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::PasswordHash)); + $passwordHashActual = hash('sha512', $password . $passwordSalt); + + if ($passwordHashExpected == $passwordHashActual) + { + $token = $this->random_str(); + + // create the instance of `System Account Signon` + $instLogin = $oms->createInstanceOf($oms->getInstanceByGlobalIdentifier(KnownClassGuids::UserLogin)); + if ($instLogin !== null) + { + // FIXME: these attribute should be defined in the Mocha/ZQ + // FIXME: they should be wrapped in a conditional which checks if we are serving in a GDPR compliant region + // should we be storing this information then? probably not... + + $oms->setAttributeValue($instLogin, KnownAttributeGuids::Token, $token); + $oms->setAttributeValue($instLogin, KnownAttributeGuids::IPAddress, $_SERVER["REMOTE_ADDR"]); + $oms->assignRelationship($instLogin, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::User_Login__has__User), $instUser); + } + $_SESSION["user_token_" . $oms->getTenant()->ID] = $token; + + System::RedirectFromLoginPage(); + exit(); + } + else + { + //$this->Page->GetControlByID("literal1")->EnableRender = true; + + //System::RedirectToLoginPage(true); + } + } + $ecPasswordMsg = $oms->getInstanceByGlobalIdentifier("684f1e039ecd43d58acadcf5b84c71f8"); + $sender->Context->setElementParm($ecPasswordMsg, "visible", true); + }; + + $renderer->IsPostback = $this->Page->IsPostback; + $renderer->StyleClasses[] = "mcx-loginpage"; if ($this->Page->IsPostback) { $renderer->processPostback($pageElement); } - - # $contents = $pageElement->getRelatedInstances($oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content)); $renderer->renderInitialElement($pageElement); exit(); - $tenant = $oms->getTenantByName($tenantName); - if ($tenant === null) - { - $this->Page->GetControlByID("header-image")->EnableRender = false; - $this->Page->GetControlByID("header-text")->Content = "Tenant Not Found"; - $this->Page->GetControlByID("litPanelElements")->EnableRender = false; - $this->Page->GetControlByID("litTenantText")->Content = "The specified tenant was not found on this server.

If you require assistance, please contact your system administrator."; - } - else - { - $oms->setTenant($tenant); - $this->Page->GetControlByID("header-image")->ImageUrl = System::ExpandRelativePath("~/madi/authgwy/" . $oms->getTenantName() . "/images/signon.xml", false, true); - } - - if ($this->Page->IsPostback) - { - $userName = $_POST["ec__56$1"]; - $password = $_POST["ec__56$2"]; - - $oms->setTenant($oms->getTenantByName($this->Page->GetPathVariableValue("tenant"))); - - $instUser = $oms->getUserByUserName($userName); - $passwordSalt = $oms->getAttributeValue($instUser, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::PasswordSalt)); - $passwordHashExpected = $oms->getAttributeValue($instUser, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::PasswordHash)); - $passwordHashActual = hash('sha512', $password . $passwordSalt); - - if ($passwordHashExpected == $passwordHashActual) - { - $token = $this->random_str(); - - // create the instance of `User Login` - $instLogin = $oms->createInstanceOf($oms->getInstanceByGlobalIdentifier(KnownClassGuids::UserLogin)); - if ($instLogin !== null) - { - $oms->setAttributeValue($instLogin, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::Token), $token); - $oms->assignRelationship($instLogin, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::User_Login__has__User), $instUser); - } - $_SESSION["user_token_" . $oms->getTenant()->ID] = $token; - - System::Redirect("~/d/home.htmld"); - exit(); - } - else - { - $this->Page->GetControlByID("literal1")->EnableRender = true; - } - } } } diff --git a/php/mocha/ui/tasks/ViewElementContent.inc.php b/php/mocha/ui/tasks/ViewElementContent.inc.php new file mode 100644 index 0000000..8b76dff --- /dev/null +++ b/php/mocha/ui/tasks/ViewElementContent.inc.php @@ -0,0 +1,53 @@ + + + View Element Content + + +

View Element Content

+

+EOK; + $value .= $this->TaskInstance->InstanceKey; + $value .= << + + +EOK; + + + $element = $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::Element__ViewElementContent); + return $element; + + return $value; + + /* + echo ("Related Instance:
"); + print_r($this->RelatedInstance); + */ + } + + } +?> \ No newline at end of file diff --git a/sql/mysql/001-procedures/mocha_prepare_instance.sql b/sql/mysql/001-procedures/mocha_prepare_instance.sql index 9f28bbf..5634007 100644 --- a/sql/mysql/001-procedures/mocha_prepare_instance.sql +++ b/sql/mysql/001-procedures/mocha_prepare_instance.sql @@ -4,6 +4,7 @@ CREATE PROCEDURE mocha_prepare_instance ( IN p_class_inst_id INT, IN p_inst_id INT, + IN p_class_global_identifier CHAR(32), -- the global identifier of the class of the newly created instance IN p_global_identifier CHAR(32), -- the desired global identifier for the newly created instance IN p_user_inst_id INT, IN p_effective_date DATETIME, @@ -23,6 +24,11 @@ sp: BEGIN -- SET p_class_index = (SELECT inst_id FROM mocha_instances WHERE tenant_id = p_tenant_id AND class_id = 1 AND id = p_class_inst_id); SET p_class_index = p_class_inst_id; + IF p_class_index IS NULL AND NOT p_class_global_identifier IS NULL THEN + + SET p_class_index = (SELECT inst_id FROM mocha_instances WHERE tenant_id = p_tenant_id AND id = mocha_get_instance_by_global_identifier(p_class_global_identifier)); + + END IF; -- IF p_class_index IS NULL THEN