svn commit: r1305581 [5/36] - in /ofbiz/branches/20111205EmailHandling: ./ applications/accounting/config/ applications/accounting/data/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/finaccount/ applications/acc...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1305581 [5/36] - in /ofbiz/branches/20111205EmailHandling: ./ applications/accounting/config/ applications/accounting/data/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/finaccount/ applications/acc...

erwan
Modified: ofbiz/branches/20111205EmailHandling/applications/commonext/script/org/ofbiz/SystemInfoServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/commonext/script/org/ofbiz/SystemInfoServices.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/commonext/script/org/ofbiz/SystemInfoServices.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/commonext/script/org/ofbiz/SystemInfoServices.xml Mon Mar 26 20:56:02 2012
@@ -22,148 +22,13 @@ under the License.
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
 
     <simple-method method-name="createSystemInfoNote" short-description="Create a system to to a specific party">
-        <set field="partyId" from-field="parameters.partyId" default-value="userLogin.partyId"/>
-        <!-- new communication events -->
-        <if-compare field="parameters.entityName" value="CommunicationEvent" operator="equals">
-            <entity-one entity-name="CommunicationEvent" value-field="comm">
-                <field-map field-name="communicationEventId" from-field="parameters.entityNameId"/>
-            </entity-one>
-            <entity-and entity-name="CommunicationEventRole" list="roles">
-                <field-map field-name="communicationEventId" from-field="parameters.entityNameId"/>
-            </entity-and>
-            <if-not-empty field="roles">
-                <make-value value-field="noteData" entity-name="NoteData"/>
-                <now-timestamp field="noteData.noteDateTime"/>
-                <set field="noteData.noteName" value="SYSTEMNOTE"/>
-                <set field="noteData.noteInfo" value="New incoming communication event: ${comm.subject} from ${comm.partyIdFrom}"/>
-                <set field="noteData.moreInfoPortletId" value="MyCommunications"/>
-                <iterate entry="role" list="roles">
-                    <if-compare field="role.statusId" value="COM_ROLE_CREATED" operator="equals">
-                        <set field="partyId" from-field="role.partyId"/>
-                        <call-simple-method method-name="getPortletAttributeMap"/>
-                        <if>
-                            <condition>
-                                <and><!-- check for 'all' notifications flag off -->
-                                    <if-compare field="haveUserLogin" value="true" operator="equals"/>
-                                    <if-compare field="attributeMap.allNotifications" value="Y" operator="not-equals"/>
-                                    <or>
-                                        <and><!-- incoming email for known parties, no notifications for unknown parties -->
-                                            <if-compare field="attributeMap.incomingEmail" value="Y" operator="not-equals"/>
-                                            <if-compare field="comm.communicationEventTypeId" value="AUTO_EMAIL_COM" operator="equals"/>
-                                        </and>
-                                        <and><!-- internal sent email -->
-                                            <if-compare field="attributeMap.email" value="Y" operator="not-equals"/>
-                                            <or>
-                                                <if-compare field="comm.communicationEventTypeId" value="AUTO_EMAIL_COMM" operator="equals"/>
-                                                <if-compare field="comm.communicationEventTypeId" value="EMAIL_COMMUNICATION" operator="equals"/>
-                                            </or>
-                                        </and>
-                                        <and><!-- internal notes -->
-                                            <if-compare field="attributeMap.internalNotes" value="Y" operator="not-equals"/>
-                                            <if-compare field="comm.communicationEventTypeId" value="COMMENT_NOTE" operator="equals"/>
-                                        </and>
-                                    </or>
-                                </and>    
-                            </condition>
-                            <then>
-                                <sequenced-id sequence-name="NoteData" field="noteData.noteId"/>
-                                <set field="noteData.noteParty" from-field="role.partyId"/>
-                                <create-value value-field="noteData"/>
-                            </then>
-                        </if>
-                    </if-compare>                        
-                </iterate>
-            </if-not-empty>
-        </if-compare>
-        
-        <!-- new task assignments for the logged on user -->
-        <if-compare field="parameters.entityName" value="WorkEffortPartyAssignment" operator="equals">
-            <entity-one entity-name="WorkEffort" value-field="workEffort">
-                <field-map field-name="workEffortId" from-field="parameters.entityNameId"/>
-            </entity-one>
-            <if-compare field="workEffort.workEffortTypeId" value="TASK" operator="equals">
-                <call-simple-method method-name="getPortletAttributeMap"/>
-                <if-compare field="haveUserLogin" value="true" operator="equals">
-                    <if-compare field="attributeMap.taskAssignment" value="Y" operator="not-equals">
-                        <entity-and entity-name="WorkEffortPartyAssignment" list="assigns" filter-by-date="true">
-                            <field-map field-name="workEffortId" from-field="parameters.entityNameId"/>
-                            <order-by field-name="-fromDate"/>
-                        </entity-and>
-                        <first-from-list entry="assign" list="assigns"/>
-                        <make-value value-field="noteData" entity-name="NoteData"/>
-                        <now-timestamp field="noteData.noteDateTime"/>
-                        <sequenced-id sequence-name="NoteData" field="noteData.noteId"/>
-                        <set field="noteData.noteParty" from-field="assign.partyId"/>
-                        <set field="noteData.noteName" value="SYSTEMNOTE"/>
-                        <set field="noteData.noteInfo" value="New task assignment '${workEffort.workEffortName}' [${workEffort.workEffortId}]"/>
-                        <set field="noteData.moreInfoPortletId" value="ViewProjectTask"/>
-                        <set field="noteData.moreInfoItemId" from-field="workEffort.workEffortId"/>
-                        <create-value value-field="noteData"/>
-                    </if-compare>
-                </if-compare>
-            </if-compare>
-        </if-compare>
-        
-        <!-- Create a system info note to all customer request participants if a note was added to the customer request
-            the originator of the customer request will get already a email so does not need to be notified-->
-        <if-compare field="parameters.entityName" value="CustRequestItemNote" operator="equals">
-            <!-- find related customer request originator -->
-            <entity-and entity-name="CustRequestItemNoteView" list="custRequesItems">
-                <field-map field-name="noteId" from-field="parameters.entityNameId"/>
-            </entity-and>
-            <first-from-list entry="custRequesItem" list="custRequesItems"/>
-            <entity-one entity-name="CustRequest" value-field="custRequest">
-                <field-map field-name="custRequestId" from-field="custRequesItem.custRequestId"/>
-                <select-field field-name="fromPartyId"/>
-                <select-field field-name="custRequestName"/>
-            </entity-one>
-            <!-- find all parties who have added a note to this request item excluding the originator (he already gets email)-->
-            <entity-condition entity-name="CustRequestItemNoteView" list="custRequestParties" distinct="true">
-                <condition-list combine="and">
-                    <condition-expr field-name="partyId" operator="not-equals" from-field="custRequest.fromPartyId"/>
-                    <condition-expr field-name="custRequestId" from-field="custRequesItem.custRequestId"/>
-                    <condition-expr field-name="custRequestItemSeqId" from-field="custRequesItem.custRequestItemSeqId"/>
-                </condition-list>
-                <select-field field-name="partyId"/>
-                <select-field field-name="custRequestId"/>
-                <select-field field-name="custRequestItemSeqId"/>
-            </entity-condition>
-            <make-value value-field="noteData" entity-name="NoteData"/>
-            <now-timestamp field="noteData.noteDateTime"/>
-            <set field="noteData.noteName" value="SYSTEMNOTE"/>
-            <set field="noteData.moreInfoPortletId" value="ViewCustRequest"/>
-            <set field="noteData.moreInfoItemId" from-field="custRequest.custRequestId"/>
-            <set field="noteData.noteInfo" value="A note has been added to customer request ${custRequest.custRequestName} [${custRequest.custRequestId}]"/>
-            <iterate entry="custRequestParty" list="custRequestParties">
-                <sequenced-id sequence-name="NoteData" field="noteData.noteId"/>
-                <set field="noteData.noteParty" from-field="custRequestParty.partyId"/>
-                <create-value value-field="noteData"/>
-            </iterate>
-        </if-compare>
-        
-        <!-- public message -->
-        <if-compare field="parameters.entityName" value="PublicMessage" operator="equals">
-            <if-has-permission permission="COMMONEXT_PUBLMSG">
-                <!-- get all recent visitors logged on the last 3 weeks -->
-                <set field="lastDate" value="${groovy:org.ofbiz.base.util.UtilDateTime.addDaysToTimestamp(org.ofbiz.base.util.UtilDateTime.nowTimestamp(), -21)}" type="Timestamp"/>
-                <entity-condition list="parties" entity-name="PartyNameVisitView" distinct="true">
-                    <condition-expr field-name="fromDate" operator="greater" from-field="lastDate"/>
-                    <select-field field-name="partyId"/>
-                </entity-condition>
-                <iterate entry="party" list="parties">            
-                    <make-value value-field="noteData" entity-name="NoteData"/>
-                    <now-timestamp field="noteData.noteDateTime"/>
-                    <sequenced-id sequence-name="NoteData" field="noteData.noteId"/>
-                    <set field="noteData.noteParty" from-field="party.partyId"/>
-                    <set field="noteData.noteName" value="SYSTEMNOTE"/>
-                    <set field="noteData.noteInfo" from-field="parameters.noteInfo"/>
-                    <create-value value-field="noteData"/>
-                </iterate>
-                <set field="noteData.noteParty" value="_NA_"/><!-- message for not logged in users -->
-                <sequenced-id sequence-name="NoteData" field="noteData.noteId"/>
-                <create-value value-field="noteData"/>
-            </if-has-permission>
-        </if-compare>
+        <set field="parameters.partyId" from-field="parameters.partyId" default-value="userLogin.partyId"/>
+        <make-value value-field="noteData" entity-name="NoteData"/>
+        <set-nonpk-fields value-field="noteData" map="parameters"/>
+        <now-timestamp field="noteData.noteDateTime"/>
+        <sequenced-id sequence-name="NoteData" field="noteData.noteId"/>
+        <set field="noteData.noteName" value="SYSTEMNOTE"/>
+        <create-value value-field="noteData"/>
     </simple-method>
 
     <simple-method method-name="getPortletAttributeMap" short-description="get the attributes of the SystemInfoNotes portlet for a userlogin">
