svn commit: r1208974 - in /ofbiz/trunk/applications/product: config/ webapp/catalog/WEB-INF/actions/imagemanagement/ widget/catalog/

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

svn commit: r1208974 - in /ofbiz/trunk/applications/product: config/ webapp/catalog/WEB-INF/actions/imagemanagement/ widget/catalog/

hansbak-2
Author: hansbak
Date: Thu Dec  1 06:55:26 2011
New Revision: 1208974

URL: http://svn.apache.org/viewvc?rev=1208974&view=rev
Log:
add product content seq and dataresource public flag to imagemanagement

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.xml
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageGallery.groovy
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy
    ofbiz/trunk/applications/product/widget/catalog/ImageManagementForms.xml
    ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=1208974&r1=1208973&r2=1208974&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Thu Dec  1 06:55:26 2011
@@ -5919,6 +5919,10 @@
         <value xml:lang="en">Opacity</value>
         <value xml:lang="th">ความทึบแสง</value>
     </property>
+    <property key="ImageManagementPublic">
+        <value xml:lang="en">Public</value>
+        <value xml:lang="th">สาธารณะ</value>
+    </property>
     <property key="ImageManagementRecentlyApproved">
         <value xml:lang="en">Recently Approved</value>
         <value xml:lang="th">อนุมัติล่าสุด</value>

Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageGallery.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageGallery.groovy?rev=1208974&r1=1208973&r2=1208974&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageGallery.groovy (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/ImageGallery.groovy Thu Dec  1 06:55:26 2011
@@ -28,7 +28,7 @@ import org.ofbiz.entity.condition.*;
 import org.ofbiz.entity.util.*;
 
 productImageList = [];
-productContentAndInfoImageManamentList = delegator.findByAnd("ProductContentAndInfo", ["productId": productId, productContentTypeId : "IMAGE", "statusId" : "IM_APPROVED", "drIsPublic" : "Y"], ["sequenceNum"]);
+productContentAndInfoImageManamentList = delegator.findByAnd("ProductContentAndInfo", ["productId": productId, productContentTypeId : "IMAGE", "statusId" : "IM_APPROVED"], ["sequenceNum"]);
 if(productContentAndInfoImageManamentList) {
     productContentAndInfoImageManamentList.each { productContentAndInfoImageManament ->
         contentAssocThumbList = delegator.findByAnd("ContentAssoc", [contentId : productContentAndInfoImageManament.contentId, contentAssocTypeId : "IMAGE_THUMBNAIL"]);

Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy?rev=1208974&r1=1208973&r2=1208974&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy Thu Dec  1 06:55:26 2011
@@ -105,7 +105,12 @@ if (fileType) {
     }
 
     defaultFileName = "temp_" + dataResourceName;
-    BufferedImage bufImg = ImageIO.read(new File(imageManagementPath + "/" + productId + "/" + dataResourceName));
+    checkPathFile = imageManagementPath + "/" + productId + "/" + dataResourceName;
+    if (checkPathFile.equals(productContentList.get(0).drObjectInfo)) {
+        BufferedImage bufImg = ImageIO.read(new File(imageManagementPath + "/" + productId + "/" + dataResourceName));
+    } else {
+        BufferedImage bufImg = ImageIO.read(new File(productContentList.get(0).drObjectInfo)));
+    }
     ImageIO.write((RenderedImage) bufImg, "jpg", new File(imageManagementPath + "/" + productId + "/" + defaultFileName));
 
     clientFileName = dataResourceName;

Modified: ofbiz/trunk/applications/product/widget/catalog/ImageManagementForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ImageManagementForms.xml?rev=1208974&r1=1208973&r2=1208974&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ImageManagementForms.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ImageManagementForms.xml Thu Dec  1 06:55:26 2011
@@ -318,7 +318,7 @@ under the License.
         </field>
         <field name="description" use-when="${groovy: return context.statusId == 'IM_APPROVED';}" title="${uiLabelMap.ImageManagementCaption}"><text/></field>
         <field name="sequenceNum" use-when="${groovy: return context.statusId == 'IM_APPROVED';}" title="${uiLabelMap.ImageManagementSortOrder}"><text maxlength="2" size="5"/></field>
-        <field name="drIsPublic" use-when="${groovy: return context.statusId == 'IM_APPROVED';}" title="${uiLabelMap.CommonEnable}"><check/></field>
+        <field name="drIsPublic" use-when="${groovy: return context.statusId == 'IM_APPROVED';}" title="${uiLabelMap.ImageManagementPublic}"><check/></field>
         <field name="defaultImage" use-when="${groovy: return context.statusId == 'IM_APPROVED';}" title="${uiLabelMap.ImageManagementDefaultImage}" widget-style="buttontext">
             <hyperlink target="setDefaultImage" description="${uiLabelMap.ImageManagementSetDefault}">
                 <parameter param-name="productId"/>

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml?rev=1208974&r1=1208973&r2=1208974&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml Thu Dec  1 06:55:26 2011
@@ -590,6 +590,7 @@ under the License.
         <field name="useTime"><display/></field>
         <field name="useTimeUomId"><display/></field>
         <field name="useRoleTypeId"><display/></field>
+        <field name="sequenceNum"><display/></field>
         <field name="editContent" title="${uiLabelMap.ProductEditContent}" widget-style="buttontext">
             <hyperlink target="/content/control/EditContent" target-type="inter-app" description="${contentId}" also-hidden="false">
                 <parameter param-name="contentId"/>