Files
ofbiz-framework/applications/content/widget/website/WebSiteForms.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

320 lines
18 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.
-->
<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
<!-- WebSite Forms -->
<form name="EditWebSite" type="single" target="updateWebSite" title="" default-map-name="webSite"
header-row-style="header-row" default-table-style="basic-table">
<alt-target use-when="webSite==null" target="createWebSite"/>
<auto-fields-service service-name="updateWebSite" map-name=""/>
<field use-when="webSite!=null" name="webSiteId"><display/></field>
<field use-when="webSite==null&amp;&amp;webSiteId!=null" name="webSiteId" tooltip="${uiLabelMap.CommonCannotBeFound}: [${webSiteId}]"><text size="20" maxlength="20"/></field>
<!-- this to be taken care of with auto-fields-service as soon as it uses entity field info too -->
<field use-when="webSite==null&amp;&amp;webSiteId==null" name="webSiteId"><text size="20" maxlength="20"/></field>
<field name="siteName"><text size="30" maxlength="60"/></field>
<field name="enableHttps">
<drop-down allow-empty="true"><option key="Y" description="${uiLabelMap.CommonY}"/><option key="N" description="${uiLabelMap.CommonN}"/></drop-down>
</field>
<field name="productStoreId">
<drop-down allow-empty="true">
<entity-options entity-name="ProductStore" description="${storeName}">
<entity-order-by field-name="storeName"/>
</entity-options>
<sub-hyperlink use-when="&quot;${webSite.productStoreId}&quot;.length()>0" link-style="buttontext" target-type="inter-app" target="/catalog/control/EditProductStore" description="${uiLabelMap.ContentEditProductStore}">
<parameter param-name="productStoreId" from-field="webSite.productStoreId"/>
</sub-hyperlink>
</drop-down>
</field>
<field name="visualThemeSetId">
<drop-down allow-empty="true">
<entity-options entity-name="VisualThemeSet">
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit button-type="button"/></field>
</form>
<form name="ListWebSites" target="" title="" type="list" list-name="webSites" paginate-target="FindWebSite" paginate="true"
odd-row-style="alternate-row" default-table-style="basic-table hover-bar" header-row-style="header-row-2">
<actions>
<set field="parameters.sortField" from-field="parameters.sortField" default-value="-webSiteId"/>
<entity-condition entity-name="WebSite" list="webSites">
<order-by field-name="${parameters.sortField}"/>
</entity-condition>
</actions>
<field name="webSiteId" title="${uiLabelMap.CommonId}" widget-style="buttontext" sort-field="true">
<hyperlink description="${webSiteId}" target="EditWebSite" also-hidden="false">
<parameter param-name="webSiteId"/>
</hyperlink>
</field>
<field name="siteName" title="${uiLabelMap.CommonName}" sort-field="true"><display/></field>
<field name="httpHost" sort-field="true"><display/></field>
</form>
<form name="FindWebSitePathAlias" target="WebSiteAliases" type="single" header-row-style="header-row" default-table-style="basic-table">
<field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
<field name="webSiteId"><hidden value="${webSiteId}"/></field>
<field name="pathAlias"><text-find ignore-case="true"/></field>
<field name="searchButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
<form name="ListWebSitePathAlias" target="" title="" list-name="listIt" type="list" paginate-target="WebSiteAliases"
odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
<actions>
<service service-name="performFind" result-map="result" result-map-list="listIt">
<field-map field-name="inputFields" from-field="parameters"/>
<field-map field-name="entityName" value="WebSitePathAlias"/>
<field-map field-name="orderBy" from-field="parameters.sortField"/>
<field-map field-name="viewIndex" from-field="viewIndex"/>
<field-map field-name="viewSize" from-field="viewSize"/>
</service>
</actions>
<field name="pathAlias" sort-field="true" widget-style="buttontext">
<hyperlink target="EditWebSitePathAlias?webSiteId=${webSiteId}&amp;pathAlias=${pathAlias}" description="${pathAlias}"></hyperlink>
</field>
<field name="aliasTo" sort-field="true"><display/></field>
<field name="contentId" sort-field="true">
<display-entity entity-name="Content" description="${contentName}">
<sub-hyperlink target="EditContent" description=" [${contentId}]">
<parameter param-name="contentId"/>
</sub-hyperlink>
</display-entity>
</field>
<field name="mapKey" sort-field="true"><display/></field>
<field name="fromDate" sort-field="true"><display/></field>
<field name="thruDate" sort-field="true"><display/></field>
<field name="deleteLink" title=" " widget-style="buttontext">
<hyperlink target="removeWebSitePathAlias" description="${uiLabelMap.CommonDelete}" also-hidden="false">
<parameter param-name="webSiteId"/>
<parameter param-name="pathAlias"/>
</hyperlink>
</field>
<on-event-update-area event-type="paginate" area-id="search-results" area-target="WebSiteAliasesSearchResults"/>
</form>
<form name="EditWebSitePathAlias" type="single" target="updateWebSitePathAlias" title="" default-map-name="webSitePathAlias"
header-row-style="header-row" default-table-style="basic-table" default-entity-name="WebSitePathAlias">
<alt-target use-when="webSitePathAlias==null" target="createWebSitePathAlias"/>
<auto-fields-service service-name="updateWebSitePathAlias" map-name=""/>
<field name="webSiteId"><display/></field>
<field name="pathAlias" use-when="webSitePathAlias!=null"><display/></field>
<field name="pathAlias" use-when="webSitePathAlias==null"><text/></field>
<field name="submitButton" use-when="webSitePathAlias!=null" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
<field name="submitButton" use-when="webSitePathAlias==null" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
<!-- WebSite Content Forms -->
<form name="ListWebSiteContent" type="list" list-name="webSiteContent" target="UpdateWebSiteContent"
paginate-target="ListWebSiteContent" paginate="true" odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
<auto-fields-service service-name="updateWebSiteRole"/>
<field name="sequenceNum"><hidden/></field>
<field name="roleTypeId"><hidden/></field>
<field name="partyId"><hidden/></field>
<field name="webSiteId"><display also-hidden="true"/></field>
<!--
<field name="contentId" title="Content ID" widget-style="linktext">
<hyperlink description="${contentId}" target="EditContent" also-hidden="true">
<parameter param-name="contentId"/>
</hyperlink>
</field>
-->
<field name="contentId">
<display-entity entity-name="Content" description="${contentName}" key-field-name="contentId">
<sub-hyperlink target="EditContent" description=" [${contentId}]" link-style="linktext">
<parameter param-name="contentId"/>
</sub-hyperlink>
</display-entity>
</field>
<field name="webSiteContentTypeId">
<display-entity entity-name="WebSiteContentType"/>
</field>
<field name="fromDate"><display/></field>
<field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
<field name="deleteLink" title=" " widget-style="buttontext">
<hyperlink target="RemoveWebSiteContent" description="${uiLabelMap.CommonDelete}" also-hidden="false">
<parameter param-name="webSiteId"/>
<parameter param-name="contentId"/>
<parameter param-name="webSiteContentTypeId"/>
<parameter param-name="fromDate"/>
</hyperlink>
</field>
<sort-order>
<sort-field name="webSiteId"/>
<sort-field name="contentId"/>
<sort-field name="webSiteContentTypeId"/>
<sort-field name="fromDate"/>
<sort-field name="thruDate"/>
<sort-field name="submitButton"/>
<sort-field name="deleteLink"/>
</sort-order>
</form>
<form name="CreateWebSiteContent" type="single" target="CreateWebSiteContent" title=""
header-row-style="header-row" default-table-style="basic-table">
<auto-fields-service service-name="createWebSiteContent"/>
<field name="webSiteId" map-name="webSite"><display also-hidden="true"/></field>
<field name="contentId"><lookup target-form-name="LookupContent"/></field>
<field name="webSiteContentTypeId">
<drop-down allow-empty="false">
<entity-options entity-name="WebSiteContentType">
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
</form>
<!-- WebSite Role Forms -->
<form name="CreateWebSiteRole" type="single" target="createWebSiteRole" title=""
header-row-style="header-row" default-table-style="basic-table">
<auto-fields-service service-name="createWebSiteRole"/>
<field name="partyId"><lookup target-form-name="LookupPartyName"/></field>
<field name="webSiteId" map-name="webSite"><hidden/></field>
<field name="roleTypeId">
<drop-down no-current-selected-key="_NA_">
<entity-options entity-name="RoleType">
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
</form>
<form name="UpdateWebSiteRole" type="list" target="updateWebSiteRole" title="" list-name="webSiteRoleDatas"
odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
<auto-fields-service service-name="updateWebSiteRole" map-name="webSiteRole"/>
<field name="webSiteId"><hidden/></field>
<!-- three possibilities for the Party: person, partyGroup, neither... just print everything and if it's empty, no biggie -->
<field name="partyId" widget-style="buttontext">
<hyperlink target-type="inter-app" target="/partymgr/control/viewprofile" description="${person.personalTitle} ${person.firstName} ${person.middleName} ${person.lastName} ${person.suffix} ${partyGroup.groupName} [${webSiteRole.partyId}]">
<parameter param-name="partyId" from-field="webSiteRole.partyId"/>
</hyperlink>
</field>
<field name="roleTypeId">
<display description="${roleType.description}"/>
</field>
<field name="fromDate"><display/></field>
<field name="thruDate"></field>
<field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
<field name="deleteLink" title=" " widget-style="buttontext">
<hyperlink target="removeWebSiteRole" description="${uiLabelMap.CommonDelete}" also-hidden="false">
<parameter param-name="webSiteId" from-field="webSiteRole.webSiteId"/>
<parameter param-name="partyId" from-field="webSiteRole.partyId"/>
<parameter param-name="roleTypeId" from-field="webSiteRole.roleTypeId"/>
<parameter param-name="fromDate" from-field="webSiteRole.fromDate"/>
</hyperlink>
</field>
</form>
<form name="AutoCreateWebsiteContent" type="single" target="autoCreateWebSiteContent" title=""
header-row-style="header-row" default-table-style="basic-table">
<field name="webSiteId"><hidden/></field>
<field name="webSiteContentTypeId">
<check all-checked="false">
<entity-options entity-name="WebSiteContentType">
<entity-order-by field-name="description"/>
</entity-options>
</check>
</field>
<field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
</form>
<!-- WebSite SEO Form -->
<form name="CreateWebsiteSEO" type="single" target="generateMissingSeoUrlForWebsite" title=""
header-row-style="header-row" default-table-style="basic-table">
<field name="webSiteId"><hidden/></field>
<field name="prodCatalogId" title="${uiLabelMap.Catalog}">
<drop-down>
<option key="all" description="All"/>
<entity-options description="${prodCatalogId}" entity-name="ProductStoreCatalog">
<entity-constraint name="productStoreId" value="${webSite.productStoreId}"/>
</entity-options>
</drop-down>
</field>
<field name="typeGenerate" title="Generate Type">
<check all-checked="false">
<option key="category" description="Category"/>
<option key="product" description="Product"/>
<option key="content" description="Content"/>
</check>
</field>
<field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit button-type="button"/></field>
</form>
<form name="CreateWebSiteContactList" type="single" target="createWebSiteContactList"
default-map-name="webSite" title="" header-row-style="header-row" default-table-style="basic-table">
<actions>
<set field="fromDate" value="${groovy: import org.ofbiz.base.util.UtilDateTime; return UtilDateTime.nowTimestamp();}" type="Timestamp"/>
</actions>
<field name="webSiteId"><display/></field>
<field name="siteName"><display/></field>
<field name="fromDate"><hidden value="${fromDate}"/></field>
<field name="contactListId">
<drop-down allow-empty="true">
<entity-options description="${contactListName} [${contactListId}]" entity-name="ContactList" key-field-name="contactListId"></entity-options>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonCreate}"><submit/></field>
</form>
<form name="ViewWebSiteContactList" type="list" target="updateWebSiteContactList" list-name="webSiteContactLists" title=""
header-row-style="header-row" default-table-style="basic-table">
<actions>
<entity-one entity-name="ContactList" value-field="contactList">
<field-map field-name="contactListId" from-field="contactListId"/>
</entity-one>
</actions>
<row-actions>
<entity-one entity-name="ContactList" value-field="contactList">
<field-map field-name="contactListId" from-field="contactListId"/>
</entity-one>
<set field="contactListName" from-field="contactList.contactListName"/>
<set field="description" from-field="contactList.description"/>
</row-actions>
<field name="contactListId"><hidden/></field>
<field name="webSiteId"><hidden/></field>
<field name="contactListName">
<display-entity entity-name="ContactList" description="${contactListName}" key-field-name="contactListId">
<sub-hyperlink target="/marketing/control/EditContactList" target-type="inter-app" link-style="linktext" description="[${contactListId}]">
<parameter param-name="contactListId"/>
</sub-hyperlink>
</display-entity>
</field>
<field name="fromDate"><display type="date-time"/></field>
<field name="thruDate"><date-time/></field>
<field name="updateButton" title="${uiLabelMap.CommonUpdate}"><submit/></field>
<field name="deleteButton" title="${uiLabelMap.CommonDelete}" widget-style="buttontext">
<hyperlink target="deleteWebSiteContactList" description="${uiLabelMap.CommonDelete}">
<parameter param-name="webSiteId"/>
<parameter param-name="contactListId"/>
<parameter param-name="fromDate"/>
</hyperlink>
</field>
</form>
</forms>