Skip to content
Snippets Groups Projects
Commit 64a30b7d authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon:
Browse files

Merge branch 'cm_1081572_revisionExport' into '2021.2.0'

Cm 1081572 revision export

See merge request xrm/basic!1307
parents c216d5fc 4d25c558
No related branches found
No related tags found
No related merge requests found
Showing
with 274 additions and 40 deletions
......@@ -4,18 +4,68 @@
<title>Place of Use</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/documentation.adoc</documentation>
<titlePlural>Places of Usage</titlePlural>
<siblings>
<element>ExportTemplateField_entity</element>
</siblings>
<grantUpdate v="false" />
<contentTitleProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/contentTitleProcess.js</contentTitleProcess>
<titlePlural>Dependencies</titlePlural>
<recordContainer>db</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityActionField>
<name>openAdminView</name>
<title>Open admin view</title>
<onActionProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/openadminview/onActionProcess.js</onActionProcess>
<isMenuAction v="true" />
<isObjectAction v="true" />
<iconId>VAADIN:CURLY_BRACKETS</iconId>
<stateProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/openadminview/stateProcess.js</stateProcess>
</entityActionField>
<entityField>
<name>DATE_NEW</name>
<contentType>DATE</contentType>
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/date_new/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>DATE_EDIT</name>
<contentType>DATE</contentType>
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/date_edit/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>USER_NEW</name>
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/user_new/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>USER_EDIT</name>
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/user_edit/valueProcess.js</valueProcess>
</entityField>
<entityProvider>
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
<entityField>
<name>EXPORTTEMPLATEPLACEOFUSEID</name>
<title>EXPORTTEMPLATEPLACEOFUSEID</title>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/exporttemplateplaceofuseid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>EXPORTTEMPLATEPLACEOFUSE_ID</name>
<title>Predecessor</title>
<consumer>ExportTemplatePlacesOfUse</consumer>
<mandatory v="true" />
<mandatoryProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/exporttemplateplaceofuse_id/mandatoryProcess.js</mandatoryProcess>
<stateProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/exporttemplateplaceofuse_id/stateProcess.js</stateProcess>
<onValueChange>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/exporttemplateplaceofuse_id/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
<element>PROCESS_SETVALUE</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>EXPORTTEMPLATE_ID</name>
<title>Exporttemplate</title>
......@@ -26,69 +76,124 @@
<name>PLACEOFUSE</name>
<documentation>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/placeofuse/documentation.adoc</documentation>
<title>Place of use</title>
<consumer>ContextExportTemplatePlaceOfUse</consumer>
<consumer>Contexts</consumer>
<mandatory v="true" />
<stateProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/placeofuse/stateProcess.js</stateProcess>
<titleProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/placeofuse/titleProcess.js</titleProcess>
<displayValueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/placeofuse/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/placeofuse/onValueChange.js</onValueChange>
</entityField>
<entityField>
<name>OBJECT_FILTER</name>
<title>Filter</title>
<contentType>FILTER_TREE</contentType>
<stateProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/object_filter/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/object_filter/valueProcess.js</valueProcess>
</entityField>
<entityParameter>
<name>ExportTemplateId_param</name>
<expose v="true" />
<mandatory v="true" />
</entityParameter>
<entityConsumer>
<name>ContextExportTemplatePlaceOfUse</name>
<name>Contexts</name>
<dependency>
<name>dependency</name>
<entityName>Context_entity</entityName>
<fieldName>ContextTemplatePlaceOfUse</fieldName>
<fieldName>Exclusive</fieldName>
</dependency>
<children>
<entityParameter>
<name>InvertBlacklist_param</name>
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/contextexporttemplateplaceofuse/children/invertblacklist_param/valueProcess.js</valueProcess>
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/contexts/children/invertblacklist_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>Blacklist_param</name>
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/contextexporttemplateplaceofuse/children/blacklist_param/valueProcess.js</valueProcess>
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/contexts/children/blacklist_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityParameter>
<name>ExportTemplatePlaceOfUse_param</name>
<name>ExportTemplatePlaceOfUseID_param</name>
<expose v="true" />
</entityParameter>
<entityProvider>
<name>ExportTemplatePlaceOfUser</name>
<documentation>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/exporttemplateplaceofuser/documentation.adoc</documentation>
<entityParameter>
<name>IsMainPlaceOfUse_param</name>
<expose v="true" />
</entityParameter>
<entityConsumer>
<name>ExportTemplatePlacesOfUse</name>
<dependency>
<name>dependency</name>
<entityName>#ENTITY</entityName>
<fieldName>#PROVIDER</fieldName>
</dependency>
<children>
<entityParameter>
<name>ExportTemplatePlaceOfUse_param</name>
<expose v="true" />
<name>ExportTemplatePlaceOfUseID_param</name>
</entityParameter>
<entityParameter>
<name>ExportTemplateId_param</name>
<valueProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/entityfields/exporttemplateplacesofuse/children/exporttemplateid_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityProvider>
<entityProvider>
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
</entityConsumer>
<entityField>
<name>TITLE</name>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<isPageable v="false" />
<hasDependentRecords v="true" />
<conditionProcess>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<onDBDelete>%aditoprj%/entity/ExportTemplatePlaceOfUse_entity/recordcontainers/db/onDBDelete.js</onDBDelete>
<alias>Data_alias</alias>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>DATE_EDIT.value</name>
<recordfield>EXPORTTEMPLATEPLACEOFUSE.DATE_EDIT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_NEW.value</name>
<recordfield>EXPORTTEMPLATEPLACEOFUSE.DATE_NEW</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>EXPORTTEMPLATE_ID.value</name>
<recordfield>EXPORTTEMPLATEPLACEOFUSE.EXPORTTEMPLATE_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>EXPORTTEMPLATEPLACEOFUSE_ID.value</name>
<recordfield>EXPORTTEMPLATEPLACEOFUSE.EXPORTTEMPLATEPLACEOFUSE_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>EXPORTTEMPLATEPLACEOFUSEID.value</name>
<recordfield>EXPORTTEMPLATEPLACEOFUSE.EXPORTTEMPLATEPLACEOFUSEID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>OBJECT_FILTER.value</name>
<recordfield>EXPORTTEMPLATEPLACEOFUSE.OBJECT_FILTER</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>PLACEOFUSE.value</name>
<recordfield>EXPORTTEMPLATEPLACEOFUSE.PLACEOFUSE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_EDIT.value</name>
<recordfield>EXPORTTEMPLATEPLACEOFUSE.USER_EDIT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_NEW.value</name>
<recordfield>EXPORTTEMPLATEPLACEOFUSE.USER_NEW</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>TITLE.value</name>
</dbRecordFieldMapping>
</recordFieldMappings>
<linkInformation>
<linkInformation>
<name>5e6f806e-c845-49ab-bfee-31b12e4c41f3</name>
<name>06fe6e4f-5ab7-404a-b820-7c23fc4a520b</name>
<tableName>EXPORTTEMPLATEPLACEOFUSE</tableName>
<primaryKey>EXPORTTEMPLATEPLACEOFUSEID</primaryKey>
<isUIDTable v="true" />
......
import("system.vars");
import("system.result");
result.string(vars.get("$field.PLACEOFUSE"));
\ No newline at end of file
= ExportTemplatePlaceOfUse_entity
Entity to select all Modules where the created template should be useable (to limit the availability in the modules).
The selection of Places Of usage is created via the link to the context_entity and limiting it
by the Blacklist_param (which is being inverted to an whitelist thanks to the invertBlacklist_param).
Linked via the ExportTemplateID to ExportTemplates.
Own dbTable and Entity are to make it possible to store multiple fields for one template.
import("ExportTemplate_lib");
import("Context_lib");
import("Dependency_lib");
import("Observation_lib");
import("system.vars");
import("system.result");
import("Sql_lib")
let placeOfUse;
let contexts = [];
let entityNames;
if (vars.get("$field.EXPORTTEMPLATEPLACEOFUSE_ID"))
{
placeOfUse = newSelect("EXPORTTEMPLATEPLACEOFUSE.PLACEOFUSE")
.from("EXPORTTEMPLATEPLACEOFUSE")
.where("EXPORTTEMPLATEPLACEOFUSE.EXPORTTEMPLATEPLACEOFUSEID", vars.get("$field.EXPORTTEMPLATEPLACEOFUSE_ID"))
.cell();
}
if (placeOfUse)
{
entityNames = Dependency.getDependency(ContextUtils.getEntity(placeOfUse), {
"isExportable" : true
});
}
else
{
entityNames = ExportTemplateUtils.exportableEntities();
}
for (let i = 0; i < entityNames.length; i++)
{
let context = ContextUtils.getContextId(entityNames[i]);
if (context)
{
contexts.push(context);
}
}
result.string(JSON.stringify(contexts));
\ No newline at end of file
import("system.result");
result.object(["Person", "Organisation"]);
\ No newline at end of file
result.string(true);
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT)
{
result.string(vars.get("$sys.date"));
}
\ No newline at end of file
import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
result.string(vars.get("$sys.date"));
}
\ No newline at end of file
import("Util_lib");
import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
if(!Utils.isNullOrEmpty(vars.getString("$param.ExportTemplateId_param")) && Utils.isNullOrEmpty(vars.get("$this.value")))
{
if(vars.exists("$param.ExportTemplatePlaceOfUse_param") && vars.get("$param.ExportTemplatePlaceOfUse_param") != null
&& vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
result.string(vars.getString("$param.ExportTemplatePlaceOfUse_param"));
result.string(vars.getString("$param.ExportTemplateId_param"));
}
\ No newline at end of file
import("Util_lib");
import("system.vars");
import("system.result");
result.string(!Utils.toBoolean(vars.get("$param.IsMainPlaceOfUse_param")));
\ No newline at end of file
import("Context_lib");
import("system.vars");
// If the place of use of the export template is changed, the selected place of use no longer matches the parent.
vars.set("$field.PLACEOFUSE", null);
\ No newline at end of file
import("system.vars");
import("Util_lib");
import("system.result");
import("system.neon");
// If this is the Main PlaceOfUse, there the parent One is null
if (Utils.toBoolean(vars.get("$param.IsMainPlaceOfUse_param")))
{
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
\ No newline at end of file
......@@ -4,4 +4,7 @@ import("system.util");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
result.string(util.getNewUUID());
\ No newline at end of file
{
result.string(util.getNewUUID());
}
= ExportTemplatePlaceOfUse_entity - ExportTemplatePlaceOfUser
needed instead of the #PROVIDER so the ExportTemplatePlaceOfUse_param can be used
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$param.ExportTemplateId_param"));
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$param.ExportTemplateId_param"));
\ No newline at end of file
import("Util_lib");
import("system.neon");
import("system.vars");
import("system.result");
let state;
if (!Utils.isNullOrEmpty(vars.get("$field.PLACEOFUSE")) && !Utils.isNullOrEmpty(vars.get("$field.EXPORTTEMPLATEPLACEOFUSE_ID")))
{
state = neon.COMPONENTSTATE_EDITABLE;
}
else
{
state = neon.COMPONENTSTATE_INVISIBLE;
}
result.string(state);
\ No newline at end of file
import("JditoFilter_lib");
import("Util_lib");
import("Observation_lib");
import("system.vars");
import("system.result");
let resFilter;
if (!Utils.isNullOrEmpty(vars.get("$this.value")) && !Utils.isNullOrEmpty(vars.get("$field.PLACEOFUSE")))
{
resFilter = JditoFilterUtils.getContextFilter(vars.get("$field.PLACEOFUSE"), null);
}
if (resFilter)
{
result.string(resFilter);
}
\ No newline at end of file
import("system.vars");
import("Context_lib");
AdminViewUtils.open("", []);
\ No newline at end of file
import("Context_lib");
import("system.result");
result.string(AdminViewUtils.getActionState());
\ No newline at end of file
import("system.translate");
import("Util_lib");
import("system.vars");
import("system.result");
import("Context_lib");
import("system.project");
import("system.result");
var placeOfUse = vars.get("$field.PLACEOFUSE");
if(placeOfUse)
result.string(ContextUtils.getTitle(placeOfUse, true));
\ No newline at end of file
if (Utils.isNotNullOrEmptyString(vars.getString("$this.value")))
{
let title = ContextUtils.getTranslatedTitle(vars.getString("$this.value")) || translate.text(vars.getString("$this.value"));
result.string(title);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment