[OFBiz] SVN: r6665 - in trunk/applications/content: script/org/ofbiz/content/compdoc servicedef src/org/ofbiz/content webapp/content/WEB-INF widget/compdoc
byersa@svn.ofbiz.org
byersa at svn.ofbiz.org
Thu Feb 2 15:31:27 CST 2006
Author: byersa
Date: 2006-02-02 15:31:16 -0600 (Thu, 02 Feb 2006)
New Revision: 6665
Modified:
trunk/applications/content/script/org/ofbiz/content/compdoc/CompDocServices.xml
trunk/applications/content/servicedef/services.xml
trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java
trunk/applications/content/webapp/content/WEB-INF/controller.xml
trunk/applications/content/widget/compdoc/CompDocForms.xml
trunk/applications/content/widget/compdoc/CompDocMenus.xml
trunk/applications/content/widget/compdoc/CompDocScreens.xml
trunk/applications/content/widget/compdoc/CompDocTemplateTree.xml
Log:
Interim commit. Improves the building of CompDoc templates and parts.
Modified: trunk/applications/content/script/org/ofbiz/content/compdoc/CompDocServices.xml
===================================================================
--- trunk/applications/content/script/org/ofbiz/content/compdoc/CompDocServices.xml 2006-02-02 18:49:59 UTC (rev 6664)
+++ trunk/applications/content/script/org/ofbiz/content/compdoc/CompDocServices.xml 2006-02-02 21:31:16 UTC (rev 6665)
@@ -124,7 +124,7 @@
</simple-method>
- <simple-method method-name="persistRootCompDoc" short-description="Create CompDoc">
+ <simple-method method-name="persistCompDoc" short-description="Create CompDoc">
<if-not-empty field-name="parameters.contentId">
<entity-one entity-name="Content" value-name="content"/>
@@ -139,6 +139,7 @@
<!-- create the compdoc Content entity -->
<set-service-fields service-name="persistContentAndAssoc" map-name="parameters" to-map-name="persistMap"/>
<set from-field="parameters.userLogin" field="persistMap.userLogin"/>
+ <log level="info" message="persistMap : ${persistMap}"/>
<call-service service-name="persistContentAndAssoc" in-map-name="persistMap">
<results-to-map map-name="pResults"/>
</call-service>
@@ -148,9 +149,33 @@
</iterate-map>
<log level="info" message="pResults : ${pResults}"/>
+ <if>
+ <condition>
+ <or>
+ <if-compare field-name="persistMap.contentTypeId" operator="equals" value="COMPDOC_TEMPLATE"/>
+ <if-compare field-name="persistMap.contentTypeId" operator="equals" value="TEMPLATE"/>
+ </or>
+ </condition>
+ <then>
+ <!-- if no rootTemplateContentId exists, this must be a root op, so set contentId = itemContentId -->
+ <set from-field="parameters.rootTemplateContentId" default-value="${pResults.contentId}" field="revisionMap.contentId"/>
+ </then>
+ </if>
+ <if>
+ <condition>
+ <or>
+ <if-compare field-name="persistMap.contentTypeId" operator="equals" value="COMPDOC_INSTANCE"/>
+ <if-compare field-name="persistMap.contentTypeId" operator="equals" value="DOCUMENT"/>
+ </or>
+ </condition>
+ <then>
+ <!-- if no rootTemplateContentId exists, this must be a root op, so set contentId = itemContentId -->
+ <set from-field="parameters.rootInstanceContentId" default-value="${pResults.contentId}" field="revisionMap.contentId"/>
+ </then>
+ </if>
<set from-field="pResults.contentId" field="revisionMap.itemContentId"/>
- <set from-field="pResults.contentId" field="revisionMap.contentId"/>
<set from-field="parameters.userLogin" field="revisionMap.userLogin"/>
+ <log level="info" message="revisionMap : ${revisionMap}"/>
<call-service service-name="persistContentRevisionAndItem" in-map-name="revisionMap">
<result-to-result result-name="contentRevisionSeqId"/>
</call-service>
Modified: trunk/applications/content/servicedef/services.xml
===================================================================
--- trunk/applications/content/servicedef/services.xml 2006-02-02 18:49:59 UTC (rev 6664)
+++ trunk/applications/content/servicedef/services.xml 2006-02-02 21:31:16 UTC (rev 6665)
@@ -1373,6 +1373,7 @@
<exclude field-name="contentId"/>
<exclude field-name="fromDate"/>
<exclude field-name="contentAssocTypeId"/>
+ <exclude field-name="sequenceNum"/>
</auto-attributes>
<auto-attributes entity-name="ContentAssocDataResourceViewFrom" include="all" mode="IN" optional="true">
</auto-attributes>
@@ -1382,11 +1383,13 @@
<attribute mode="INOUT" entity-name="ContentAssoc" name="contentIdFrom" optional="true" type="String"/>
<attribute mode="INOUT" entity-name="ContentAssoc" name="contentAssocTypeId" optional="true" type="String"/>
<attribute mode="INOUT" entity-name="ContentAssoc" name="fromDate" optional="true" type="Timestamp"/>
+ <attribute mode="INOUT" entity-name="ContentAssoc" name="sequenceNum" optional="true" type="Long"/>
<attribute mode="INOUT" entity-name="DataResource" name="drDataResourceId" optional="true" type="String"/>
<attribute mode="INOUT" name="caContentIdTo" optional="true" type="String"/>
<attribute mode="INOUT" name="caContentAssocTypeId" optional="true" type="String"/>
<attribute mode="INOUT" name="caFromDate" optional="true" type="Timestamp"/>
+ <attribute mode="INOUT" name="caSequenceNum" optional="true" type="Long"/>
<attribute mode="IN" name="rootDir" optional="true" type="String"/>
<attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
<attribute mode="IN" name="contentPurposeList" optional="true" type="List"/>
@@ -1898,12 +1901,14 @@
<attribute name="rootInstanceContentId" type="String" mode="INOUT" optional="false"/>
</service>
- <service name="persistRootCompDoc" engine="simple"
+ <service name="persistCompDoc" engine="simple"
location="org/ofbiz/content/compdoc/CompDocServices.xml"
- invoke="persistRootCompDoc" auth="true">
+ invoke="persistCompDoc" auth="true">
<description>Create a CompDoc Template entity and associated ContentRevision/Item entities</description>
<implements service="persistContentAndAssoc"/>
<attribute name="contentRevisionSeqId" type="String" mode="OUT" optional="false"/>
+ <attribute name="rootTemplateContentId" type="String" mode="INOUT" optional="true"/>
+ <attribute name="rootInstanceContentId" type="String" mode="INOUT" optional="true"/>
</service>
</services>
Modified: trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java
===================================================================
--- trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java 2006-02-02 18:49:59 UTC (rev 6664)
+++ trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java 2006-02-02 21:31:16 UTC (rev 6665)
@@ -429,10 +429,12 @@
//result.put("contentId", thisResult.get("contentIdFrom"));
result.put("contentAssocTypeId", thisResult.get("contentAssocTypeId"));
result.put("fromDate", thisResult.get("fromDate"));
+ result.put("sequenceNum", thisResult.get("sequenceNum"));
result.put("caContentIdTo", thisResult.get("contentIdTo"));
result.put("caContentAssocTypeId", thisResult.get("contentAssocTypeId"));
result.put("caFromDate", thisResult.get("fromDate"));
+ result.put("caSequenceNum", thisResult.get("sequenceNum"));
} else {
if ("true".equalsIgnoreCase(deactivateExisting)) {
Map deactivateContext = UtilMisc.toMap("contentId", contentId, "contentAssocTypeId", contentAssocTypeId );
Modified: trunk/applications/content/webapp/content/WEB-INF/controller.xml
===================================================================
--- trunk/applications/content/webapp/content/WEB-INF/controller.xml 2006-02-02 18:49:59 UTC (rev 6664)
+++ trunk/applications/content/webapp/content/WEB-INF/controller.xml 2006-02-02 21:31:16 UTC (rev 6665)
@@ -1034,16 +1034,22 @@
</request-map>
<request-map uri="updateRootCompDocTemplate">
<security auth="true" https="true"/>
- <event invoke="persistRootCompDoc" path="" type="service"/>
+ <event invoke="persistCompDoc" path="" type="service"/>
<response name="success" type="view" value="EditRootCompDocTemplate"/>
<response name="error" type="view" value="EditRootCompDocTemplate"/>
</request-map>
<request-map uri="createRootCompDocTemplate">
<security auth="true" https="true"/>
- <event invoke="persistRootCompDoc" path="" type="service"/>
+ <event invoke="persistCompDoc" path="" type="service"/>
<response name="success" type="view" value="EditRootCompDocTemplate"/>
<response name="error" type="view" value="AddRootCompDocTemplate"/>
</request-map>
+ <request-map uri="createChildCompDocTemplate">
+ <security auth="true" https="true"/>
+ <event invoke="persistCompDoc" path="" type="service"/>
+ <response name="success" type="view" value="EditChildCompDocTemplate"/>
+ <response name="error" type="view" value="AddChildCompDocTemplate"/>
+ </request-map>
<request-map uri="genCompDocInstance">
<security auth="true" https="true"/>
<event invoke="genCompDocInstance" path="" type="service"/>
Modified: trunk/applications/content/widget/compdoc/CompDocForms.xml
===================================================================
--- trunk/applications/content/widget/compdoc/CompDocForms.xml 2006-02-02 18:49:59 UTC (rev 6664)
+++ trunk/applications/content/widget/compdoc/CompDocForms.xml 2006-02-02 21:31:16 UTC (rev 6665)
@@ -368,21 +368,28 @@
<field name="contentId"><text/></field>
<field name="contentName"><text/></field>
- <field name="contentTypeId" ><hidden value="TEMPLATE"/></field>
+ <field name="contentTypeId" ><display description="Template"/></field>
<field name="contentIdTo" ><display/></field>
- <field name="contentAssocTypeId" ><display/></field>
+ <field name="contentAssocTypeId" ><display /></field>
<field name="fromDate" ><display/></field>
<field name="thruDate" ><date-time/></field>
<field name="sequenceNum" ><text/></field>
+ <field name="rootTemplateContentId"><hidden /></field>
<field name="submitButton" title="Submit" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
- <form name="EditChildCompDocTemplate" default-map-name="" title="" type="single" target="updateChildCompDocTemplate"
+ <form name="EditChildCompDocTemplate" default-map-name="contentAssocView" title="" type="single" target="updateChildCompDocTemplate"
default-title-style="tableheadtext" default-tooltip-style="tabletext" default-widget-style="inputBox">
<field name="contentId"><text/></field>
<field name="contentName"><text/></field>
<field name="contentTypeId" ><hidden value="TEMPLATE"/></field>
+ <field name="caContentIdTo" title="ContentId To" ><display/></field>
+ <field name="caContentAssocTypeId" title="Content Assoc Type Id" ><display /></field>
+ <field name="caFromDate" title="From Date" ><display/></field>
+ <field name="caThruDate" title="Thru Date" ><date-time/></field>
+ <field name="caSequenceNum" title="Sequence Num" ><text/></field>
+ <field name="rootTemplateContentId"><hidden /></field>
<field name="submitButton" title="Submit" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
Modified: trunk/applications/content/widget/compdoc/CompDocMenus.xml
===================================================================
--- trunk/applications/content/widget/compdoc/CompDocMenus.xml 2006-02-02 18:49:59 UTC (rev 6664)
+++ trunk/applications/content/widget/compdoc/CompDocMenus.xml 2006-02-02 21:31:16 UTC (rev 6665)
@@ -148,16 +148,44 @@
<link target="EditRootCompDoc?contentId=${contentId}&contentRevisionSeqId=${contentRevisionSeqId}"/>
</menu-item>
<menu-item name="edit-link" title="Edit" >
- <link target="EditRootCompDoc?contentId=${contentId}&caContentIdTo=${contentIdTo}&caContentAssocTypeId=${contentAssocTypeId}&caSequenceNum=${seqNumBefore}&caFromDate=${fromDate}"/>
+ <link target="EditRootCompDoc?contentId=${contentId}&contentRevisionSeqId=${contentRevisionSeqId}"/>
</menu-item>
<menu-item name="child" title="+Child" >
- <link target="AddChildCompDocTemplate?caContentIdTo=${contentId}&caSequenceNum=9999&currentContentTypeId=COMPDOC_TEMPLATE"/>
+ <link target="AddChildCompDocTemplate?contentIdTo=${contentId}&sequenceNum=9999&rootTemplateContentId=${rootTemplateContentId}"/>
</menu-item>
<menu-item name="addinst" title="Add Instance" >
<link target="AddCompDocInstance?instanceOfContentId=${contentId}"/>
</menu-item>
</menu>
+ <menu name="childTemplateLine" default-title-style="tabButton"
+ default-selected-style="tabButtonSelected"
+ default-menu-item-name="content"
+ orientation="horizontal"
+ menu-width="100%"
+ default-tooltip-style="tabletext" default-widget-style="tabButton"
+ selected-menuitem-context-field-name="currentMenuItemName"
+ title="" type="simple">
+ <menu-item name="edit-inplace" title="${contentName}[${contentId}]" >
+ <link target="EditChildCompDoc?contentId=${contentId}&caContentIdTo=${contentIdTo}&caContentAssocTypeId=${contentAssocTypeId}&caSequenceNum=${seqNumBefore}&caFromDate=${fromDate}&contentRevisionSeqId=${contentRevisionSeqId}"/>
+ </menu-item>
+ <menu-item name="edit-link" title="Edit" >
+ <link target="EditChildCompDoc?contentId=${contentId}&caContentIdTo=${contentIdTo}&caContentAssocTypeId=${contentAssocTypeId}&caSequenceNum=${seqNumBefore}&caFromDate=${fromDate}&contentRevisionSeqId=${contentRevisionSeqId}"/>
+ </menu-item>
+ <menu-item name="child" title="+Child" >
+ <link target="AddChildCompDocTemplate?contentIdTo=${contentId}&sequenceNum=9999&rootTemplateContentId=${rootTemplateContentId}"/>
+ </menu-item>
+ <menu-item name="child" title="+Bef" >
+ <link target="AddChildCompDocTemplate?contentIdTo=${contentId}&sequenceNum=9999&rootTemplateContentId=${rootTemplateContentId}"/>
+ </menu-item>
+ <menu-item name="child" title="+Aft" >
+ <link target="AddChildCompDocTemplate?contentIdTo=${contentId}&sequenceNum=9999&rootTemplateContentId=${rootTemplateContentId}"/>
+ </menu-item>
+ <menu-item name="addinst" title="Add Instance" >
+ <link target="AddCompDocInstance?instanceOfContentId=${contentId}"/>
+ </menu-item>
+ </menu>
+
<menu name="rootInstanceLine" default-title-style="tabButton"
default-selected-style="tabButtonSelected"
default-menu-item-name="content"
Modified: trunk/applications/content/widget/compdoc/CompDocScreens.xml
===================================================================
--- trunk/applications/content/widget/compdoc/CompDocScreens.xml 2006-02-02 18:49:59 UTC (rev 6664)
+++ trunk/applications/content/widget/compdoc/CompDocScreens.xml 2006-02-02 21:31:16 UTC (rev 6665)
@@ -708,7 +708,12 @@
<actions>
<set field="menuName" value="treecdt"/>
<set field="title" value="Composite Document Instance Add Page"/>
- <set from-field="parameters.instanceOfContentId" field="rootTemplateContentId" />
+ <set from-field="parameters.contentId" field="contentIdTo" />
+ <set from-field="nowTimestamp" field="fromDate" />
+ <set value="COMPDOC_PART" field="contentAssocTypeId" />
+ <set value="9999" field="sequenceNum" />
+ <set value="TEMPLATE" field="contentTypeId" />
+ <set value="" field="rootInstanceContentId" />
</actions>
<widgets>
<decorator-screen name="commonCompDocDecorator" location="component://content/widget/CommonScreens.xml">
@@ -728,9 +733,19 @@
<actions>
<set field="menuName" value="treecdt"/>
<set field="title" value="Composite Document Template Edit Page"/>
- <set from-field="parameters.contentId" field="rootTemplateContentId" />
+ <set from-field="parameters.contentIdTo" field="rootTemplateContentId" />
<set value="" field="rootInstanceContentId" />
+ <!--
<entity-one entity-name="Content" value-name="content" use-cache="true"/>
+ -->
+ <entity-one entity-name="ContentAssocViewFrom" value-name="contentAssocView" use-cache="true">
+ <field-map field-name="contentId" env-name="parameters.contentId"/>
+ <field-map field-name="caContentId" env-name="parameters.contentId"/>
+ <field-map field-name="caContentIdTo" env-name="parameters.contentIdTo"/>
+ <field-map field-name="caContentAssocTypeId" env-name="parameters.caContentAssocTypeId"/>
+ <field-map field-name="caFromDate" env-name="parameters.caFromDate"/>
+ <field-map field-name="contentIdStart" env-name="parameters.contentIdTo"/>
+ </entity-one>
</actions>
<widgets>
<decorator-screen name="commonCompDocDecorator" location="component://content/widget/CommonScreens.xml">
@@ -807,7 +822,6 @@
<widgets>
<decorator-screen name="commonCompDocDecorator" location="component://content/widget/CommonScreens.xml">
<decorator-section name="body">
- <label text="rootTemplateContentId : ${rootTemplateContentId}"/>
<include-tree name="CompDocTemplateTree" location="component://content/widget/compdoc/CompDocTemplateTree.xml"/>
</decorator-section>
</decorator-screen>
@@ -880,6 +894,23 @@
</section>
</screen>
+
+ <screen name="rootTemplateLine">
+ <section>
+ <widgets>
+ <include-menu name="rootTemplateLine" location="component://content/widget/compdoc/CompDocMenus.xml"/>
+ </widgets>
+ </section>
+ </screen>
+
+ <screen name="rootInstanceLine">
+ <section>
+ <widgets>
+ <include-menu name="rootInstanceLine" location="component://content/widget/compdoc/CompDocMenus.xml"/>
+ </widgets>
+ </section>
+ </screen>
+
<screen name="responseTreeLine">
<section>
<actions>
@@ -890,12 +921,13 @@
</widgets>
</section>
</screen>
- <screen name="responseTemplateLine">
+ <screen name="childTemplateLine">
<section>
<actions>
<script location="component://content/webapp/content/WEB-INF/actions/content/prepseqno.bsh"/>
</actions>
<widgets>
+ <include-menu name="childTemplateLine" location="component://content/widget/compdoc/CompDocMenus.xml"/>
<container style="responseSelected">
<link text="${contentName}[${contentId}]" target="EditCompDocContent?contentId=${contentId}&contentRevisionSeqId=${contentRevisionSeqId}&rootTemplateContentId=${rootTemplateContentId}" style="responseheader" />
<link text="Edit" target="EditCompDocContent?contentId=${contentId}&contentRevisionSeqId=${contentRevisionSeqId}&rootTemplateContentId=${rootTemplateContentId}" style="tabButton" />
@@ -954,23 +986,6 @@
</widgets>
</section>
</screen>
-
- <screen name="rootTemplateLine">
- <section>
- <widgets>
- <include-menu name="rootTemplateLine" location="component://content/widget/compdoc/CompDocMenus.xml"/>
- </widgets>
- </section>
- </screen>
-
- <screen name="rootInstanceLine">
- <section>
- <widgets>
- <include-menu name="rootInstanceLine" location="component://content/widget/compdoc/CompDocMenus.xml"/>
- </widgets>
- </section>
- </screen>
-
<screen name="AddCompDocTemplate">
<section>
<condition>
Modified: trunk/applications/content/widget/compdoc/CompDocTemplateTree.xml
===================================================================
--- trunk/applications/content/widget/compdoc/CompDocTemplateTree.xml 2006-02-02 18:49:59 UTC (rev 6664)
+++ trunk/applications/content/widget/compdoc/CompDocTemplateTree.xml 2006-02-02 21:31:16 UTC (rev 6665)
@@ -36,7 +36,7 @@
<entity-one entity-name="Content" use-cache="false">
<field-map field-name="contentId" env-name="itemContentId"/>
</entity-one>
- <include-screen name="responseTreeLine"
+ <include-screen name="childTemplateLine"
location="component://content/widget/compdoc/CompDocScreens.xml" />
<sub-node node-name="node-body">
<entity-condition entity-name="AssocRevisionItemView" use-cache="false" >
@@ -96,7 +96,7 @@
<entity-one entity-name="Content" use-cache="false">
<field-map field-name="contentId" env-name="itemContentId"/>
</entity-one>
- <include-screen name="responseTreeLine"
+ <include-screen name="childInstanceLine"
location="component://content/widget/compdoc/CompDocScreens.xml" />
<sub-node node-name="node-body">
<entity-condition entity-name="AssocRevisionItemView" use-cache="false" >
More information about the Svn
mailing list