Files
ofbiz-framework/applications/content/servicedef/secas.xml
T
Jacques Le Roux 5d65e6e84b A modified patch from James Young based on a an original patch from Christoph Neuroth for "Improved CMS tree: more functionality and faster for large trees" - https://issues.apache.org/jira/browse/OFBIZ-4502
We here at [Lusini|http://www.lusini.de/] did several improvements to the CMS backend to make it more usable for large CMS installations. 

* Improved performance of CMS tree
** loading nodes dynamically using AJAX
*** Created ContentJsonEvents to handle the JSON calls
** use OFBiz entity caches
** removed duplicate execution of WebSitePublishPoint.groovy
*** removed reference from controller.xml as it is not used anywhere

* Moving nodes in CMS tree possible now using drag'n'drop
** ContentJsonEvents returns updated node attributes
** Adjusted WebSiteCMSNav.ftl to update the moved node with the data from the ajax request
** Needed to replace the jstree jQuery plugin by the current version available on the jstree website

* Made nodes deleteable
** added remove to context menu
** We did not want to delete the WebSitePathAlias entities right away, so we added a fromDate and thruDate to it. 
*** extended WebSitePathAlias entity definition: added fromDate and thruDate
*** now checking for date range everywhere when accessing path aliases
*** This also allows users to publish or unpublish contents under a certain URL automatically at some time in the future. 
** created event to "delete" a node
*** thruDate of all assocs pointing to this node are set to current timestamp
*** thruDate of WebSitePathAliases pointing to this content or any contents below are set to current timestamp
*** this way nothing is actually removed from the DB and a "undo" would be possible if necessary
** extracted context menu to variable so it can be reused for all trees

* fixed missing references to uiLabels in CMS menu bar

* Activated cookie plugin so the selected node is remembered



jleroux: I made few changes
* Use of UtilGenerics.cast() in new ContentJsonEvents.java rather than @SuppressWarnings("unchecked")
* Removal of the commented out block "Lusini: disable RTE". I see no reasons why we would not use elRTE. Notably in relation with adding errors where it's currently used in trunk demo
* I changed the line 
    var unmovableSubtrees = [false, "categoryChildren_LusiniBrowseRoot", "homeContentsRoot", "merchantContentsRoot"];
    We have no such subtrees OOTB but it's good to keep the idea, I just renamed categoryChildren_LusiniBrowseRoot to categoryChildren and put an explaining comment
* I have roughly added the labels ContentWebSiteErrors, ContentWebSiteAddNewErrors and ContentWebSiteAddError, though I have a doubt about how this works. At least it's different than on trunk demo where it seems to works better (despite having uncommented out elRTE in this commit). ALso I don't remember how to add a menu worked (if it worked).
* I checked the version of jstree we use is the same than in the original patch from Christoph Neuroth. BTW at r1559769 I tried to update jstree  to jstree 3 but gave up.
* I removed the jquery.cookie.js implemnentation and replaced link in WebSiteCMSNav.ftl. I already updted to jquery.cookie-1.4.0 at r1559769

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1738588 13f79535-47bb-0310-9956-ffa450edef68
2016-04-11 14:17:30 +00:00

188 lines
9.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
<eca service="createFile" event="in-validate">
<condition field-name="dataResource" operator="is-empty"/>
<action service="createDataResource" mode="sync"/>
</eca>
<eca service="createSurveyQuestion" event="commit">
<condition field-name="surveyId" operator="is-not-empty"/>
<action service="createSurveyQuestionAppl" mode="sync"/>
</eca>
<!-- create data resource ecas -->
<eca service="createDataResource" event="commit">
<condition field-name="partyId" operator="is-not-empty"/>
<condition field-name="roleTypeId" operator="is-not-empty"/>
<action service="createDataResourceRole" mode="sync" run-as-user="system"/>
</eca>
<eca service="createDataResource" event="commit">
<condition field-name="partyId" operator="is-not-empty"/>
<condition field-name="roleTypeId" operator="is-empty"/>
<set field-name="roleTypeId" value="OWNER"/>
<action service="createDataResourceRole" mode="sync" run-as-user="system"/>
</eca>
<eca service="createDataResource" event="commit">
<condition field-name="partyId" operator="is-empty"/>
<condition field-name="roleTypeId" operator="is-empty"/>
<condition field-name="userLogin" operator="is-not-empty"/>
<set field-name="partyId" env-name="${userLogin.partyId}"/>
<set field-name="roleTypeId" value="OWNER"/>
<action service="createDataResourceRole" mode="sync" run-as-user="system"/>
</eca>
<!-- other data resource; needs dataResourceId -->
<eca service="createOtherDataResource" event="in-validate">
<condition field-name="dataResourceId" operator="is-empty"/>
<set field-name="dataResourceTypeId" value="OTHER_OBJECT"/>
<action service="createDataResource" mode="sync" result-to-context="true"/>
</eca>
<!-- dataresource role ecas -->
<eca service="createDataResourceRole" event="invoke">
<action service="ensurePartyRole" mode="sync" run-as-user="system"/>
</eca>
<!-- create/update data text service is a route; determine which path to follow -->
<eca service="createDataText" event="invoke">
<condition field-name="dataResourceTypeId" operator="equals" value="ELECTRONIC_TEXT"/>
<set field-name="dataResourceTypeId" value="ELECTRONIC_TEXT"/>
<action service="createElectronicText" mode="sync" result-to-context="true"/>
</eca>
<eca service="createDataText" event="invoke">
<condition field-name="dataResourceTypeId" operator="is-empty"/>
<condition field-name="textData" operator="is-not-empty"/>
<set field-name="dataResourceTypeId" value="ELECTRONIC_TEXT"/>
<action service="createElectronicText" mode="sync" result-to-context="true"/>
</eca>
<eca service="createDataText" event="invoke">
<condition field-name="dataResourceTypeId" operator="equals" value="SHORT_TEXT"/>
<condition field-name="textData" operator="is-not-empty"/>
<set field-name="dataResourceTypeId" value="SHORT_TEXT"/>
<action service="createDataResource" mode="sync" result-to-context="true"/>
</eca>
<!-- This one is a bit weird, why choosing SHORT_TEXT ?-->
<eca service="createDataText" event="invoke">
<condition field-name="dataResourceTypeId" operator="is-empty"/>
<condition field-name="textData" operator="is-empty"/>
<set field-name="dataResourceTypeId" value="SHORT_TEXT"/>
<action service="createDataResource" mode="sync" result-to-context="true"/>
</eca>
<eca service="createDataText" event="invoke">
<condition field-name="dataResourceTypeId" operator="not-equals" value="ELECTRONIC_TEXT"/>
<condition field-name="dataResourceTypeId" operator="is-not-empty"/>
<condition field-name="textData" operator="is-empty"/>
<action service="createDataResource" mode="sync" result-to-context="true"/>
</eca>
<eca service="updateDataText" event="invoke">
<condition field-name="dataResourceTypeId" operator="equals" value="ELECTRONIC_TEXT"/>
<action service="updateDataResource" mode="sync" result-to-context="true"/>
<action service="updateElectronicText" mode="sync" result-to-context="true"/>
</eca>
<eca service="updateDataText" event="invoke">
<condition field-name="dataResourceTypeId" operator="not-equals" value="ELECTRONIC_TEXT"/>
<action service="updateDataResource" mode="sync" result-to-context="true"/>
</eca>
<!-- electronic text; needs dataResourceId -->
<eca service="createElectronicText" event="invoke">
<condition field-name="dataResourceId" operator="is-empty"/>
<set field-name="dataResourceTypeId" value="ELECTRONIC_TEXT"/>
<action service="createDataResource" mode="sync" result-to-context="true"/>
</eca>
<!-- create content ecas -->
<eca service="createContent" event="commit">
<condition field-name="partyId" operator="is-not-empty"/>
<condition field-name="roleTypeId" operator="is-not-empty"/>
<action service="createContentRole" mode="sync" run-as-user="system"/>
</eca>
<eca service="createContent" event="commit">
<condition field-name="partyId" operator="is-not-empty"/>
<condition field-name="roleTypeId" operator="is-empty"/>
<set field-name="roleTypeId" value="OWNER"/>
<action service="createContentRole" mode="sync" run-as-user="system"/>
</eca>
<eca service="createContent" event="commit">
<condition field-name="partyId" operator="is-empty"/>
<condition field-name="roleTypeId" operator="is-empty"/>
<condition field-name="userLogin" operator="is-not-empty"/>
<set field-name="partyId" env-name="${userLogin.partyId}"/>
<set field-name="roleTypeId" value="OWNER"/>
<action service="createContentRole" mode="sync" run-as-user="system"/>
</eca>
<eca service="createContent" event="commit">
<condition field-name="contentAssocTypeId" operator="is-not-empty"/>
<condition field-name="contentIdTo" operator="is-not-empty"/>
<action service="createContentAssoc" mode="sync" run-as-user="system" result-to-result="true" />
</eca>
<eca service="createContent" event="commit">
<condition field-name="contentAssocTypeId" operator="is-not-empty"/>
<condition field-name="contentIdFrom" operator="is-not-empty"/>
<action service="createContentAssoc" mode="sync" run-as-user="system" result-to-result="true" />
</eca>
<eca service="createContent" event="commit">
<condition field-name="contentPurposeTypeId" operator="is-not-empty"/>
<action service="createContentPurpose" mode="sync" run-as-user="system"/>
</eca>
<!-- content role ecas -->
<eca service="createContentRole" event="invoke">
<action service="ensurePartyRole" mode="sync" run-as-user="system"/>
</eca>
<!-- update content ecas -->
<eca service="updateContent" event="commit">
<condition field-name="contentAssocTypeId" operator="is-not-empty"/>
<condition field-name="contentIdTo" operator="is-not-empty"/>
<condition field-name="fromDate" operator="is-not-empty"/>
<action service="updateContentAssoc" mode="sync" run-as-user="system"/>
</eca>
<eca service="updateContent" event="commit">
<condition field-name="contentAssocTypeId" operator="is-not-empty"/>
<condition field-name="contentIdFrom" operator="is-not-empty"/>
<condition field-name="fromDate" operator="is-not-empty"/>
<action service="updateContentAssoc" mode="sync" run-as-user="system"/>
</eca>
<eca service="updateContent" event="commit">
<condition field-name="contentPurposeTypeId" operator="is-not-empty"/>
<action service="updateSingleContentPurpose" mode="sync" run-as-user="system"/>
</eca>
<!-- content assoc services -->
<eca service="createContentAssoc" event="in-validate">
<action service="checkContentAssocIds" mode="sync"/>
</eca>
<eca service="updateContentAssoc" event="in-validate">
<action service="checkContentAssocIds" mode="sync"/>
</eca>
<!--
<eca service="createContent" event="commit">
<condition field-name="contentId" operator="is-not-empty"/>
<action service="createContentAlternativeUrl" mode="sync" run-as-user="system"/>
</eca>
-->
</service-eca>