svn commit: r522272 - in /ofbiz/trunk/applications/content: servicedef/services_output.xml src/org/ofbiz/content/output/OutputServices.java

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

svn commit: r522272 - in /ofbiz/trunk/applications/content: servicedef/services_output.xml src/org/ofbiz/content/output/OutputServices.java

jacopoc
Author: jacopoc
Date: Sun Mar 25 07:43:04 2007
New Revision: 522272

URL: http://svn.apache.org/viewvc?view=rev&rev=522272
Log:
Small change to the print screen service to allow for a different content name for the content of the printer output stream.

Modified:
    ofbiz/trunk/applications/content/servicedef/services_output.xml
    ofbiz/trunk/applications/content/src/org/ofbiz/content/output/OutputServices.java

Modified: ofbiz/trunk/applications/content/servicedef/services_output.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services_output.xml?view=diff&rev=522272&r1=522271&r2=522272
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services_output.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services_output.xml Sun Mar 25 07:43:04 2007
@@ -29,6 +29,7 @@
         <attribute name="screenLocation" type="String" mode="IN" optional="false"/>
         <attribute name="screenContext" type="Map" mode="IN" optional="true"/>
         <attribute name="contentType" type="String" mode="IN" optional="true"/>
+        <attribute name="printerContentType" type="String" mode="IN" optional="true"/>
         <attribute name="printerName" type="String" mode="IN" optional="true"/>
     </service>
 

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/output/OutputServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/output/OutputServices.java?view=diff&rev=522272&r1=522271&r2=522272
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/output/OutputServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/output/OutputServices.java Sun Mar 25 07:43:04 2007
@@ -99,6 +99,7 @@
         String screenLocation = (String) serviceContext.remove("screenLocation");
         Map screenContext = (Map) serviceContext.remove("screenContext");
         String contentType = (String) serviceContext.remove("contentType");
+        String printerContentType = (String) serviceContext.remove("printerContentType");
         String printerName = (String) serviceContext.remove("printerName");
         
         if (UtilValidate.isEmpty(screenContext)) {
@@ -108,6 +109,9 @@
         if (UtilValidate.isEmpty(contentType)) {
             contentType = "application/postscript";
         }
+        if (UtilValidate.isEmpty(printerContentType)) {
+            printerContentType = contentType;
+        }
 
         try {
             
@@ -144,7 +148,7 @@
             fopFactory.getImageFactory().clearCaches();
 
             // Print is sent
-            DocFlavor psInFormat = new DocFlavor.INPUT_STREAM(contentType);
+            DocFlavor psInFormat = new DocFlavor.INPUT_STREAM(printerContentType);
             InputStream bais = new ByteArrayInputStream(baos.toByteArray());
             
             Doc myDoc = new SimpleDoc(bais, psInFormat, null);