@@ -182,6 +47,19 @@ under the License.
         </if-not-empty>
     </simple-method>
 
+    <simple-method method-name="deleteSystemInfoNote" short-description="Delete SystemInfo Note">
+        <entity-one value-field="noteData" entity-name="NoteData"/>
+        <remove-related relation-name="ContentNote" value-field="noteData"/>
+        <remove-related relation-name="CustRequestItemNote" value-field="noteData"/>
+        <remove-related relation-name="CustRequestNote" value-field="noteData"/>
+        <remove-related relation-name="MarketingCampaignNote" value-field="noteData"/>
+        <remove-related relation-name="OrderHeaderNote" value-field="noteData"/>
+        <remove-related relation-name="PartyNote" value-field="noteData"/>
+        <remove-related relation-name="QuoteNote" value-field="noteData"/>
+        <remove-related relation-name="WorkEffortNote" value-field="noteData"/>
+        <remove-value value-field="noteData"/>
+    </simple-method>
+
     <simple-method method-name="deleteAllSystemNotes" short-description="delete all system notes from a particular user">
         <set field="removeData.noteParty" from-field="parameters.userLogin.partyId"/>
         <set field="removeData.noteName" value="SYSTEMNOTE"/>
@@ -207,7 +85,6 @@ under the License.
             <set field="status.noteInfo" value="Open communication events: ${comCount}"/>
             <first-from-list entry="comm" list="comms"/>
             <set field="status.noteDateTime" from-field="comm.entryDate"/>
-            <set field="status.moreInfoPortletId" value="MyCommunications"/>
             <field-to-list field="status" list="systemInfoStatus"/>
             <clear-field field="status"/>
         </if-compare>
@@ -229,7 +106,6 @@ under the License.
             <set field="status.noteInfo" value="Assigned and not completed tasks: ${assignCount}"/>
             <first-from-list entry="assign" list="assigns"/>
             <set field="status.noteDateTime" from-field="assign.fromDate"/>
-            <set field="status.moreInfoPortletId" value="mytasks"/>
             <field-to-list field="status" list="systemInfoStatus"/>
         </if-compare>
         
@@ -281,5 +157,4 @@ under the License.
             </if-not-empty>
         </if-not-empty>
     </simple-method>
-  
 </simple-methods>

Modified: ofbiz/branches/20111205EmailHandling/applications/commonext/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/commonext/servicedef/secas.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/commonext/servicedef/secas.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/commonext/servicedef/secas.xml Mon Mar 26 20:56:02 2012
@@ -20,27 +20,5 @@ under the License.
 
 <service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
-    <!-- send a note when a communicationevent is created for a certain loginId when an
-        existing comm event's status changes into status: entered-->
-    <eca service="setCommunicationEventStatus" event="commit">
-        <condition field-name="statusId" operator="equals" value="COM_ENTERED"/>
-        <set field-name="entityName" value="CommunicationEvent"/>
-        <set field-name="entityNameId" env-name="communicationEventId"/>
-        <action service="createSystemInfoNote" mode="sync"/>
-    </eca>
-    <!-- send a note when a communicationevent is created for a certain loginId
-        with the status entered -->
-    <eca service="createCommunicationEvent" event="commit">
-        <condition field-name="statusId" operator="equals" value="COM_ENTERED"/>
-        <set field-name="entityName" value="CommunicationEvent"/>
-        <set field-name="entityNameId" env-name="communicationEventId"/>
-        <action service="createSystemInfoNote" mode="sync"/>
-    </eca>
-    <!-- send a system note to all Customer request participants (excluding the originator)
-        when a note is added to a particular customer request.-->
-    <eca service="createCustRequestItemNote" event="commit">
-        <set field-name="entityName" value="CustRequestItemNote"/>
-        <set field-name="entityNameId" env-name="noteId"/>
-        <action service="createSystemInfoNote" mode="sync"/>
-    </eca>
+        
 </service-eca>

Modified: ofbiz/branches/20111205EmailHandling/applications/commonext/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/commonext/servicedef/services.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/commonext/servicedef/services.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/commonext/servicedef/services.xml Mon Mar 26 20:56:02 2012
@@ -26,11 +26,13 @@ under the License.
 
     <service name="createSystemInfoNote" engine="simple" default-entity-name="NoteData"
         location="component://commonext/script/org/ofbiz/SystemInfoServices.xml" invoke="createSystemInfoNote">
-        <description>Create a system info note realted to a certain entityId</description>        
-        <auto-attributes mode="IN" optional="true"/>
-        <attribute name="partyId" type="String" mode="IN" optional="true"/><!-- userLogin.partyId is default -->
-        <attribute name="entityName" type="String" mode="IN"/>
-        <attribute name="entityNameId" type="String" mode="IN"/>
+        <description>Create a system info note</description>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="deleteSystemInfoNote" engine="simple" default-entity-name="NoteData"
+        location="component://commonext/script/org/ofbiz/SystemInfoServices.xml" invoke="deleteSystemInfoNote">
+        <description>Delete a system info note</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
     <service name="deleteAllSystemNotes" engine="simple" auth="true"
         location="component://commonext/script/org/ofbiz/SystemInfoServices.xml" invoke="deleteAllSystemNotes">

Modified: ofbiz/branches/20111205EmailHandling/applications/commonext/webapp/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/commonext/webapp/WEB-INF/controller.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/commonext/webapp/WEB-INF/controller.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/commonext/webapp/WEB-INF/controller.xml Mon Mar 26 20:56:02 2012
@@ -23,6 +23,13 @@ under the License.
     <description>General Application CommonExt Configuration File</description>
     
     <!-- Request Mappings -->
+    
+    <request-map uri="deleteSystemInfoNote">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="deleteSystemInfoNote"/>
+        <response name="success" type="view-last"/>
+    </request-map>
+    
     <request-map uri="deleteAllSystemNotes">
         <security https="true" auth="true"/>
         <event type="service" invoke="deleteAllSystemNotes"/>

Modified: ofbiz/branches/20111205EmailHandling/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml Mon Mar 26 20:56:02 2012
@@ -38,7 +38,7 @@
         <response name="success" type="view" value="showMessage"/>
     </request-map>
 
- <!-- party requests -->
+    <!-- party requests -->
     <request-map uri="updatePartyGroup">
         <security https="true" auth="true"/>
         <event type="service" path="" invoke="updatePartyGroup"/>

Modified: ofbiz/branches/20111205EmailHandling/applications/commonext/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/commonext/widget/CommonScreens.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/commonext/widget/CommonScreens.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/commonext/widget/CommonScreens.xml Mon Mar 26 20:56:02 2012
@@ -35,14 +35,16 @@ under the License.
                 <set field="layoutSettings.suppressTab" value="ofbizsetup"/><!-- diseable ofbiz setup by default -->
                 <!-- system info notes -->
                 <service service-name="getLastSystemInfoNote" result-map="resultNote"/>
