svn commit: r754536 - in /ofbiz/trunk: applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java specialpurpose/ecommerce/data/DemoSurvey.xml

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

svn commit: r754536 - in /ofbiz/trunk: applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java specialpurpose/ecommerce/data/DemoSurvey.xml

jonesde
Author: jonesde
Date: Sat Mar 14 21:53:00 2009
New Revision: 754536

URL: http://svn.apache.org/viewvc?rev=754536&view=rev
Log:
Changed SurveyWrapper to support rendering from a flexible location, ie component://, and changed DemoSurvey data to use component://; fixes issue with ecommerce now that it is in specialpurpose instead of applications

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java
    ofbiz/trunk/specialpurpose/ecommerce/data/DemoSurvey.xml

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java?rev=754536&r1=754535&r2=754536&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java Sat Mar 14 21:53:00 2009
@@ -23,6 +23,7 @@
 import java.io.InputStreamReader;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Iterator;
 import java.util.List;
@@ -32,10 +33,10 @@
 import javolution.util.FastMap;
 import javolution.util.FastSet;
 
+import org.ofbiz.base.location.FlexibleLocation;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilURL;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.template.FreeMarkerWorker;
 import org.ofbiz.entity.GenericDelegator;
@@ -143,7 +144,12 @@
      * @throws SurveyWrapperException
      */
     public Writer render(String templatePath) throws SurveyWrapperException {
-        URL templateUrl = UtilURL.fromResource(templatePath);
+        URL templateUrl = null;
+        try {
+            templateUrl = FlexibleLocation.resolveLocation(templatePath);
+        } catch (MalformedURLException e) {
+            throw new SurveyWrapperException(e);
+        }
         if (templateUrl == null) {
             String errMsg = "Problem getting the template for Survey from URL: " + templatePath;
             Debug.logError(errMsg, module);

Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoSurvey.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoSurvey.xml?rev=754536&r1=754535&r2=754536&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoSurvey.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoSurvey.xml Sat Mar 14 21:53:00 2009
@@ -107,6 +107,6 @@
     <ProductStoreSurveyAppl productStoreSurveyId="1000" productStoreId="9000" surveyApplTypeId="CART_ADD" surveyId="1000" productCategoryId="GC-101" fromDate="2003-11-24 16:00:02.467" surveyTemplate="/applications/content/template/survey/genericsurvey.ftl"/>
     <ProductStoreSurveyAppl productStoreSurveyId="1001" productStoreId="9000" surveyApplTypeId="CART_ADD" surveyId="1001" productCategoryId="GC-102" fromDate="2003-11-24 16:00:51.693" surveyTemplate="/applications/content/template/survey/genericsurvey.ftl"/>
     <ProductStoreSurveyAppl productStoreSurveyId="1002" productStoreId="9000" surveyApplTypeId="CUSTOMER_PROFILE" surveyId="1002" fromDate="2003-12-05 19:22:40.925" surveyTemplate="/applications/content/template/survey/genericsurvey.ftl" resultTemplate="/applications/ecommerce/templates/survey/genericresult.ftl" sequenceNum="1"/>
-    <ProductStoreSurveyAppl productStoreSurveyId="1003" productStoreId="9000" surveyApplTypeId="RANDOM_POLL" groupName="testSurveyGroup" surveyId="1003" fromDate="2003-12-05 19:22:40.925" surveyTemplate="/applications/ecommerce/templates/survey/minisurvey.ftl" resultTemplate="/applications/ecommerce/templates/survey/miniresult.ftl" sequenceNum="1"/>
-    <ProductStoreSurveyAppl productStoreSurveyId="1004" productStoreId="9000" surveyApplTypeId="RANDOM_POLL" groupName="testSurveyGroup" surveyId="1004" fromDate="2003-12-05 19:22:40.925" surveyTemplate="/applications/ecommerce/templates/survey/minisurvey.ftl" resultTemplate="/applications/ecommerce/templates/survey/miniresult.ftl" sequenceNum="1"/>
+    <ProductStoreSurveyAppl productStoreSurveyId="1003" productStoreId="9000" surveyApplTypeId="RANDOM_POLL" groupName="testSurveyGroup" surveyId="1003" fromDate="2003-12-05 19:22:40.925" surveyTemplate="component://ecommerce/templates/survey/minisurvey.ftl" resultTemplate="component://ecommerce/templates/survey/miniresult.ftl" sequenceNum="1"/>
+    <ProductStoreSurveyAppl productStoreSurveyId="1004" productStoreId="9000" surveyApplTypeId="RANDOM_POLL" groupName="testSurveyGroup" surveyId="1004" fromDate="2003-12-05 19:22:40.925" surveyTemplate="component://ecommerce/templates/survey/minisurvey.ftl" resultTemplate="component://ecommerce/templates/survey/miniresult.ftl" sequenceNum="1"/>
 </entity-engine-xml>