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/28 09:34:39 UTC

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

Author: hansbak
Date: Mon Sep 28 07:34:39 2009
New Revision: 819467

URL: http://svn.apache.org/viewvc?rev=819467&view=rev
Log:
if the visual scheme not found use the one from general properties for the cmssite display of docbook files

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=819467&r1=819466&r2=819467&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 Mon Sep 28 07:34:39 2009
@@ -694,8 +694,15 @@
                     String docbookStyleLocation = docbookStyleSheets.get(0);
                     sourceFileLocation = new File(System.getProperty("ofbiz.home")+"/themes"+docbookStyleLocation);
                 }
-                if(sourceFileLocation != null && sourceFileLocation.exists()) {
+                if (sourceFileLocation != null && sourceFileLocation.exists()) {
                     UtilMisc.copyFile(sourceFileLocation,targetFileLocation);
+                } else {
+                    String defaultVisualThemeId = UtilProperties.getPropertyValue("general", "defaultVisualThemeId");
+                    if (defaultVisualThemeId != null) {
+                        GenericValue themeValue = delegator.findByPrimaryKeyCache("VisualThemeResource", UtilMisc.toMap("visualThemeId", defaultVisualThemeId,"resourceTypeEnumId","VT_DOCBOOKSTYLESHEET","sequenceId","01"));
+                        sourceFileLocation = new File(System.getProperty("ofbiz.home")+"/themes"+themeValue.get("resourceValue"));
+                        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();