-                <set field="linkStart" value="/myportal/control/showPortletMainDecorator?portalPortletId="/>
+                <set field="lastSystemInfoNote1" from-field="resultNote.lastSystemInfoNote1"/>
+                <set field="lastSystemInfoNote2" from-field="resultNote.lastSystemInfoNote2"/>
+                <set field="lastSystemInfoNote3" from-field="resultNote.lastSystemInfoNote3"/>
                 <set field="layoutSettings.middleTopHeader" value="---------- ${uiLabelMap.CommonLastSytemNotes} ----------"/>
-                <set field="layoutSettings.middleTopMessage1" value="${groovy:resultNote.lastSystemInfoNote1!=null?resultNote.lastSystemInfoNote1.noteDateTime.toString().substring(0,16) + &quot; &quot; + resultNote.lastSystemInfoNote1.noteInfo:&quot;&quot;}"/>
-                <set field="layoutSettings.middleTopLink1" value="${linkStart}${resultNote.lastSystemInfoNote1.moreInfoPortletId}&amp;amp;id=${resultNote.lastSystemInfoNote1.moreInfoItemId}"/>
-                <set field="layoutSettings.middleTopMessage2" value="${groovy:resultNote.lastSystemInfoNote2!=null?resultNote.lastSystemInfoNote2.noteDateTime.toString().substring(0,16) + &quot; &quot; + resultNote.lastSystemInfoNote2.noteInfo:&quot;&quot;}"/>
-                <set field="layoutSettings.middleTopLink2" value="${linkStart}${resultNote.lastSystemInfoNote2.moreInfoPortletId}&amp;amp;id=${resultNote.lastSystemInfoNote2.moreInfoItemId}"/>
-                <set field="layoutSettings.middleTopMessage3" value="${groovy:resultNote.lastSystemInfoNote3!=null?resultNote.lastSystemInfoNote3.noteDateTime.toString().substring(0,16) + &quot; &quot; + resultNote.lastSystemInfoNote3.noteInfo:&quot;&quot;}"/>
-                <set field="layoutSettings.middleTopLink3" value="${linkStart}${resultNote.lastSystemInfoNote3.moreInfoPortletId}&amp;amp;id=${resultNote.lastSystemInfoNote3.moreInfoItemId}"/>
+                <set field="layoutSettings.middleTopMessage1" value="${groovy:lastSystemInfoNote1!=null?lastSystemInfoNote1.noteDateTime.toString().substring(0,16) + &quot; &quot; + lastSystemInfoNote1.noteInfo:&quot;&quot;}"/>
+                <set field="layoutSettings.middleTopMessage2" value="${groovy:lastSystemInfoNote2!=null?lastSystemInfoNote2.noteDateTime.toString().substring(0,16) + &quot; &quot; + lastSystemInfoNote2.noteInfo:&quot;&quot;}"/>
+                <set field="layoutSettings.middleTopMessage3" value="${groovy:lastSystemInfoNote3!=null?lastSystemInfoNote3.noteDateTime.toString().substring(0,16) + &quot; &quot; + lastSystemInfoNote3.noteInfo:&quot;&quot;}"/>
+                <set field="layoutSettings.middleTopLink1" value="${lastSystemInfoNote1.moreInfoUrl}${groovy: if (lastSystemInfoNote1&amp;&amp;lastSystemInfoNote1.moreInfoItemName&amp;&amp;lastSystemInfoNote1.moreInfoItemId)&quot;?&quot; + lastSystemInfoNote1.moreInfoItemName + &quot;=&quot; + lastSystemInfoNote1.moreInfoItemId + &quot;&amp;id=&quot; + lastSystemInfoNote1.moreInfoItemId;}"/>
+                <set field="layoutSettings.middleTopLink2" value="${lastSystemInfoNote2.moreInfoUrl}${groovy: if (lastSystemInfoNote2&amp;&amp;lastSystemInfoNote2.moreInfoItemName&amp;&amp;lastSystemInfoNote2.moreInfoItemId)&quot;?&quot; + lastSystemInfoNote2.moreInfoItemName + &quot;=&quot; + lastSystemInfoNote2.moreInfoItemId + &quot;&amp;id=&quot; + lastSystemInfoNote2.moreInfoItemId;}"/>
+                <set field="layoutSettings.middleTopLink3" value="${lastSystemInfoNote3.moreInfoUrl}${groovy: if (lastSystemInfoNote3&amp;&amp;lastSystemInfoNote3.moreInfoItemName&amp;&amp;lastSystemInfoNote3.moreInfoItemId)&quot;?&quot; + lastSystemInfoNote3.moreInfoItemName + &quot;=&quot; + lastSystemInfoNote3.moreInfoItemId + &quot;&amp;id=&quot; + lastSystemInfoNote3.moreInfoItemId;}"/>
                 <!-- Help link actions -->
                 <!--<set field="helpTopic" value="${groovy: webSiteId + '_' + requestAttributes._CURRENT_VIEW_}"/>-->
                 <set field="helpTopic" value="${groovy: parameters.componentName.toUpperCase() + '_' + requestAttributes._CURRENT_VIEW_}"/>

Modified: ofbiz/branches/20111205EmailHandling/applications/commonext/widget/SystemInfoForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/commonext/widget/SystemInfoForms.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/commonext/widget/SystemInfoForms.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/commonext/widget/SystemInfoForms.xml Mon Mar 26 20:56:02 2012
@@ -24,7 +24,13 @@ under the License.
     <form name="SystemInfoNotes" type="list" list-name="systemInfoNotes"
         odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
         <field name="noteDateTime" title="${uiLabelMap.CommonExtDateInfoCreated}"><display type="date-time"/></field>
-        <field name="noteInfo" title="${uiLabelMap.CommonExtSystemInfoNote}"><hyperlink target="/myportal/control/showPortletMainDecorator?portalPortletId=${moreInfoPortletId}&amp;id=${moreInfoItemId}" target-type="inter-app" description="${noteInfo}"></hyperlink></field>
+        <field name="noteInfo" title="${uiLabelMap.CommonExtSystemInfoNote}"><hyperlink target="${moreInfoUrl}${groovy: if (moreInfoItemName &amp;&amp;moreInfoItemId)&quot;?&quot; + moreInfoItemName + &quot;=&quot; + moreInfoItemId + &quot;&amp;id=&quot; + moreInfoItemId;}" target-type="inter-app" description="${noteInfo}"></hyperlink></field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext" >
+            <hyperlink target="deleteSystemInfoNote" description="${uiLabelMap.CommonDelete}">
+                <parameter param-name="noteId"/>
+                <parameter param-name="portalPageId" from-field="parameters.portalPageId"/>
+            </hyperlink>
+        </field>
     </form>
     
     <form name="EditSysInfoPortletParams" extends="CommonPortletEdit" extends-resource="component://common/widget/PortletEditForms.xml">
@@ -40,12 +46,12 @@ under the License.
     <form name="SystemInfoStatus" type="list" list-name="systemInfoStatus"
         odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
         <field name="noteDateTime" title="${uiLabelMap.CommonExtDateLastChanged}"><display type="date-time"/></field>
-        <field name="noteInfo" title="${uiLabelMap.CommonExtSystemInfoStatus}"><hyperlink target="/myportal/control/showPortletMainDecorator?portalPortletId=${moreInfoPortletId}" target-type="inter-app" description="${noteInfo}"></hyperlink></field>
+        <field name="noteInfo" title="${uiLabelMap.CommonExtSystemInfoStatus}"><hyperlink target="${moreInfoUrl}" target-type="inter-app" description="${noteInfo}"></hyperlink></field>
     </form>
     
     <form name="CreateSystemInfoNote" type="single" target="createSystemInfoNote">
-        <field name="entityName"><hidden value="PublicMessage"/></field>
-        <field name="entityNameId"><hidden value="dummy"/></field>
+        <field name="noteParty"><text/></field>
+        <field name="moreInfoUrl"><text size="50"/></field>
         <field name="noteInfo"><text size="50"/></field>
         <field name="createButton"><submit/></field>
     </form>

Modified: ofbiz/branches/20111205EmailHandling/applications/commonext/widget/ofbizsetup/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/commonext/widget/ofbizsetup/CommonScreens.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/commonext/widget/ofbizsetup/CommonScreens.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/commonext/widget/ofbizsetup/CommonScreens.xml Mon Mar 26 20:56:02 2012
@@ -52,11 +52,11 @@
     </screen>
     
     <screen name="CommonPartyDecorator">
-     <section>
-     <widgets>
+        <section>
+            <widgets>
                 <include-screen name="CommonSetupDecorator"/>
