diff --git a/.liquibase/Data_alias/basic/2021.0.0/Keywords/update_keywordAttribute.xml b/.liquibase/Data_alias/basic/2021.0.0/Keywords/update_keywordAttribute.xml index b75f38f1225374b99e81ef181f0836cb864d1bd8..407f0bd634eb59a79e2705942eb3315bba9c4c7e 100644 --- a/.liquibase/Data_alias/basic/2021.0.0/Keywords/update_keywordAttribute.xml +++ b/.liquibase/Data_alias/basic/2021.0.0/Keywords/update_keywordAttribute.xml @@ -8,5 +8,8 @@ <dropNotNullConstraint tableName="AB_KEYWORD_ATTRIBUTE" columnName="CONTAINER" columnDataType="VARCHAR(80)"/> + <createIndex indexName="IDX_AB_KEYWORD_ATTR_CAT_ID" tableName="AB_KEYWORD_ATTRIBUTE"> + <column name="AB_KEYWORD_CATEGORY_ID"/> + </createIndex> </changeSet> </databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2021.0.0/Keywords/update_keywordEntry.xml b/.liquibase/Data_alias/basic/2021.0.0/Keywords/update_keywordEntry.xml index e45e792dbb96364b3b15a05be548452110001a70..af49a88227038bae79afdc2b2b7012af236c131d 100644 --- a/.liquibase/Data_alias/basic/2021.0.0/Keywords/update_keywordEntry.xml +++ b/.liquibase/Data_alias/basic/2021.0.0/Keywords/update_keywordEntry.xml @@ -8,5 +8,8 @@ <dropNotNullConstraint tableName="AB_KEYWORD_ENTRY" columnName="CONTAINER" columnDataType="VARCHAR(80)"/> + <createIndex indexName="IDX_AB_KEYWORD_ENTRY_CAT_ID" tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_CATEGORY_ID"/> + </createIndex> </changeSet> </databaseChangeLog> diff --git a/.liquibase/Data_alias/changelog.xml b/.liquibase/Data_alias/changelog.xml index 12d0865aebe1c4bc81cb8563000a34e896ec8998..7324a01f078502089af8772d6ff926d24482aecd 100644 --- a/.liquibase/Data_alias/changelog.xml +++ b/.liquibase/Data_alias/changelog.xml @@ -22,5 +22,5 @@ <include relativeToChangelogFile="true" file="basic/2021.0.0/changelog.xml"/> <!--enable this only when you definetly want to overwrite the existing data with demo records:--> - <!--<include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/>--> + <include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/> </databaseChangeLog> \ No newline at end of file diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index e7fffbd3b79ae5520b1b56ed1c7870d518399740..c11813dbb29225d87cc86ba13b661a200c04c77d 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -6671,7 +6671,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <title></title> <description></description> @@ -6834,7 +6834,7 @@ <columnType v="12" /> <size v="80" /> <scale v="0" /> - <notNull v="true" /> + <notNull v="false" /> <isUnique v="false" /> <index v="true" /> <documentation></documentation> @@ -6899,7 +6899,7 @@ <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> - <index v="false" /> + <index v="true" /> <documentation></documentation> <description></description> </entityFieldDb> @@ -18239,6 +18239,138 @@ </entityFieldDb> </entityFields> </entityDb> + <entityDb> + <name>AB_SYNCCONTACT</name> + <dbName></dbName> + <idColumn>SYNCCONTACTID</idColumn> + <idGeneratorType v="0" /> + <idGeneratorInterval v="1" /> + <documentation></documentation> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>DATE_EDIT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>EXCHANGEID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="254" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="true" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>ASYS_FAVORITEID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="true" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>USER_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="46" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="true" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>CONTACT_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="true" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_NEW</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>SYNCCONTACTID</name> + <dbName></dbName> + <primaryKey v="true" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="true" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_DEL</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> </entities> </entityGroup> </aliasDefDb> diff --git a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod index 91281b4cfaa6c8b14ac125c4d9dda3ecb4825d64..30e957717bd688d4b60b8b624272000b4935b5a3 100644 --- a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod +++ b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod @@ -294,13 +294,6 @@ <name>TARGET_CONTEXT</name> <valueProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/target_context/valueProcess.js</valueProcess> </entityField> - <entityActionField> - <name>openAdminView</name> - <title>Open admin view</title> - <onActionProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/openadminview/onActionProcess.js</onActionProcess> - <iconId>VAADIN:CURLY_BRACKETS</iconId> - <stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/openadminview/stateProcess.js</stateProcess> - </entityActionField> <entityField> <name>REPLACEMENTNAME</name> <title>Replacement name</title> @@ -347,6 +340,27 @@ <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>openHtmlEditor</name> + <title>Edit HTML</title> + <onActionProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/openhtmleditor/onActionProcess.js</onActionProcess> + <iconId>NEON:PENCIL</iconId> + <state>INVISIBLE</state> + <stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/openhtmleditor/stateProcess.js</stateProcess> + </entityActionField> + <entityActionField> + <name>openAdminView</name> + <title>Open admin view</title> + <onActionProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/openadminview/onActionProcess.js</onActionProcess> + <iconId>VAADIN:CURLY_BRACKETS</iconId> + <stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/openadminview/stateProcess.js</stateProcess> + </entityActionField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/DocumentTemplate_entity/entityfields/htmledit/valueProcess.js b/entity/DocumentTemplate_entity/entityfields/htmledit/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..36a9c17e2705fcba467c4a8ac938bd4459876cf4 --- /dev/null +++ b/entity/DocumentTemplate_entity/entityfields/htmledit/valueProcess.js @@ -0,0 +1,10 @@ +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 diff --git a/entity/DocumentTemplate_entity/entityfields/openhtmleditor/onActionProcess.js b/entity/DocumentTemplate_entity/entityfields/openhtmleditor/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..fffffbec7b3c32bd321a33286a6db7cbd07dc13a --- /dev/null +++ b/entity/DocumentTemplate_entity/entityfields/openhtmleditor/onActionProcess.js @@ -0,0 +1,6 @@ +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) diff --git a/entity/DocumentTemplate_entity/entityfields/openhtmleditor/stateProcess.js b/entity/DocumentTemplate_entity/entityfields/openhtmleditor/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c0824ad21cb8d86f3e4cd4b0729d393cb7db7870 --- /dev/null +++ b/entity/DocumentTemplate_entity/entityfields/openhtmleditor/stateProcess.js @@ -0,0 +1,11 @@ +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); diff --git a/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js b/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js index 3fcb0bfdea5a7b87a043d458315bcde4a77dd59b..f26e45f82fa837f71d0e36e77a96dc713b49eaa0 100644 --- a/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js +++ b/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js @@ -1,3 +1,4 @@ +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 diff --git a/entity/DocumentTemplate_entity/recordcontainers/db/onDBUpdate.js b/entity/DocumentTemplate_entity/recordcontainers/db/onDBUpdate.js index a3311749b10574b4ab7133c69b685d571d80f204..dee24321b4a3655b4a253742be82b7ca9c25d66e 100644 --- a/entity/DocumentTemplate_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/DocumentTemplate_entity/recordcontainers/db/onDBUpdate.js @@ -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 diff --git a/entity/Organisation_entity/entityfields/map_config/valueProcess.js b/entity/Organisation_entity/entityfields/map_config/valueProcess.js index b5c60bd2e238e1e5e3478f33dffe0becdb6a71aa..3bec2c7cfd685da266384138eff96e258d89dfc0 100644 --- a/entity/Organisation_entity/entityfields/map_config/valueProcess.js +++ b/entity/Organisation_entity/entityfields/map_config/valueProcess.js @@ -1,46 +1,15 @@ -import("system.translate"); -import("system.vars"); -import("system.util"); -import("system.fileIO"); import("system.result"); +import("system.vars"); +import("system.vars"); +import("MapViewTemplate_lib"); -/* !WARNING! This openstreetmap TileLayer Server is only used for demonstration purposes and to show how this map template configuration works. - * From the tile-usage-policy: - * "Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission" - * See more about the openstreetmap policy here: - * https://operations.osmfoundation.org/policies/tiles/ - * - * This means you have to change the following tile source for using the MapViewTemplate in any real scenario (Dev-Serers, Test-Servers, - * Production-Servers and so on). - */ -var licenseCaption = translate.text("License"); -var contributionCaption = translate.text("Contribute map data"); -var selectedTile = { - title: "Open Street Map", - url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", - attribution: translate.withArguments("Map data © %0 contributors | %1 | %2", [ - "<a href=\"https://openstreetmap.org\">OpenStreetMap</a>", - "<a href=\"https://www.openstreetmap.org/copyright\">" + licenseCaption + "</a>", - "<a href=\"https://www.openstreetmap.org/fixthemap\">" + contributionCaption + "</a>"]) -}; - +var config = MapViewConfigUtils.getBaseConfiguration(); +config.startingCenterPosition.lat = parseFloat(vars.get("$param.MapViewCenterLat_param")); +config.startingCenterPosition.lon = parseFloat(vars.get("$param.MapViewCenterLon_param")); +config.startingCenterPosition.zoomLevel = 5; -var config = { - startingCenterPosition : { - lat: parseFloat(vars.get("$param.MapViewCenterLat_param")), - lon: parseFloat(vars.get("$param.MapViewCenterLon_param")), - zoomLevel: 5, - //but let's try to locate the users posistion for a better view - autoLocate: true - }, - boundaries: { - minZoom: 0, - maxZoom: 20 - }, - tiles: [ - /*add more tile layer sources here*/ - ] -}; +var tileConfig = MapViewConfigUtils.getMainTileConfig(); +config.tiles = tileConfig; //when opening the AroundLocation view we do want to have the source organisation as center, so let's not overwrite the starting center position by //looking for the users current location @@ -50,7 +19,5 @@ if (vars.get("$param.MapViewAdditionalFeatures_param")) config.startingCenterPosition.autoLocate = false; } -config.tiles.push(selectedTile);//the last tile layer will be always selected by leaflet, so let's push it here - var res = JSON.stringify(config); result.string(res); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index a2533252710e522d04c573380324ad194b229aaa..b248344595e239c452f104bd2bd47a873c850640 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -8076,6 +8076,18 @@ <entry> <key>EML files can't be edited here. You can download, edit and reupload the template to change the content.</key> </entry> + <entry> + <key>Edit HTML</key> + </entry> + <entry> + <key>HTML Editor</key> + </entry> + <entry> + <key>Add to order</key> + </entry> + <entry> + <key>Add to offer</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 045b4a294e877d356edd2a60506858b206d6524f..bc30cae34996390b432f80d773a0866b45f6719d 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -51,12 +51,12 @@ <value>Es ist nicht erlaubt Vertriebsprojektphasen zu überspringen.</value> </entry> <entry> - <key>Add to offer</key> - <value>Zu Angebot hinzufügen</value> + <key>Add to offer</key> + <value>Zu Angebot hinzufügen</value> </entry> <entry> - <key>Add to order</key> - <value>Zu Beleg hinzufügen</value> + <key>Add to order</key> + <value>Zu Beleg hinzufügen</value> </entry> <entry> <key>Probability AI</key> @@ -2962,6 +2962,10 @@ <key>Tonga</key> <value>Tonga</value> </entry> + <entry> + <key>Edit HTML</key> + <value>HTML bearbeiten</value> + </entry> <entry> <key>Western Sahara</key> <value>Westsahara</value> @@ -10637,6 +10641,9 @@ Bitte Datumseingabe prüfen</value> <entry> <key>Calendar week</key> </entry> + <entry> + <key>HTML Editor</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index aab38d453ab679337ca3e7173fb8bbdebccfa89f..26abcd7d5720512b84130268e80ce218ee5f91c2 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -8157,6 +8157,18 @@ <entry> <key>EML files can't be edited here. You can download, edit and reupload the template to change the content.</key> </entry> + <entry> + <key>Edit HTML</key> + </entry> + <entry> + <key>HTML Editor</key> + </entry> + <entry> + <key>Add to order</key> + </entry> + <entry> + <key>Add to offer</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/Document/Document.aod b/neonContext/Document/Document.aod index cfb02a7f2b32b641b632905df49b01ef560bd62c..625b588c0d26638db8e8001004ea6d6d8a12f3c1 100644 --- a/neonContext/Document/Document.aod +++ b/neonContext/Document/Document.aod @@ -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> diff --git a/neonContext/DocumentTemplate/DocumentTemplate.aod b/neonContext/DocumentTemplate/DocumentTemplate.aod index 93bb494e4a2b1a7850ba0ec770c28e4ae4466216..106a7ab18eba8cfb0186d7ab15594326becb77e3 100644 --- a/neonContext/DocumentTemplate/DocumentTemplate.aod +++ b/neonContext/DocumentTemplate/DocumentTemplate.aod @@ -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> diff --git a/neonView/DocumentTemplateHtmlEdit_view/DocumentTemplateHtmlEdit_view.aod b/neonView/DocumentTemplateHtmlEdit_view/DocumentTemplateHtmlEdit_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..bc2bab9c2c5c24bf58bb874f8522cbab0d1b9f07 --- /dev/null +++ b/neonView/DocumentTemplateHtmlEdit_view/DocumentTemplateHtmlEdit_view.aod @@ -0,0 +1,22 @@ +<?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.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> + <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> diff --git a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod index 880f20c2d38b04c1ecdeadd1245ad5134b4c6667..3254060f7a1cec72e4b9f9df970b0dcba00e4c2b 100644 --- a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod +++ b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod @@ -85,6 +85,10 @@ <name>dataCaching.client.forceDisable</name> <description>Enabling this option will disable the per-client-context data-cache within the customzing (for exameple the caching of Keywords). This is usefull if you're testing and want to frequently add data like keywords, etc. which are cached which help of the "DataCaching_lib".</description> </customBooleanProperty> + <customStringProperty> + <name>geo.maptiler.apikey</name> + <description>An API Key for using Maptiler functions. For example for the MapViewTemplate.</description> + </customStringProperty> </customConfigProperties> <customProperties> <customBooleanProperty> diff --git a/process/DocumentTemplate_lib/process.js b/process/DocumentTemplate_lib/process.js index 3c074ffd23098632fde158cbebaa1bfad78e50f1..5fef12bb28f9133080c716a9f542a528103792ec 100644 --- a/process/DocumentTemplate_lib/process.js +++ b/process/DocumentTemplate_lib/process.js @@ -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; diff --git a/process/MapViewTemplate_lib/MapViewTemplate_lib.aod b/process/MapViewTemplate_lib/MapViewTemplate_lib.aod new file mode 100644 index 0000000000000000000000000000000000000000..909ee2f9e3ac4f1dc45394e232d1f20b842b2caf --- /dev/null +++ b/process/MapViewTemplate_lib/MapViewTemplate_lib.aod @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.2"> + <name>MapViewTemplate_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/MapViewTemplate_lib/process.js</process> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/MapViewTemplate_lib/process.js b/process/MapViewTemplate_lib/process.js new file mode 100644 index 0000000000000000000000000000000000000000..86385e6627a2c9e2723f369feb7bfd44d5cfd1bb --- /dev/null +++ b/process/MapViewTemplate_lib/process.js @@ -0,0 +1,96 @@ +import("system.project"); +import("system.translate"); + +/** + * Provides utility functions for the MapViewTemplate <br/> + * <b><u>Don't instanciate this!</u></b> + * + * @class + */ +function MapViewConfigUtils(){} + +/** + * Returns a basic object for the configuration of a MapViewTemplate, so this is a starting point of every map configuration. <br/> + * Starting coordinates are 0,0 but autoLocation is enabled. <br/ + * Zoom ist between 1-20. <br/ + * There are no tiles defined by default. <br/ + * @return {Object} mutable object with the default configuration + */ +MapViewConfigUtils.getBaseConfiguration = function() +{ + var config = { + startingCenterPosition : { + lat: 0, + lon: 0, + autoLocate: true + }, + boundaries: { + minZoom: 1, + maxZoom: 20 + }, + tiles: [] + }; + + return config; +}; + +/** + * Returns the tile configs that are considered to be mainly used in the project.<br/> + * + * @return {Array} Array of map tile configs - these are possible map tile types where the user can choose from. + */ +MapViewConfigUtils.getMainTileConfig = function () +{ + var res = []; + //add more tile configs here if you want, the bottom tile will be the by default selected tileconfig + res.push(MapViewConfigUtils.getTileConfigMapTiler()); + return res; +}; + +/** + * Returns a tile configuration for an open street map.<br/> + * !WARNING! The openstreetmap TileLayer Server forbids heavy and commercial use. This is only for showcase purposes. Never use this in real scenarios. + * @return {Object} Configuration as mutable object with a title, url and attribution that can be added to the tiles-property of a MapViewTemplate-config + */ +MapViewConfigUtils.getTileConfigOSM = function () +{ + /* !WARNING! This openstreetmap TileLayer Server is only used for demonstration purposes and to show how this map template configuration works. + * From the tile-usage-policy: + * "Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission" + * See more about the openstreetmap policy here: + * https://operations.osmfoundation.org/policies/tiles/ + * + * This means you have to change the following tile source for using the MapViewTemplate in any real scenario (Dev-Serers, Test-Servers, + * Production-Servers and so on). + */ + var licenseCaption = translate.text("License"); + var contributionCaption = translate.text("Contribute map data"); + var tile = { + title: "Open Street Map", + url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + attribution: translate.withArguments("Map data © %0 contributors | %1 | %2", [ + "<a href=\"https://openstreetmap.org\">OpenStreetMap</a>", + "<a href=\"https://www.openstreetmap.org/copyright\">" + licenseCaption + "</a>", + "<a href=\"https://www.openstreetmap.org/fixthemap\">" + contributionCaption + "</a>"]) + }; + return tile; +}; + +/** + * Returns a tile configuration for a maptiler map.<br/> + * The required API-key is retreived from the custom _____CONFIGURATION value with the name "geo.maptiler.apikey". <br/> + * Uses the "streets" layer.<br/> + * @return {Object} Configuration as mutable object with a title, url and attribution that can be added to the tiles-property of a MapViewTemplate-config + */ +MapViewConfigUtils.getTileConfigMapTiler = function() +{ + var apikey = project.getInstanceConfigValue("custom.geo.maptiler.apikey", ""); + var mapTilerUrl = "https://api.maptiler.com/maps/streets/256/{z}/{x}/{y}.png?key=" + apikey; + var tile = { + title: translate.text("Streetmap"), + url: mapTilerUrl, + //copied from the maptiler website: https://cloud.maptiler.com/maps/basic/leaflet + attribution: "\u003ca href=\"https://www.maptiler.com/copyright/\" target=\"_blank\"\u003e\u0026copy; MapTiler\u003c/a\u003e \u003ca href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\"\u003e\u0026copy; OpenStreetMap contributors\u003c/a\u003e" + }; + return tile; +}; \ No newline at end of file