[OFBiz] SVN: r6910 - in trunk/applications/content: script/org/ofbiz/content/compdoc widget/compdoc
byersa@svn.ofbiz.org
byersa at svn.ofbiz.org
Fri Mar 3 12:47:29 CST 2006
Author: byersa
Date: 2006-03-03 12:47:25 -0600 (Fri, 03 Mar 2006)
New Revision: 6910
Modified:
trunk/applications/content/script/org/ofbiz/content/compdoc/CompDocServices.xml
trunk/applications/content/widget/compdoc/CompDocScreens.xml
Log:
Fix for bumping ContentApprovals. Does not count on every revision having
approvals attached.
Modified: trunk/applications/content/script/org/ofbiz/content/compdoc/CompDocServices.xml
===================================================================
--- trunk/applications/content/script/org/ofbiz/content/compdoc/CompDocServices.xml 2006-03-03 18:40:40 UTC (rev 6909)
+++ trunk/applications/content/script/org/ofbiz/content/compdoc/CompDocServices.xml 2006-03-03 18:47:25 UTC (rev 6910)
@@ -583,39 +583,38 @@
</entity-one>
<set from-field="parameters.contentId" field="thisContentId" />
<set from-field="parameters.contentRevisionSeqId" field="thisContentRevisionSeqId" />
- <log level="info" message="cloneContentApprovals(0)- previousContentRevisionSeqId : ${previousContentRevisionSeqId} "/>
- <entity-condition entity-name="ContentRevision" list-name="contentRevisionList" use-cache="true">
- <condition-list>
- <condition-expr field-name="contentId" env-name="parameters.contentId" operator="equals"/>
- <condition-expr field-name="contentRevisionSeqId" env-name="thisContentRevisionSeqId" operator="less"/>
- </condition-list>
- <order-by field-name="-contentRevisionSeqId"/>
- </entity-condition>
- <set from-field="contentRevisionList[0].contentRevisionSeqId" field="previousContentRevisionSeqId" />
- <log level="info" message="cloneContentApprovals(1)- previousContentRevisionSeqId : ${previousContentRevisionSeqId} "/>
-
- <!--
- <calculate field-name="previousContentRevisionSeqId" type="Long">
- <calcop operator="add">
- <calcop operator="get" field-name="parameters.contentRevisionSeqId" />
- <number value="-1"/>
- </calcop>
- </calculate>
- <calculate field-name="numericPadding" type="Integer">
- <number value="6"/>
- </calculate>
- <call-class-method method-name="padNumberWithLeadingZeros" class-name="org.ofbiz.content.compdoc.CompDocEvents"
- ret-field-name="previousContentRevisionSeqId">
- <field field-name="previousContentRevisionSeqId" type="Long"/>
- <field field-name="numericPadding" type="Integer" />
- </call-class-method>
- -->
+ <log level="info" message="cloneContentApprovals(0)- thisContentRevisionSeqId : ${thisContentRevisionSeqId} "/>
+ <log level="info" message="cloneContentApprovals(0b)- parameters : ${parameters} "/>
+ <now-timestamp-to-env env-name="nowTimestamp"/>"
<!-- get previous list of ContentApproval -->
- <entity-and entity-name="ContentApproval" list-name="contentApprovalList">
- <field-map field-name="contentId" env-name="thisContentId"/>
- <field-map field-name="contentRevisionSeqId" env-name="previousContentRevisionSeqId"/>
- </entity-and>
+ <entity-condition entity-name="MaxContentApprovalView" list-name="maxContentApprovalList">
+ <condition-list combine="and">
+ <condition-expr field-name="contentId" operator="equals" env-name="thisContentId" />
+ <condition-expr field-name="contentRevisionSeqId" operator="less" env-name="thisContentRevisionSeqId" ignore-if-null="true"/>
+ </condition-list>
+ <select-field field-name="maxContentRevisionSeqId"/>
+ <select-field field-name="contentId"/>
+ <select-field field-name="partyId"/>
+ <select-field field-name="roleTypeId"/>
+
+ <order-by field-name="-maxContentRevisionSeqId"/>
+ </entity-condition>
+ <log level="info" message="cloneContentApprovals(2a)- maxContentApprovalList : ${maxContentApprovalList} "/>
+ <iterate list-name="maxContentApprovalList" entry-name="maxContentApproval">
+ <!-- look for this entity in newly created entities -->
+ <entity-condition entity-name="ContentApproval" list-name="newContentApprovalList">
+ <condition-list combine="and">
+ <condition-expr field-name="contentId" operator="equals" env-name="maxContentApproval.contentId"/>
+ <condition-expr field-name="contentRevisionSeqId" operator="equals" env-name="maxContentApproval.maxContentRevisionSeqId"/>
+ <condition-expr field-name="partyId" operator="equals" env-name="maxContentApproval.partyId" ignore-if-empty="true"/>
+ <condition-expr field-name="roleTypeId" operator="equals" env-name="maxContentApproval.roleTypeId" ignore-if-empty="true"/>
+ </condition-list>
+ </entity-condition>
+ <set field="contentApprovalList[]" from-field="newContentApprovalList[0]"/>
+ </iterate>
+
+ <log level="info" message="cloneContentApprovals(2b)- contentApprovalList : ${contentApprovalList} "/>
<!-- determine status of previous approvals -->
<!-- primaryApprovalStatusId is the applicable status from previous approvals -->
@@ -662,7 +661,6 @@
</if>
</iterate>
<log level="info" message="cloneContentApprovals(2)- primaryApprovalStatusId : ${primaryApprovalStatusId} "/>
- <log level="info" message="cloneContentApprovals(2)- contentApprovalList : ${contentApprovalList} "/>
<!-- conditionally set the contentApprovalId status of each entity -->
<iterate list-name="contentApprovalList" entry-name="existingContentApproval">
@@ -734,6 +732,7 @@
<!-- if an instance track, check to see if there any new or deleted records on the template -->
<if-compare field-name="content.contentTypeId" operator="equals" value="COMPDOC_INSTANCE">
<set from-field="content.instanceOfContentId" field="rootTemplateContentId" />
+ <log level="info" message="rootTemplateContentId 0aa: ${rootTemplateContentId}"/>
<entity-condition entity-name="ContentRevision" list-name="templateContentRevisionList" use-cache="true">
<condition-list>
<condition-expr field-name="contentId" env-name="rootTemplateContentId" operator="equals"/>
@@ -741,18 +740,20 @@
<order-by field-name="-contentRevisionSeqId"/>
</entity-condition>
<set from-field="templateContentRevisionList[0].contentRevisionSeqId" field="latestContentRevisionSeqId" />
+ <log level="info" message="latestContentRevisionSeqId 0aa: ${latestContentRevisionSeqId}"/>
<entity-and entity-name="ContentApproval" list-name="templateContentApprovalList">
<field-map field-name="contentId" env-name="rootTemplateContentId"/>
<field-map field-name="contentRevisionSeqId" env-name="latestContentRevisionSeqId"/>
</entity-and>
+ <log level="info" message="templateContentApprovalList 0aa: ${templateContentApprovalList}"/>
<iterate list-name="templateContentApprovalList" entry-name="templateContentApproval">
<!-- look for this entity in newly created entities -->
<entity-condition entity-name="ContentApproval" list-name="newContentApprovalList">
<condition-list combine="and">
<condition-expr field-name="contentId" operator="equals" env-name="thisContentId"/>
<condition-expr field-name="contentRevisionSeqId" operator="equals" env-name="thisContentRevisionSeqId"/>
- <condition-expr field-name="partyId" operator="equals" env-name="templateContentApproval.partyId" ignore-if-empty="false"/>
- <condition-expr field-name="roleTypeId" operator="equals" env-name="templateContentApproval.roleTypeId" ignore-if-empty="false"/>
+ <condition-expr field-name="partyId" operator="equals" env-name="templateContentApproval.partyId" ignore-if-empty="true"/>
+ <condition-expr field-name="roleTypeId" operator="equals" env-name="templateContentApproval.roleTypeId" ignore-if-empty="true"/>
</condition-list>
</entity-condition>
<if-empty field-name="newContentApprovalList">
Modified: trunk/applications/content/widget/compdoc/CompDocScreens.xml
===================================================================
--- trunk/applications/content/widget/compdoc/CompDocScreens.xml 2006-03-03 18:40:40 UTC (rev 6909)
+++ trunk/applications/content/widget/compdoc/CompDocScreens.xml 2006-03-03 18:47:25 UTC (rev 6910)
@@ -895,7 +895,7 @@
<decorator-section name="body">
<container>
<link target="ViewInstances?rootContentId=${rootContentId}&contentRevisionSeqId=${rootContentRevisionSeqId}" text="View Instances" style="buttontext"/>
- <link target="AddRootCompDocInstance?contentId=${rootContentId}&contentRevisionSeqId=${rootContentRevisionSeqId}" text="Create Instance of This Template" style="buttontext"/>
+ <link target="AddRootCompDocInstance?rootContentId=${rootContentId}&rootContentRevisionSeqId=${rootContentRevisionSeqId}" text="Create Instance of This Template" style="buttontext"/>
</container>
<include-tree name="CompDocTemplateTree" location="component://content/widget/compdoc/CompDocTemplateTree.xml"/>
</decorator-section>
More information about the Svn
mailing list