Author: mrisaliti
Date: Sat Jan 29 22:24:00 2011 New Revision: 1065128 URL: http://svn.apache.org/viewvc?rev=1065128&view=rev Log: Remove some java compilation warnings of RenderContentAndSubContent/RenderContentAsText/RenderContentTransform/RenderSubContentAsText (OFBIZ-4102) Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentAsText.java Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java?rev=1065128&r1=1065127&r2=1065128&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java Sat Jan 29 22:24:00 2011 @@ -24,9 +24,6 @@ import java.util.Locale; import java.util.Map; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import javolution.util.FastMap; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; @@ -57,17 +54,17 @@ public class RenderContentAndSubContent final LocalDispatcher dispatcher = FreeMarkerWorker.getWrappedObject("dispatcher", env); final Delegator delegator = FreeMarkerWorker.getWrappedObject("delegator", env); final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env); - final HttpServletResponse response = FreeMarkerWorker.getWrappedObject("response", env); - final Map envMap = FreeMarkerWorker.createEnvironmentMap(env); - final Map templateRoot = MapStack.create(); + // final HttpServletResponse response = FreeMarkerWorker.getWrappedObject("response", env); + final Map<String, Object> envMap = FreeMarkerWorker.createEnvironmentMap(env); + final MapStack<String> templateRoot = MapStack.create(); ((MapStack)templateRoot).push(envMap); if (Debug.verboseOn()) Debug.logVerbose("in RenderContentAndSubContent, contentId(0):" + templateRoot.get("contentId"), module); FreeMarkerWorker.getSiteParameters(request, templateRoot); -// final Map savedValuesUp = FastMap.newInstance(); - //FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp); + // final Map savedValuesUp = FastMap.newInstance(); + // FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp); FreeMarkerWorker.overrideWithArgs(templateRoot, args); - final Map savedValues = FastMap.newInstance(); + // final Map<String, Object> savedValues = FastMap.newInstance(); return new Writer(out) { Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java?rev=1065128&r1=1065127&r2=1065128&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java Sat Jan 29 22:24:00 2011 @@ -33,6 +33,7 @@ import javolution.util.FastMap; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilFormatOut; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; @@ -64,13 +65,17 @@ public class RenderContentAsText impleme final Delegator delegator = FreeMarkerWorker.getWrappedObject("delegator", env); final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env); final HttpServletResponse response = FreeMarkerWorker.getWrappedObject("response", env); - final Map templateRoot = FreeMarkerWorker.createEnvironmentMap(env); - if (Debug.verboseOn()) Debug.logVerbose("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module); + final Map<String, Object> templateRoot = FreeMarkerWorker.createEnvironmentMap(env); + if (Debug.verboseOn()) { + Debug.logVerbose("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module); + } FreeMarkerWorker.getSiteParameters(request, templateRoot); - final Map savedValuesUp = FastMap.newInstance(); + final Map<String, Object> savedValuesUp = FastMap.newInstance(); FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp); FreeMarkerWorker.overrideWithArgs(templateRoot, args); - if (Debug.verboseOn()) Debug.logVerbose("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); + if (Debug.verboseOn()) { + Debug.logVerbose("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); + } // not used yet: final GenericValue userLogin = FreeMarkerWorker.getWrappedObject("userLogin", env); // not used yet: List trail = (List)templateRoot.get("globalNodeTrail"); //if (Debug.infoOn()) Debug.logInfo("in Render(0), globalNodeTrail ." + trail , module); @@ -80,7 +85,9 @@ public class RenderContentAsText impleme final String thisContentId = (String)templateRoot.get("contentId"); final String xmlEscape = (String)templateRoot.get("xmlEscape"); final boolean directAssocMode = UtilValidate.isNotEmpty(thisContentId) ? true : false; - if (Debug.verboseOn()) Debug.logVerbose("in Render(0), directAssocMode ." + directAssocMode , module); + if (Debug.verboseOn()) { + Debug.logVerbose("in Render(0), directAssocMode ." + directAssocMode , module); + } /* if (Debug.infoOn()) Debug.logInfo("in Render(0), thisSubContentId ." + thisSubContentId , module); String thisSubContentId = (String)templateRoot.get("subContentId"); @@ -122,7 +129,7 @@ public class RenderContentAsText impleme templateRoot.put("subDataResourceTypeId", subDataResourceTypeId); */ - final Map savedValues = FastMap.newInstance(); + final Map<String, Object> savedValues = FastMap.newInstance(); return new Writer(out) { @@ -137,8 +144,10 @@ public class RenderContentAsText impleme @Override public void close() throws IOException { - List globalNodeTrail = (List)templateRoot.get("globalNodeTrail"); - if (Debug.verboseOn()) Debug.logVerbose("Render close, globalNodeTrail(2a):" + ContentWorker.nodeTrailToCsv(globalNodeTrail), ""); + List<Map<String, ? extends Object>> globalNodeTrail = UtilGenerics.checkList(templateRoot.get("globalNodeTrail")); + if (Debug.verboseOn()) { + Debug.logVerbose("Render close, globalNodeTrail(2a):" + ContentWorker.nodeTrailToCsv(globalNodeTrail), ""); + } renderSubContent(); //if (Debug.verboseOn()) Debug.logVerbose("in Render(2), globalNodeTrail ." + getWrapped(env, "globalNodeTrail") , module); } @@ -157,8 +166,10 @@ public class RenderContentAsText impleme // Timestamp fromDate = UtilDateTime.nowTimestamp(); // List passedGlobalNodeTrail = (List)templateRoot.get("globalNodeTrail"); String editRequestName = (String)templateRoot.get("editRequestName"); - if (Debug.verboseOn()) Debug.logVerbose("in Render(3), editRequestName ." + editRequestName , module); - /* + if (Debug.verboseOn()) { + Debug.logVerbose("in Render(3), editRequestName ." + editRequestName , module); + } + /* GenericValue thisView = null; if (view != null) { thisView = view; @@ -177,8 +188,10 @@ public class RenderContentAsText impleme openEditWrap(out, editStyle); } - if (Debug.verboseOn()) Debug.logVerbose("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); - if (Debug.verboseOn()) Debug.logVerbose("in RenderSubContent, subContentId(2):" + templateRoot.get("subContentId"), module); + if (Debug.verboseOn()) { + Debug.logVerbose("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); + Debug.logVerbose("in RenderSubContent, subContentId(2):" + templateRoot.get("subContentId"), module); + } FreeMarkerWorker.saveContextValues(templateRoot, saveKeyNames, savedValues); //if (thisView != null) { try { @@ -211,8 +224,10 @@ public class RenderContentAsText impleme } public void closeEditWrap(Writer out, String editRequestName) throws IOException { - if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, contentId(3):" + templateRoot.get("contentId"), module); - if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, subContentId(3):" + templateRoot.get("subContentId"), module); + if (Debug.infoOn()) { + Debug.logInfo("in RenderSubContent, contentId(3):" + templateRoot.get("contentId"), module); + Debug.logInfo("in RenderSubContent, subContentId(3):" + templateRoot.get("subContentId"), module); + } String fullRequest = editRequestName; String contentId = null; contentId = (String)templateRoot.get("subContentId"); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java?rev=1065128&r1=1065127&r2=1065128&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java Sat Jan 29 22:24:00 2011 @@ -59,7 +59,7 @@ public class RenderContentTransform impl final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env); final HttpServletResponse response = FreeMarkerWorker.getWrappedObject("response", env); - final Map templateRoot = MapStack.create(FreeMarkerWorker.createEnvironmentMap(env)); + final Map<String, Object> templateRoot = MapStack.create(FreeMarkerWorker.createEnvironmentMap(env)); ((MapStack)templateRoot).push(args); final String xmlEscape = (String)templateRoot.get("xmlEscape"); final String thisContentId = (String)templateRoot.get("contentId"); @@ -129,7 +129,7 @@ public class RenderContentTransform impl } public void closeEditWrap(Writer out, String editRequestName) throws IOException { - StringBuilder sb = new StringBuilder(); + // StringBuilder sb = new StringBuilder(); String fullRequest = editRequestName; String delim = "?"; if (UtilValidate.isNotEmpty(thisContentId)) { Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentAsText.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentAsText.java?rev=1065128&r1=1065127&r2=1065128&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentAsText.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentAsText.java Sat Jan 29 22:24:00 2011 @@ -20,20 +20,18 @@ package org.ofbiz.content.webapp.ftl; import java.io.IOException; import java.io.Writer; -import java.sql.Timestamp; import java.util.List; import java.util.Locale; import java.util.Map; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import javolution.util.FastMap; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; -import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilFormatOut; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; @@ -58,19 +56,23 @@ public class RenderSubContentAsText impl public Writer getWriter(final Writer out, Map args) { final Environment env = Environment.getCurrentEnvironment(); - //final Map templateCtx = FreeMarkerWorker.getWrappedObject("context", env); - //final Map templateCtx = FastMap.newInstance(); + // final Map templateCtx = FreeMarkerWorker.getWrappedObject("context", env); + // final Map templateCtx = FastMap.newInstance(); final LocalDispatcher dispatcher = FreeMarkerWorker.getWrappedObject("dispatcher", env); final Delegator delegator = FreeMarkerWorker.getWrappedObject("delegator", env); final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env); - final HttpServletResponse response = FreeMarkerWorker.getWrappedObject("response", env); - final Map templateRoot = FreeMarkerWorker.createEnvironmentMap(env); - if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module); + // final HttpServletResponse response = FreeMarkerWorker.getWrappedObject("response", env); + final Map<String, Object> templateRoot = FreeMarkerWorker.createEnvironmentMap(env); + if (Debug.infoOn()) { + Debug.logInfo("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module); + } FreeMarkerWorker.getSiteParameters(request, templateRoot); - final Map savedValuesUp = FastMap.newInstance(); + final Map<String, Object> savedValuesUp = FastMap.newInstance(); FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp); FreeMarkerWorker.overrideWithArgs(templateRoot, args); - if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); + if (Debug.infoOn()) { + Debug.logInfo("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module); + } //final GenericValue userLogin = FreeMarkerWorker.getWrappedObject("userLogin", env); //List trail = (List)templateRoot.get("globalNodeTrail"); //if (Debug.infoOn()) Debug.logInfo("in Render(0), globalNodeTrail ." + trail , module); @@ -80,9 +82,13 @@ public class RenderSubContentAsText impl final String thisContentId = (String)templateRoot.get("contentId"); final String thisMapKey = (String)templateRoot.get("mapKey"); final String xmlEscape = (String)templateRoot.get("xmlEscape"); - if (Debug.infoOn()) Debug.logInfo("in Render(0), thisSubContentId ." + thisContentId , module); + if (Debug.infoOn()) { + Debug.logInfo("in Render(0), thisSubContentId ." + thisContentId , module); + } final boolean directAssocMode = UtilValidate.isNotEmpty(thisContentId) ? true : false; - if (Debug.infoOn()) Debug.logInfo("in Render(0), directAssocMode ." + directAssocMode , module); + if (Debug.infoOn()) { + Debug.logInfo("in Render(0), directAssocMode ." + directAssocMode , module); + } /* GenericValue val = null; try { @@ -122,7 +128,7 @@ public class RenderSubContentAsText impl templateRoot.put("subDataResourceTypeId", subDataResourceTypeId); */ - final Map savedValues = FastMap.newInstance(); + final Map<String, Object> savedValues = FastMap.newInstance(); return new Writer(out) { @@ -137,8 +143,10 @@ public class RenderSubContentAsText impl @Override public void close() throws IOException { - List globalNodeTrail = (List)templateRoot.get("globalNodeTrail"); - if (Debug.infoOn()) Debug.logInfo("Render close, globalNodeTrail(2a):" + ContentWorker.nodeTrailToCsv(globalNodeTrail), ""); + List<Map<String, ? extends Object>> globalNodeTrail = UtilGenerics.checkList(templateRoot.get("globalNodeTrail")); + if (Debug.infoOn()) { + Debug.logInfo("Render close, globalNodeTrail(2a):" + ContentWorker.nodeTrailToCsv(globalNodeTrail), ""); + } renderSubContent(); //if (Debug.infoOn()) Debug.logInfo("in Render(2), globalNodeTrail ." + getWrapped(env, "globalNodeTrail") , module); } @@ -153,8 +161,8 @@ public class RenderSubContentAsText impl locale = UtilMisc.ensureLocale(localeObject); } - //TemplateHashModel dataRoot = env.getDataModel(); - Timestamp fromDate = UtilDateTime.nowTimestamp(); + // TemplateHashModel dataRoot = env.getDataModel(); + // Timestamp fromDate = UtilDateTime.nowTimestamp(); // List passedGlobalNodeTrail = (List) templateRoot.get("globalNodeTrail"); String editRequestName = (String)templateRoot.get("editRequestName"); if (Debug.infoOn()) Debug.logInfo("in Render(3), editRequestName ." + editRequestName , module); |
Free forum by Nabble | Edit this page |