Author: hansbak
Date: Mon Sep 28 07:34:39 2009
New Revision: 819467
URL:
http://svn.apache.org/viewvc?rev=819467&view=revLog:
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();