ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jler...@apache.org
Subject svn commit: r490893 - in /ofbiz/trunk/applications/product: webapp/catalog/WEB-INF/controller.xml webapp/catalog/product/ProductBarCode.fo.ftl widget/catalog/CatalogCommonScreens.xml widget/catalog/ProductScreens.xml
Date Fri, 29 Dec 2006 00:51:17 GMT
Author: jleroux
Date: Thu Dec 28 16:51:16 2006
New Revision: 490893

URL: http://svn.apache.org/viewvc?view=rev&rev=490893
Log:
Printing prodcut barcode from product screens (https://issues.apache.org/jira/browse/OFBIZ-557).
An easy way to get a product barcode, useful for POS at least...

Added:
    ofbiz/trunk/applications/product/webapp/catalog/product/ProductBarCode.fo.ftl   (with
props)
Modified:
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/widget/catalog/CatalogCommonScreens.xml
    ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml

Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml?view=diff&rev=490893&r1=490892&r2=490893
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml Thu Dec 28 16:51:16
2006
@@ -431,7 +431,12 @@
         <event type="service" path="" invoke="copyToProductVariants"/>
         <response name="success" type="view" value="EditProduct"/>
         <response name="error" type="view" value="EditProduct"/>
+    </request-map>    
+    <request-map uri="ProductBarCode.pdf">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="ProductBarCode.pdf"/>
     </request-map>
+    
 
     <!-- ================ Product Asset Usage (rental) Requests ================= -->
     <request-map uri="EditProductAssetUsage">
@@ -2257,6 +2262,7 @@
     <view-map name="EditProductAssetUsage" type="screen" page="component://product/widget/catalog/ProductScreens.xml#EditProductAssetUsage"/>
     <view-map name="showFixedAssetProduct" type="screen" page="component://product/widget/catalog/ProductScreens.xml#showFixedAssetProduct"/>
     <view-map name="newFixedAssetProduct" type="screen" page="component://product/widget/catalog/ProductScreens.xml#newFixedAssetProduct"/>
+    <view-map name="ProductBarCode.pdf" type="screenfop" page="component://product/widget/catalog/ProductScreens.xml#ProductBarCode.fo"/>
   
 
     <view-map name="EditProductContent" type="screen" page="component://product/widget/catalog/ProductScreens.xml#EditProductContent"/>
     <view-map name="EditProductGoodIdentifications" type="screen" page="component://product/widget/catalog/ProductScreens.xml#EditProductGoodIdentifications"/>

Added: ofbiz/trunk/applications/product/webapp/catalog/product/ProductBarCode.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/ProductBarCode.fo.ftl?view=auto&rev=490893
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/product/ProductBarCode.fo.ftl (added)
+++ ofbiz/trunk/applications/product/webapp/catalog/product/ProductBarCode.fo.ftl Thu Dec
28 16:51:16 2006
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<#--
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations
+under the License.
+-->
+
+<#escape x as x?xml>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+    <fo:layout-master-set>
+        <fo:simple-page-master master-name="main" page-height="4in" page-width="8in"
+                               margin-top="0.5in" margin-bottom="0.25in" margin-left="0.25in"
margin-right="0.25in">
+            <fo:region-body margin-top="0in"/>
+            <fo:region-before extent="0in"/>
+            <fo:region-after extent="0in"/>
+        </fo:simple-page-master>
+    </fo:layout-master-set>
+
+    <fo:page-sequence master-reference="main">
+        <fo:flow flow-name="xsl-region-body" font-family="Helvetica">
+            <fo:block text-align="center">
+                 ${productName}
+            </fo:block>
+            <fo:block text-align="center">
+                <fo:instream-foreign-object>
+                    <barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns"
+                                     message="${productId}">
+                        <barcode:code39>
+                            <barcode:height>0.75in</barcode:height>
+                            <barcode:module-width>.375mm</barcode:module-width>
+                        </barcode:code39>
+                        <barcode:human-readable>
+                            <barcode:placement>bottom</barcode:placement>
+                            <barcode:font-name>Helvetica</barcode:font-name>
+                            <barcode:font-size>18pt</barcode:font-size>
+                            <barcode:display-start-stop>false</barcode:display-start-stop>
+                            <barcode:display-checksum>false</barcode:display-checksum>
+                        </barcode:human-readable>
+                    </barcode:barcode>
+                </fo:instream-foreign-object>
+            </fo:block>
+            <fo:block><fo:leader/></fo:block>
+        </fo:flow>
+    </fo:page-sequence>
+</fo:root>
+</#escape>

Propchange: ofbiz/trunk/applications/product/webapp/catalog/product/ProductBarCode.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/product/webapp/catalog/product/ProductBarCode.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/product/webapp/catalog/product/ProductBarCode.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/product/widget/catalog/CatalogCommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/CatalogCommonScreens.xml?view=diff&rev=490893&r1=490892&r2=490893
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/CatalogCommonScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/CatalogCommonScreens.xml Thu Dec 28 16:51:16
2006
@@ -51,8 +51,9 @@
                 <set field="leftbarScreenLocation" value="component://product/widget/catalog/CommonScreens.xml"/>
                 <set field="MainColumnStyle" value="leftonly"/>
                 
-                <set field="productId" from-field="parameters.productId"/>
+                <set field="productId" from-field="parameters.productId"/>        
       
                 <entity-one entity-name="Product" value-name="product"/>
+                <set field="productName" from-field="product.productName"/>       
        
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -78,6 +79,7 @@
                                             <link target="EditProduct" text="${uiLabelMap.ProductNewProduct}"
style="buttontext"/>
                                             <link target="CreateVirtualWithVariantsForm"
text="${uiLabelMap.ProductNewVirtualProduct}" style="buttontext"/>
                                             <link target="/ecommerce/control/product?product_id=${productId}"
url-mode="inter-app" text="${uiLabelMap.ProductProductPage}" style="buttontext"/>
+                                            <link target="ProductBarCode.pdf?productId=${productId}&amp;productName=${productName}"
url-mode="intra-app" text="${uiLabelMap.ProductBarcode}" style="buttontext"/>
                                         </container>
                                     </widgets>
                                 </section>

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?view=diff&rev=490893&r1=490892&r2=490893
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Thu Dec 28 16:51:16
2006
@@ -902,5 +902,23 @@
             </widgets>
         </section>
     </screen>
-    
+
+    <screen name="ProductBarCode.fo">
+        <section>
+            <actions>
+                <!-- base/top/specific map first, then more common map added for shared
labels -->
+                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
+
+                <set field="productId" from-field="parameters.productId"/>
+                <set field="productName" from-field="parameters.productName"/>
+            </actions>
+            <widgets>
+                <platform-specific>
+                    <html><html-template location="component://product/webapp/catalog/product/ProductBarCode.fo.ftl"/></html>
+                </platform-specific>
+            </widgets>
+        </section>
+    </screen>
+            
 </screens>



Mime
View raw message