-     </widgets>
-     </section>
+            </widgets>
+        </section>
     </screen>
     
     <screen name="CommonSetupDecorator">

Modified: ofbiz/branches/20111205EmailHandling/applications/commonext/widget/ofbizsetup/SetupForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/commonext/widget/ofbizsetup/SetupForms.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/commonext/widget/ofbizsetup/SetupForms.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/commonext/widget/ofbizsetup/SetupForms.xml Mon Mar 26 20:56:02 2012
@@ -207,7 +207,7 @@
     
     <form name="EditProdCatalog" extends="EditProdCatalog" extends-resource="component://product/widget/catalog/ProdCatalogForms.xml">
         <field use-when="prodCatalog==null&amp;&amp;prodCatalogId==null" name="prodCatalogId" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text default-value="${partyId}"/></field>
-        <field name="catalogName" title="${uiLabelMap.ProductCatalogName}" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text size="30" maxlength="60"/></field>
+        <field name="catalogName" title="${uiLabelMap.FormFieldTitle_prodCatalogName}" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text size="30" maxlength="60"/></field>
         <field name="partyId"><hidden value="${partyId}"/></field>
         <field name="productStoreId"><hidden value="${productStoreId}"/></field>
         <field name="useQuickAdd"><hidden value="Y"/></field>
@@ -230,7 +230,7 @@
         <field name="prodCatalogId"><hidden value="${prodCatalogId}"/></field>
         <field name="productCategoryTypeId"><hidden value="CATALOG_CATEGORY"/></field>
         <field name="categoryName" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text size="30" maxlength="60"/></field>
-        <field name="description" title="${uiLabelMap.ProductProductDescription}"><textarea cols="60" rows="2"/></field>
+        <field name="description" title="${uiLabelMap.ProductCategoryDescription}"><textarea cols="60" rows="2"/></field>
         <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>  
     

Modified: ofbiz/branches/20111205EmailHandling/applications/content/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/build.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/build.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/build.xml Mon Mar 26 20:56:02 2012
@@ -47,6 +47,7 @@ under the License.
         <fileset dir="../../framework/webapp/build/lib" includes="*.jar"/>
         <fileset dir="../../framework/widget/build/lib" includes="*.jar"/>
         <fileset dir="../../framework/common/build/lib" includes="*.jar"/>
+        <fileset dir="../../framework/jcr/lib" includes="*.jar"/>
     </path>
 
     <patternset id="src.exc.set">

