svn commit: r1859737 - in /ofbiz/ofbiz-plugins/branches/release18.12: ./ birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java

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

svn commit: r1859737 - in /ofbiz/ofbiz-plugins/branches/release18.12: ./ birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java

jleroux@apache.org
Author: jleroux
Date: Wed May 22 16:41:59 2019
New Revision: 1859737

URL: http://svn.apache.org/viewvc?rev=1859737&view=rev
Log:
"Applied fix from plugins for revision: 1859735 "
------------------------------------------------------------------------
r1859735 | jleroux | 2019-05-22 18:41:04 +0200 (mer. 22 mai 2019) | 12 lignes

Fixed: massPrintOrders service does not work
(OFBIZ-11049)

This problem was similar to what was resolved by r1806237 for OFBIZ-9138.

This fixes it by using the same solution than in r1806237. If the visual theme
is unknown in the the service  context  get the default theme from
general.properties using ThemeFactory::resolveTheme.

sendPrintFromScreen, createFileFromScreen, sendBirtMail, getXslFo and
printReportPdf (in example) were concerned

------------------------------------------------------------------------

Modified:
    ofbiz/ofbiz-plugins/branches/release18.12/   (props changed)
    ofbiz/ofbiz-plugins/branches/release18.12/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java
    ofbiz/ofbiz-plugins/branches/release18.12/example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java

Propchange: ofbiz/ofbiz-plugins/branches/release18.12/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 22 16:41:59 2019
@@ -10,4 +10,4 @@
 /ofbiz/branches/json-integration-refactoring/plugins:1634077-1635900
 /ofbiz/branches/multitenant20100310/plugins:921280-927264
 /ofbiz/branches/release13.07/plugins:1547657
-/ofbiz/ofbiz-plugins/trunk:1851002,1851009,1851068,1851135,1851139-1851140,1851185,1851316,1851885,1852988,1853904,1854684,1855082,1855084,1856212,1856802,1856917,1857120,1857173,1858141,1858244,1858265,1858285,1858289,1858312,1859012
+/ofbiz/ofbiz-plugins/trunk:1851002,1851009,1851068,1851135,1851139-1851140,1851185,1851316,1851885,1852988,1853904,1854684,1855082,1855084,1856212,1856802,1856917,1857120,1857173,1858141,1858244,1858265,1858285,1858289,1858312,1859012,1859735

Modified: ofbiz/ofbiz-plugins/branches/release18.12/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/branches/release18.12/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java?rev=1859737&r1=1859736&r2=1859737&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/branches/release18.12/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java (original)
+++ ofbiz/ofbiz-plugins/branches/release18.12/birt/src/main/java/org/apache/ofbiz/birt/email/BirtEmailServices.java Wed May 22 16:41:59 2019
@@ -46,8 +46,8 @@ import org.apache.ofbiz.common.email.Not
 import org.apache.ofbiz.entity.Delegator;
 import org.apache.ofbiz.security.Security;
 import org.apache.ofbiz.service.DispatchContext;
-import org.apache.ofbiz.service.LocalDispatcher;
 import org.apache.ofbiz.service.GenericServiceException;
+import org.apache.ofbiz.service.LocalDispatcher;
 import org.apache.ofbiz.service.ServiceUtil;
 import org.apache.ofbiz.widget.model.ThemeFactory;
 import org.apache.ofbiz.widget.renderer.ScreenRenderer;
@@ -90,6 +90,9 @@ public class BirtEmailServices {
         String birtImageDirectory = (String) serviceContext.remove(BirtWorker.getBirtImageDirectory());
         String birtContentType = (String) serviceContext.remove(BirtWorker.getBirtContentType());
         VisualTheme visualTheme = (VisualTheme) context.get("visualTheme");
+        if (visualTheme == null) {
+            visualTheme = ThemeFactory.resolveVisualTheme(null);
+        }        
         if (visualTheme == null) visualTheme = ThemeFactory.resolveVisualTheme(null);
         if (bodyParameters == null) {
             bodyParameters = MapStack.create();

Modified: ofbiz/ofbiz-plugins/branches/release18.12/example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/branches/release18.12/example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java?rev=1859737&r1=1859736&r2=1859737&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/branches/release18.12/example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java (original)
+++ ofbiz/ofbiz-plugins/branches/release18.12/example/src/main/java/org/apache/ofbiz/example/ExamplePrintServices.java Wed May 22 16:41:59 2019
@@ -69,6 +69,9 @@ public class ExamplePrintServices {
         String screenLocation = "component://example/widget/example/ExampleReportScreens.xml";
         String reportScreenName = "ExampleReport";
         VisualTheme visualTheme = (VisualTheme) context.get("visualTheme");
+        if (visualTheme == null) {
+            visualTheme = ThemeFactory.resolveVisualTheme(null);
+        }        
         if (visualTheme == null) visualTheme = ThemeFactory.resolveVisualTheme(null);
         Map<String, Object> workContext = new HashMap<String, Object>();
         workContext.putAll(context);