You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2009/09/25 12:05:24 UTC

svn commit: r818802 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java

Author: hansbak
Date: Fri Sep 25 10:05:24 2009
New Revision: 818802

URL: http://svn.apache.org/viewvc?rev=818802&view=rev
Log:
some enhancements suggested by MR Ashish

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java?rev=818802&r1=818801&r2=818802&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java Fri Sep 25 10:05:24 2009
@@ -686,27 +686,27 @@
                 }
 
             } else if ("XSLT".equals(dataTemplateTypeId)) {
-                 File sourceFileLocation = null;
-                 File targetFileLocation = new File(System.getProperty("ofbiz.home")+"/runtime/tempfiles/docbook.css");
-                 if (templateContext.get("visualThemeId") != null){
-                     Map layoutSettings  = (Map) templateContext.get("layoutSettings");
-                     List<String> docbookStyleSheets = (List) layoutSettings.get("VT_DOCBOOKSTYLESHEET");
-                     String docbookStyleLocation = docbookStyleSheets.get(0);
-                     sourceFileLocation = new File(System.getProperty("ofbiz.home")+"/themes"+docbookStyleLocation);
-                 }
-                 if(sourceFileLocation != null && sourceFileLocation.exists()){
-                         UtilMisc.copyFile(sourceFileLocation,targetFileLocation);
-                 }
-                    // get the template data for rendering
-                    String templateLocation = DataResourceWorker.getContentFile(dataResource.getString("dataResourceTypeId"), dataResource.getString("objectInfo"), (String) templateContext.get("contextRoot")).toString();
-                    // render the XSLT template and file
-                    String outDoc = null;
-                    try {
-                        outDoc = XslTransform.renderTemplate(templateLocation, (String) templateContext.get("docFile"));
-                    } catch (TransformerException c) {
-                        Debug.logError("XSL TransformerException: " + c.getMessage(), module);
-                    }
-                    out.append(outDoc);
+                File sourceFileLocation = null;
+                File targetFileLocation = new File(System.getProperty("ofbiz.home")+"/runtime/tempfiles/docbook.css");
+                if (templateContext.get("visualThemeId") != null) {
+                    Map layoutSettings  = (Map) templateContext.get("layoutSettings");
+                    List<String> docbookStyleSheets = (List) layoutSettings.get("VT_DOCBOOKSTYLESHEET");
+                    String docbookStyleLocation = docbookStyleSheets.get(0);
+                    sourceFileLocation = new File(System.getProperty("ofbiz.home")+"/themes"+docbookStyleLocation);
+                }
+                if(sourceFileLocation != null && sourceFileLocation.exists()) {
+                    UtilMisc.copyFile(sourceFileLocation,targetFileLocation);
+                }
+                // get the template data for rendering
+                String templateLocation = DataResourceWorker.getContentFile(dataResource.getString("dataResourceTypeId"), dataResource.getString("objectInfo"), (String) templateContext.get("contextRoot")).toString();
+                // render the XSLT template and file
+                String outDoc = null;
+                try {
+                    outDoc = XslTransform.renderTemplate(templateLocation, (String) templateContext.get("docFile"));
+                } catch (TransformerException c) {
+                    Debug.logError("XSL TransformerException: " + c.getMessage(), module);
+                }
+                out.append(outDoc);
 
             // Screen Widget template
             } else if ("SCREEN_COMBINED".equals(dataTemplateTypeId)) {