Modified: ofbiz/branches/20111205EmailHandling/applications/content/data/DemoBlogEntryData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/data/DemoBlogEntryData.xml?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/data/DemoBlogEntryData.xml (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/data/DemoBlogEntryData.xml Mon Mar 26 20:56:02 2012
@@ -18,7 +18,7 @@
     under the License.
 -->
 <entity-engine-xml>
- <DataResource dataResourceId="BLG10000" dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="NONE" isPublic="Y" createdByUserLogin="admin" createdDate="2004-01-16 01:24:06.522" createdStamp="2007-01-23 16:46:22.421" createdTxStamp="2007-01-23 16:46:21.406" lastModifiedByUserLogin="admin" lastModifiedDate="2010-09-26 13:13:32.482" lastUpdatedStamp="2010-09-26 13:13:32.483" lastUpdatedTxStamp="2010-09-26 13:13:32.429" mimeTypeId="application/octet-stream" statusId="CTNT_PUBLISHED"/>
+    <DataResource dataResourceId="BLG10000" dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="NONE" isPublic="Y" createdByUserLogin="admin" createdDate="2004-01-16 01:24:06.522" createdStamp="2007-01-23 16:46:22.421" createdTxStamp="2007-01-23 16:46:21.406" lastModifiedByUserLogin="admin" lastModifiedDate="2010-09-26 13:13:32.482" lastUpdatedStamp="2010-09-26 13:13:32.483" lastUpdatedTxStamp="2010-09-26 13:13:32.429" mimeTypeId="application/octet-stream" statusId="CTNT_PUBLISHED"/>
     <DataResource dataResourceId="BLG10001" dataResourceTypeId="OFBIZ_FILE_BIN" dataTemplateTypeId="NONE" statusId="CTNT_PUBLISHED" mimeTypeId="image/jpeg" objectInfo="specialpurpose/ecommerce/data/cutekid.jpg" isPublic="Y" createdDate="2007-01-23 16:46:22.843" createdByUserLogin="bigal" lastModifiedDate="2007-01-23 16:46:22.843" lastModifiedByUserLogin="bigal" lastUpdatedStamp="2007-01-23 16:46:22.843" lastUpdatedTxStamp="2007-01-23 16:46:21.406" createdStamp="2007-01-23 16:46:22.843" createdTxStamp="2007-01-23 16:46:21.406"/>
     <DataResource dataResourceId="BLG10002" dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="NONE" statusId="CTNT_PUBLISHED" createdDate="2007-01-23 16:46:22.984" createdByUserLogin="bigal" lastModifiedDate="2007-01-23 16:46:38.671" lastModifiedByUserLogin="bigal" lastUpdatedStamp="2007-01-23 16:46:38.671" lastUpdatedTxStamp="2007-01-23 16:46:37.359" createdStamp="2007-01-23 16:46:22.984" createdTxStamp="2007-01-23 16:46:21.406"/>
     <DataResource dataResourceId="BLG10003" dataResourceTypeId="ELECTRONIC_TEXT" dataTemplateTypeId="NONE" statusId="CTNT_PUBLISHED" createdDate="2007-01-23 16:47:49.343" createdByUserLogin="bigal" lastModifiedDate="2007-01-23 16:47:49.343" lastModifiedByUserLogin="bigal" lastUpdatedStamp="2007-01-23 16:47:49.343" lastUpdatedTxStamp="2007-01-23 16:47:49.328" createdStamp="2007-01-23 16:47:49.343" createdTxStamp="2007-01-23 16:47:49.328"/>

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementEvents.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementEvents.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementEvents.java Mon Mar 26 20:56:02 2012
@@ -99,16 +99,12 @@ public class ContentManagementEvents {
         }
 */
 
-        Iterator<Map<String, Object>> it = valueList.iterator();
         int counter = 0;
-        while (it.hasNext()) {
-            Map<String, Object> map = it.next();
+        for(Map<String, Object> map : valueList) {
             String contentId = (String)map.get("contentId");
             //Integer idxObj = (Integer)contentIdLookup.get(contentId);
             //int idx = idxObj.intValue();
-            Iterator<String []> itPubPt = permittedPublishPointList.iterator();
-            while (itPubPt.hasNext()) {
-                String [] pubArr = itPubPt.next();
+            for(String [] pubArr : permittedPublishPointList) {
                 String pubContentId = pubArr[0];
                 String pubValue = (String)map.get(pubContentId);
                 String paramName = Integer.toString(counter)  + "_" + pubContentId;
@@ -212,11 +208,8 @@ public class ContentManagementEvents {
 
         // make a map of the values that are passed in using the top subSite as the key.
         // Content can only be linked to one subsite under a top site (ends with "_MASTER")
-        Set<String> keySet = paramMap.keySet();
-        Iterator<String> itKeySet = keySet.iterator();
         Map<String, String> siteIdLookup = FastMap.newInstance();
-        while (itKeySet.hasNext()) {
-            String param = itKeySet.next();
+        for(String param : paramMap.keySet()) {
             int pos = param.indexOf("select_");
                 //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, param:" + param + " pos:" + pos , module);
             if (pos >= 0) {
@@ -228,7 +221,6 @@ public class ContentManagementEvents {
         //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, siteIdLookup:" + siteIdLookup , module);
 
         // Loop thru all the possible subsites
-        Iterator<Object []> it = origPublishedLinkList.iterator();
         Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
         // int counter = 0;
         String responseMessage = null;
@@ -236,18 +228,15 @@ public class ContentManagementEvents {
         // String permissionMessage = null;
         boolean statusIdUpdated = false;
         Map<String, Object> results = null;
-        while (it.hasNext()) {
-            Object [] arr = it.next();
+        for(Object [] arr : origPublishedLinkList) {
             //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, arr:" + Arrays.asList(arr) , module);
             String contentId = (String)arr[0]; // main (2nd level) site id
             String origSubContentId = null;
             List<Object []> origSubList = UtilGenerics.checkList(arr[1]);
             // Timestamp topFromDate = (Timestamp)arr[3];
             Timestamp origFromDate = null;
-            Iterator<Object []> itOrigSubPt = origSubList.iterator();
+            for(Object [] pubArr : origSubList) {
             // see if a link already exists by looking for non-null fromDate
-            while (itOrigSubPt.hasNext()) {
-                Object [] pubArr = itOrigSubPt.next();
                 //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, pubArr:" + Arrays.asList(pubArr) , module);
                 Timestamp fromDate = (Timestamp)pubArr[2];
                 origSubContentId = null;
@@ -267,9 +256,7 @@ public class ContentManagementEvents {
                         // disable existing link
                         if (UtilValidate.isNotEmpty(origSubContentId) && origFromDate != null) {
                             List<GenericValue> oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", origSubContentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null));
-                            Iterator<GenericValue> iterOldActive = oldActiveValues.iterator();
-                            while (iterOldActive.hasNext()) {
-                                GenericValue cAssoc = iterOldActive.next();
+                            for(GenericValue cAssoc : oldActiveValues) {
                                 cAssoc.set("thruDate", nowTimestamp);
                                 cAssoc.store();
                                 //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, deactivating:" + cAssoc , module);
@@ -323,16 +310,12 @@ public class ContentManagementEvents {
                 } else if (UtilValidate.isNotEmpty(origSubContentId)) {
                     // if no current link is passed in, look to see if there is an existing link(s) that must be disabled
                     List<GenericValue> oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", origSubContentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null));
-                    Iterator<GenericValue> iterOldActive = oldActiveValues.iterator();
-                    while (iterOldActive.hasNext()) {
-                        GenericValue cAssoc = iterOldActive.next();
+                    for(GenericValue cAssoc : oldActiveValues) {
                         cAssoc.set("thruDate", nowTimestamp);
                         cAssoc.store();
                     }
                     oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", contentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null));
-                    iterOldActive = oldActiveValues.iterator();
-                    while (iterOldActive.hasNext()) {
-                        GenericValue cAssoc = iterOldActive.next();
+                    for(GenericValue cAssoc : oldActiveValues) {
                         cAssoc.set("thruDate", nowTimestamp);
                         cAssoc.store();
                     }

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementServices.java Mon Mar 26 20:56:02 2012
@@ -367,9 +367,7 @@ public class ContentManagementServices {
                 try {
                     if (contentPurposeList != null) {
                         Set<String> contentPurposeSet = UtilMisc.makeSetWritable(contentPurposeList);
-                        Iterator<String> iter = contentPurposeSet.iterator();
-                        while (iter.hasNext()) {
-                            String contentPurposeTypeId = iter.next();
+                        for(String contentPurposeTypeId : contentPurposeSet) {
                             GenericValue contentPurpose = delegator.makeValue("ContentPurpose", UtilMisc.toMap("contentId", contentId, "contentPurposeTypeId", contentPurposeTypeId));
                             contentPurpose.create();
                         }
@@ -497,14 +495,12 @@ public class ContentManagementServices {
           return ServiceUtil.returnError(e.toString());
       }
 
-      Iterator<GenericValue> siteRoleIter = siteRoles.iterator();
-      while (siteRoleIter.hasNext()) {
+      for(GenericValue roleType : siteRoles) {
           Map<String, Object> serviceContext = FastMap.newInstance();
           serviceContext.put("partyId", partyId);
           serviceContext.put("contentId", siteContentId);
           serviceContext.put("userLogin", userLogin);
           Debug.logInfo("updateSiteRoles, serviceContext(0):" + serviceContext, module);
-            GenericValue roleType = siteRoleIter.next();
           String siteRole = (String)roleType.get("roleTypeId"); // BLOG_EDITOR, BLOG_ADMIN, etc.
           String cappedSiteRole = ModelUtil.dbNameToVarName(siteRole);
           if (Debug.infoOn()) {
@@ -797,9 +793,7 @@ public class ContentManagementServices {
         String partyId = (String)serviceContext.get("partyId");
         Map<String, Object> findMap = UtilMisc.<String, Object>toMap("partyId", partyId);
         List<GenericValue> userLoginList = delegator.findByAnd("UserLogin", findMap);
-        Iterator<GenericValue> iter = userLoginList.iterator();
-        while (iter.hasNext()) {
-            GenericValue partyUserLogin = iter.next();
+        for(GenericValue partyUserLogin : userLoginList) {
             String partyUserLoginId = partyUserLogin.getString("userLoginId");
             serviceContext.put("contentId", partyUserLoginId); // author contentId
             dispatcher.runSync("createContentRole", serviceContext);
@@ -829,9 +823,7 @@ public class ContentManagementServices {
         } catch (GenericEntityException e) {
           return ServiceUtil.returnError(e.toString());
         }
-        Iterator<GenericValue> siteRoleIter = siteRoles.iterator();
-        while (siteRoleIter.hasNext()) {
-            GenericValue roleType = siteRoleIter.next();
+        for(GenericValue roleType : siteRoles) {
             String siteRole = (String)roleType.get("roleTypeId"); // BLOG_EDITOR, BLOG_ADMIN, etc.
             String cappedSiteRole = ModelUtil.dbNameToVarName(siteRole);
             //if (Debug.infoOn()) Debug.logInfo("updateSiteRoles, cappediteRole(1):" + cappedSiteRole, module);
@@ -1186,9 +1178,7 @@ public class ContentManagementServices {
             thisContent.set("contentTypeId", contentTypeId);
             thisContent.store();
             List<GenericValue> kids = ContentWorker.getAssociatedContent(thisContent, "from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
-            Iterator<GenericValue> iter = kids.iterator();
-            while (iter.hasNext()) {
-                GenericValue kidContent = iter.next();
+            for(GenericValue kidContent : kids) {
                 if (contentTypeId.equals("OUTLINE_NODE")) {
                     updateOutlineNodeChildren(kidContent, false, context);
                 } else {
@@ -1229,18 +1219,14 @@ public class ContentManagementServices {
             thisContent.set("contentTypeId", "OUTLINE_NODE");
             thisContent.store();
             List<GenericValue> kids = ContentWorker.getAssociatedContent(thisContent, "from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
-            Iterator<GenericValue> iter = kids.iterator();
-            while (iter.hasNext()) {
-                GenericValue kidContent = iter.next();
+            for(GenericValue kidContent : kids) {
                 if (contentTypeId.equals("OUTLINE_NODE")) {
                     updateOutlineNodeChildren(kidContent, true, context);
                 } else {
                     kidContent.put("contentTypeId", "PAGE_NODE");
                     kidContent.store();
                     List<GenericValue> kids2 = ContentWorker.getAssociatedContent(kidContent, "from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
-                    Iterator<GenericValue> iter2 = kids2.iterator();
-                    while (iter2.hasNext()) {
-                        GenericValue kidContent2 = iter2.next();
+                    for(GenericValue kidContent2 : kids2) {
                         updatePageNodeChildren(kidContent2, context);
                     }
                 }
@@ -1311,9 +1297,7 @@ public class ContentManagementServices {
 
         //if (contentTypeId == null || contentTypeId.equals("OUTLINE_DOCUMENT") || contentTypeId.equals("DOCUMENT")) {
         List<GenericValue> kids = ContentWorker.getAssociatedContent(content, "from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
-        Iterator<GenericValue> iter = kids.iterator();
-        while (iter.hasNext()) {
-            GenericValue kidContent = iter.next();
+        for(GenericValue kidContent : kids) {
             updatePageNodeChildren(kidContent, context);
         }
         //}
@@ -1355,9 +1339,7 @@ public class ContentManagementServices {
         if (contentTypeId == null || contentTypeId.equals("DOCUMENT") || contentTypeId.equals("OUTLINE_NODE")) {
         //if (contentTypeId == null || contentTypeId.equals("DOCUMENT")) {
             List<GenericValue> kids = ContentWorker.getAssociatedContent(content, "from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
-            Iterator<GenericValue> iter = kids.iterator();
-            while (iter.hasNext()) {
-                GenericValue kidContent = iter.next();
+            for(GenericValue kidContent : kids) {
                 updateOutlineNodeChildren(kidContent, forceOutline, context);
             }
         }
@@ -1609,8 +1591,11 @@ public class ContentManagementServices {
             Debug.logError(msg, module);
             return ServiceUtil.returnError(msg);
         }
-        Long useTime = (Long)productContent.get("useTime");
-        Integer newUseTime = Integer.valueOf(useTime.intValue() * qty.intValue());
+        Long useTime = (Long) productContent.get("useTime");
+        Integer newUseTime = null;
+        if (UtilValidate.isNotEmpty(useTime)) {
+            newUseTime = Integer.valueOf(useTime.intValue() * qty.intValue());
+        }
         context.put("useTime", newUseTime);
         context.put("useTimeUomId", productContent.get("useTimeUomId"));
         context.put("useRoleTypeId", productContent.get("useRoleTypeId"));
@@ -1650,10 +1635,8 @@ public class ContentManagementServices {
             Timestamp orderCreatedDate = (Timestamp) orderHeader.get("orderDate");
             context.put("orderCreatedDate", orderCreatedDate);
             List<GenericValue> orderItemList = orderHeader.getRelated("OrderItem");
-            Iterator<GenericValue> orderItemIter = orderItemList.iterator();
             ModelService subscriptionModel = dispatcher.getDispatchContext().getModelService("updateContentSubscriptionByProduct");
-            while (orderItemIter.hasNext()) {
-                GenericValue orderItem = orderItemIter.next();
+            for(GenericValue orderItem : orderItemList) {
                 BigDecimal qty = orderItem.getBigDecimal("quantity");
                 String productId = (String) orderItem.get("productId");
                 List<GenericValue> productContentList = delegator.findByAnd("ProductContent", UtilMisc.toMap("productId", productId, "productContentTypeId", "ONLINE_ACCESS"));
@@ -1727,9 +1710,7 @@ public class ContentManagementServices {
         result = dispatcher.runSync(serviceName, UtilMisc.toMap("content", content, "userLogin", userLogin));
 
         List<GenericValue> kids = ContentWorker.getAssociatedContent(content, "from", contentAssocTypeIdList, null, null, null);
-        Iterator<GenericValue> iter = kids.iterator();
-        while (iter.hasNext()) {
-            GenericValue kidContent = iter.next();
+        for(GenericValue kidContent : kids) {
             followNodeChildrenMethod(kidContent, dispatcher, serviceName, context);
         }
         return result;

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementWorker.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementWorker.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ContentManagementWorker.java Mon Mar 26 20:56:02 2012
@@ -130,9 +130,7 @@ public class ContentManagementWorker {
         Collection<String> keyColl = pk.getPrimaryKey().getAllKeys();
         List<String> keyList = UtilMisc.makeListWritable(keyColl);
         Collections.sort(keyList);
-        Iterator<String> it = keyList.iterator();
-        while (it.hasNext()) {
-            String ky = it.next();
+        for(String ky : keyList) {
             String val = (String)pk.get(ky);
             if (UtilValidate.isNotEmpty(val)) {
                 if (sig.length() > 0) sig.append("_");
@@ -229,9 +227,7 @@ public class ContentManagementWorker {
         GenericValue v = delegator.makeValue(entityName);
         GenericPK passedPK = v.getPrimaryKey();
         Collection<String> keyColl = passedPK.getAllKeys();
-        Iterator<String> keyIt = keyColl.iterator();
-        while (keyIt.hasNext()) {
-            String attrName = keyIt.next();
+        for(String attrName : keyColl) {
             String attrVal = (String)request.getAttribute(attrName);
             if (UtilValidate.isEmpty(attrVal)) {
                 attrVal = (String)paramMap.get(attrName);
@@ -249,13 +245,11 @@ public class ContentManagementWorker {
         if (cachedPK != null) {
             useCached = true;
             keyColl = cachedPK.getPrimaryKey().getAllKeys();
-            keyIt = keyColl.iterator();
-            while (keyIt.hasNext()) {
+            for(String ky : keyColl) {
                 String sCached = null;
                 String sPassed = null;
                 Object oPassed = null;
                 Object oCached = null;
-                String ky = keyIt.next();
                 oPassed = passedPK.get(ky);
                 if (oPassed != null) {
                     sPassed = oPassed.toString();
@@ -306,9 +300,7 @@ public class ContentManagementWorker {
         List<String []> permittedPublishPointList = FastList.newInstance();
 
         // Check that user has permission to admin sites
-        Iterator<GenericValue> it = allPublishPoints.iterator();
-        while (it.hasNext()) {
-            GenericValue webSitePP = it.next();
+        for(GenericValue webSitePP : allPublishPoints) {
             String contentId = (String)webSitePP.get("contentId");
             String templateTitle = (String)webSitePP.get("templateTitle");
             GenericValue content = delegator.makeValue("Content", UtilMisc.toMap("contentId", contentId));
@@ -352,10 +344,7 @@ public class ContentManagementWorker {
         }
         List<GenericValue> allPublishPoints = FastList.newInstance();
         GenericValue webSitePublishPoint = null;
-        GenericValue contentAssoc = null;
-        Iterator<GenericValue> it = relatedPubPts.iterator();
-        while (it.hasNext()) {
-           contentAssoc = it.next();
+        for(GenericValue contentAssoc : relatedPubPts) {
            String pub = (String)contentAssoc.get("contentId");
            //webSitePublishPoint = delegator.findByPrimaryKeyCache("WebSitePublishPoint", UtilMisc.toMap("contentId", pub));
            webSitePublishPoint = getWebSitePublishPoint(delegator, pub, false);
@@ -367,9 +356,7 @@ public class ContentManagementWorker {
     public static Map<String, GenericValue> getPublishPointMap(Delegator delegator, String pubPtId) throws GeneralException {
         List<GenericValue> publishPointList = getAllPublishPoints(delegator, pubPtId);
         Map<String, GenericValue> publishPointMap = FastMap.newInstance();
-        Iterator<GenericValue> it = publishPointList.iterator();
-        while (it.hasNext()) {
-           GenericValue webSitePublishPoint = it.next();
+        for(GenericValue webSitePublishPoint : publishPointList) {
            String pub = (String)webSitePublishPoint.get("contentId");
            publishPointMap.put(pub, webSitePublishPoint);
         }
@@ -379,9 +366,7 @@ public class ContentManagementWorker {
 
     public static void getAllPublishPointMap(Delegator delegator, String pubPtId, Map<String, GenericValue> publishPointMap) throws GeneralException {
         List<GenericValue> publishPointList = getAllPublishPoints(delegator, pubPtId);
-        Iterator<GenericValue> it = publishPointList.iterator();
-        while (it.hasNext()) {
-           GenericValue webSitePublishPoint = it.next();
+        for(GenericValue webSitePublishPoint : publishPointList) {
            String pub = (String)webSitePublishPoint.get("contentId");
            publishPointMap.put(pub, webSitePublishPoint);
            getAllPublishPointMap(delegator, pub, publishPointMap);
@@ -390,9 +375,7 @@ public class ContentManagementWorker {
 
     public static Map<String, GenericValue> getPublishPointMap(Delegator delegator, List<GenericValue> publishPointList) {
         Map<String, GenericValue> publishPointMap = FastMap.newInstance();
-        Iterator<GenericValue> it = publishPointList.iterator();
-        while (it.hasNext()) {
-           GenericValue webSitePublishPoint = it.next();
+        for(GenericValue webSitePublishPoint : publishPointList) {
            String pub = (String)webSitePublishPoint.get("contentId");
            publishPointMap.put(pub, webSitePublishPoint);
         }
@@ -408,10 +391,8 @@ public class ContentManagementWorker {
         }
 
         List<Map<String, Object>> staticValueList = FastList.newInstance();
-        Iterator<GenericValue> it = assocValueList.iterator();
         int counter = 0;
-        while (it.hasNext()) {
-            GenericValue content = it.next();
+        for(GenericValue content : assocValueList) {
             String contentId = (String)content.get("contentId");
             String contentName = (String)content.get("contentName");
             String description = (String)content.get("description");
@@ -419,21 +400,17 @@ public class ContentManagementWorker {
             map.put("contentId", contentId);
             map.put("contentName", contentName);
             map.put("description", description);
-            Iterator<String []> it2 = permittedPublishPointList.iterator();
-            while (it2.hasNext()) {
-                String [] publishPointArray = it2.next();
+            for(String [] publishPointArray : permittedPublishPointList) {
                 String publishPointId = publishPointArray[0];
-                //fieldName = "_" + Integer.toString(counter) + "_" + publishPointId;
-                String fieldName = publishPointId;
                 List<GenericValue> contentAssocList = content.getRelatedByAnd("ToContentAssoc", UtilMisc.toMap("contentId", publishPointId));
                 List<GenericValue> filteredList = EntityUtil.filterByDate(contentAssocList);
                 if (filteredList.size() > 0) {
-                    map.put(fieldName, "Y");
+                    map.put(publishPointId, "Y");
                     GenericValue assoc = filteredList.get(0);
                     Timestamp fromDate = (Timestamp)assoc.get("fromDate");
-                    map.put(fieldName + "FromDate", fromDate);
+                    map.put(publishPointId + "FromDate", fromDate);
                 } else {
-                    map.put(fieldName, "N");
+                    map.put(publishPointId, "N");
                 }
             }
             staticValueList.add(map);
@@ -536,12 +513,10 @@ public class ContentManagementWorker {
         List<String []> publishPointList = getPermittedPublishPoints(delegator, allPublishPointList, userLogin, security , permittedAction, permittedOperations, passedRoles);
         Map<String, Object> publishPointMap = FastMap.newInstance();
         Map<String, Object> publishPointMapAll = FastMap.newInstance();
-        Iterator<String []> it = publishPointList.iterator();
-        while (it.hasNext()) {
+        for(String [] arr : publishPointList) {
             //GenericValue webSitePublishPoint = (GenericValue)it.next();
             //String contentId = (String)webSitePublishPoint.get("contentId");
             //String description = (String)webSitePublishPoint.get("description");
-            String [] arr = it.next();
             String contentId = arr[0];
             String description = arr[1];
             List<Object []> subPointList = FastList.newInstance();
@@ -550,12 +525,10 @@ public class ContentManagementWorker {
             publishPointMap.put(contentId, subArr);
             publishPointMapAll.put(contentId, contentId);
             List<GenericValue> subPublishPointList = getAllPublishPoints(delegator, contentId);
-            Iterator<GenericValue> it2 = subPublishPointList.iterator();
-            while (it2.hasNext()) {
+            for(GenericValue webSitePublishPoint2 : subPublishPointList) {
                 //String [] arr2 = (String [])it2.next();
                 //String contentId2 = (String)arr2[0];
                 //String description2 = (String)arr2[1];
-                GenericValue webSitePublishPoint2 = it2.next();
                 String contentId2 = (String)webSitePublishPoint2.get("contentId");
                 String description2 = (String)webSitePublishPoint2.get("templateTitle");
                 publishPointMapAll.put(contentId2, contentId);
@@ -572,9 +545,7 @@ public class ContentManagementWorker {
         } catch (GenericEntityException e) {
             throw new GeneralException(e.getMessage());
         }
-        Iterator<GenericValue> it4 = assocValueList.iterator();
-        while (it4.hasNext()) {
-            GenericValue contentAssoc = it4.next();
+        for(GenericValue contentAssoc : assocValueList) {
             String contentIdTo = contentAssoc.getString("contentIdTo");
             String topContentId = (String)publishPointMapAll.get(contentIdTo);
             Object [] subArr = (Object [])publishPointMap.get(topContentId);
@@ -598,10 +569,7 @@ public class ContentManagementWorker {
         }
 
         List<Object []> publishedLinkList = FastList.newInstance();
-        Set<String> keySet = publishPointMap.keySet();
-        Iterator<String> it3 = keySet.iterator();
-        while (it3.hasNext()) {
-            String contentId = it3.next();
+        for(String contentId : publishPointMap.keySet()) {
             Object [] subPointArr = (Object [])publishPointMap.get(contentId);
             publishedLinkList.add(subPointArr);
         }
@@ -635,9 +603,7 @@ public class ContentManagementWorker {
         List<String []> permittedDepartmentPointList = FastList.newInstance();
 
         // Check that user has permission to admin sites
-        Iterator<GenericValue> it = allDepartmentPoints.iterator();
-        while (it.hasNext()) {
-            GenericValue content = it.next();
+        for(GenericValue content : allDepartmentPoints) {
             String contentId = (String)content.get("contentId");
             String contentName = (String)content.get("contentName");
             String statusId = null;
@@ -680,10 +646,7 @@ public class ContentManagementWorker {
         }
         List<GenericValue> allDepartmentPoints = FastList.newInstance();
         GenericValue departmentContent = null;
-        GenericValue contentAssoc = null;
-        Iterator<GenericValue> it = relatedPubPts.iterator();
-        while (it.hasNext()) {
-           contentAssoc = it.next();
+        for(GenericValue contentAssoc : relatedPubPts) {
            String pub = (String)contentAssoc.get("contentId");
            departmentContent = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", pub));
            allDepartmentPoints.add(departmentContent);
@@ -715,9 +678,7 @@ public class ContentManagementWorker {
        }
         List<GenericValue> listAll = delegator.findList("ContentAssoc", conditionMain, null, null, null, true);
         List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll);
-        Iterator<GenericValue> iter = listFiltered.iterator();
-        while (iter.hasNext()) {
-            GenericValue contentAssoc = iter.next();
+        for(GenericValue contentAssoc : listFiltered) {
             String subContentId = contentAssoc.getString("contentId");
             subLeafCount += updateStatsTopDown(delegator, subContentId, typeList);
         }
@@ -741,9 +702,7 @@ public class ContentManagementWorker {
         EntityCondition conditionMain = EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("contentId", EntityOperator.EQUALS, contentId), conditionType), EntityOperator.AND);
         List<GenericValue> listAll = delegator.findList("ContentAssoc", conditionMain, null, null, null, true);
         List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll);
-        Iterator<GenericValue> iter = listFiltered.iterator();
-        while (iter.hasNext()) {
-            GenericValue contentAssoc = iter.next();
+        for(GenericValue contentAssoc : listFiltered) {
             String contentIdTo = contentAssoc.getString("contentIdTo");
             GenericValue contentTo = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentIdTo));
             int intLeafCount = 0;

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ConvertTree.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ConvertTree.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ConvertTree.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/ConvertTree.java Mon Mar 26 20:56:02 2012
@@ -129,7 +129,7 @@ In order ta make this service active add
                                 contentName = "",
                                 contentNameInprogress = "",
                                 data = line.substring(3,size);
-                                //Debug.log("======Data======"+data);
+                                //Debug.logInfo("======Data======"+data);
                                 size = data.length();
                                 List<GenericValue> contents = null;
 
@@ -190,7 +190,7 @@ In order ta make this service active add
                                             delegator.create(Entity);
                                             hasFolder = false;
                                         } else {
-                                            //Debug.log("Content Name = [ "+contentId+"] already exist.");//ShoW log file
+                                            //Debug.logInfo("Content Name = [ "+contentId+"] already exist.");//ShoW log file
                                             hasFolder = true;
                                         }
                                         //Relation Content
@@ -208,7 +208,7 @@ In order ta make this service active add
                                                 dispatcher.runSync("createContentAssoc", contentAssoc);
                                                 rootContent=contentId;
                                             } else {
-                                                //Debug.log("ContentAssoc [contentId= "+contentId+",contentIdTo="+rootContent+"] already exist.");//ShoW log file
+                                                //Debug.logInfo("ContentAssoc [contentId= "+contentId+",contentIdTo="+rootContent+"] already exist.");//ShoW log file
                                                 rootContent=contentId;
                                             }
                                         contentName = "";
@@ -277,7 +277,7 @@ In order ta make this service active add
                 boolean contentNameMatch = false;
                 if (subContents.charAt(index) == check.charAt(0)) {//store data
                     contentName = contentName + contentNameInprogress;
-                    //Debug.log("subcontentName---->"+contentName);
+                    //Debug.logInfo("subcontentName---->"+contentName);
                     if (contentName.length()>100) {
                         contentName = contentName.substring(0,100);
                     }
@@ -300,7 +300,7 @@ In order ta make this service active add
                         Map<String,Object> data = FastMap.newInstance();
                         data.put("userLogin", userLogin);
                         String dataResourceId = (dispatcher.runSync("createDataResource",data)).get("dataResourceId").toString();
-                        //Debug.log("==dataResourceId"+dataResourceId);
+                        //Debug.logInfo("==dataResourceId"+dataResourceId);
 
                         //create Content
                         contentId = delegator.getNextSeqId("Content");
@@ -360,7 +360,7 @@ In order ta make this service active add
                         Map<String,Object> data = FastMap.newInstance();
                         data.put("userLogin", userLogin);
                         String dataResourceId = (dispatcher.runSync("createDataResource",data)).get("dataResourceId").toString();
-                        //Debug.log("==dataResourceId"+dataResourceId);
+                        //Debug.logInfo("==dataResourceId"+dataResourceId);
 
                         //create Content
                         contentId = delegator.getNextSeqId("Content");

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java Mon Mar 26 20:56:02 2012
@@ -115,9 +115,7 @@ public class BlogRssServices {
         }
 
         if (contentRecs != null) {
-            Iterator<GenericValue> i = contentRecs.iterator();
-            while (i.hasNext()) {
-                GenericValue v = i.next();
+            for(GenericValue v : contentRecs) {
                 String sub = null;
                 try {
                     Map<String, Object> dummy = FastMap.newInstance();

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/cms/CmsEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/cms/CmsEvents.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/cms/CmsEvents.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/cms/CmsEvents.java Mon Mar 26 20:56:02 2012
@@ -142,7 +142,7 @@ public class CmsEvents {
             if (pathInfo.endsWith("/")) {
                 pathInfo = pathInfo.substring(0, pathInfo.length() - 1);
             }
-            Debug.log("Path INFO for Alias: " + pathInfo, module);
+            Debug.logInfo("Path INFO for Alias: " + pathInfo, module);
 
             GenericValue pathAlias = null;
             try {
@@ -284,8 +284,14 @@ public class CmsEvents {
                     templateMap.put("formStringRenderer", formStringRenderer);
                     //include DOCTYPE for cms screens
                     writer.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
+                    
+                    // if use web analytics
+                    List<GenericValue> webAnalytics = delegator.findByAnd("WebAnalyticsConfig", UtilMisc.toMap("webSiteId", webSiteId));
+                    
                     // render
-                    if (UtilValidate.isEmpty(mapKey)) {
+                    if (UtilValidate.isNotEmpty(webAnalytics) && hasErrorPage) {
+                        ContentWorker.renderContentAsText(dispatcher, delegator, contentId, writer, templateMap, locale, "text/html", null, null, true, webAnalytics);
+                    } else if (UtilValidate.isEmpty(mapKey)) {
                         ContentWorker.renderContentAsText(dispatcher, delegator, contentId, writer, templateMap, locale, "text/html", null, null, true);
                     } else {
                         ContentWorker.renderSubContentAsText(dispatcher, delegator, contentId, writer, mapKey, templateMap, locale, "text/html", true);

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java Mon Mar 26 20:56:02 2012
@@ -104,10 +104,7 @@ public class CompDocEvents {
             Map<String, Object> persistResult = dispatcher.runSync("persistContentAndAssoc", persistMap);
             contentId = (String)persistResult.get("contentId");
             //request.setAttribute("contentId", contentId);
-            Set<String> keySet = persistResult.keySet();
-            Iterator<String> iter = keySet.iterator();
-            while (iter.hasNext()) {
-                Object obj = iter.next();
+            for(Object obj : persistResult.keySet()) {
                 Object val = persistResult.get(obj);
                 request.setAttribute(obj.toString(), val);
             }
@@ -117,10 +114,7 @@ public class CompDocEvents {
             contentRevisionMap.put("contentId", contentId);
             contentRevisionMap.put("userLogin", userLogin);
             Map<String, Object> result = dispatcher.runSync("persistContentRevisionAndItem", contentRevisionMap);
-            keySet = result.keySet();
-            iter = keySet.iterator();
-            while (iter.hasNext()) {
-                Object obj = iter.next();
+            for(Object obj : result.keySet()) {
                 Object val = result.get(obj);
                 request.setAttribute(obj.toString(), val);
             }

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java Mon Mar 26 20:56:02 2012
@@ -177,10 +177,8 @@ public class CompDocServices {
             //PdfWriter writer = PdfWriter.getInstance(document, baos);
             PdfCopy writer = new PdfCopy(document, baos);
             document.open();
-            Iterator<GenericValue> iter = compDocParts.iterator();
             int pgCnt =0;
-            while (iter.hasNext()) {
-                GenericValue contentAssocRevisionItemView = iter.next();
+            for(GenericValue contentAssocRevisionItemView : compDocParts) {
                 //String thisContentId = contentAssocRevisionItemView.getString("contentId");
                 //String thisContentRevisionSeqId = contentAssocRevisionItemView.getString("maxRevisionSeqId");
                 String thisDataResourceId = contentAssocRevisionItemView.getString("dataResourceId");

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentSearch.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentSearch.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentSearch.java Mon Mar 26 20:56:02 2012
@@ -460,7 +460,7 @@ public class ContentSearch {
     // ======================================================================
 
     @SuppressWarnings("serial")
- public static abstract class ContentSearchConstraint implements java.io.Serializable {
+    public static abstract class ContentSearchConstraint implements java.io.Serializable {
         public ContentSearchConstraint() { }
 
         public abstract void addConstraint(ContentSearchContext contentSearchContext);
@@ -470,7 +470,7 @@ public class ContentSearch {
 
 
     @SuppressWarnings("serial")
- public static class ContentAssocConstraint extends ContentSearchConstraint {
+    public static class ContentAssocConstraint extends ContentSearchConstraint {
         public static final String constraintName = "ContentAssoc";
         protected String contentId;
         protected String contentAssocTypeId;

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentSearchSession.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentSearchSession.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentSearchSession.java Mon Mar 26 20:56:02 2012
@@ -43,7 +43,7 @@ public class ContentSearchSession {
     public static final String module = ContentSearchSession.class.getName();
     
     @SuppressWarnings("serial")
- public static class ContentSearchOptions implements java.io.Serializable {
+    public static class ContentSearchOptions implements java.io.Serializable {
         protected List<ContentSearchConstraint> constraintList = null;
         protected ResultSortOrder resultSortOrder = null;
         protected Integer viewIndex = null;

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentServices.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentServices.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentServices.java Mon Mar 26 20:56:02 2012
@@ -102,10 +102,8 @@ public class ContentServices {
         serviceInMap.put("entityOperation", context.get("entityOperation"));
 
         List<GenericValue> permittedList = FastList.newInstance();
-        Iterator<GenericValue> it = contentList.iterator();
         Map<String, Object> permResults = null;
-        while (it.hasNext()) {
-            GenericValue content = it.next();
+        for(GenericValue content : contentList) {
             serviceInMap.put("currentContent", content);
             try {
                 permResults = dispatcher.runSync("checkContentPermission", serviceInMap);
@@ -162,9 +160,7 @@ public class ContentServices {
         if (UtilValidate.isEmpty(kids)) {
             parentList.add(nodeMap.get("contentId"));
         } else {
-            Iterator<Map<String, Object>> iter = kids.iterator();
-            while (iter.hasNext()) {
-                Map<String, Object> node = iter.next();
+            for(Map<String, Object> node : kids) {
                 walkParentTree(node, parentList);
             }
         }
@@ -843,9 +839,7 @@ public class ContentServices {
             List<GenericValue> filteredAssocs = EntityUtil.filterByDate(relatedAssocs);
             //if (Debug.infoOn()) Debug.logInfo("in deactivateAssocs, filteredAssocs:" + filteredAssocs, module);
 
-            Iterator<GenericValue> it = filteredAssocs.iterator();
-            while (it.hasNext()) {
-                GenericValue val = it.next();
+            for(GenericValue val : filteredAssocs) {
                 val.set("thruDate", nowTimestamp);
                 val.store();
                 //if (Debug.infoOn()) Debug.logInfo("in deactivateAssocs, val:" + val, module);

Modified: ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java?rev=1305581&r1=1305580&r2=1305581&view=diff
==============================================================================
--- ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java (original)
+++ ofbiz/branches/20111205EmailHandling/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java Mon Mar 26 20:56:02 2012
@@ -210,7 +210,6 @@ public class ContentServicesComplex {
         //EntityExpr joinExpr = null;
         //EntityExpr expr = null;
         String viewName = null;
-        GenericValue contentAssoc = null;
         String contentFieldName = null;
         if (direction != null && direction.equalsIgnoreCase("From")) {
             contentFieldName = "contentIdTo";
@@ -257,9 +256,7 @@ public class ContentServicesComplex {
         String contentAssocTypeId = null;
         List<GenericValue> contentAssocsTypeFiltered = FastList.newInstance();
         if (assocTypes != null && assocTypes.size() > 1) {
-            Iterator<GenericValue> it = contentAssocsDateFiltered.iterator();
-            while (it.hasNext()) {
-                contentAssoc = it.next();
+            for(GenericValue contentAssoc : contentAssocsDateFiltered) {
                 contentAssocTypeId = (String)contentAssoc.get("contentAssocTypeId");
                 if (assocTypes.contains(contentAssocTypeId)) {
                     contentAssocsTypeFiltered.add(contentAssoc);
@@ -281,9 +278,7 @@ public class ContentServicesComplex {
         GenericValue dataResource = null;
         List<GenericValue> contentAssocDataResourceList = FastList.newInstance();
         Locale locale = Locale.getDefault(); // TODO: this needs to be passed in
-        Iterator<GenericValue> it = contentAssocsTypeFiltered.iterator();
-        while (it.hasNext()) {
-            contentAssoc = it.next();
+        for(GenericValue contentAssoc : contentAssocsTypeFiltered) {
             content = contentAssoc.getRelatedOneCache(assocRelationName);
             if (UtilValidate.isNotEmpty(contentTypes)) {
                 String contentTypeId = (String)content.get("contentTypeId");