major updates, we can now properly iterate through BEMs
This commit is contained in:
parent
c561422292
commit
852a2e7f2b
@ -64,6 +64,54 @@ class YAMLLibraryParser (LibraryParser):
|
||||
|
||||
self.apply_template(elem, template, instanceId)
|
||||
|
||||
def assign_relationship_value(self, instanceId, rel, rel_iid, relationshipValue):
|
||||
if (isinstance(relationshipValue, str)):
|
||||
# single instance, this should be a GUID or entityref
|
||||
# we should only need to refer to existing instance in this case
|
||||
relationshipValueInst = Guid(self.manager.expand_entity_references(relationshipValue))
|
||||
if "instance" in rel:
|
||||
self.manager.assign_relationship(instanceId, Guid(self.manager.expand_entity_references(rel["instance"])), relationshipValueInst)
|
||||
else:
|
||||
print("no relationship instance specified for relationship sugar")
|
||||
|
||||
else:
|
||||
# dynamically created instance
|
||||
#FIXME: this 'instance' isn't always the tag name, this can be subject to customTagName as well!and should be processed accordingly
|
||||
(relinst_key, relinst_iid) = self.find_custom_tag_name(relationshipValue)
|
||||
if relinst_key is not None:
|
||||
# for example, 'relinst_key' is 'elementContent' and 'relinst_iid' is '{8ECA14A4...}'
|
||||
|
||||
if rel_iid is not None:
|
||||
print("found customTagName '" + str(relinst_key) + "' with value '" + str(relinst_iid.get_value()) + "'")
|
||||
|
||||
# relval = Guid(self.manager.expand_entity_references(elem[customTagName]))
|
||||
# we need to create the new instance and assign relationship
|
||||
self.manager.assign_relationship(instanceId, rel_iid, relinst_iid)
|
||||
else:
|
||||
if "globalIdentifier" in relationshipValue:
|
||||
globalIdentifier = Guid(relationshipValue["globalIdentifier"])
|
||||
else:
|
||||
globalIdentifier = Guid.create()
|
||||
|
||||
print("creating new instance for relationship '%s' with globalid '%s'" % (rel_iid, globalIdentifier.get_value()))
|
||||
if "customTagNameCreatesInstanceOf" in rel:
|
||||
createsInstanceOf = Guid(self.manager.expand_entity_references(rel["customTagNameCreatesInstanceOf"]))
|
||||
|
||||
# create the new instance
|
||||
self.manager.add_instance(createsInstanceOf, globalIdentifier, None, None)
|
||||
|
||||
# assign relationships
|
||||
self.manager.assign_relationship(instanceId, rel_iid, globalIdentifier)
|
||||
# self.manager.assign_relationship(globalIdentifier, relationshipInstanceId, instanceId)
|
||||
|
||||
# FIXME: apply relationships from the parent class template
|
||||
if createsInstanceOf.get_value() in self.templates:
|
||||
print("applying template for createsInstanceOf '%s'" % (createsInstanceOf.get_value()))
|
||||
createsInstanceOfTemplate = self.templates[createsInstanceOf.get_value()]
|
||||
self.apply_template(relationshipValue, createsInstanceOfTemplate, globalIdentifier)
|
||||
else:
|
||||
print("no template registered for createsInstanceOf '%s'" % (createsInstanceOf.get_value()))
|
||||
|
||||
def apply_template(self, elem, template, instanceId):
|
||||
|
||||
if "value" in elem:
|
||||
@ -94,61 +142,16 @@ class YAMLLibraryParser (LibraryParser):
|
||||
customTagName = rel["customTagName"]
|
||||
if customTagName in elem:
|
||||
relationshipValue = elem[customTagName]
|
||||
if relationshipValue is None:
|
||||
continue
|
||||
|
||||
if isinstance(relationshipValue, list):
|
||||
# multiple instances
|
||||
for v in relationshipValue:
|
||||
#FIXME: this 'instance' isn't always the tag name, this can be subject to customTagName as well!and should be processed accordingly
|
||||
(relinst_key, relinst_iid) = self.find_custom_tag_name(v)
|
||||
if relinst_key is not None:
|
||||
# for example, 'relinst_key' is 'elementContent' and 'relinst_iid' is '{8ECA14A4...}'
|
||||
|
||||
if rel_iid is not None:
|
||||
print("found customTagName '" + str(relinst_key) + "' with value '" + str(relinst_iid.get_value()) + "'")
|
||||
|
||||
# relval = Guid(self.manager.expand_entity_references(elem[customTagName]))
|
||||
# we need to create the new instance and assign relationship
|
||||
self.manager.assign_relationship(instanceId, Guid(self.manager.expand_entity_references(rel_iid)), relinst_iid)
|
||||
else:
|
||||
print("HELLO!!! NO RELATIONSHIP SUGAR!!! CREATE THE INSTANCE!!!")
|
||||
self.assign_relationship_value(instanceId, rel, Guid(self.manager.expand_entity_references(rel_iid)), v)
|
||||
|
||||
else:
|
||||
|
||||
if (isinstance(relationshipValue, str)):
|
||||
# single instance, this should be a GUID or entityref
|
||||
# we should only need to refer to existing instance in this case
|
||||
relationshipValueInst = Guid(self.manager.expand_entity_references(relationshipValue))
|
||||
if "instance" in rel:
|
||||
self.manager.assign_relationship(instanceId, Guid(self.manager.expand_entity_references(rel["instance"])), relationshipValueInst)
|
||||
else:
|
||||
print("no relationship instance specified for relationship sugar")
|
||||
|
||||
else:
|
||||
# dynamically created instance
|
||||
if "globalIdentifier" in relationshipValue:
|
||||
globalIdentifier = relationshipValue["globalIdentifier"]
|
||||
else:
|
||||
globalIdentifier = Guid.create()
|
||||
|
||||
print("creating new instance for relationship '%s' with globalid '%s'" % (rel_iid, globalIdentifier.get_value()))
|
||||
if "customTagNameCreatesInstanceOf" in rel:
|
||||
createsInstanceOf = Guid(self.manager.expand_entity_references(rel["customTagNameCreatesInstanceOf"]))
|
||||
|
||||
# create the new instance
|
||||
self.manager.add_instance(createsInstanceOf, globalIdentifier, None, None)
|
||||
|
||||
# assign relationships
|
||||
self.manager.assign_relationship(instanceId, Guid(self.manager.expand_entity_references(rel_iid)), globalIdentifier)
|
||||
# self.manager.assign_relationship(globalIdentifier, relationshipInstanceId, instanceId)
|
||||
|
||||
# FIXME: apply relationships from the parent class template
|
||||
if createsInstanceOf.get_value() in self.templates:
|
||||
print("applying template for createsInstanceOf '%s'" % (createsInstanceOf.get_value()))
|
||||
createsInstanceOfTemplate = self.templates[createsInstanceOf.get_value()]
|
||||
self.apply_template(relationshipValue, createsInstanceOfTemplate, globalIdentifier)
|
||||
else:
|
||||
print("no template registered for createsInstanceOf '%s'" % (createsInstanceOf.get_value()))
|
||||
|
||||
self.assign_relationship_value(instanceId, rel, Guid(self.manager.expand_entity_references(rel_iid)), relationshipValue)
|
||||
|
||||
def get_instance_sugar_for_elem(self, elem):
|
||||
if "instance" in elem:
|
||||
@ -219,7 +222,8 @@ class YAMLLibraryParser (LibraryParser):
|
||||
creatorKey = None
|
||||
if "instance" in elem:
|
||||
if "templateOnly" in elem and elem["templateOnly"] == True:
|
||||
instanceId = None
|
||||
# instanceId = None
|
||||
instanceId = Guid(self.manager.expand_entity_references(elem["instance"]))
|
||||
else:
|
||||
instanceId = Guid(self.manager.expand_entity_references(elem["instance"]))
|
||||
|
||||
@ -240,6 +244,7 @@ class YAMLLibraryParser (LibraryParser):
|
||||
|
||||
if classId is None and instanceId is not None:
|
||||
classId = instanceId # HACK HACK
|
||||
print("WARNING: class hack used for instanceId " + instanceId.get_value())
|
||||
|
||||
if instanceId is not None:
|
||||
self.manager.add_instance(classId, instanceId, classIndex, index)
|
||||
|
||||
@ -63,3 +63,5 @@
|
||||
- IDA_UserNameOrPasswordIncorrectMessage: '{7a63f087-f47c-4b49-9043-94d6d59ac6c4}'
|
||||
- IDA_LoginPageInstructions: '{dc11f905-335d-4e9b-8f03-55551a184dc3}'
|
||||
- IDA_OpenInNewWindow: '{4a211f11-c5c3-4b58-a7f4-ed62538c5a3d}'
|
||||
- IDA_LongRunning: '{c03aa999-83bc-49db-a27e-70fee477b9fb}'
|
||||
- IDA_SuppressRIHints: '{43328aec-6a5d-4955-8d04-a96dcf98ab02}'
|
||||
@ -50,6 +50,7 @@
|
||||
- IDR_Class__instance_labeled_by__String: "{F52FC851-D655-48A9-B526-C5FE0D7A29D2}"
|
||||
- IDR_Class__has_summary__Report_Field: "{D11050AD-7376-4AB7-84DE-E8D0336B74D2}"
|
||||
- IDR_Class__has_related__Task: "{4D8670E1-2AF1-4E7C-9C87-C910BD7B319B}"
|
||||
- IDR_Task__related_for__Class: "{F6D05235-AAA8-4DC0-8D3A-A0F336B39F01}"
|
||||
|
||||
- IDR_Report_Object__has__Report_Field: "{0af62656-42bc-40a5-b0bc-dbba67c347f6}"
|
||||
- IDR_Report_Field__for__Report_Object: "{b46c8caa-3f46-465f-ba11-7d6f385425a2}"
|
||||
@ -108,7 +109,10 @@
|
||||
- IDR_Get_Referenced_Attribute_Method__has__Attribute: "{87f90fe9-5ec6-4b09-8f51-b8a4d1544cae}"
|
||||
- IDR_Get_Referenced_Attribute_Method__loop_on__Instance_Set: "{c7ecd498-6d05-4e07-b1bc-f7127d0d6666}"
|
||||
|
||||
- IDR_Get_Specific_Instances_Method__has__Instance: "{dea1aa0b-2bef-4bac-b4f9-0ce8cf7006fc}"
|
||||
- IDR_Get_Specified_Instances_Method__returns__Work_Set: "{27796f3d-0cbd-42c5-a840-791d3af6c16d}"
|
||||
- IDR_Work_Set__returned_by__Get_Specified_Instances_Method: "{3a0080c7-7061-42a4-9814-cd3f6efaaa16}"
|
||||
- IDR_Get_Specified_Instances_Method__uses__Instance: "{dea1aa0b-2bef-4bac-b4f9-0ce8cf7006fc}"
|
||||
- IDR_Instance__used_by__Get_Specified_Instances_Method: "{13978b33-dd35-4d96-9414-4cb929b549e9}"
|
||||
|
||||
- IDR_Evaluate_Boolean_Expression_Method__has_source_attribute__Method: "{45d76d56-01ed-4641-9f68-cfe0c7d0d265}"
|
||||
- IDR_Evaluate_Boolean_Expression_Method__equal_to_attribute__Method: "{0646df91-7e3e-4d59-be71-b978a22ced8e}"
|
||||
@ -352,4 +356,11 @@
|
||||
- IDR_Assign_Attribute_Method__assigns__Attribute: '{74061875-8a27-403b-9456-02e52cfd13b2}'
|
||||
- IDR_Attribute__assigned_by__Assign_Attribute_Method: '{d3b540e8-0f52-4595-bf52-1968637da59a}'
|
||||
|
||||
- IDR_BEM_Process__uses_loop__Executable_returning_Instance_Set: '{0fb2b538-eacb-418a-b7d8-43a584b85952}'
|
||||
- IDR_Executable_returning_Instance_Set__loop_used_by__BEM_Process: '{903e0a4b-f93b-420c-a11d-f34be76d0479}'
|
||||
|
||||
- IDR_Build_Element_Method__has__BEM_Process: '{6f1811b0-4e58-4e66-8318-083b62aac5de}'
|
||||
- IDR_BEM_Process__for__Build_Element_Method: '{da991add-0a67-428c-9568-efba5633c91a}'
|
||||
|
||||
- IDR_Build_Element_Method__returns__Element: '{4d13d021-7363-4131-b74a-241698c3f1d0}'
|
||||
- IDR_Element__returned_by__Build_Element_Method: '{ae6a82f0-950b-44c0-a1e6-53d8a7e9e46d}'
|
||||
@ -35,7 +35,7 @@
|
||||
- IDC_GetReferencedElementMethod: "{7b46b5d7-0130-44c9-9c7a-89e693369cc7}" # 1$197
|
||||
- IDC_GetRelationshipMethod: "{d53c9232-89ef-4cca-8520-261da6787450}" # 1$207
|
||||
- IDC_InvokeWebServiceMethod: "{26d9e733-50a0-49f7-9b2c-2142934e3952}" # 1$208
|
||||
- IDC_GetInstancesMethod: '{0a379314-9d0f-432d-ae59-63194ab32dd3}' # 1$393
|
||||
- IDC_InstanceOpMethod: "{4c814982-938f-4116-bdc1-827bae6a5f71}"
|
||||
- IDC_ConditionalSelectAttributeMethod: "{d534a369-321e-4c32-bd7f-8ff2017f191e}" # 1$13038
|
||||
- IDC_ConditionalSelectFromInstanceSetMethod: "{ffea8e52-06e5-4e95-8c40-da3ba54ce95f}" # 1$13039
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
- entityDefinitions:
|
||||
- IDI_Task_ViewElement: '{64e9c8f6-c3d7-4915-98c8-83b91c211a8d}'
|
||||
- IDI_Task_ViewElementContent: '{9c90e09a-2efc-4ebd-92e6-c0767ac3fbfd}'
|
||||
- IDI_Task_ViewClass: '{cd9366be-08d7-4b32-8963-3c42753fa8d9}'
|
||||
#- IDC_SequenceTask: "{74c26737-000e-4bda-a1af-ad6d59bcc4b2}"
|
||||
#- IDC_ConvenienceTask: "{8a9fb632-6d04-49ff-8271-1f41dce1f254}"
|
||||
- IDI_SequenceTask_TestMethodBinding: '{3e55af17-00a9-418d-ae6f-7e52ec11148e}'
|
||||
- IDI_Task_ShowDefinitionInCodeEditor: '{4f8a0e8e-e139-4cc6-b8cf-a32e67bd192d}'
|
||||
- IDI_Task_DeleteInstance: '{276c5933-89a9-4a22-8fe3-cd9fda5377a8}'
|
||||
- IDI_Task_ViewIntegrationIDs: '{8a2a0ef3-a145-4026-9c55-4d0133eff929}'
|
||||
@ -4,3 +4,6 @@
|
||||
- IDE_HomePage: '{3c1f92a5-09a0-4b52-9269-46c386b0c905}'
|
||||
- IDE_ViewElementContent: '{e68bb6c4-29eb-4c77-908a-1b3793c952bc}'
|
||||
- IDE_ViewElementContent_Summary: '{a639e587-f8a5-4503-afb6-08e98cb40a09}'
|
||||
|
||||
- IDE_ViewElement: '{f39280f4-a62a-4fb3-9f58-3a4abe57cee9}'
|
||||
- IDE_ElementStart: '{3abffca7-b904-4988-9583-cf7f4fc4146e}'
|
||||
@ -4,3 +4,6 @@
|
||||
- IDI_TaskCategory_Instance: '{5303969f-dafc-4c1f-916c-f1079c3b19b5}'
|
||||
- IDI_TaskCategory_MethodBinding: '{871cec9e-faf3-4996-b873-57e78c988b11}'
|
||||
- IDI_TaskCategory_ReturnedWorkData: '{57443af8-65f2-4e9b-97c7-f36a4b635760}'
|
||||
- IDI_TaskCategory_Debugging: '{8f6e81be-9663-4226-85c3-253588126ea2}'
|
||||
- IDI_TaskCategory_IntegrationIDs: '{79449821-89d6-4f83-b3dd-0e780b0a9fef}'
|
||||
- IDI_TaskCategory_Element: '{7ac1d803-7007-4b3d-b06e-886d62f758c9}'
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
customTagName: 'inherits'
|
||||
- instance: '&IDR_Class__has_default__Task;'
|
||||
customTagName: 'defaultTask'
|
||||
- instance: '&IDR_Class__has_related__Task;'
|
||||
customTagName: 'relatedTasks'
|
||||
translations:
|
||||
- relationship: '&IDR_Class__has_title__Translation;'
|
||||
values:
|
||||
@ -22,3 +24,5 @@
|
||||
name: Class
|
||||
index: 1
|
||||
defaultTask: '&IDI_Task_ViewClass;'
|
||||
relatedTasks:
|
||||
- instance: '&IDI_Task_ViewClass;'
|
||||
|
||||
@ -268,3 +268,19 @@
|
||||
destinationClassId: '&IDC_Task;'
|
||||
siblingRelationshipId: '&IDR_Task__has__Task_Category;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Class__has_related__Task;'
|
||||
index: 7948 # was: Related Menu Item.uses object of Class
|
||||
sourceClassId: '&IDC_Class;'
|
||||
type: 'has related'
|
||||
destinationClassId: '&IDC_Task;'
|
||||
siblingRelationshipId: '&IDR_Task__related_for__Class;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Task__related_for__Class;'
|
||||
index: 7949 # was: Related Menu Item.for UI Task
|
||||
sourceClassId: '&IDC_Task;'
|
||||
type: 'related for'
|
||||
destinationClassId: '&IDC_Class;'
|
||||
siblingRelationshipId: '&IDR_Class__has_related__Task;'
|
||||
singular: no
|
||||
@ -35,6 +35,9 @@
|
||||
- textAttribute: '&IDA_Comment;'
|
||||
name: Comment
|
||||
index: 6
|
||||
- textAttribute: '&IDA_Order;'
|
||||
name: 'Order'
|
||||
index: 7
|
||||
- textAttribute: '&IDA_RelationshipType;'
|
||||
name: 'Relationship Type'
|
||||
index: 8
|
||||
|
||||
@ -59,6 +59,9 @@
|
||||
- instance: '&IDA_UseAnyCondition;'
|
||||
name: Use Any Condition
|
||||
index: 18
|
||||
- instance: '&IDA_LongRunning;'
|
||||
name: Long Running
|
||||
index: 19
|
||||
- instance: '&IDA_IncludeMIs;'
|
||||
name: Include MIs
|
||||
index: 20
|
||||
@ -69,6 +72,9 @@
|
||||
name: Allow Any
|
||||
index: 22
|
||||
- instance: '&IDA_OpenInNewWindow;'
|
||||
name: Open in New Winow
|
||||
name: Open in New Window
|
||||
index: 23
|
||||
- instance: '&IDA_SuppressRIHints;'
|
||||
name: Suppress RI Hints
|
||||
index: 24
|
||||
|
||||
@ -5,6 +5,9 @@
|
||||
name: Element
|
||||
index: 6
|
||||
customTagName: 'element'
|
||||
defaultTask: '&IDI_Task_ViewElement;'
|
||||
relatedTasks:
|
||||
- instance: '&IDI_Task_ViewElement;'
|
||||
attributes:
|
||||
- instance: '&IDA_Name;'
|
||||
customTagName: 'name'
|
||||
@ -13,6 +16,7 @@
|
||||
relationships:
|
||||
- instance: '&IDR_Element__has__Element_Content;'
|
||||
customTagName: 'elementContents'
|
||||
customTagNameCreatesInstanceOf: '&IDC_ElementContent;'
|
||||
- instance: '&IDR_Element__processed_by__Process_Related_Updates_Method;'
|
||||
customTagName: 'processedByPRUMethod'
|
||||
instances:
|
||||
|
||||
@ -4,14 +4,34 @@
|
||||
- class: '&IDC_BEMProcess;'
|
||||
name: BEM Process
|
||||
index: 16
|
||||
customTagName: 'bemProcess'
|
||||
registerForTemplate: yes
|
||||
translations:
|
||||
- relationship: '&IDR_Class__has_title__Translation;'
|
||||
values:
|
||||
- languageInstanceId: '&IDI_Language_English;'
|
||||
value: 'BEM Process'
|
||||
relationships:
|
||||
- instance: '&IDR_BEM_Process__uses_loop__Executable_returning_Instance_Set;'
|
||||
customTagName: 'loopExecutableReturningInstanceSet'
|
||||
|
||||
instances:
|
||||
- instance: '&IDBEM_1;'
|
||||
- bemProcess: '&IDBEM_1;'
|
||||
|
||||
- relationship: '&IDR_BEM_Process__uses_loop__Executable_returning_Instance_Set;'
|
||||
index: 44
|
||||
sourceClassId: '&IDC_BEMProcess;'
|
||||
type: 'uses loop'
|
||||
destinationClassId: '&IDC_ExecutableReturningInstanceSet;'
|
||||
siblingRelationshipId: '&IDR_Executable_returning_Instance_Set__loop_used_by__BEM_Process;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Executable_returning_Instance_Set__loop_used_by__BEM_Process;'
|
||||
index: 45
|
||||
sourceClassId: '&IDC_ExecutableReturningInstanceSet;'
|
||||
type: 'loop used by'
|
||||
destinationClassId: '&IDC_BEMProcess;'
|
||||
siblingRelationshipId: '&IDR_BEM_Process__uses_loop__Executable_returning_Instance_Set;'
|
||||
singular: no
|
||||
|
||||
|
||||
- relationship: '&IDR_Element_Content__built_from__BEM_Process;'
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
---
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- class: '&IDC_Instance;'
|
||||
name: Instance
|
||||
index: 17
|
||||
translations:
|
||||
- relationship: '&IDR_Class__has_title__Translation;'
|
||||
values:
|
||||
- languageInstanceId: '&IDI_Language_English;'
|
||||
value: 'Instance'
|
||||
relatedTasks:
|
||||
# !FIXME: there should be a better way to do this, like specifying an Instance Set
|
||||
# ! containing multiple related tasks that can be reused across different class definitions
|
||||
- instance: '&IDI_Task_ShowDefinitionInCodeEditor;'
|
||||
- instance: '&IDI_Task_DeleteInstance;'
|
||||
- instance: '&IDI_Task_ViewIntegrationIDs;'
|
||||
- instance: '{42bdbbc9-214f-4d81-b91f-36a177e5087b}'
|
||||
- instance: '{643a3780-250b-4575-be50-50dc346137c0}'
|
||||
- instance: '{5aafc3a1-8490-4860-866d-717a4c2c77e2}'
|
||||
@ -0,0 +1,51 @@
|
||||
---
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- class: '&IDC_BuildElementMethod;'
|
||||
inherits: '&IDC_Method;'
|
||||
name: BEM - Build Element Method
|
||||
index: 29
|
||||
customTagName: buildElementMethod
|
||||
attributes:
|
||||
- instance: '&IDA_Verb;'
|
||||
customTagName: 'verb'
|
||||
- instance: '&IDA_Name;'
|
||||
customTagName: 'name'
|
||||
relationships:
|
||||
- instance: '&IDR_Build_Element_Method__has__BEM_Process;'
|
||||
customTagName: 'hasBemProcess'
|
||||
customTagNameCreatesInstanceOf: '&IDC_BEMProcess;'
|
||||
- instance: '&IDR_Build_Element_Method__returns__Element;'
|
||||
customTagName: 'returnsElement'
|
||||
|
||||
- relationship: '&IDR_Build_Element_Method__has__BEM_Process;'
|
||||
index: 52
|
||||
sourceClassId: '&IDC_BuildElementMethod;'
|
||||
type: 'returns'
|
||||
destinationClassId: '&IDC_BEMProcess;'
|
||||
siblingRelationshipId: '&IDR_BEM_Process__for__Build_Element_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_BEM_Process__for__Build_Element_Method;'
|
||||
index: 53
|
||||
sourceClassId: '&IDC_BEMProcess;'
|
||||
type: 'for'
|
||||
destinationClassId: '&IDC_BuildElementMethod;'
|
||||
siblingRelationshipId: '&IDR_Build_Element_Method__has__BEM_Process;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Build_Element_Method__returns__Element;'
|
||||
index: 54
|
||||
sourceClassId: '&IDC_BuildAttributeMethod;'
|
||||
type: 'returns'
|
||||
destinationClassId: '&IDC_BuildElementMethod;'
|
||||
siblingRelationshipId: '&IDR_Element__returned_by__Build_Element_Method;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Element__returned_by__Build_Element_Method;'
|
||||
index: 55
|
||||
sourceClassId: '&IDC_Element;'
|
||||
type: 'returned by'
|
||||
destinationClassId: '&IDC_BuildElementMethod;'
|
||||
siblingRelationshipId: '&IDR_Build_Element_Method__returns__Element;'
|
||||
singular: no
|
||||
@ -0,0 +1,44 @@
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- class: '&IDC_GetSpecifiedInstancesMethod;'
|
||||
name: GSI - Get Specified Instances Method
|
||||
index: 40
|
||||
inherits: '&IDC_Method;'
|
||||
customTagName: getSpecifiedInstancesMethod
|
||||
relationships:
|
||||
- instance: '&IDR_Get_Specified_Instances_Method__returns__Work_Set;'
|
||||
customTagName: 'returnsWorkSet'
|
||||
- instance: '&IDR_Get_Specified_Instances_Method__uses__Instance;'
|
||||
customTagName: 'selectsInstances'
|
||||
|
||||
- relationship: '&IDR_Get_Specified_Instances_Method__returns__Work_Set;'
|
||||
index: 74
|
||||
sourceClassId: '&IDC_GetSpecifiedInstancesMethod;'
|
||||
type: 'returns'
|
||||
destinationClassId: '&IDC_WorkSet;'
|
||||
siblingRelationshipId: '&IDR_Work_Set__returned_by__Get_Specified_Instances_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Work_Set__returned_by__Get_Specified_Instances_Method;'
|
||||
index: 75
|
||||
sourceClassId: '&IDC_WorkSet;'
|
||||
type: 'returned by'
|
||||
destinationClassId: '&IDC_GetSpecifiedInstancesMethod;'
|
||||
siblingRelationshipId: '&IDR_Get_Specified_Instances_Method__returns__Work_Set;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Get_Specified_Instances_Method__uses__Instance;'
|
||||
index: 76
|
||||
sourceClassId: '&IDC_GetSpecifiedInstancesMethod;'
|
||||
type: 'uses'
|
||||
destinationClassId: '&IDC_Instance;'
|
||||
siblingRelationshipId: '&IDR_Instance__used_by__Get_Specified_Instances_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Instance__used_by__Get_Specified_Instances_Method;'
|
||||
index: 77
|
||||
sourceClassId: '&IDC_Instance;'
|
||||
type: 'used by'
|
||||
destinationClassId: '&IDC_GetSpecifiedInstancesMethod;'
|
||||
siblingRelationshipId: '&IDR_Get_Specified_Instances_Method__uses__Instance;'
|
||||
singular: no
|
||||
@ -38,6 +38,7 @@
|
||||
name: Element Content
|
||||
index: 56
|
||||
customTagName: 'elementContent'
|
||||
registerForTemplate: yes
|
||||
defaultTask: '&IDI_Task_ViewElementContent;'
|
||||
attributes:
|
||||
- instance: '&IDA_Order;'
|
||||
@ -53,6 +54,8 @@
|
||||
customTagName: 'layout'
|
||||
- instance: '&IDR_Element_Content__built_from__BEM_Process;'
|
||||
customTagName: 'builtFromBEMProcess'
|
||||
- instance: '&IDR_Derived_Element_Content__update_with__Executable_returning_Work_Data;'
|
||||
customTagName: 'value'
|
||||
instances:
|
||||
- instance: '&IDI_Element_AddMetadataInstance;'
|
||||
name: add metadata instance
|
||||
@ -72,3 +75,18 @@
|
||||
destinationClassId: '&IDC_ElementContent;'
|
||||
siblingRelationshipId: '&IDR_Element_Content__has__Element_Content_Display_Option;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Derived_Element_Content__update_with__Executable_returning_Work_Data;'
|
||||
index: 2165
|
||||
sourceClassId: '&IDC_ElementContent;'
|
||||
type: 'update with'
|
||||
destinationClassId: '&IDC_ExecutableReturningWorkData;'
|
||||
siblingRelationshipId: '&IDR_Executable_returning_Work_Data__used_by__Derived_Element_Content;'
|
||||
singular: no
|
||||
- relationship: '&IDR_Executable_returning_Work_Data__used_by__Derived_Element_Content;'
|
||||
index: 2166
|
||||
sourceClassId: '&IDC_ExecutableReturningWorkData;'
|
||||
type: 'used by'
|
||||
destinationClassId: '&IDC_ElementContent;'
|
||||
siblingRelationshipId: '&IDR_Derived_Element_Content__update_with__Executable_returning_Work_Data;'
|
||||
singular: no
|
||||
@ -0,0 +1,51 @@
|
||||
---
|
||||
- entityDefinitions:
|
||||
- IDR_Get_Instances_Method__returns__Work_Set: '{7d0f93b1-8c93-464e-a44d-d674f910b589}'
|
||||
- IDR_Work_Set__returned_by__Get_Instances_Method: '{6a5873ac-13f8-4688-96ac-3d43403dc291}'
|
||||
- IDR_Get_Instances_Method__selects_instances_of__Class: '{c0b85d90-de8c-44c2-9420-c5e724ccdf2c}'
|
||||
- IDR_Class__instances_selected_by__Get_Instances_Method: '{7a20a467-fdb3-4932-8372-f93f0fc8f77f}'
|
||||
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- class: '&IDC_GetInstancesMethod;'
|
||||
inherits: '&IDC_Method;'
|
||||
name: GI - Get Instances Method
|
||||
index: 393
|
||||
customTagName: getInstancesMethod
|
||||
relationships:
|
||||
- instance: '&IDR_Get_Instances_Method__returns__Work_Set;'
|
||||
customTagName: 'returnsWorkSet'
|
||||
- instance: '&IDR_Get_Instances_Method__selects_instances_of__Class;'
|
||||
customTagName: 'selectsInstancesOfClass'
|
||||
|
||||
- relationship: '&IDR_Get_Instances_Method__returns__Work_Set;'
|
||||
index: 915
|
||||
sourceClassId: '&IDC_GetInstancesMethod;'
|
||||
type: 'returns'
|
||||
destinationClassId: '&IDC_WorkSet;'
|
||||
siblingRelationshipId: '&IDR_Work_Set__returned_by__Get_Instances_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Work_Set__returned_by__Get_Instances_Method;'
|
||||
index: 916
|
||||
sourceClassId: '&IDC_WorkSet;'
|
||||
type: 'returned by'
|
||||
destinationClassId: '&IDC_GetInstancesMethod;'
|
||||
siblingRelationshipId: '&IDR_Get_Instances_Method__returns__Work_Set;'
|
||||
singular: no
|
||||
|
||||
- relationship: '&IDR_Get_Instances_Method__selects_instances_of__Class;'
|
||||
index: 918
|
||||
sourceClassId: '&IDC_GetInstancesMethod;'
|
||||
type: 'selects instances of'
|
||||
destinationClassId: '&IDC_Class;'
|
||||
siblingRelationshipId: '&IDR_Class__instances_selected_by__Get_Instances_Method;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Class__instances_selected_by__Get_Instances_Method;'
|
||||
index: 920
|
||||
sourceClassId: '&IDC_Class;'
|
||||
type: 'instances selected by'
|
||||
destinationClassId: '&IDC_GetInstancesMethod;'
|
||||
siblingRelationshipId: '&IDR_Get_Instances_Method__selects_instances_of__Class;'
|
||||
singular: no
|
||||
@ -7,3 +7,23 @@
|
||||
relationships:
|
||||
- instance: '&IDR_Task__related_action_for__Instance;'
|
||||
customTagName: relatedActionForInstanceId
|
||||
|
||||
# BUIR - Build UI Response Method.uses Executable returning Element
|
||||
# the BUIR is referenced via a Build Response Method Binding [BRMB] on the CT
|
||||
# the CT is in turn referenced by the Task
|
||||
|
||||
- relationship: '&IDR_Task__has_initiating__Element;'
|
||||
index: 89
|
||||
sourceClassId: '&IDC_Task;'
|
||||
type: 'has initiating'
|
||||
destinationClassId: '&IDC_Element;'
|
||||
siblingRelationshipId: '&IDR_Element__initiates_for__Task;'
|
||||
singular: yes
|
||||
|
||||
- relationship: '&IDR_Element__initiates_for__Task;'
|
||||
index: 90
|
||||
sourceClassId: '&IDC_Element;'
|
||||
type: 'initiates for'
|
||||
destinationClassId: '&IDC_Task;'
|
||||
siblingRelationshipId: '&IDR_Task__has_initiating__Element;'
|
||||
singular: no
|
||||
|
||||
@ -10,10 +10,9 @@
|
||||
customTagName: 'name'
|
||||
- instance: '&IDA_ClassName;'
|
||||
customTagName: 'className'
|
||||
|
||||
- hardcodedTask: '&IDI_Task_ViewClass;'
|
||||
name: 'View Class'
|
||||
className: 'Mocha\\UI\\Tasks\\ViewClass'
|
||||
relationships:
|
||||
- instance: '&IDR_Task__has__Task_Category;'
|
||||
customTagName: 'taskCategory'
|
||||
|
||||
- hardcodedTask: '&IDI_Task_ViewElementContent;'
|
||||
name: 'View Element Content'
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
superclasses:
|
||||
- '&IDC_Task;'
|
||||
attributes:
|
||||
- instance: '&IDA_Name;' #!FIXME: inherit from class 'inherits' attribute
|
||||
customTagName: 'name'
|
||||
- instance: '&IDA_Schedulable'
|
||||
customTagName: schedulable
|
||||
- instance: '&IDA_LongRunning;'
|
||||
@ -19,4 +21,24 @@
|
||||
relationships:
|
||||
- instance: '&IDR_Task__has_initiating__Element;'
|
||||
customTagName: initiatingElementId
|
||||
- instance: '&IDR_Task__has__Task_Category;'
|
||||
customTagName: taskCategory
|
||||
|
||||
- sequenceTask: '&IDI_Task_ViewElement;'
|
||||
name: 'View Element'
|
||||
schedulable: no
|
||||
longRunning: no
|
||||
suppressRIHints: no
|
||||
stepName: View Element
|
||||
showSpreadsheetButonOnSelection: no
|
||||
taskCategory: '&IDI_TaskCategory_Element;'
|
||||
initiatingElementId: '&IDE_ElementStart;'
|
||||
|
||||
- element: '&IDE_ElementStart;'
|
||||
name: 'Element Start'
|
||||
elementContents:
|
||||
- elementContent: '{2b534e53-b0ef-429d-b9a4-4eba9e36a455}'
|
||||
defaultDataType: '&IDC_Element;'
|
||||
order: a
|
||||
- elementContent: '{3dd3c7f6-9da6-48bc-8fe5-a6d03dcd1d9e}'
|
||||
defaultDataType: '&IDA_Name;'
|
||||
@ -9,9 +9,9 @@
|
||||
attributes:
|
||||
- instance: '&IDA_Name;'
|
||||
customTagName: name
|
||||
- instance: '&IDA_OpenInNewWindow'
|
||||
- instance: '&IDA_OpenInNewWindow;'
|
||||
customTagName: openInNewWindow
|
||||
- instance: '&IDA_TargetURL'
|
||||
- instance: '&IDA_TargetURL;'
|
||||
customTagName: targetUrl
|
||||
|
||||
relationships:
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
name: Task Category
|
||||
customTagName: taskCategory
|
||||
attributes:
|
||||
- instance: '&IDA_Name'
|
||||
- instance: '&IDA_Name;'
|
||||
customTagName: name
|
||||
|
||||
# ents defined in ../000-EntityDefinitions/016-TaskCategories.yaml
|
||||
@ -19,3 +19,7 @@
|
||||
name: 'Method Binding'
|
||||
- taskCategory: '&IDI_TaskCategory_ReturnedWorkData;'
|
||||
name: 'Returned Work Data'
|
||||
- taskCategory: '&IDI_TaskCategory_Debugging;'
|
||||
name: 'Debugging'
|
||||
- taskCategory: '&IDI_TaskCategory_Element;'
|
||||
name: 'Element'
|
||||
@ -18,6 +18,7 @@
|
||||
module: '&IDI_Module_MochaBaseSystem;'
|
||||
elementContents:
|
||||
- instance: '{bce8db21-66e1-4cfb-b398-9f010747c225}'
|
||||
- instance: '{22eb6d52-6ad9-4b6f-8f59-d7c896cae8ac}'
|
||||
|
||||
- elementContent: '{bce8db21-66e1-4cfb-b398-9f010747c225}'
|
||||
defaultDataType: '&IDR_Element_Content__for__Element;'
|
||||
@ -25,3 +26,10 @@
|
||||
order: a
|
||||
displayOptions:
|
||||
- instance: '&IDI_DisplayOption_NotEnterable;'
|
||||
|
||||
- elementContent: '{22eb6d52-6ad9-4b6f-8f59-d7c896cae8ac}'
|
||||
defaultDataType: '&IDA_Order;'
|
||||
label: 'Order'
|
||||
order: b
|
||||
displayOptions:
|
||||
- instance: '&IDI_DisplayOption_NotEnterable;'
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
---
|
||||
- entityDefinitions:
|
||||
- IDE_UserList: '{ceccad4f-a1c2-4945-831a-a34ee2c502ea}'
|
||||
- IDBEM_UserList: '{0c202bb4-6afb-4f34-8a29-55723dc61ae1}'
|
||||
- IDBEMP_UserList: '{ca4361b5-c336-4c6d-8f44-95487879fca4}'
|
||||
- IDI_GetInstances_User: '{7415d0de-ec70-4542-8885-f4c6319f08a8}'
|
||||
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- getInstancesMethod: '&IDI_GetInstances_User;'
|
||||
returnsWorkSet: null
|
||||
selectsInstancesOfClass: '&IDC_User;'
|
||||
|
||||
- buildElementMethod: '&IDBEM_UserList;'
|
||||
hasBemProcess: '&IDBEMP_UserList;'
|
||||
|
||||
- bemProcess: '&IDBEMP_UserList;'
|
||||
loopExecutableReturningInstanceSet: '&IDI_GetInstances_User;' # the GSI, below
|
||||
|
||||
- element: '&IDE_UserList;'
|
||||
name: user list
|
||||
index: 113789
|
||||
processedByPRUMethod: null
|
||||
elementContents:
|
||||
- globalIdentifier: '{ce9eff84-034f-49ab-a976-adff7c402f00}'
|
||||
order: 'a'
|
||||
label: 'User'
|
||||
defaultDataType: '&IDC_User;'
|
||||
# builtFromBEMProcess: '&IDBEM_1;'
|
||||
- globalIdentifier: '{f24ec140-7f6c-4efc-920d-076352f257ae}'
|
||||
order: 'b'
|
||||
label: 'User Name'
|
||||
defaultDataType: '&IDA_UserName;'
|
||||
# builtFromBEMProcess: '&IDBEM_1;'
|
||||
- globalIdentifier: '{82b0a709-eedc-4af2-9ffa-b91648b6e53f}'
|
||||
order: 'c'
|
||||
label: 'Nonce'
|
||||
defaultDataType: '&IDA_PasswordSalt;'
|
||||
# builtFromBEMProcess: '&IDBEM_1;'
|
||||
- globalIdentifier: '{52dadfbd-79d7-409b-9b3e-710c13a7aefc}'
|
||||
order: 'd'
|
||||
label: 'SHA-512 Hash'
|
||||
defaultDataType: '&IDA_PasswordHash;'
|
||||
# builtFromBEMProcess: '&IDBEM_1;'
|
||||
@ -7,11 +7,21 @@
|
||||
processedByPRUMethod: '{2aa20384-4132-49d3-a661-ae7d9a2e2feb}'
|
||||
elementContents:
|
||||
- instance: '{91b1a767-08ac-47f0-9f30-620de6374d12}'
|
||||
- instance: '{628550d8-673d-4156-8983-447ea2ee6d1b}'
|
||||
- elementContent: '{628550d8-673d-4156-8983-447ea2ee6d1b}'
|
||||
layout: '&IDI_ButtonLayout_DefaultButtonGroup;'
|
||||
label: 'Test Method Binding'
|
||||
value:
|
||||
- taskId: '{d44b1278-4e29-44f4-b1ca-2e6bde40377e}'
|
||||
- elementContent: '{dafb235b-ba1a-4b1a-8f9b-84cd987553e4}'
|
||||
layout: '&IDI_ButtonLayout_DefaultButtonGroup;'
|
||||
label: 'Edit Class'
|
||||
value:
|
||||
- taskId: '{9dbdb202-e9f8-49ca-bbc2-0b63df651246}'
|
||||
- instance: '{8c69fd8c-28fa-4f3c-a283-5d0006c1027d}'
|
||||
- instance: '{535b1507-68ed-4981-8cd4-e8e843a24916}'
|
||||
- instance: '{d74123b5-9fde-4c2a-bd28-8cd00ce86734}'
|
||||
- instance: '{d5653b81-a5e2-4f77-92f8-bcbae09f0d71}'
|
||||
- instance: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}'
|
||||
|
||||
- class: '{cce471d6-5fe7-4202-b678-9fcab20fd864}'
|
||||
name: 'Element Tests Testing Class 1'
|
||||
@ -27,12 +37,41 @@
|
||||
twml: 'hi world'
|
||||
rqft: 'test test'
|
||||
|
||||
- ettc: '{d1a0e1d2-e380-4056-8c4f-f893c554527f}'
|
||||
twml: 'second ETTC test'
|
||||
rqft: 'another value for testing required'
|
||||
|
||||
- workSet: '{36af925a-93f5-4cb8-986e-19ac239af253}'
|
||||
validClasses:
|
||||
- instance: '{cce471d6-5fe7-4202-b678-9fcab20fd864}' # ETTC 1
|
||||
|
||||
- buildElementMethod: '{7a1add0d-1789-430f-95aa-203fe6991fcd}'
|
||||
hasBemProcess: {
|
||||
globalIdentifier: '{d1326df7-d897-46de-bad1-4d1e6f85b042}',
|
||||
loopExecutableReturningInstanceSet: '{ce3a9fcc-f5a1-45a6-9d9f-6e805906bb1f}' # the GSI, below
|
||||
}
|
||||
|
||||
# `Element Tests Testing Class 1@get Instances for Element Tests Testing (GSI)*P*S`
|
||||
- getSpecifiedInstancesMethod: '{ce3a9fcc-f5a1-45a6-9d9f-6e805906bb1f}'
|
||||
forClass: '{cce471d6-5fe7-4202-b678-9fcab20fd864}' # ETTC 1
|
||||
verb: 'get'
|
||||
name: 'Instances for Element Tests Testing'
|
||||
returnsWorkSet: '{36af925a-93f5-4cb8-986e-19ac239af253}'
|
||||
selectsInstances:
|
||||
- instance: '{98e038eb-ad55-4259-a4c5-8e82c221270c}'
|
||||
- instance: '{d1a0e1d2-e380-4056-8c4f-f893c554527f}'
|
||||
|
||||
- processRelatedUpdatesMethod: '{2aa20384-4132-49d3-a661-ae7d9a2e2feb}'
|
||||
name: 'PRU for Element Tests Class 1'
|
||||
processesForClass: '{cce471d6-5fe7-4202-b678-9fcab20fd864}'
|
||||
usesExecutableForPUMB:
|
||||
- instance: '{0063c073-28be-4e81-a9bc-b551a17e75e0}'
|
||||
- instance: '{d6aea527-d0a8-4070-9332-9101ee14c656}'
|
||||
|
||||
- assignAttributeMethod: '{0063c073-28be-4e81-a9bc-b551a17e75e0}'
|
||||
usesExecutableReturningAttribute: '{1a907d6e-b3fd-4f8e-a170-550aeb2faea5}' # EC
|
||||
assignsAttribute: '{1a907d6e-b3fd-4f8e-a170-550aeb2faea5}' # req field test
|
||||
|
||||
- assignAttributeMethod: '{d6aea527-d0a8-4070-9332-9101ee14c656}'
|
||||
usesExecutableReturningAttribute: '{d53d7283-92a2-4a62-b8f2-cf0a0b975634}' # EC
|
||||
assignsAttribute: '{d53d7283-92a2-4a62-b8f2-cf0a0b975634}' # req field test
|
||||
@ -40,12 +79,6 @@
|
||||
- buttonLayout: '&IDI_ButtonLayout_DefaultButtonGroup;'
|
||||
executesTask: '&IDI_SequenceTask_TestMethodBinding;'
|
||||
|
||||
- elementContent: '{628550d8-673d-4156-8983-447ea2ee6d1b}'
|
||||
layout: '&IDI_ButtonLayout_DefaultButtonGroup;'
|
||||
label: 'Test Method Binding'
|
||||
value:
|
||||
- taskId: '{d44b1278-4e29-44f4-b1ca-2e6bde40377e}'
|
||||
|
||||
- textAttribute: '{1a907d6e-b3fd-4f8e-a170-550aeb2faea5}'
|
||||
name: 'Test_With_MaxLength_20'
|
||||
maximumLength: 20
|
||||
@ -102,10 +135,19 @@
|
||||
index: 113803
|
||||
#processedByPRUMethod: '{2aa20384-4132-49d3-a661-ae7d9a2e2feb}'
|
||||
elementContents:
|
||||
- instance: '{c87a8626-0b3c-4ef2-97b0-f5064f6b09d9}'
|
||||
- instance: '{482845f5-c9cc-4c7b-ad5b-5aecbce3b086}'
|
||||
- instance: '{c38d8498-005e-4046-8150-e3def3c091ca}'
|
||||
- instance: '{a3032fd2-e149-4b00-b702-17862254adc2}'
|
||||
|
||||
- elementContent: '{c87a8626-0b3c-4ef2-97b0-f5064f6b09d9}'
|
||||
order: 'a'
|
||||
label: 'Test Class Again'
|
||||
defaultDataType: '{cce471d6-5fe7-4202-b678-9fcab20fd864}'
|
||||
value: '{98e038eb-ad55-4259-a4c5-8e82c221270c}'
|
||||
#displayOptions:
|
||||
#- instance: '&IDI_DisplayOption_DoNotShow;'
|
||||
|
||||
- elementContent: '{482845f5-c9cc-4c7b-ad5b-5aecbce3b086}'
|
||||
label: 'Not Enterable Again'
|
||||
defaultDataType: '{dd33bb2a-1e10-4090-a846-89a225103c07}'
|
||||
@ -128,8 +170,14 @@
|
||||
order: 'e'
|
||||
label: 'Test Horizontal EC with Grid Layout'
|
||||
defaultDataType: '{0f95606c-3653-4e40-af4e-34c501b669af}'
|
||||
# builtFromBEMProcess: '&IDBEM_1;'
|
||||
builtFromBEMProcess: '{d1326df7-d897-46de-bad1-4d1e6f85b042}'
|
||||
# displayOptions:
|
||||
# - instance: '&IDI_DisplayOption_Required;'
|
||||
parameters:
|
||||
- instance: '{a8c306ed-9eb6-49c8-a6dc-357617e493d5}'
|
||||
|
||||
- elementContent: '{946f14a7-559f-4f6f-ae47-cbcad1523ad5}'
|
||||
order: 'f'
|
||||
label: 'Users On This SUV'
|
||||
defaultDataType: '&IDE_UserList;'
|
||||
builtFromBEMProcess: '&IDBEMP_UserList;'
|
||||
displayOptions:
|
||||
- instance: '&IDI_DisplayOption_NotEnterable;'
|
||||
@ -8,3 +8,4 @@
|
||||
- sequenceTask: '{9dbdb202-e9f8-49ca-bbc2-0b63df651246}'
|
||||
name: 'Edit Class'
|
||||
relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;'
|
||||
taskCategory: '&IDI_TaskCategory_Class;'
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- taskCategory: '&IDI_TaskCategory_IntegrationIDs;'
|
||||
name: 'Integration IDs'
|
||||
|
||||
- sequenceTask: '&IDI_Task_ViewIntegrationIDs;'
|
||||
name: 'View Integration IDs'
|
||||
relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;'
|
||||
taskCategory: '&IDI_TaskCategory_IntegrationIDs;'
|
||||
- sequenceTask: '{42bdbbc9-214f-4d81-b91f-36a177e5087b}'
|
||||
name: 'Edit External IDs'
|
||||
relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;'
|
||||
taskCategory: '&IDI_TaskCategory_IntegrationIDs;'
|
||||
- sequenceTask: '{643a3780-250b-4575-be50-50dc346137c0}'
|
||||
name: 'Edit Reference ID'
|
||||
relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;'
|
||||
taskCategory: '&IDI_TaskCategory_IntegrationIDs;'
|
||||
- sequenceTask: '{5aafc3a1-8490-4860-866d-717a4c2c77e2}'
|
||||
name: 'Maintain Reference IDs'
|
||||
relatedTaskParameter: '&IDI_WorkSet_ClassForEditClassTask;'
|
||||
taskCategory: '&IDI_TaskCategory_IntegrationIDs;'
|
||||
@ -1,7 +1,12 @@
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- redirectTask: '{4f8a0e8e-e139-4cc6-b8cf-a32e67bd192d}'
|
||||
name: 'ViewInCodeEditor'
|
||||
- redirectTask: '&IDI_Task_ShowDefinitionInCodeEditor;'
|
||||
name: 'Show Definition in Code Editor'
|
||||
openInNewWindow: yes
|
||||
taskCategory: '&IDI_TaskCategory_Debugging;'
|
||||
targetUrl: 'https://localhost:47071/?hi'
|
||||
- redirectTask: '&IDI_Task_DeleteInstance;'
|
||||
name: 'Delete Instance'
|
||||
openInNewWindow: yes
|
||||
taskCategory: '&IDI_TaskCategory_Instance;'
|
||||
targetUrl: 'https://localhost:47071/?hi'
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
# - library: '&IDL_MochaBaseSystem;'
|
||||
# instances:
|
||||
- library: '&IDL_MochaBaseSystem;'
|
||||
instances:
|
||||
- hardcodedTask: '&IDI_Task_ViewClass;'
|
||||
name: 'View Class'
|
||||
className: 'Mocha\\UI\\Tasks\\ViewClass'
|
||||
taskCategory: '&IDI_TaskCategory_Class;'
|
||||
|
||||
# - task: '&IDI_Task_ViewClass;'
|
||||
# name: View Class
|
||||
# module: '&IDI_Module_MochaBaseSystem;'
|
||||
|
||||
@ -1,95 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Mocha\Core\KnownAttributeGuids;
|
||||
use Mocha\Core\KnownInstanceGuids;
|
||||
use Mocha\Core\KnownRelationshipGuids;
|
||||
use Mocha\Oms\MySQLDatabaseOms;
|
||||
use Phast\System;
|
||||
|
||||
function mocha_get_oms()
|
||||
{
|
||||
global $oms;
|
||||
if ($oms === null)
|
||||
{
|
||||
$oms = new MySQLDatabaseOms(System::GetConfigurationValue("Database.ServerName"), System::GetConfigurationValue("Database.PortNumber"), System::GetConfigurationValue("Database.DatabaseName"), System::GetConfigurationValue("Database.UserName"), System::GetConfigurationValue("Database.Password"));
|
||||
}
|
||||
return $oms;
|
||||
}
|
||||
function mocha_init_spot_timer($pg)
|
||||
{
|
||||
$literalSpotTimer = $pg->GetControlByID("literalSpotTimer");
|
||||
|
||||
if (file_exists("/etc/mocha/suvstart"))
|
||||
{
|
||||
$suv_start_time = trim(file_get_contents("/etc/mocha/suvstart"));
|
||||
$suv_start_time_d = new \DateTime($suv_start_time);
|
||||
$suv_start_time_d->setTimezone(new \DateTimeZone("UTC"));
|
||||
|
||||
// this can be adjusted?
|
||||
$suv_end_time_d = $suv_start_time_d->add(new \DateInterval("PT10H"));
|
||||
$suv_end_time_d->setTimezone(new \DateTimeZone("UTC"));
|
||||
|
||||
$suv_end_time = $suv_end_time_d->format('Y-m-d\TH:i:s\Z');
|
||||
|
||||
$suv_current_time_d = new \DateTime();
|
||||
$interval = $suv_end_time_d->diff($suv_current_time_d);
|
||||
|
||||
$literalSpotTimer->Content = $interval->h . ":" . $interval->i;
|
||||
|
||||
$spotTimerInitializationScript = $pg->Page->GetControlByID("spotTimerInitializationScript");
|
||||
$spotTimerInitializationScript->Content = <<<EOT
|
||||
<script type="text/javascript">
|
||||
var spot_end_time = new Date('$suv_end_time');
|
||||
window.datediff = function(earlierDate, laterDate)
|
||||
{
|
||||
var interval = { };
|
||||
var a = earlierDate, b = laterDate;
|
||||
|
||||
console.log(earlierDate);
|
||||
console.log(laterDate);
|
||||
|
||||
const _MS_PER_DAY = 1000 * 60 * 60 * 24;
|
||||
// Discard the time and time-zone information.
|
||||
const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds());
|
||||
const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate(), b.getHours(), b.getMinutes(), b.getSeconds());
|
||||
|
||||
console.log(utc2);
|
||||
console.log(utc1);
|
||||
|
||||
var diffMS = (utc2 - utc1);
|
||||
|
||||
console.log(diffMS);
|
||||
|
||||
var secs = (diffMS / 1000) % 60;
|
||||
var mins = (diffMS / (1000 * 60)) % 60;
|
||||
var hrs = (diffMS / (1000 * 60 * 60)) % 24;
|
||||
|
||||
interval =
|
||||
{
|
||||
"raw": diffMS,
|
||||
"seconds": Math.floor(secs),
|
||||
"minutes": Math.floor(mins),
|
||||
"hours": Math.floor(hrs)
|
||||
};
|
||||
return interval;
|
||||
};
|
||||
window.spot_timer_tick = function()
|
||||
{
|
||||
var spot_cur_time = new Date();
|
||||
var diff = datediff(spot_cur_time, spot_end_time);
|
||||
console.log(diff);
|
||||
document.getElementById('spot_timer').innerHTML = diff.hours + ':' + diff.minutes.toString().padStart(2, '0');
|
||||
|
||||
window.setTimeout(spot_timer_tick, 60000);
|
||||
};
|
||||
window.addEventListener("load", function()
|
||||
{
|
||||
spot_timer_tick();
|
||||
});
|
||||
</script>
|
||||
EOT;
|
||||
}
|
||||
}
|
||||
require_once("mochacommon.inc.php");
|
||||
|
||||
System::$BeforeGetTenantNameHandler = function()
|
||||
{
|
||||
@ -129,7 +42,7 @@ function requiresLogin($path)
|
||||
System::$BeforeLaunchEventHandler = function($path)
|
||||
{
|
||||
/**
|
||||
* @var MySQLDatabaseOms
|
||||
* @var \Mocha\Oms\MySQLDatabaseOms
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
@ -196,64 +109,6 @@ System::$BeforeLaunchEventHandler = function($path)
|
||||
{
|
||||
$oms->setTenant($currentTenant);
|
||||
}
|
||||
|
||||
$currentUser = null;
|
||||
if (isset($_SESSION["user_token_" . $currentTenant->ID]))
|
||||
{
|
||||
// SELECT FROM `Users` WHERE `Token` = $_SESSION["user_token"]
|
||||
$insts = $oms->getInstancesByAttributes(array
|
||||
(
|
||||
KnownAttributeGuids::Token => $_SESSION["user_token_" . $currentTenant->ID]
|
||||
));
|
||||
|
||||
$currentUser = null;
|
||||
$loginEntry = null;
|
||||
if (count($insts) == 1)
|
||||
{
|
||||
$loginEntry = $insts[0];
|
||||
|
||||
if ($loginEntry != null)
|
||||
{
|
||||
$users = $oms->getRelatedInstances($loginEntry, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::User_Login__has__User));
|
||||
if (count($users) == 1)
|
||||
{
|
||||
$currentUser = $users[0];
|
||||
}
|
||||
}
|
||||
|
||||
if ($currentUser === null)
|
||||
{
|
||||
echo("returned null");
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$page = null;
|
||||
$pathVars = null;
|
||||
System::ParsePathVariablesIntoPage($page, $pathVars);
|
||||
|
||||
if ($currentUser === null)
|
||||
{
|
||||
if (count($path) >= 4)
|
||||
{
|
||||
if ($path[0] == "madi" && $path[1] == "authgwy")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($page != null)
|
||||
{
|
||||
if (requiresLogin($page->FileName))
|
||||
{
|
||||
echo($page->FileName);
|
||||
$_SESSION["login_return"] = $path;
|
||||
System::RedirectToLoginPage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
159
php/mocha/include/mochacommon.inc.php
Normal file
159
php/mocha/include/mochacommon.inc.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
use Mocha\Core\InstanceReference;
|
||||
use Mocha\Core\KnownAttributeGuids;
|
||||
use Mocha\Core\KnownInstanceGuids;
|
||||
use Mocha\Core\KnownRelationshipGuids;
|
||||
use Mocha\Oms\MySQLDatabaseOms;
|
||||
use Phast\System;
|
||||
|
||||
function mocha_get_oms()
|
||||
{
|
||||
global $oms;
|
||||
if ($oms === null)
|
||||
{
|
||||
$oms = new MySQLDatabaseOms(System::GetConfigurationValue("Database.ServerName"), System::GetConfigurationValue("Database.PortNumber"), System::GetConfigurationValue("Database.DatabaseName"), System::GetConfigurationValue("Database.UserName"), System::GetConfigurationValue("Database.Password"));
|
||||
}
|
||||
$oms->setCurrentUser(mocha_get_current_user());
|
||||
return $oms;
|
||||
}
|
||||
function mocha_get_current_user() : ?InstanceReference
|
||||
{
|
||||
/**
|
||||
* @var MySQLDatabaseOms
|
||||
*/
|
||||
global $oms; //! WE CANNOT CALL mocha_get_oms() HERE!
|
||||
|
||||
$currentTenant = $oms->getTenant();
|
||||
if (isset($_SESSION["user_token_" . $currentTenant->ID]))
|
||||
{
|
||||
// SELECT FROM `Users` WHERE `Token` = $_SESSION["user_token"]
|
||||
$insts = $oms->getInstancesByAttributes(array
|
||||
(
|
||||
KnownAttributeGuids::Token => $_SESSION["user_token_" . $currentTenant->ID]
|
||||
));
|
||||
|
||||
$currentUser = null;
|
||||
$loginEntry = null;
|
||||
if (count($insts) == 1)
|
||||
{
|
||||
$loginEntry = $insts[0];
|
||||
|
||||
if ($loginEntry != null)
|
||||
{
|
||||
$users = $oms->getRelatedInstances($loginEntry, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::User_Login__has__User));
|
||||
if (count($users) == 1)
|
||||
{
|
||||
$currentUser = $users[0];
|
||||
}
|
||||
}
|
||||
|
||||
if ($currentUser === null)
|
||||
{
|
||||
echo("returned null");
|
||||
die();
|
||||
}
|
||||
return $currentUser;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Initializes the SPOT timer into the specified WebPage.
|
||||
*
|
||||
* @return bool true if the spot timer was initialized successfully; false otherwise.
|
||||
*/
|
||||
function mocha_init_spot_timer($pg) : bool
|
||||
{
|
||||
if ($pg === null)
|
||||
return false;
|
||||
|
||||
$literalSpotTimer = $pg->GetControlByID("literalSpotTimer");
|
||||
$spotTimerInitializationScript = $pg->GetControlByID("spotTimerInitializationScript");
|
||||
if ($literalSpotTimer === null || $spotTimerInitializationScript === null)
|
||||
return false;
|
||||
|
||||
$spotTimerContent = "";
|
||||
$spotTimerScript = "";
|
||||
mocha_get_spot_timer_script($spotTimerContent, $spotTimerScript);
|
||||
|
||||
$literalSpotTimer->Content = $spotTimerContent;
|
||||
$spotTimerInitializationScript->Content = $spotTimerScript;
|
||||
return true;
|
||||
}
|
||||
function mocha_get_spot_timer_script(&$spotTimerContent, &$spotTimerScript)
|
||||
{
|
||||
$spotTimerContent = "";
|
||||
$spotTimerScript = "";
|
||||
|
||||
if (file_exists("/etc/mocha/suvstart"))
|
||||
{
|
||||
$suv_start_time = trim(file_get_contents("/etc/mocha/suvstart"));
|
||||
$suv_start_time_d = new \DateTime($suv_start_time);
|
||||
$suv_start_time_d->setTimezone(new \DateTimeZone("UTC"));
|
||||
|
||||
// this can be adjusted?
|
||||
$suv_end_time_d = $suv_start_time_d->add(new \DateInterval("PT10H"));
|
||||
$suv_end_time_d->setTimezone(new \DateTimeZone("UTC"));
|
||||
|
||||
$suv_end_time = $suv_end_time_d->format('Y-m-d\TH:i:s\Z');
|
||||
|
||||
$suv_current_time_d = new \DateTime();
|
||||
$interval = $suv_end_time_d->diff($suv_current_time_d);
|
||||
|
||||
$spotTimerContent = $interval->h . ":" . $interval->i;
|
||||
|
||||
$spotTimerScript = <<<EOT
|
||||
<script type="text/javascript">
|
||||
var spot_end_time = new Date('$suv_end_time');
|
||||
window.datediff = function(earlierDate, laterDate)
|
||||
{
|
||||
var interval = { };
|
||||
var a = earlierDate, b = laterDate;
|
||||
|
||||
console.log(earlierDate);
|
||||
console.log(laterDate);
|
||||
|
||||
const _MS_PER_DAY = 1000 * 60 * 60 * 24;
|
||||
// Discard the time and time-zone information.
|
||||
const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds());
|
||||
const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate(), b.getHours(), b.getMinutes(), b.getSeconds());
|
||||
|
||||
console.log(utc2);
|
||||
console.log(utc1);
|
||||
|
||||
var diffMS = (utc2 - utc1);
|
||||
|
||||
console.log(diffMS);
|
||||
|
||||
var secs = (diffMS / 1000) % 60;
|
||||
var mins = (diffMS / (1000 * 60)) % 60;
|
||||
var hrs = (diffMS / (1000 * 60 * 60)) % 24;
|
||||
|
||||
interval =
|
||||
{
|
||||
"raw": diffMS,
|
||||
"seconds": Math.floor(secs),
|
||||
"minutes": Math.floor(mins),
|
||||
"hours": Math.floor(hrs)
|
||||
};
|
||||
return interval;
|
||||
};
|
||||
window.spot_timer_tick = function()
|
||||
{
|
||||
var spot_cur_time = new Date();
|
||||
var diff = datediff(spot_cur_time, spot_end_time);
|
||||
console.log(diff);
|
||||
document.getElementById('spot_timer').innerHTML = diff.hours + ':' + diff.minutes.toString().padStart(2, '0');
|
||||
|
||||
window.setTimeout(spot_timer_tick, 60000);
|
||||
};
|
||||
window.addEventListener("load", function()
|
||||
{
|
||||
spot_timer_tick();
|
||||
});
|
||||
</script>
|
||||
EOT;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -130,6 +130,9 @@ class KnownClassGuids
|
||||
const ButtonLayout = "6f6338db68e04cc7b257d1b97cf3cb92";
|
||||
const ImageLayout = "4b1bb7c6168e4ce0b4f876dd5069a80b";
|
||||
|
||||
const GetInstancesMethod = "{0a379314-9d0f-432d-ae59-63194ab32dd3}";
|
||||
|
||||
const GetSpecifiedInstancesMethod = "{7794c7d0-b15d-4b23-aa40-63bb3d1f53ac}";
|
||||
const ProcessRelatedUpdatesMethod = "2953e69803c54752a1ebcbbfa8f13905";
|
||||
}
|
||||
?>
|
||||
@ -39,5 +39,7 @@ class KnownInstanceGuids
|
||||
const Alignment__Near = "35ea407a45e1462fa923a526d12fbc47";
|
||||
const Alignment__Center = "{63179b92-9a6a-495b-a823-f45e353be9d8}";
|
||||
const Alignment__Far = "f19d16c799ff48a3b86a7db8f400d869";
|
||||
|
||||
const WorkSet__RelatedInstance = "{d9634929-0bb4-482a-85cc-9c8f1251556f}";
|
||||
}
|
||||
?>
|
||||
@ -100,7 +100,7 @@ class KnownRelationshipGuids
|
||||
const Get_Referenced_Attribute_Method__has__Attribute = "87f90fe95ec64b098f51b8a4d1544cae";
|
||||
const Get_Referenced_Attribute_Method__loop_on__Instance_Set = "c7ecd4986d054e07b1bcf7127d0d6666";
|
||||
|
||||
const Get_Specific_Instances_Method__has__Instance = "dea1aa0b2bef4bacb4f90ce8cf7006fc";
|
||||
const Get_Specified_Instances_Method__uses__Instance = "dea1aa0b2bef4bacb4f90ce8cf7006fc";
|
||||
|
||||
const Evaluate_Boolean_Expression_Method__has_source_attribute__Method = "45d76d5601ed46419f68cfe0c7d0d265";
|
||||
const Evaluate_Boolean_Expression_Method__equal_to_attribute__Method = "0646df917e3e4d59be71b978a22ced8e";
|
||||
@ -237,6 +237,10 @@ class KnownRelationshipGuids
|
||||
|
||||
const Element_Content__has__Layout = "1ab7412005ea4acab6d3c7e0133e0c4f";
|
||||
|
||||
const Element_Content__built_from__BEM_Process = "{3d7094ff-33e5-4800-9e4e-93dde0d1d331}";
|
||||
|
||||
const BEM_Process__uses_loop__Executable_returning_Instance_Set = "{0fb2b538-eacb-418a-b7d8-43a584b85952}";
|
||||
|
||||
const Layout__has__Style = "{e684bb26-7e78-4a21-b8b4-5a550f3053d5}";
|
||||
|
||||
const Element_Content__has__Element_Content_Display_Option = "f070dfa762604488a779fae291903f2d";
|
||||
@ -289,5 +293,7 @@ class KnownRelationshipGuids
|
||||
const Assign_Attribute_Method__uses__Executable_returning_Attribute = "{9313f96e-58af-416f-852e-ef83725057fc}";
|
||||
const Assign_Attribute_Method__assigns__Attribute = "{74061875-8a27-403b-9456-02e52cfd13b2}";
|
||||
|
||||
const Get_Instances_Method__selects_instances_of__Class = "{c0b85d90-de8c-44c2-9420-c5e724ccdf2c}";
|
||||
|
||||
}
|
||||
?>
|
||||
@ -11,6 +11,16 @@
|
||||
{
|
||||
private \PDO $PDO;
|
||||
|
||||
private ?InstanceReference $_currentUser = null;
|
||||
public function setCurrentUser(?InstanceReference $userInstance)
|
||||
{
|
||||
$this->_currentUser = $userInstance;
|
||||
}
|
||||
public function getCurrentUser() : ?InstanceReference
|
||||
{
|
||||
return $this->_currentUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raised when the tenant is changed via setTenant.
|
||||
*/
|
||||
@ -275,13 +285,13 @@
|
||||
);
|
||||
$result = $stmt->execute($parms);
|
||||
|
||||
trigger_error($query, \E_USER_NOTICE);
|
||||
trigger_error("source inst id: " . $sourceInstance->InstanceKey, \E_USER_NOTICE);
|
||||
trigger_error("relationship inst id: " . $relationshipInstance->InstanceKey, \E_USER_NOTICE);
|
||||
foreach ($parms as $key => $value)
|
||||
{
|
||||
trigger_error($key . ": '" . $value . "'", \E_USER_NOTICE);
|
||||
}
|
||||
// trigger_error($query, \E_USER_NOTICE);
|
||||
// trigger_error("source inst id: " . $sourceInstance->InstanceKey, \E_USER_NOTICE);
|
||||
// trigger_error("relationship inst id: " . $relationshipInstance->InstanceKey, \E_USER_NOTICE);
|
||||
// foreach ($parms as $key => $value)
|
||||
// {
|
||||
// trigger_error($key . ": '" . $value . "'", \E_USER_NOTICE);
|
||||
// }
|
||||
|
||||
if ($result === false)
|
||||
{
|
||||
@ -333,6 +343,14 @@
|
||||
}
|
||||
public function setAttributeValueInternal(InstanceReference $sourceInstance, InstanceReference $attributeInstance, mixed $value, ?\DateTime $effectiveDate = null)
|
||||
{
|
||||
$currentUser = $this->getCurrentUser();
|
||||
|
||||
$cudbid = null;
|
||||
if ($currentUser !== null)
|
||||
{
|
||||
$cudbid = $currentUser->DatabaseId;
|
||||
}
|
||||
|
||||
$query = "CALL mocha_set_attribute_value(:src_inst_id, :attr_inst_id, :attr_value, :user_inst_id, :eff_date)";
|
||||
$stmt = $this->PDO->prepare($query);
|
||||
$result = $stmt->execute(array
|
||||
@ -340,7 +358,7 @@
|
||||
"src_inst_id" => $this->getDbId($sourceInstance),
|
||||
"attr_inst_id" => $this->getDbId($attributeInstance),
|
||||
"attr_value" => $value,
|
||||
"user_inst_id" => null,
|
||||
"user_inst_id" => $cudbid,
|
||||
"eff_date" => $effectiveDate
|
||||
));
|
||||
}
|
||||
|
||||
@ -29,6 +29,19 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indices are 1-based
|
||||
*/
|
||||
public function getNthInstanceOf(InstanceReference|string|InstanceKey $sourceInstance, int $index, $defaultValue = null)
|
||||
{
|
||||
$insts = $this->getRelatedInstances($sourceInstance, KnownRelationshipGuids::Class__has__Instance);
|
||||
if (count($insts) > 0)
|
||||
{
|
||||
return $insts[$index - 1];
|
||||
}
|
||||
return $defaultValue;
|
||||
}
|
||||
|
||||
public function getRelatedInstances(InstanceReference|string|InstanceKey $sourceInstance, InstanceReference|string|InstanceKey|null $relationshipInstance, \DateTime $effectiveDate = null) : ?array
|
||||
{
|
||||
$tenant = $this->getTenant();
|
||||
@ -169,6 +182,19 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
public function printInstanceKeys(array $instanceReferences, string $separator = ":")
|
||||
{
|
||||
$ct = count($instanceReferences);
|
||||
for($i = 0; $i < $ct; $i++)
|
||||
{
|
||||
echo($instanceReferences[$i]->InstanceKey);
|
||||
if ($i < $ct - 1)
|
||||
{
|
||||
echo ($separator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function instanceSetContains(array /*<InstanceReference>*/ $haystack, InstanceReference $needle)
|
||||
{
|
||||
foreach ($haystack as $v)
|
||||
@ -181,12 +207,34 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
public function executeMethodReturningInstanceSet(InstanceReference $method, array $parms)
|
||||
public function getInstancesOf(InstanceReference $classInstance)
|
||||
{
|
||||
$instances = $this->getRelatedInstances($classInstance, KnownRelationshipGuids::Class__has__Instance);
|
||||
return $instances;
|
||||
}
|
||||
|
||||
public function executeMethodReturningInstanceSet(InstanceReference $method, array $parms) : ?array
|
||||
{
|
||||
$parentClass = $this->getParentClass($method);
|
||||
echo("parent class of method");
|
||||
print_r($parentClass);
|
||||
if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::ReturnInstanceSetMethodBinding)))
|
||||
{
|
||||
//return $this->executeMethodReturningInstanceSet($methodBindingHasMethod, $parms);
|
||||
}
|
||||
else if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::GetSpecifiedInstancesMethod)))
|
||||
{
|
||||
$instances = $this->getRelatedInstances($method, KnownRelationshipGuids::Get_Specified_Instances_Method__uses__Instance);
|
||||
return $instances;
|
||||
}
|
||||
else if ($parentClass->GlobalIdentifier->__is_equal(UUID::parse(KnownClassGuids::GetInstancesMethod)))
|
||||
{
|
||||
$selectsOfClass = $this->getRelatedInstance($method, KnownRelationshipGuids::Get_Instances_Method__selects_instances_of__Class);
|
||||
return $this->getInstancesOf($selectsOfClass);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("zq: executeMethod: unknown parent class '" . $parentClass->GlobalIdentifier . "' [" . $parentClass->InstanceKey . "]");
|
||||
die();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -251,6 +299,44 @@
|
||||
|
||||
}
|
||||
|
||||
public function getRelatedTasks(InstanceReference $inst)
|
||||
{
|
||||
$instParent = $this->getParentClass($inst);
|
||||
|
||||
$relatedTasks = [];
|
||||
|
||||
$instInstance = $this->getInstanceByGlobalIdentifier(KnownClassGuids::Instance);
|
||||
$relatedTasks0 = $this->getRelatedInstances($instInstance, KnownRelationshipGuids::Class__has_related__Task);
|
||||
foreach ($relatedTasks0 as $task)
|
||||
{
|
||||
$relatedTasks[] = $task;
|
||||
}
|
||||
|
||||
$relatedTasks1 = $this->getRelatedInstances($instParent, KnownRelationshipGuids::Class__has_related__Task);
|
||||
foreach ($relatedTasks1 as $task)
|
||||
{
|
||||
$relatedTasks[] = $task;
|
||||
}
|
||||
|
||||
$superclasses = $this->getRelatedInstances($instParent, KnownRelationshipGuids::Class__has_super__Class);
|
||||
foreach ($superclasses as $superclass)
|
||||
{
|
||||
$relatedTasks2 = $this->getRelatedInstances($superclass, KnownRelationshipGuids::Class__has_related__Task);
|
||||
foreach ($relatedTasks2 as $task)
|
||||
{
|
||||
$relatedTasks[] = $task;
|
||||
}
|
||||
}
|
||||
return $relatedTasks;
|
||||
}
|
||||
|
||||
public function getNthRelatedInstance(InstanceReference $inst, InstanceReference|string|InstanceKey|array $rel, int $index)
|
||||
{
|
||||
$rel = $this->normalizeInstanceReference($rel);
|
||||
$relInsts = $this->getRelatedInstances($inst, $rel);
|
||||
return $relInsts[$index];
|
||||
}
|
||||
|
||||
public function executeMethod(OmsContext $context, InstanceReference $methodInstance)
|
||||
{
|
||||
$methodInstanceClass = $this->getParentClass($methodInstance);
|
||||
@ -261,8 +347,15 @@
|
||||
$classForPRU = $this->getRelatedInstance($methodInstance, KnownRelationshipGuids::Process_Related_Updates_Method__processes_for__Class);
|
||||
if ($classForPRU !== null)
|
||||
{
|
||||
echo("current work data for '" . $classForPRU->GlobalIdentifier . "' = '" . $context->getWorkData($classForPRU->GlobalIdentifier->__toString()) . "'");
|
||||
}
|
||||
|
||||
//!HACK!
|
||||
$instForPRU = $this->getNthInstanceOf($classForPRU, 1);
|
||||
if ($instForPRU !== null)
|
||||
{
|
||||
//echo("current work data for '" . $instForPRU->GlobalIdentifier . "' = '" . $context->getWorkData($instForPRU->GlobalIdentifier->__toString()) . "'");
|
||||
}
|
||||
|
||||
$instExecutablesForPUMB = $this->getRelatedInstances($methodInstance, KnownRelationshipGuids::Process_Related_Updates_Method__uses__Executable_for_PUMB);
|
||||
foreach ($instExecutablesForPUMB as $instExecutableForPUMB)
|
||||
{
|
||||
@ -271,9 +364,18 @@
|
||||
$assignsAttribute = $this->getRelatedInstance($instExecutableForPUMB, KnownRelationshipGuids::Assign_Attribute_Method__assigns__Attribute);
|
||||
$usesExecutableReturningAttribute = $this->getRelatedInstance($instExecutableForPUMB, KnownRelationshipGuids::Assign_Attribute_Method__uses__Executable_returning_Attribute);
|
||||
|
||||
$context->setWorkData($assignsAttribute->GlobalIdentifier->__toString(), $usesExecutableReturningAttribute);
|
||||
echo ("assigning attribute '" . $assignsAttribute->GlobalIdentifier . "' the value from executable '" . $usesExecutableReturningAttribute->GlobalIdentifier . "'");
|
||||
//echo ("the value from work data is '" . $context->getWorkData($usesExecutableReturningAttribute->GlobalIdentifier) . "'");
|
||||
//$context->setWorkData($assignsAttribute->GlobalIdentifier->__toString(), $usesExecutableReturningAttribute);
|
||||
//echo ("assigning attribute '" . $assignsAttribute->GlobalIdentifier . "' the value from executable '" . $usesExecutableReturningAttribute->GlobalIdentifier . "'");
|
||||
|
||||
$value = $context->getWorkData($usesExecutableReturningAttribute->GlobalIdentifier->__toString());
|
||||
if ($value instanceof InstanceReference)
|
||||
{
|
||||
//echo ("the value from work data is ##IS#'" . $value->GlobalIdentifier . "'##");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setAttributeValue($instForPRU, $assignsAttribute, $value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
|
||||
use Mocha\Core\InstanceKey;
|
||||
use Mocha\Core\InstanceReference;
|
||||
use Mocha\Core\KnownInstanceGuids;
|
||||
use Mocha\Core\KnownRelationshipGuids;
|
||||
use Mocha\Oms\MySQLDatabaseOms;
|
||||
|
||||
use Phast\HTMLControl;
|
||||
@ -17,6 +19,11 @@
|
||||
{
|
||||
public $Name;
|
||||
|
||||
public bool $Editable;
|
||||
public bool $MultiSelect;
|
||||
public bool $DisplayAsCount;
|
||||
public bool $DisableLink;
|
||||
|
||||
public array $SelectedInstances;
|
||||
public array $ValidClasses;
|
||||
|
||||
@ -27,6 +34,10 @@
|
||||
$this->Name = null;
|
||||
$this->TagName = "div";
|
||||
$this->ClassList[] = "mcx-instancebrowser";
|
||||
$this->Editable = false;
|
||||
$this->MultiSelect = false;
|
||||
$this->DisplayAsCount = false;
|
||||
$this->DisableLink = false;
|
||||
$this->ValidClasses = array();
|
||||
|
||||
if ($instanceReferences === null)
|
||||
@ -153,6 +164,21 @@
|
||||
$adw->ClassList[] = "mcx-moniker";
|
||||
$adw->ClassTitle = $parentClassName;
|
||||
|
||||
$adw->ShowURL = false;
|
||||
$instDefaultTask = $oms->getRelatedInstance($instParent, KnownRelationshipGuids::Class__has_default__Task);
|
||||
if ($instDefaultTask != null)
|
||||
{
|
||||
// !FIXME: check to see if the task is authorized for the current user
|
||||
// (e.g. this can be by if `User .has Security Domain` any in `Securable.has Security Domain`)
|
||||
// e.g. if User has `Administrator` and Task has `Administrator`, return true
|
||||
|
||||
if (true) // ($oms->isTaskAuthorizedForUser($instDefaultTask, $oms->getCurrentUser()))
|
||||
{
|
||||
$adw->TargetURL = System::ExpandRelativePath("~/d/inst/" . $instParent->InstanceKey . "/" . $inst->InstanceKey . ".htmld");
|
||||
$adw->ShowURL = true;
|
||||
}
|
||||
}
|
||||
|
||||
$adw->Text = $oms->getInstanceText($inst);
|
||||
/*
|
||||
$this->MenuItems = array(
|
||||
@ -179,7 +205,6 @@
|
||||
))
|
||||
);
|
||||
*/
|
||||
$adw->TargetURL = System::ExpandRelativePath("~/d/inst/" . $inst->InstanceKey . ".htmld");
|
||||
|
||||
$li->Controls[] = $adw;
|
||||
$ul->Controls[] = $li;
|
||||
|
||||
@ -47,6 +47,8 @@
|
||||
public bool $IsPostback;
|
||||
public string $SubmitButtonText;
|
||||
|
||||
private $__renderingNotEnterable;
|
||||
|
||||
public function __construct(OmsContext $context)
|
||||
{
|
||||
$this->Context = $context;
|
||||
@ -55,6 +57,7 @@
|
||||
$this->IsPostback = false;
|
||||
$this->StyleClasses = [];
|
||||
$this->SubmitButtonText = "Save Changes";
|
||||
$this->__renderingNotEnterable = false;
|
||||
}
|
||||
/**
|
||||
* Thanks https://stackoverflow.com/a/31107425
|
||||
@ -154,11 +157,30 @@
|
||||
|
||||
private function updateWorkDataWithElementContents()
|
||||
{
|
||||
echo ("updating work datas from element contents...<br/>");
|
||||
echo ("current work data: <br/>");
|
||||
print_r($this->Context->workData);
|
||||
echo ("<br/><br/>");
|
||||
echo ("proposed changes: <br/>");
|
||||
/**
|
||||
* @var MySQLDatabaseOms
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
// echo ("updating work datas from element contents...<br/>");
|
||||
// echo ("current work data: <br/>");
|
||||
// print_r($this->Context->workData);
|
||||
|
||||
foreach ($_POST as $key => $value)
|
||||
{
|
||||
if (str_starts_with($key, "ec_"))
|
||||
{
|
||||
$ecid = substr($key, 3);
|
||||
$inst_ec = $oms->getInstanceByKey(InstanceKey::Parse($ecid));
|
||||
|
||||
$value = $this->Context->getElementParm($inst_ec, $inst_ec->GlobalIdentifier->__toString());
|
||||
|
||||
$targetInst = $oms->getRelatedInstance($inst_ec, KnownRelationshipGuids::Element_Content__has__Instance);
|
||||
|
||||
//? this feels like a hack...
|
||||
$this->Context->setWorkData($targetInst->GlobalIdentifier->__toString(), $value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -471,7 +493,7 @@
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function renderElementContent(InstanceReference $elementContent)
|
||||
public function renderElementContent(InstanceReference $elementContent, InstanceReference $relatedInstanceParm = null)
|
||||
{
|
||||
/**
|
||||
* @var MySQLDatabaseOms
|
||||
@ -479,6 +501,7 @@
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
$ecInst = $oms->getRelatedInstance($elementContent, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Instance));
|
||||
$relatedInstance = $this->Context->getWorkData(KnownInstanceGuids::WorkSet__RelatedInstance);
|
||||
|
||||
echo ("<!-- " . $elementContent->InstanceKey . " ; " . $ecInst->InstanceKey . " -->");
|
||||
|
||||
@ -565,7 +588,26 @@
|
||||
}
|
||||
else if ($oms->is_a($ecInst, KnownClassGuids::TextAttribute))
|
||||
{
|
||||
$value = $oms->getAttributeValue($this->TargetInstance, $ecInst);
|
||||
// fill in the value from the target instance
|
||||
$targetInstance = $relatedInstance;
|
||||
if ($relatedInstanceParm !== null)
|
||||
{
|
||||
$targetInstance = $relatedInstanceParm;
|
||||
}
|
||||
if ($targetInstance === null)
|
||||
{
|
||||
$targetInstance = $this->TargetInstance;
|
||||
|
||||
$firstElementContent = $oms->getNthRelatedInstance($this->__renderingElement, KnownRelationshipGuids::Element__has__Element_Content, 0);
|
||||
$firstElementContentInst = $oms->getRelatedInstance($firstElementContent, KnownRelationshipGuids::Element_Content__has__Instance);
|
||||
|
||||
$targetInstance = $oms->getNthInstanceOf($firstElementContentInst, 1);
|
||||
}
|
||||
if ($targetInstance !== null)
|
||||
{
|
||||
$value = $oms->getAttributeValue($targetInstance, $ecInst);
|
||||
}
|
||||
|
||||
if ($value === null)
|
||||
{
|
||||
$value = $oms->getAttributeValue($ecInst, $oms->getInstanceByGlobalIdentifier(KnownAttributeGuids::Value));
|
||||
@ -573,21 +615,27 @@
|
||||
|
||||
if ($this->IsPostback && isset($_POST["ec_" . strval($elementContent->InstanceKey)]))
|
||||
{
|
||||
// fill in the value from the postback
|
||||
$value = $_POST["ec_" . strval($elementContent->InstanceKey)];
|
||||
}
|
||||
|
||||
if (!$oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__NotEnterable)))
|
||||
{
|
||||
$this->renderTextAttribute($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value);
|
||||
}
|
||||
else
|
||||
if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__NotEnterable)) || $this->__renderingNotEnterable)
|
||||
{
|
||||
echo($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->renderTextAttribute($elementContent, $ecInst, $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ObscuredText)), $value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$adw = new InstanceBrowser(array($ecInst));
|
||||
$targetInstance = $relatedInstanceParm;
|
||||
if ($targetInstance === null)
|
||||
{
|
||||
$targetInstance = $ecInst;
|
||||
}
|
||||
$adw = new InstanceBrowser(array($targetInstance));
|
||||
$adw->Render();
|
||||
// echo ("<span class=\"mcx-value\">unknown pclass ident " . $oms->getParentClass($ecInst)->GlobalIdentifier . "</span>");
|
||||
}
|
||||
@ -603,6 +651,7 @@
|
||||
* @var MySQLDatabaseOms
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
$displayOptions = $oms->getRelatedInstances($ec, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element_Content__has__Element_Content_Display_Option));
|
||||
|
||||
$ecid = $ec->InstanceKey;
|
||||
@ -695,7 +744,20 @@
|
||||
$this->renderBeginTag("title");
|
||||
echo($title);
|
||||
$this->renderEndTag("title");
|
||||
echo("<link rel=\"stylesheet\" type=\"text/css\" href=\"" . System::ExpandRelativePath("~/themes/" . System::GetConfigurationValue("Application.ThemeName") . "/theme.css", false, true) . "\" />");
|
||||
|
||||
$this->renderTag("link", array
|
||||
(
|
||||
"rel" => "stylesheet",
|
||||
"type" => "text/css",
|
||||
"href" => System::ExpandRelativePath("~/themes/" . System::GetConfigurationValue("Application.ThemeName") . "/theme.css", false, true)
|
||||
));
|
||||
$this->renderTag("link", array
|
||||
(
|
||||
"rel" => "stylesheet",
|
||||
"type" => "text/css",
|
||||
"href" => System::ExpandRelativePath("~/themes/mocha/theme.css", false, true)
|
||||
));
|
||||
|
||||
$this->renderTag("script", array("type" => "text/javascript", "src" => System::ExpandRelativePath("~/scripts/phast/System.js.php", false, true)));
|
||||
$this->renderTag("script", array("type" => "text/javascript", "src" => System::ExpandRelativePath("~/scripts/mocha.js.php", false, true)));
|
||||
$this->renderBeginTag("script", array("type" => "text/javascript"));
|
||||
@ -715,9 +777,12 @@
|
||||
}
|
||||
$this->renderBeginTag("body", null, $bodyClasses);
|
||||
|
||||
$this->renderBeginTag("div", [ ], [ "uwt-page-header" ] );
|
||||
|
||||
$this->renderEndTag("div");
|
||||
$spotTimerContent = ""; $spotTimerScript = "";
|
||||
\mocha_get_spot_timer_script($spotTimerContent, $spotTimerScript);
|
||||
echo(<<<MSG_EOF
|
||||
<div class="mocha-ams-spot-popup" id="spot_popup"><h1>SPOT:</h1><h3>Stop in: <label id="spot_timer">$spotTimerContent</label></h3></div>
|
||||
MSG_EOF);
|
||||
$this->renderTag("script", [ ], [ ], $spotTimerScript);
|
||||
}
|
||||
public function renderEndPage()
|
||||
{
|
||||
@ -859,6 +924,8 @@
|
||||
return $title;
|
||||
}
|
||||
|
||||
private InstanceReference $__renderingElement;
|
||||
|
||||
public function renderElement(InstanceReference $element, array $displayOptions)
|
||||
{
|
||||
/**
|
||||
@ -866,6 +933,12 @@
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
$this->__renderingElement = $element;
|
||||
$parentElementContent = $oms->getRelatedInstance($element, KnownRelationshipGuids::Instance__for__Element_Content);
|
||||
|
||||
$renderingNotEnterable = $this->__renderingNotEnterable;
|
||||
$this->__renderingNotEnterable = $oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__NotEnterable));
|
||||
|
||||
if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__ShowSubelementsVertically)))
|
||||
{
|
||||
echo("<!-- show subelements vertically -->");
|
||||
@ -886,6 +959,10 @@
|
||||
{
|
||||
$mcx_classes = [ "mcx-element" ];
|
||||
}
|
||||
if (!$this->shouldRenderElementContentLabel($elementContent))
|
||||
{
|
||||
$mcx_classes[] = "mcx-hidden-label";
|
||||
}
|
||||
|
||||
if ($oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__Required)))
|
||||
{
|
||||
@ -895,6 +972,10 @@
|
||||
{
|
||||
$mcx_classes[] = "mcx-failed-validation";
|
||||
}
|
||||
if (!$this->shouldRenderElementContentLabel($elementContent))
|
||||
{
|
||||
$mcx_classes[] = "mcx-hidden-label";
|
||||
}
|
||||
|
||||
// $this->renderBeginTag("tr", [ "data-instance-id" => $ecInst->InstanceKey, "data-ecid" => $elementContent->InstanceKey ], $mcx_classes);
|
||||
$this->renderBeginTag("div", [ "data-instance-id" => $ecInst->InstanceKey, "data-ecid" => $elementContent->InstanceKey ], $mcx_classes);
|
||||
@ -908,10 +989,6 @@
|
||||
if ($this->shouldRenderElementContentLabel($elementContent))
|
||||
{
|
||||
// $this->renderBeginTag("td");
|
||||
if (!$oms->instanceSetContains($displayOptions, $oms->getInstanceByGlobalIdentifier(KnownInstanceGuids::DisplayOption__DoNotShowLabel)))
|
||||
{
|
||||
echo ("<label for=\"ec_" . $elementContent->InstanceKey . "\">" . $title . "</label>");
|
||||
}
|
||||
// $this->renderEndTag("td");
|
||||
// $this->renderBeginTag("td");
|
||||
}
|
||||
@ -919,6 +996,7 @@
|
||||
{
|
||||
// $this->renderBeginTag("td", [ "colspan" => "2" ]);
|
||||
}
|
||||
echo ("<label for=\"ec_" . $elementContent->InstanceKey . "\">" . $title . "</label>");
|
||||
|
||||
$this->renderBeginTag("div");
|
||||
$this->renderElementContent($elementContent);
|
||||
@ -954,7 +1032,26 @@
|
||||
}
|
||||
|
||||
$contents = $oms->getRelatedInstances($element, $oms->getInstanceByGlobalIdentifier(KnownRelationshipGuids::Element__has__Element_Content));
|
||||
$rowCount = 5;
|
||||
|
||||
$instances = [];
|
||||
// $bem = $oms->getRelatedInstance($element, KnownRelationshipGuids::Element__returned_by__Build_Element_Method);
|
||||
//$bemProcess = $oms->getRelatedInstance($bem, KnownRelationshipGuids::Build_Element_Method__has__BEM_Process);
|
||||
if ($parentElementContent !== null)
|
||||
{
|
||||
$bemProcess = $oms->getRelatedInstance($parentElementContent, KnownRelationshipGuids::Element_Content__built_from__BEM_Process);
|
||||
if ($bemProcess != null)
|
||||
{
|
||||
// execute the `Executable returning Instance Set` to get the rows to display (Primary Instances)
|
||||
$instanceExecutable = $oms->getRelatedInstance($bemProcess, KnownRelationshipGuids::BEM_Process__uses_loop__Executable_returning_Instance_Set);
|
||||
if ($instanceExecutable !== null)
|
||||
{
|
||||
//! FIXME: this array should be put into teh specified `returns Work Set` variable
|
||||
// ... BUT this works the way it's supposed to , for right now!
|
||||
$instances = $oms->executeMethodReturningInstanceSet($instanceExecutable, array());
|
||||
}
|
||||
}
|
||||
}
|
||||
$rowCount = count($instances);
|
||||
|
||||
echo("<!-- nonsingular -->");
|
||||
// $this->renderBeginTag("table", [ "data-instance-id" => $element->InstanceKey ], [ "uwt-listview", "mcx-element" ]);
|
||||
@ -1018,13 +1115,14 @@
|
||||
|
||||
for ($i = 0; $i < $rowCount; $i++)
|
||||
{
|
||||
$rowInst = $instances[$i];
|
||||
|
||||
$this->renderBeginTag("div", [ ], [ "uwt-listview-item" ]);
|
||||
foreach ($contents as $content)
|
||||
{
|
||||
// $this->renderBeginTag("td");
|
||||
$this->renderBeginTag("div", [], [ "mcx-elementcontent", "uwt-listview-item-column" ]);
|
||||
$this->renderElementContent($content);
|
||||
$this->renderElementContent($content, $rowInst);
|
||||
$this->renderEndTag("div");
|
||||
// $this->renderEndTag("td");
|
||||
}
|
||||
@ -1041,7 +1139,10 @@
|
||||
$this->renderEndTag("div");
|
||||
}
|
||||
}
|
||||
|
||||
$this->__renderingNotEnterable = $renderingNotEnterable;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@ -97,4 +97,9 @@ window.addEventListener("load", function()
|
||||
console.log(items[i]);
|
||||
items[i].McxNativeObject = new McxElementContent(items[i]);
|
||||
}
|
||||
var items = document.getElementsByClassName("mcx-element");
|
||||
for (var i = 0; i < items.length; i++)
|
||||
{
|
||||
items[i].McxNativeObject = new McxElementContent(items[i]);
|
||||
}
|
||||
});
|
||||
22
php/mocha/scripts/mcx_instancekey.js
Normal file
22
php/mocha/scripts/mcx_instancekey.js
Normal file
@ -0,0 +1,22 @@
|
||||
function InstanceKey()
|
||||
{
|
||||
this.ClassIndex = 0;
|
||||
this.InstanceIndex = 0;
|
||||
|
||||
this.toString = function()
|
||||
{
|
||||
return this.ClassIndex + "$" + this.InstanceIndex;
|
||||
};
|
||||
}
|
||||
|
||||
InstanceKey.parse = function(value)
|
||||
{
|
||||
var split = value.split("$");
|
||||
var classIndex = parseInt(split[0]);
|
||||
var instanceIndex = parseInt(split[1]);
|
||||
|
||||
var ik = new InstanceKey();
|
||||
ik.ClassIndex = classIndex;
|
||||
ik.InstanceIndex = instanceIndex;
|
||||
return ik;
|
||||
};
|
||||
15
php/mocha/scripts/mcx_messages.js
Normal file
15
php/mocha/scripts/mcx_messages.js
Normal file
@ -0,0 +1,15 @@
|
||||
var mochaMessages = {
|
||||
"MXRES.CONTEXTMENUITEM.ViewPrintableVersion": "View Printable Version",
|
||||
"MXRES.CONTEXTMENUITEM.ExportToSpreadsheet": "Export to Spreadsheet",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.CopyInstanceID": "Copy Instance ID ({0})",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.CopyText": "Copy Text",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.CopyTextAndInstanceID": "Copy Text and Instance ID",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.CopyURL": "Copy URL",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.EditInNewWindow": "Edit in New Window",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.EditInstance": "Edit Instance",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.SearchInstanceID": "Search Instance ID ({0})",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.SearchInstanceIDInMaster": "Search Instance ID ({0}) in Master",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.SearchInstanceIDInNewWindow": "Search Instance ID ({0}) in New Window",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.SeeInNewWindow": "See in New Tab",
|
||||
"MXRES.MONIKER.CONTEXTMENUITEM.SeeRelatedInstances": "See Related Instances"
|
||||
};
|
||||
@ -5,6 +5,137 @@ function McxMoniker(parentElement)
|
||||
this.ButtonElement = this.ParentElement.children[1];
|
||||
this.PopupElement = this.ParentElement.children[2];
|
||||
|
||||
this.ParentElement.addEventListener("contextmenu", function(e)
|
||||
{
|
||||
var cm = new ContextMenu();
|
||||
cm.Data = this.McxNativeObject;
|
||||
var ecid = this.NativeObject.ECID;
|
||||
var iid = this.McxNativeObject.ParentElement.getAttribute("data-instance-id");
|
||||
cm.Items = [
|
||||
{
|
||||
"ClassName": "MenuItemCommand",
|
||||
"Title": mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.SeeInNewWindow"],
|
||||
"Visible": function()
|
||||
{
|
||||
return this.Menu.Data.LabelElement.tagName == "A";
|
||||
},
|
||||
"Execute": function()
|
||||
{
|
||||
var ik = InstanceKey.parse(iid);
|
||||
var castClassId = "1$" + ik.ClassIndex;
|
||||
var relativeUrl = System.ExpandRelativePath("~/" + System.TenantName + "/d/inst/" + castClassId + "/" + iid + ".htmld");
|
||||
var url = new URL(relativeUrl, document.baseURI).href;
|
||||
window.open(relativeUrl);
|
||||
}
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemSeparator",
|
||||
"Visible": function()
|
||||
{
|
||||
return this.Menu.Data.LabelElement.tagName == "A";
|
||||
}
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemCommand",
|
||||
"Title": mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.CopyURL"],
|
||||
"Visible": true,
|
||||
"Execute": function()
|
||||
{
|
||||
var ik = InstanceKey.parse(iid);
|
||||
var castClassId = "1$" + ik.ClassIndex;
|
||||
var relativeUrl = System.ExpandRelativePath("~/" + System.TenantName + "/d/inst/" + castClassId + "/" + iid + ".htmld");
|
||||
var url = new URL(relativeUrl, document.baseURI).href;
|
||||
Clipboard.setText(url);
|
||||
}
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemCommand",
|
||||
"Title": mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.CopyText"],
|
||||
"Visible": true,
|
||||
"Execute": function()
|
||||
{
|
||||
Clipboard.setText(this.Menu.Data.LabelElement.innerText);
|
||||
}
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemSeparator",
|
||||
"Visible": true
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemCommand",
|
||||
"Title": String.format(mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.CopyInstanceID"], iid),
|
||||
"Visible": true,
|
||||
"Execute": function()
|
||||
{
|
||||
Clipboard.setText(iid);
|
||||
}
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemCommand",
|
||||
"Title": mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.CopyTextAndInstanceID"],
|
||||
"Visible": true,
|
||||
"Execute": function()
|
||||
{
|
||||
Clipboard.setText(this.Menu.Data.LabelElement.innerText);
|
||||
}
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemSeparator",
|
||||
"Visible": true
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemCommand",
|
||||
"Title": mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.EditInstance"],
|
||||
"Visible": true,
|
||||
"TargetURL": function()
|
||||
{
|
||||
var ik = InstanceKey.parse(iid);
|
||||
var castClassId = "1$" + ik.ClassIndex;
|
||||
var relativeUrl = System.ExpandRelativePath("~/" + System.TenantName + "/d/inst/" + castClassId + "/" + iid + ".htmld");
|
||||
var url = new URL(relativeUrl, document.baseURI).href;
|
||||
return url;
|
||||
}
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemCommand",
|
||||
"Title": String.format(mochaMessages["MXRES.MONIKER.CONTEXTMENUITEM.SearchInstanceID"], iid),
|
||||
"Visible": true,
|
||||
"TargetURL": function()
|
||||
{
|
||||
return System.ExpandRelativePath("~/" + System.TenantName + "/d/search.htmld?q=" + iid + "&branch=true");
|
||||
}
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemSeparator",
|
||||
"Visible": true
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemCommand",
|
||||
"Title": mochaMessages["MXRES.CONTEXTMENUITEM.ViewPrintableVersion"],
|
||||
"Visible": true,
|
||||
"Execute": function()
|
||||
{
|
||||
Window.ShowDialog("The method or operation is not implemented", "Not Implemented");
|
||||
}
|
||||
},
|
||||
{
|
||||
"ClassName": "MenuItemCommand",
|
||||
"Title": mochaMessages["MXRES.CONTEXTMENUITEM.ExportToSpreadsheet"],
|
||||
"Visible": true,
|
||||
"Execute": function()
|
||||
{
|
||||
Window.ShowDialog("The method or operation is not implemented", "Not Implemented");
|
||||
}
|
||||
}
|
||||
];
|
||||
cm.Show(e.clientX, e.clientY, this);
|
||||
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
this.ActionsMenuElement = this.PopupElement.children[0].children[1];
|
||||
this.ClassTitleElement = this.PopupElement.children[1].children[0].children[0].children[0];
|
||||
this.InstanceTitleElement = this.PopupElement.children[1].children[0].children[0].children[1];
|
||||
@ -32,16 +163,25 @@ function McxMoniker(parentElement)
|
||||
|
||||
var url = System.ExpandRelativePath("~/" + System.TenantName + "/inst/" + this.McxNativeObject.InstanceID + "/rel-tasks.htmld");
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.timeout = 5000;
|
||||
xhr.open("GET", url);
|
||||
xhr.thiss = this.McxNativeObject;
|
||||
xhr.onreadystatechange = function(e)
|
||||
{
|
||||
var xhr = e.target;
|
||||
if (xhr.readyState == 4)
|
||||
{
|
||||
if (xhr.status == 200)
|
||||
{
|
||||
var json = JSON.parse(xhr.responseText);
|
||||
console.log(json);
|
||||
|
||||
if (json.result == "failure" && json.responseCode == 403)
|
||||
{
|
||||
Alert.show(json.message, json.title, "uwt-color-danger");
|
||||
return;
|
||||
}
|
||||
|
||||
if (json.instance)
|
||||
{
|
||||
if (json.instance.label)
|
||||
@ -63,6 +203,9 @@ function McxMoniker(parentElement)
|
||||
for (var i = 0; i < json.taskGroups.length; i++)
|
||||
{
|
||||
var tgprimary = json.taskGroups[i].taskGroups[0];
|
||||
if (tgprimary.taskGroups.length === 0)
|
||||
continue;
|
||||
|
||||
var label = tgprimary.label;
|
||||
|
||||
var li = document.createElement("li");
|
||||
@ -107,6 +250,15 @@ function McxMoniker(parentElement)
|
||||
|
||||
System.ClassList.Remove(xhr.thiss.PopupElement, "uwt-loading");
|
||||
}
|
||||
else if (xhr.status == 403)
|
||||
{
|
||||
|
||||
}
|
||||
else if (xhr.status == 0)
|
||||
{
|
||||
Alert.show("Please check your connection and try again", "Connection lost", "uwt-color-danger", 5000);
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
});
|
||||
|
||||
@ -48,7 +48,7 @@ div.apb-preview
|
||||
}
|
||||
&> div.apb-actions
|
||||
{
|
||||
background: #eeeeee;
|
||||
background: #eeeeee; // #ccaaff - we could use this for Sydne;
|
||||
border-right: solid 1px #ccc;
|
||||
&> h2
|
||||
{
|
||||
@ -61,15 +61,13 @@ div.apb-preview
|
||||
{
|
||||
&> a
|
||||
{
|
||||
/*
|
||||
&> span.uwt-title
|
||||
{
|
||||
font-size: 12pt;
|
||||
font-weight: 300;
|
||||
}
|
||||
}
|
||||
&:hover > a
|
||||
{
|
||||
background-color: #ddd;
|
||||
*/
|
||||
}
|
||||
&.uwt-menu-item-popup
|
||||
{
|
||||
@ -88,11 +86,6 @@ div.apb-preview
|
||||
background-color: #fff;
|
||||
border: solid 1px #ccc;
|
||||
box-shadow: 2px 2px 4px #ccc;
|
||||
&> li > a > span.uwt-title
|
||||
{
|
||||
font-size: 12pt;
|
||||
font-weight: 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,11 +18,19 @@ div.uwt-listview > .uwt-content
|
||||
border: solid 1px #ced4da;
|
||||
}
|
||||
.uwt-listview
|
||||
{
|
||||
&:not(.uwt-gridlines)
|
||||
{
|
||||
&> thead, &> .uwt-content > .uwt-listview-column-headers
|
||||
{
|
||||
border-bottom: solid 2px;
|
||||
border-bottom-color: @TableGridLineColor;
|
||||
}
|
||||
}
|
||||
&> thead, &> .uwt-content > .uwt-listview-column-headers
|
||||
{
|
||||
//border-bottom: solid 2px;
|
||||
//border-bottom-color: @TableGridLineColor;
|
||||
&> tr
|
||||
{
|
||||
&> th
|
||||
@ -118,9 +126,32 @@ div.uwt-listview > .uwt-content
|
||||
}
|
||||
&.uwt-gridlines
|
||||
{
|
||||
&> .uwt-content > .uwt-listview-column-headers > .uwt-listview-column-header, &> .uwt-listview-items > .uwt-listview-item > .uwt-listview-item-column
|
||||
&> .uwt-content, &> .uwt-content > .uwt-listview-column-headers
|
||||
{
|
||||
border: solid 1px @TableGridLineColor;
|
||||
border: 1px solid rgba(0,0,0,0.2);
|
||||
}
|
||||
&> .uwt-content > .uwt-listview-column-headers > .uwt-listview-column-header
|
||||
{
|
||||
border: 1px solid @TableGridLineColor;
|
||||
/*
|
||||
&:not(:first-child)
|
||||
{
|
||||
border-left: 1px solid rgba(0,0,0,0.1);
|
||||
}
|
||||
&:not(:last-child)
|
||||
{
|
||||
border-right: 1px solid rgba(0,0,0,0.1);
|
||||
}
|
||||
*/
|
||||
font-weight: bold;
|
||||
}
|
||||
&> .uwt-content > .uwt-listview-items > .uwt-listview-item > .uwt-listview-item-column
|
||||
{
|
||||
border: 1px solid rgba(0,0,0,0.05);
|
||||
}
|
||||
&> .uwt-content > .uwt-listview-items > .uwt-listview-item
|
||||
{
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
&.uwt-hottracking
|
||||
|
||||
@ -15,8 +15,13 @@ ul.uwt-menu
|
||||
{
|
||||
&> a
|
||||
{
|
||||
/*
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
*/
|
||||
font-size: 12pt;
|
||||
font-weight: 300;
|
||||
|
||||
padding: 0.309375rem 0.9375rem;
|
||||
|
||||
&:not(:hover) > span.uwt-description
|
||||
|
||||
10
php/mocha/themes/common/styles/mobile/uwt-window.less
Normal file
10
php/mocha/themes/common/styles/mobile/uwt-window.less
Normal file
@ -0,0 +1,10 @@
|
||||
@media (max-width: 1000px)
|
||||
{
|
||||
div.uwt-window
|
||||
{
|
||||
left: 0px !important;
|
||||
top: 0px !important;
|
||||
right: 0px !important;
|
||||
bottom: 0px !important;
|
||||
}
|
||||
}
|
||||
1
php/mocha/themes/common/styles/mobile/uwt.less
Normal file
1
php/mocha/themes/common/styles/mobile/uwt.less
Normal file
@ -0,0 +1 @@
|
||||
@import "uwt-window.less";
|
||||
@ -23,6 +23,10 @@ div.uwt-actionpreviewbutton
|
||||
content: "...";
|
||||
font-family: inherit;
|
||||
font-weight: bold;
|
||||
|
||||
display: block;
|
||||
margin-top: -3px;
|
||||
height: 0px;
|
||||
}
|
||||
}
|
||||
&:hover, &:focus-within
|
||||
|
||||
@ -10,6 +10,7 @@ body > div.uwt-alert-container
|
||||
|
||||
div.uwt-alert
|
||||
{
|
||||
margin-bottom: 8px;
|
||||
position: relative;
|
||||
transition: all 1s;
|
||||
right: 0px;
|
||||
|
||||
@ -12,16 +12,14 @@
|
||||
font-weight: bold;
|
||||
padding-right: 8px;
|
||||
}
|
||||
&> span.uwt-listview-item-count
|
||||
{
|
||||
}
|
||||
&> span.uwt-listview-item-count-label
|
||||
&> span.uwt-listview-item-count, &> span.uwt-listview-item-count-label
|
||||
{
|
||||
color: var(--uwt-color-secondary);
|
||||
}
|
||||
&> .uwt-listview-controlbox
|
||||
{
|
||||
margin-left: auto;
|
||||
padding: 8px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,6 +29,16 @@
|
||||
{
|
||||
border-collapse: collapse;
|
||||
margin-top: 10px;
|
||||
&> .uwt-listview-items
|
||||
{
|
||||
&> .uwt-listview-item
|
||||
{
|
||||
&> .uwt-listview-item-column
|
||||
{
|
||||
word-wrap: break-word;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.uwt-expand
|
||||
{
|
||||
|
||||
@ -25,15 +25,15 @@ ul.uwt-menu
|
||||
display: block;
|
||||
&.uwt-title
|
||||
{
|
||||
font-weight: bold;
|
||||
//font-weight: bold;
|
||||
}
|
||||
}
|
||||
&:hover
|
||||
}
|
||||
&:hover > a
|
||||
{
|
||||
background-color: var(--uwt-dropdown-menu-highlight-background);
|
||||
background-color: rgba(0, 0, 0, 0.05); // var(--uwt-dropdown-menu-highlight-background);
|
||||
color: var(--uwt-dropdown-menu-highlight-foreground);
|
||||
}
|
||||
}
|
||||
&.uwt-separator
|
||||
{
|
||||
border-bottom: solid 1px #eee;
|
||||
|
||||
@ -1,8 +1,18 @@
|
||||
div.uwt-window
|
||||
{
|
||||
position: fixed;
|
||||
|
||||
&> div.uwt-header
|
||||
{
|
||||
-moz-user-select: none;
|
||||
&> div.uwt-controlbox
|
||||
{
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
&> div.uwt-footer
|
||||
{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
&.uwt-footer-hidden > div.uwt-footer
|
||||
|
||||
@ -48,6 +48,8 @@
|
||||
@import "uwt-window.less";
|
||||
@import "uwt-wunderbar.less";
|
||||
|
||||
@import "mobile/uwt.less";
|
||||
|
||||
@import "../fonts/awesome/css/all.min.less";
|
||||
|
||||
html
|
||||
|
||||
25
php/mocha/themes/mocha/mcx-colors.less
Normal file
25
php/mocha/themes/mocha/mcx-colors.less
Normal file
@ -0,0 +1,25 @@
|
||||
.uwt-button:not(.uwt-toolbar > .uwt-button)
|
||||
{
|
||||
background-color: #9c6516;
|
||||
border-color: #804b00;
|
||||
border-radius: 24px;
|
||||
color: #ffffff;
|
||||
&:hover
|
||||
{
|
||||
background-color: #dea147;
|
||||
border-color: #9c6516;
|
||||
}
|
||||
}
|
||||
.uwt-toolbar > .uwt-button
|
||||
{
|
||||
&:hover
|
||||
{
|
||||
background-color: #efc381;
|
||||
border-color: #9c6516;
|
||||
}
|
||||
&:active, &.uwt-selected
|
||||
{
|
||||
background-color: #dea147;
|
||||
border-color: #9c6516;
|
||||
}
|
||||
}
|
||||
145
php/mocha/themes/mocha/mcx-instancebrowser.less
Normal file
145
php/mocha/themes/mocha/mcx-instancebrowser.less
Normal file
@ -0,0 +1,145 @@
|
||||
div.mcx-instancebrowser
|
||||
{
|
||||
&> ul
|
||||
{
|
||||
list-style-type: none;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
}
|
||||
/*
|
||||
div.mcx-instancebrowser
|
||||
{
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
|
||||
&:not(.mcx-display-as-count):not(.mcx-editable).mcx-empty
|
||||
{
|
||||
&::after
|
||||
{
|
||||
content: "(empty)";
|
||||
color: #aaaaaa;
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.mcx-editable) > input
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
&> input
|
||||
{
|
||||
&:not(:focus)
|
||||
{
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
&.mcx-editable
|
||||
{
|
||||
&> input
|
||||
{
|
||||
padding-right: 32px;
|
||||
}
|
||||
&::before
|
||||
{
|
||||
content: "\f0c9";
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 7px;
|
||||
pointer-events: none;
|
||||
|
||||
font-family: FontAwesome;
|
||||
font-size: 16px;
|
||||
color: #999;
|
||||
}
|
||||
&> ul
|
||||
{
|
||||
border: solid 1px #ccc;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
margin-top: -1px;
|
||||
padding: 4px;
|
||||
}
|
||||
}
|
||||
&.mcx-editable:hover::before, &.mcx-active::before
|
||||
{
|
||||
color: #00ACAC;
|
||||
}
|
||||
|
||||
&> ul
|
||||
{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
|
||||
&> li
|
||||
{
|
||||
list-style-type: none;
|
||||
&+ li
|
||||
{
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
&> a.mcx-count-link
|
||||
{
|
||||
cursor: pointer;
|
||||
&::after
|
||||
{
|
||||
content: "\f0d7";
|
||||
font-family: "FontAwesome";
|
||||
padding-left: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&> div.uwt-popup > div.uwt-dropdown-content > ul.uwt-menu
|
||||
{
|
||||
width: max-content;
|
||||
min-width: 100%;
|
||||
max-width: 400px;
|
||||
|
||||
&> li
|
||||
{
|
||||
&> a
|
||||
{
|
||||
&> span.uwt-subtitle, &> span.uwt-content
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.uwt-loading) > div.uwt-popup > div.uwt-spinner
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
&.uwt-loading > div.uwt-popup > div.uwt-dropdown-content
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
div.apb-preview.uwt-collapsed
|
||||
{
|
||||
height: 10px;
|
||||
overflow: hidden;
|
||||
&> div.apb-actions, &> div.apb-content > div > div.uwt-content
|
||||
{
|
||||
visibility: hidden;
|
||||
}
|
||||
&> div.apb-content > div > div.apb-title
|
||||
{
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
top: 0px;
|
||||
&> h1, h2
|
||||
{
|
||||
display: inline-block;
|
||||
font-size: 16pt;
|
||||
font-weight: bold;
|
||||
margin: 0px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
@ -1,3 +1,5 @@
|
||||
@import "mcx-colors.less";
|
||||
@import "mcx-instancebrowser.less";
|
||||
|
||||
html
|
||||
{
|
||||
@ -80,6 +82,9 @@ div.mocha-ams-spot-popup
|
||||
text-align: center;
|
||||
z-index: 5000;
|
||||
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
|
||||
&> h1
|
||||
{
|
||||
font-weight: 600;
|
||||
@ -210,28 +215,44 @@ div.mcx-element
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.uwt-button:not(.uwt-toolbar > .uwt-button)
|
||||
|
||||
|
||||
// these styles override the previous ones earlier defined
|
||||
div.mcx-element
|
||||
{
|
||||
background-color: #9c6516 !important;
|
||||
border-color: #804b00 !important;
|
||||
border-radius: 24px !important;
|
||||
color: #ffffff !important;
|
||||
&:hover
|
||||
display: block;
|
||||
}
|
||||
div.mcx-element > label, div.mcx-elementcontent > label
|
||||
{
|
||||
background-color: #dea147 !important;
|
||||
border-color: #9c6516 !important;
|
||||
display: table-cell;
|
||||
padding: 8px;
|
||||
padding-right: 32px;
|
||||
}
|
||||
|
||||
div.mcx-elementcontent
|
||||
{
|
||||
&:not(.uwt-listview-item-column)
|
||||
{
|
||||
display: table-row;
|
||||
}
|
||||
&.uwt-listview-item-column
|
||||
{
|
||||
display: table-cell;
|
||||
}
|
||||
&.mcx-hidden-label
|
||||
{
|
||||
display: block;
|
||||
&> label
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.uwt-toolbar > .uwt-button
|
||||
{
|
||||
&:hover
|
||||
{
|
||||
background-color: #efc381 !important;
|
||||
border-color: #9c6516 !important;
|
||||
}
|
||||
&:active, &.uwt-selected
|
||||
|
||||
div.mcx-moniker > span.apb-text:empty::after
|
||||
{
|
||||
background-color: #dea147 !important;
|
||||
border-color: #9c6516 !important;
|
||||
}
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
content: "\f002";
|
||||
font-family: var(--fa-style-family,"Font Awesome 6 Pro");
|
||||
}
|
||||
33
php/mocha/themes/pleasanton/uwt-button.less
Normal file
33
php/mocha/themes/pleasanton/uwt-button.less
Normal file
@ -0,0 +1,33 @@
|
||||
.uwt-button
|
||||
{
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
font-weight: bold;
|
||||
|
||||
padding: 4px 8px;
|
||||
|
||||
/* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#ffffff+0,f1f1f3+100 */
|
||||
background: #ffffff; /* Old browsers */
|
||||
background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f3 100%); /* FF3.6-15 */
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f1f1f3)); /* Chrome4-9,Safari4-5 */
|
||||
background: -webkit-linear-gradient(top, #ffffff 0%,#f1f1f3 100%); /* Chrome10-25,Safari5.1-6 */
|
||||
background: -o-linear-gradient(top, #ffffff 0%,#f1f1f3 100%); /* Opera 11.10-11.50 */
|
||||
background: -ms-linear-gradient(top, #ffffff 0%,#f1f1f3 100%); /* IE10 preview */
|
||||
background: linear-gradient(to bottom, #ffffff 0%,#f1f1f3 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f1f1f3',GradientType=0 ); /* IE6-9 */
|
||||
|
||||
&.uwt-color-success
|
||||
{
|
||||
border-color: #719a56;
|
||||
|
||||
/* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#9acd70+0,8cc759+49,87c651+51,78bf45+100 */
|
||||
background: #9acd70; /* Old browsers */
|
||||
background: -moz-linear-gradient(top, #9acd70 0%, #8cc759 49%, #87c651 51%, #78bf45 100%); /* FF3.6-15 */
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9acd70), color-stop(49%,#8cc759), color-stop(51%,#87c651), color-stop(100%,#78bf45)); /* Chrome4-9,Safari4-5 */
|
||||
background: -webkit-linear-gradient(top, #9acd70 0%,#8cc759 49%,#87c651 51%,#78bf45 100%); /* Chrome10-25,Safari5.1-6 */
|
||||
background: -o-linear-gradient(top, #9acd70 0%,#8cc759 49%,#87c651 51%,#78bf45 100%); /* Opera 11.10-11.50 */
|
||||
background: -ms-linear-gradient(top, #9acd70 0%,#8cc759 49%,#87c651 51%,#78bf45 100%); /* IE10 preview */
|
||||
background: linear-gradient(to bottom, #9acd70 0%,#8cc759 49%,#87c651 51%,#78bf45 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9acd70', endColorstr='#78bf45',GradientType=0 ); /* IE6-9 */
|
||||
}
|
||||
}
|
||||
7
php/mocha/themes/pleasanton/uwt.less
Normal file
7
php/mocha/themes/pleasanton/uwt.less
Normal file
@ -0,0 +1,7 @@
|
||||
@import "Fonts/SourceSansPro/SourceSansPro.css";
|
||||
|
||||
@import "../common/styles/uwt.less";
|
||||
|
||||
@import "uwt-button.less";
|
||||
|
||||
@import "../common/styles/mochahacks.less";
|
||||
@ -4,6 +4,9 @@
|
||||
<Scripts>
|
||||
<Script ContentType="text/javascript" FileName="~/scripts/spot_timer.js" />
|
||||
</Scripts>
|
||||
<StyleSheets>
|
||||
<StyleSheet ContentType="text/css" FileName="~~/themes/mocha/theme.css" />
|
||||
</StyleSheets>
|
||||
<References>
|
||||
<Reference TagPrefix="html" NamespacePath="Phast\HTMLControls" />
|
||||
<Reference TagPrefix="wcx" NamespacePath="Phast\WebControls" />
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace Mocha\UI\MasterPages;
|
||||
|
||||
use Phast\CancelEventArgs;
|
||||
use Phast\RenderedEventArgs;
|
||||
use Phast\RenderingEventArgs;
|
||||
use Phast\RenderMode;
|
||||
@ -9,12 +10,50 @@
|
||||
|
||||
class BlankMasterPage extends WebPage
|
||||
{
|
||||
public $RequireLogin;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->RequireLogin = true;
|
||||
}
|
||||
|
||||
protected function OnPreRender(CancelEventArgs $e)
|
||||
{
|
||||
/**
|
||||
* @var \Mocha\Oms\MySQLDatabaseOms
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
$path = System::GetVirtualPath();
|
||||
$currentUser = mocha_get_current_user();
|
||||
|
||||
$page = null;
|
||||
$pathVars = null;
|
||||
System::ParsePathVariablesIntoPage($page, $pathVars);
|
||||
if ($currentUser === null)
|
||||
{
|
||||
if ($page != null)
|
||||
{
|
||||
if ($page->MasterPage->ClassReference->RequireLogin) // requiresLogin($page->FileName))
|
||||
{
|
||||
// echo($page->FileName);
|
||||
$_SESSION["login_return"] = $path;
|
||||
System::RedirectToLoginPage(true);
|
||||
$e->Cancel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function OnRendering(RenderingEventArgs $re)
|
||||
{
|
||||
if ($re->RenderMode === RenderMode::Complete)
|
||||
{
|
||||
echo("<!DOCTYPE html>");
|
||||
echo("<html xmlns=\"http:http://www.w3.org/1999/xhtml\">");
|
||||
echo("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
17
php/mocha/ui/masterPages/Blank2.phpx
Normal file
17
php/mocha/ui/masterPages/Blank2.phpx
Normal file
@ -0,0 +1,17 @@
|
||||
<Website>
|
||||
<MasterPages>
|
||||
<MasterPage FileName="masterPages/Blank2.phpx" CodeBehindClassName="Mocha\UI\MasterPages\BlankMasterPage2">
|
||||
<Scripts>
|
||||
<Script ContentType="text/javascript" FileName="~/scripts/spot_timer.js" />
|
||||
</Scripts>
|
||||
<References>
|
||||
<Reference TagPrefix="html" NamespacePath="Phast\HTMLControls" />
|
||||
<Reference TagPrefix="wcx" NamespacePath="Phast\WebControls" />
|
||||
</References>
|
||||
<Content>
|
||||
<wcx:SectionPlaceholder ID="aspcContent">
|
||||
</wcx:SectionPlaceholder>
|
||||
</Content>
|
||||
</MasterPage>
|
||||
</MasterPages>
|
||||
</Website>
|
||||
31
php/mocha/ui/masterPages/Blank2.phpx.php
Normal file
31
php/mocha/ui/masterPages/Blank2.phpx.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace Mocha\UI\MasterPages;
|
||||
|
||||
use Phast\CancelEventArgs;
|
||||
use Phast\RenderedEventArgs;
|
||||
use Phast\RenderingEventArgs;
|
||||
use Phast\RenderMode;
|
||||
use Phast\System;
|
||||
use Phast\WebPage;
|
||||
|
||||
class BlankMasterPage2 extends WebPage
|
||||
{
|
||||
protected function OnRendering(RenderingEventArgs $re)
|
||||
{
|
||||
if ($re->RenderMode === RenderMode::Complete)
|
||||
{
|
||||
echo("<!DOCTYPE html>");
|
||||
echo("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
|
||||
}
|
||||
}
|
||||
|
||||
protected function OnRendered(RenderedEventArgs $e)
|
||||
{
|
||||
if ($e->RenderMode === RenderMode::Complete)
|
||||
{
|
||||
echo("</html>");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -29,6 +29,8 @@
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
mocha_init_spot_timer($this->Page);
|
||||
|
||||
$context = new OmsContext();
|
||||
|
||||
$renderer = new HTMLRenderer($context);
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace Mocha\UI\Pages;
|
||||
|
||||
use Mocha\Core\InstanceKey;
|
||||
use Mocha\Core\KnownInstanceGuids;
|
||||
use Mocha\Core\KnownRelationshipGuids;
|
||||
|
||||
use Mocha\Core\OmsContext;
|
||||
@ -24,10 +25,10 @@
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
mocha_init_spot_timer($this);
|
||||
mocha_init_spot_timer($this->Page);
|
||||
|
||||
$instIdCtl = $this->GetControlByID("instId");
|
||||
$castIdCtl = $this->GetControlByID("castId");
|
||||
$instIdCtl = $this->Page->GetControlByID("instId");
|
||||
$castIdCtl = $this->Page->GetControlByID("castId");
|
||||
|
||||
$instkey = InstanceKey::Parse($this->Page->GetPathVariableValue("instid"));
|
||||
|
||||
@ -66,6 +67,8 @@
|
||||
{
|
||||
$context = new OmsContext();
|
||||
|
||||
$context->setWorkData(KnownInstanceGuids::WorkSet__RelatedInstance, $inst);
|
||||
|
||||
$taskRenderer = new HTMLRenderer($context);
|
||||
$taskRenderer->TargetInstance = $inst;
|
||||
$taskRenderer->IsPostback = $this->Page->IsPostback;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<Website>
|
||||
<Pages>
|
||||
<Page MasterPageFileName="masterPages/Blank.phpx" FileName="invalid-url">
|
||||
<Page MasterPageFileName="masterPages/Blank.phpx" FileName="invalid-url" CodeBehindClassName="Mocha\UI\Pages\InvalidURLPage">
|
||||
<References>
|
||||
<Reference TagPrefix="html" NamespacePath="Phast\HTMLControls" />
|
||||
<Reference TagPrefix="wcx" NamespacePath="Phast\WebControls" />
|
||||
|
||||
18
php/mocha/ui/pages/InvalidURLPage.phpx.php
Normal file
18
php/mocha/ui/pages/InvalidURLPage.phpx.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Mocha\UI\Pages;
|
||||
|
||||
use Phast\CancelEventArgs;
|
||||
use Phast\WebPage;
|
||||
|
||||
class InvalidURLPage extends WebPage
|
||||
{
|
||||
|
||||
protected function OnInitializing(CancelEventArgs $re)
|
||||
{
|
||||
$this->Page->MasterPage->ClassReference->RequireLogin = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -10,6 +10,8 @@
|
||||
use Mocha\Core\OmsContext;
|
||||
|
||||
use Mocha\UI\Renderers\HTML\HTMLRenderer;
|
||||
use Phast\CancelEventArgs;
|
||||
use Phast\EventArgs;
|
||||
use Phast\RenderingEventArgs;
|
||||
use Phast\System;
|
||||
use Phast\WebPage;
|
||||
@ -17,6 +19,12 @@
|
||||
use Mocha\Oms\MySQLDatabaseOms;
|
||||
class LoginPage extends WebPage
|
||||
{
|
||||
protected function OnInitializing(CancelEventArgs $e)
|
||||
{
|
||||
$this->Page->MasterPage->ClassReference->RequireLogin = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Thanks https://stackoverflow.com/a/31107425
|
||||
*
|
||||
@ -58,7 +66,7 @@
|
||||
*/
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
mocha_init_spot_timer($this);
|
||||
//mocha_init_spot_timer($this);
|
||||
|
||||
$path = System::GetVirtualPath();
|
||||
$tenantName = "";
|
||||
@ -132,8 +140,8 @@
|
||||
$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;
|
||||
|
||||
$_SESSION["user_token_" . $oms->getTenant()->ID] = $token;
|
||||
System::RedirectFromLoginPage();
|
||||
exit();
|
||||
}
|
||||
|
||||
@ -2,8 +2,13 @@
|
||||
|
||||
namespace Mocha\UI\Pages;
|
||||
use Mocha\Core\InstanceKey;
|
||||
use Mocha\Core\InstanceReference;
|
||||
use Mocha\Core\KnownRelationshipGuids;
|
||||
use Phast\CancelEventArgs;
|
||||
use Phast\EventArgs;
|
||||
use Phast\QuickSort;
|
||||
use Phast\RenderingEventArgs;
|
||||
use Phast\System;
|
||||
use Phast\WebPage;
|
||||
|
||||
class RelatedTaskListPageAPI extends WebPage
|
||||
@ -11,38 +16,18 @@
|
||||
protected function OnInitializing(CancelEventArgs $e)
|
||||
{
|
||||
$this->Page->ContentType = "application/json";
|
||||
$this->Page->MasterPage->ClassReference->RequireLogin = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function OnRendering(RenderingEventArgs $re)
|
||||
private function createRelatedTask(InstanceReference $inst, InstanceReference $task)
|
||||
{
|
||||
/** @var \Mocha\Oms\MySQLDatabaseOMS */
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
$tenant = $this->Page->GetPathVariableValue("tenant");
|
||||
$iid = $this->Page->GetPathVariableValue("instid");
|
||||
$inst = $oms->getInstanceByKey(InstanceKey::Parse($iid));
|
||||
$instParent = $oms->getParentClass($inst);
|
||||
$label = $oms->getInstanceText($task);
|
||||
|
||||
$json = array
|
||||
(
|
||||
"result" => "success",
|
||||
"widget" => "relatedTasks",
|
||||
"taskGroups" => array
|
||||
(
|
||||
array
|
||||
(
|
||||
"widget" => "relatedTaskGroup",
|
||||
"renderDifferently" => false,
|
||||
"taskGroups" => array
|
||||
(
|
||||
array
|
||||
(
|
||||
"widget" => "relatedTaskGroup",
|
||||
"label" => "Preferences",
|
||||
"renderDifferently" => false,
|
||||
"taskGroups" => array
|
||||
(
|
||||
array
|
||||
(
|
||||
"widget" => "relatedTaskGroup",
|
||||
"tasks" => array
|
||||
@ -50,19 +35,94 @@
|
||||
array
|
||||
(
|
||||
"widget" => "relatedTask",
|
||||
"uri" => "",
|
||||
"uri" => System::ExpandRelativePath("~/d/inst/" . $inst->InstanceKey . "/rel-task/" . $task->InstanceKey . ".htmld"),
|
||||
"view" => true,
|
||||
"webService" => false,
|
||||
"iid" => "192$1080",
|
||||
"label" => "Hello World"
|
||||
"iid" => $task->InstanceKey->__toString(),
|
||||
"label" => $label
|
||||
)
|
||||
)
|
||||
);
|
||||
return $json;
|
||||
}
|
||||
|
||||
private function createTaskGroup($name, $taskGroup)
|
||||
{
|
||||
$json = array
|
||||
(
|
||||
"widget" => "relatedTaskGroup",
|
||||
"renderDifferently" => false,
|
||||
"taskGroups" => array
|
||||
(
|
||||
array
|
||||
(
|
||||
"widget" => "relatedTaskGroup",
|
||||
"label" => $name,
|
||||
"renderDifferently" => false,
|
||||
"taskGroups" => $taskGroup
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
return $json;
|
||||
}
|
||||
|
||||
protected function OnRendering(RenderingEventArgs $re)
|
||||
{
|
||||
/** @var \Mocha\Oms\MySQLDatabaseOMS */
|
||||
$oms = mocha_get_oms();
|
||||
|
||||
if ($oms->getCurrentUser() === null)
|
||||
{
|
||||
$json = array
|
||||
(
|
||||
"result" => "failure",
|
||||
"responseCode" => 403,
|
||||
"responseText" => "Forbidden",
|
||||
|
||||
"title" => "Not Authorized",
|
||||
"message" => "Please log in to perform this action"
|
||||
);
|
||||
echo (json_encode($json));
|
||||
$re->Handled = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
$tenant = $this->Page->GetPathVariableValue("tenant");
|
||||
$iid = $this->Page->GetPathVariableValue("instid");
|
||||
$inst = $oms->getInstanceByKey(InstanceKey::Parse($iid));
|
||||
$instParent = $oms->getParentClass($inst);
|
||||
|
||||
$tasks = $oms->getRelatedTasks($inst);
|
||||
$taskGroupsDefs = [ ];
|
||||
|
||||
$names = [ ];
|
||||
foreach ($tasks as $task)
|
||||
{
|
||||
$taskCategory = $oms->getRelatedInstance($task, KnownRelationshipGuids::Task__has__Task_Category);
|
||||
$name = $oms->getInstanceText($taskCategory);
|
||||
if (!in_array($name, $names))
|
||||
{
|
||||
$names[] = $name;
|
||||
}
|
||||
if (!array_key_exists($name, $taskGroupsDefs))
|
||||
{
|
||||
$taskGroupsDefs[$name] = array();
|
||||
}
|
||||
$taskGroupsDefs[$name][] = $this->createRelatedTask($inst, $task);
|
||||
}
|
||||
|
||||
natsort($names);
|
||||
|
||||
$taskGroups = [ ];
|
||||
foreach ($names as $name)
|
||||
{
|
||||
$taskGroups[] = $this->createTaskGroup($name, $taskGroupsDefs[$name]);
|
||||
}
|
||||
|
||||
$json = array
|
||||
(
|
||||
"widget" => "relatedTasks",
|
||||
"taskGroups" => $taskGroups,
|
||||
"instance" => array
|
||||
(
|
||||
"instanceId" => strval($inst->InstanceKey),
|
||||
@ -70,6 +130,8 @@
|
||||
"title" => $oms->getInstanceText($inst)
|
||||
)
|
||||
);
|
||||
$json["result"] = "success";
|
||||
|
||||
echo(json_encode($json));
|
||||
$re->Handled = true;
|
||||
}
|
||||
|
||||
@ -11,10 +11,10 @@
|
||||
{
|
||||
parent::OnRendering($re);
|
||||
|
||||
mocha_init_spot_timer($this);
|
||||
//mocha_init_spot_timer($this->Page);
|
||||
|
||||
$instIdCtl = $this->GetControlByID("instId");
|
||||
$taskInstIdCtl = $this->GetControlByID("taskInstId");
|
||||
$instIdCtl = $this->Page->GetControlByID("instId");
|
||||
$taskInstIdCtl = $this->Page->GetControlByID("taskInstId");
|
||||
|
||||
$instIdCtl->Content = $this->Page->GetPathVariableValue("instid");
|
||||
$taskInstIdCtl->Content = $this->Page->GetPathVariableValue("reltaskid");
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<Website>
|
||||
<Pages>
|
||||
<Page FileName="suv/suvinfo.html" CodeBehindClassName="Mocha\UI\Pages\SUVPage" />
|
||||
<Page MasterPageFileName="masterPages/Blank2.phpx" FileName="suv/suvinfo.html" CodeBehindClassName="Mocha\UI\Pages\SUVPage" />
|
||||
<Page FileName="suv/phpinfo.html" CodeBehindClassName="Mocha\UI\Pages\SUVPage" />
|
||||
</Pages>
|
||||
</Website>
|
||||
@ -8,10 +8,8 @@
|
||||
|
||||
class SUVPage extends WebPage
|
||||
{
|
||||
protected function OnRendering(RenderingEventArgs $re)
|
||||
protected function RenderContents()
|
||||
{
|
||||
parent::OnRendering($re);
|
||||
|
||||
$path = System::GetVirtualPath();
|
||||
$tenantName = null;
|
||||
|
||||
@ -27,10 +25,13 @@
|
||||
<div class="uwt-panel">
|
||||
<div class="uwt-content">
|
||||
<table class="uwt-listview">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Property</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>suv</td>
|
||||
@ -39,15 +40,14 @@
|
||||
<td>Instance Id</td>
|
||||
<td><?php echo($_SERVER["SERVERNAME"]); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Actions</h3>
|
||||
<button>SUV Logs</button>
|
||||
<button class="uwt-button uwt-color-primary">SUV Logs</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
$re->Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
5
php/mocha/ui/pages/SearchPage.phpx
Normal file
5
php/mocha/ui/pages/SearchPage.phpx
Normal file
@ -0,0 +1,5 @@
|
||||
<Website>
|
||||
<Pages>
|
||||
<Page MasterPageFileName="masterPages/Blank.phpx" FileName="{tenant}/d/search.htmld" CodeBehindClassName="Mocha\UI\Pages\SearchPage" />
|
||||
</Pages>
|
||||
</Website>
|
||||
19
php/mocha/ui/pages/SearchPage.phpx.php
Normal file
19
php/mocha/ui/pages/SearchPage.phpx.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Mocha\UI\Pages;
|
||||
|
||||
use Phast\RenderingEventArgs;
|
||||
use Phast\System;
|
||||
use Phast\WebPage;
|
||||
|
||||
class SearchPage extends WebPage
|
||||
{
|
||||
protected function RenderContents()
|
||||
{
|
||||
?>
|
||||
<h1>Search Results</h1>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -27,6 +27,6 @@ BEGIN
|
||||
AND mocha_relationships.source_inst_id = p_src_inst_id
|
||||
AND mocha_relationships.relationship_inst_id = p_rel_inst_id
|
||||
AND mocha_relationships.effective_date <= z_effective_date
|
||||
ORDER BY mocha_relationships.effective_date, mocha_instances.class_id, mocha_instances.inst_id ASC;
|
||||
ORDER BY mocha_relationships.effective_date ASC;
|
||||
|
||||
END;
|
||||
Loading…
x
Reference in New Issue
Block a user