svn commit: r801584 - in /ofbiz/trunk/applications/content: config/ContentUiLabels.xml webapp/content/WEB-INF/controller.xml widget/content/DataResourceScreens.xml

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

svn commit: r801584 - in /ofbiz/trunk/applications/content: config/ContentUiLabels.xml webapp/content/WEB-INF/controller.xml widget/content/DataResourceScreens.xml

jacopoc
Author: jacopoc
Date: Thu Aug  6 09:49:43 2009
New Revision: 801584

URL: http://svn.apache.org/viewvc?rev=801584&view=rev
Log:
Added download link for binary data resources.

Modified:
    ofbiz/trunk/applications/content/config/ContentUiLabels.xml
    ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
    ofbiz/trunk/applications/content/widget/content/DataResourceScreens.xml

Modified: ofbiz/trunk/applications/content/config/ContentUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/config/ContentUiLabels.xml?rev=801584&r1=801583&r2=801584&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/config/ContentUiLabels.xml (original)
+++ ofbiz/trunk/applications/content/config/ContentUiLabels.xml Thu Aug  6 09:49:43 2009
@@ -611,6 +611,9 @@
         <value xml:lang="it">Tipo documento</value>
         <value xml:lang="zh">文档类型</value>
     </property>
+    <property key="ContentDownload">
+        <value xml:lang="en">Download</value>
+    </property>
     <property key="ContentEditProductStore">
         <value xml:lang="ar">تحرير مخزن المنتوج</value>
         <value xml:lang="de">Produktladen bearbeiten</value>

Modified: ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml?rev=801584&r1=801583&r2=801584&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml Thu Aug  6 09:49:43 2009
@@ -625,6 +625,7 @@
         <security auth="true" https="true"/>
         <response name="success" type="view" value="listDataResources"/>
     </request-map>
+    <request-map uri="ViewBinaryDataResource"><security auth="true" https="true"/><response name="success" type="view" value="ViewBinaryDataResource"/></request-map>
 
     <request-map uri="EditDataResourceType">
         <security auth="true" https="true"/>
@@ -1935,6 +1936,7 @@
     <view-map name="EditCompDocContentRole" page="component://content/widget/compdoc/CompDocScreens.xml#EditCompDocContentRole" type="screen"/>
     <view-map name="ViewInstances" page="component://content/widget/compdoc/CompDocScreens.xml#ViewInstances" type="screen"/>
     <view-map name="ViewCompDocContentBinary" page="" type="simplecontent"/>
+    <view-map name="ViewBinaryDataResource" page="" type="simplecontent"/>
     <view-map name="ViewCompDocContent" page="component://content/widget/compdoc/CompDocScreens.xml#ViewCompDocContent" type="screen"/>
 
     <view-map name="ViewSimpleContent" page="" type="simplecontent"/>

Modified: ofbiz/trunk/applications/content/widget/content/DataResourceScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/content/DataResourceScreens.xml?rev=801584&r1=801583&r2=801584&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/widget/content/DataResourceScreens.xml (original)
+++ ofbiz/trunk/applications/content/widget/content/DataResourceScreens.xml Thu Aug  6 09:49:43 2009
@@ -175,6 +175,7 @@
                 <set field="tabButtonItem" value="editDataResource"/>
                 <set field="dataResourceId" from-field="parameters.dataResourceId"/>
                 <entity-one entity-name="DataResource" value-field="currentValue"/>
+                <set field="dataResource" from-field="currentValue"/>
                 <entity-condition entity-name="DataCategory" list="dataCategoryList"/>
             </actions>
             <widgets>
@@ -199,8 +200,21 @@
                                 <not><if-empty field="currentValue"/></not>
                             </condition>
                             <widgets>
-                                <label text="${uiLabelMap.ContentContentsAssociatedToDataResource}" style="h3"/>
-                                <include-form name="ListContentsAssociatedToDataResource" location="component://content/widget/content/DataResourceForms.xml"/>
+                                <include-screen name="DataResourceViewLink"/>
+                                <container style="screenlet">
+                                    <container style="screenlet-title-bar">
+                                        <container style="h3">
+                                            <label text="${uiLabelMap.ContentContentsAssociatedToDataResource}"/>
+                                        </container>
+                                    </container>
+                                    <container style="screenlet-body">
+                                        <section>
+                                            <widgets>
+                                                <include-form name="ListContentsAssociatedToDataResource" location="component://content/widget/content/DataResourceForms.xml"/>
+                                            </widgets>
+                                        </section>
+                                    </container>
+                                </container>
                             </widgets>
                         </section>
                     </decorator-section>
@@ -485,4 +499,26 @@
             </widgets>
         </section>
     </screen>
+    <screen name="DataResourceViewLink">
+        <section>
+            <condition>
+                <or>
+                    <if-compare field="dataResource.mimeTypeId" operator="equals" value="application/msword"/>
+                    <if-compare field="dataResource.mimeTypeId" operator="equals" value="application/pdf"/>
+                    <if-compare field="dataResource.mimeTypeId" operator="equals" value="application/vnd.oasis.opendocument.text"/>
+                    <if-compare field="dataResource.mimeTypeId" operator="equals" value="image/jpeg"/>
+                    <if-compare field="dataResource.mimeTypeId" operator="equals" value="image/gif"/>
+                    <if-compare field="dataResource.mimeTypeId" operator="equals" value="image/tiff"/>
+                    <if-compare field="dataResource.mimeTypeId" operator="equals" value="image/png"/>
+                </or>
+            </condition>
+            <widgets>
+                <container>
+                    <link target="ViewBinaryDataResource" text="${uiLabelMap.ContentDownload}" style="buttontext">
+                        <parameter param-name="dataResourceId"/>
+                   </link>
+                </container>
+            </widgets>
+        </section>
+    </screen>
 </screens>