Skip to content
Snippets Groups Projects
Commit 5fcbcbf1 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

merged origin/2020.2.3_DocumentTemplateHTMLedit_mw into 2021.0.0

parents 5c266cc4 a4af425d
No related branches found
No related tags found
No related merge requests found
Showing with 111 additions and 38 deletions
......@@ -94,11 +94,6 @@
</entityField>
<entityConsumer>
<name>Documents</name>
<dependency>
<name>dependency</name>
<entityName>Document_entity</entityName>
<fieldName>Documents</fieldName>
</dependency>
<children>
<entityParameter>
<name>AssignmentTable_param</name>
......@@ -109,6 +104,11 @@
<valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
<dependency>
<name>dependency</name>
<entityName>Document_entity</entityName>
<fieldName>Documents</fieldName>
</dependency>
</entityConsumer>
<entityConsumer>
<name>Languages</name>
......@@ -120,27 +120,22 @@
</entityConsumer>
<entityConsumer>
<name>KeywordDocumentTemplateType</name>
<dependency>
<name>dependency</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContainerName_param</name>
<valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/keyworddocumenttemplatetype/children/containername_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
<dependency>
<name>dependency</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName>
</dependency>
</entityConsumer>
<entityConsumer>
<name>Attributes</name>
<stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/attributes/stateProcess.js</stateProcess>
<onValidation>%aditoprj%/entity/DocumentTemplate_entity/entityfields/attributes/onValidation.js</onValidation>
<dependency>
<name>dependency</name>
<entityName>AttributeRelation_entity</entityName>
<fieldName>AttributeRelations</fieldName>
</dependency>
<children>
<entityParameter>
<name>ObjectRowId_param</name>
......@@ -151,6 +146,11 @@
<valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/attributes/children/objecttype_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
<dependency>
<name>dependency</name>
<entityName>AttributeRelation_entity</entityName>
<fieldName>AttributeRelations</fieldName>
</dependency>
</entityConsumer>
<entityField>
<name>Content</name>
......@@ -176,11 +176,6 @@
</entityField>
<entityConsumer>
<name>DocumentTemplateTypeCategory</name>
<dependency>
<name>dependency</name>
<entityName>DocumentTemplateTypeCategory_entity</entityName>
<fieldName>ByCategory</fieldName>
</dependency>
<children>
<entityParameter>
<name>usageFilter_param</name>
......@@ -188,6 +183,11 @@
<expose v="true" />
</entityParameter>
</children>
<dependency>
<name>dependency</name>
<entityName>DocumentTemplateTypeCategory_entity</entityName>
<fieldName>ByCategory</fieldName>
</dependency>
</entityConsumer>
<entityProvider>
<name>Attachments</name>
......@@ -208,11 +208,6 @@
<entityConsumer>
<name>Links</name>
<stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/links/stateProcess.js</stateProcess>
<dependency>
<name>dependency</name>
<entityName>DocumentTemplateLink_entity</entityName>
<fieldName>Links</fieldName>
</dependency>
<children>
<entityParameter>
<name>DocumentId_param</name>
......@@ -225,6 +220,11 @@
<expose v="true" />
</entityParameter>
</children>
<dependency>
<name>dependency</name>
<entityName>DocumentTemplateLink_entity</entityName>
<fieldName>Links</fieldName>
</dependency>
</entityConsumer>
<entityParameter>
<name>DocumentTemplateTypeClassification_param</name>
......@@ -234,6 +234,12 @@
<entityProvider>
<name>DocumentTemplateProvider</name>
<documentation>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documenttemplateprovider/documentation.adoc</documentation>
<children>
<entityParameter>
<name>ComingFrom_param</name>
<expose v="true" />
</entityParameter>
</children>
<dependencies>
<entityDependency>
<name>9c10883d-eb73-4587-b758-693a66367a4c</name>
......@@ -278,12 +284,6 @@
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
<name>ComingFrom_param</name>
<expose v="true" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>DocumentTemplateType_param</name>
......@@ -322,11 +322,6 @@
<name>DocumentTemplatePlaceOfUse</name>
<stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documenttemplateplaceofuse/stateProcess.js</stateProcess>
<onValidation>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documenttemplateplaceofuse/onValidation.js</onValidation>
<dependency>
<name>dependency</name>
<entityName>DocumentTemplatePlaceOfUse_entity</entityName>
<fieldName>DocumentTemplatePlaceOfUse</fieldName>
</dependency>
<children>
<entityParameter>
<name>DocumentTemplatePlaceOfUse_param</name>
......@@ -334,6 +329,11 @@
<expose v="true" />
</entityParameter>
</children>
<dependency>
<name>dependency</name>
<entityName>DocumentTemplatePlaceOfUse_entity</entityName>
<fieldName>DocumentTemplatePlaceOfUse</fieldName>
</dependency>
</entityConsumer>
<entityParameter>
<name>ComingFrom_param</name>
......@@ -347,6 +347,20 @@
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
<entityField>
<name>HtmlEdit</name>
<title>HTML Editor</title>
<contentType>HTML</contentType>
<valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/htmledit/valueProcess.js</valueProcess>
</entityField>
<entityActionField>
<name>HtmlEditor</name>
<title>Edit HTML file</title>
<onActionProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/htmleditor/onActionProcess.js</onActionProcess>
<iconId>NEON:PENCIL</iconId>
<state>INVISIBLE</state>
<stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/htmleditor/stateProcess.js</stateProcess>
</entityActionField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.result");
import("system.neon");
import("DocumentTemplate_lib");
import("system.vars");
if((vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT || vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW) && vars.get("$this.value") == null)
{
var [content, type] = DocumentTemplateUtils.getTemplateContent(vars.get("$field.DOCUMENTTEMPLATEID"), new FileUpload(vars.get("$field.BINDATA")));
result.string(content);
}
\ No newline at end of file
import("system.logging");
import("system.vars");
import("DocumentTemplate_lib");
import("system.neon");
neon.openContext("DocumentTemplate", "DocumentTemplateHtmlEdit_view", [vars.get("$field.DOCUMENTTEMPLATEID")], neon.OPERATINGSTATE_EDIT, null)
import("KeywordRegistry_basic");
import("system.result");
import("system.vars");
import("DocumentTemplate_lib");
import("system.neon");
var template = DocumentTemplateUtils.getTemplate(vars.get("$field.DOCUMENTTEMPLATEID"), false);
var kind = vars.get("$field.KIND");
if(template.type == DocumentTemplate.types.HTML && kind == $KeywordRegistry.documentTemplateType$textModular() || kind == $KeywordRegistry.documentTemplateType$mail())
result.string(neon.COMPONENTSTATE_EDITABLE);
import("system.logging");
import("Workflow_lib");
import("DocumentTemplate_lib");
import("system.vars");
......@@ -8,5 +9,4 @@ var upload = new FileUpload(vars.get("$field.BINDATA"));
var rowId = vars.get("$local.uid");
DocumentTemplateUtils.insertTemplateData(rowId, upload, rowdata["DOCUMENTTEMPLATE.KIND"], vars.get("$field.Content"), rowdata["DOCUMENTTEMPLATE.CLASSIFICATION"], rowdata["DOCUMENTTEMPLATE.NAME"]);
WorkflowSignalSender.inserted();
\ No newline at end of file
......@@ -10,4 +10,7 @@ var rowId = vars.get("$local.uid");
DocumentTemplateUtils.updateTemplateData(rowId, upload, rowdata["DOCUMENTTEMPLATE.KIND"], content, rowdata["DOCUMENTTEMPLATE.CLASSIFICATION"], rowdata["DOCUMENTTEMPLATE.NAME"]);
if(vars.get("$field.HtmlEdit") != null)
DocumentTemplateUtils.updateTemplateData(rowId, upload, rowdata["DOCUMENTTEMPLATE.KIND"], vars.get("$field.HtmlEdit"), rowdata["DOCUMENTTEMPLATE.CLASSIFICATION"], rowdata["DOCUMENTTEMPLATE.NAME"])
WorkflowSignalSender.updated();
\ No newline at end of file
......@@ -37,5 +37,8 @@
<name>434ed60c-8219-4ef5-b795-6d72b9ae48c9</name>
<view>DocumentWithIdFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>0dfe06a2-7a32-40b4-bac7-3b408956deba</name>
</neonViewReference>
</references>
</neonContext>
......@@ -26,5 +26,9 @@
<name>df9dab28-502c-41c2-8a8f-1c0745ca14dd</name>
<view>DocumentTemplateFilterSmall_view</view>
</neonViewReference>
<neonViewReference>
<name>9a7692da-4374-4fd8-a65f-aea4100bedca</name>
<view>DocumentTemplateHtmlEdit_view</view>
</neonViewReference>
</references>
</neonContext>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6">
<name>DocumentTemplateHtmlEdit_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<noneLayout>
<name>layout</name>
</noneLayout>
</layout>
<children>
<genericViewTemplate>
<name>Edit</name>
<editMode v="true" />
<fields>
<entityFieldLink>
<name>30901b23-7bad-42d6-aa14-ebc11268d407</name>
<entityField>HtmlEdit</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
</neonView>
......@@ -913,7 +913,7 @@ DocumentTemplateUtils.chooseSuppliedTemplate = function (pFileUpload, pKind, pTe
// use fileUpload but use the custom text as bindata
pFileUpload.bindata = util.encodeBase64String(pText);
}
else if (!pFileUpload.isFilled() && pText != "" && pKind == $KeywordRegistry.documentTemplateType$textModular()) // edit is only allowed in modular templates
else if (!pFileUpload.isFilled() && pText != "" && pKind == $KeywordRegistry.documentTemplateType$textModular() || pKind == $KeywordRegistry.documentTemplateType$mail()) // edit is only allowed in modular templates
{
pFileUpload.filename = pTemplateName;
......
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