Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java Sat Nov 7 21:35:50 2009 @@ -27,6 +27,7 @@ import javax.xml.parsers.ParserConfigurationException; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.collections.MapStack; @@ -95,7 +96,7 @@ context.put("isError", Boolean.TRUE); } - Map uiLabelMap = (Map) request.getAttribute("uiLabelMap"); + Map<String, String> uiLabelMap = UtilGenerics.cast(request.getAttribute("uiLabelMap")); if (uiLabelMap != null && uiLabelMap.size() > 0 && context.get("uiLabelMap") == null) { Debug.logInfo("Got uiLabelMap: " + uiLabelMap, module); context.put("uiLabelMap", uiLabelMap); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapper.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapper.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapper.java Sat Nov 7 21:35:50 2009 @@ -75,7 +75,7 @@ this.renderer = getMenuRenderer(); this.context = new HashMap<String, Object>(); - Map parameterMap = UtilHttp.getParameterMap(request); + Map<String, Object> parameterMap = UtilHttp.getParameterMap(request); context.put("parameters", parameterMap); HttpSession session = request.getSession(); @@ -212,7 +212,7 @@ if (menuWrapper == null) { try { - Class cls = Class.forName("org.ofbiz.widget.html." + menuWrapperClassName); + Class<?> cls = Class.forName("org.ofbiz.widget.html." + menuWrapperClassName); menuWrapper = (HtmlMenuWrapper)cls.newInstance(); menuWrapper.init(menuDefFile, menuName, request, response); } catch (InstantiationException e) { @@ -231,7 +231,7 @@ } else { menuWrapper.setRequest(request); menuWrapper.setResponse(response); - Map parameterMap = UtilHttp.getParameterMap(request); + Map<String, Object> parameterMap = UtilHttp.getParameterMap(request); menuWrapper.setParameters(parameterMap); GenericValue userLogin = (GenericValue)session.getAttribute("userLogin"); @@ -245,7 +245,7 @@ return menuWrapper; } - public void setParameters(Map paramMap) { + public void setParameters(Map<String, Object> paramMap) { context.put("parameters", paramMap); } Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapperImage.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapperImage.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapperImage.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapperImage.java Sat Nov 7 21:35:50 2009 @@ -66,10 +66,7 @@ Delegator delegator = (Delegator)request.getAttribute("delegator"); //if (Debug.infoOn()) Debug.logInfo("in init, delegator:" + delegator, module); try { - List menuItemList = modelMenu.getMenuItemList(); - Iterator iter = menuItemList.iterator(); - while (iter.hasNext()) { - ModelMenuItem menuItem = (ModelMenuItem)iter.next(); + for (ModelMenuItem menuItem : modelMenu.getMenuItemList()) { String contentId = menuItem.getAssociatedContentId(dummyMap); //if (Debug.infoOn()) Debug.logInfo("in init, contentId:" + contentId, module); GenericValue webSitePublishPoint = delegator.findByPrimaryKeyCache("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId)); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java Sat Nov 7 21:35:50 2009 @@ -277,7 +277,7 @@ if (actualPageSize >= listSize && listSize >= 0) return; // needed for the "Page" and "rows" labels - Map uiLabelMap = (Map) context.get("uiLabelMap"); + Map<String, String> uiLabelMap = UtilGenerics.cast(context.get("uiLabelMap")); String ofLabel = ""; if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", module); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java Sat Nov 7 21:35:50 2009 @@ -63,8 +63,7 @@ String entityId = null; String entryName = node.getEntryName(); if (UtilValidate.isNotEmpty(entryName)) { - Map map = (Map)context.get(entryName); - entityId = (String)map.get(pkName); + entityId = UtilGenerics.<Map<String, String>>cast(context.get(entryName)).get(pkName); } else { entityId = (String) context.get(pkName); } @@ -218,9 +217,6 @@ writer.append(" href=\""); String urlMode = link.getUrlMode(); String prefix = link.getPrefix(context); - boolean fullPath = link.getFullPath(); - boolean secure = link.getSecure(); - boolean encode = link.getEncode(); HttpServletResponse res = (HttpServletResponse) context.get("response"); HttpServletRequest req = (HttpServletRequest) context.get("request"); if (urlMode != null && urlMode.equalsIgnoreCase("intra-app")) { Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuFactory.java Sat Nov 7 21:35:50 2009 @@ -21,9 +21,8 @@ import java.io.IOException; import java.net.URL; import java.util.HashMap; -import java.util.Iterator; -import java.util.List; import java.util.Map; + import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.xml.parsers.ParserConfigurationException; @@ -35,7 +34,6 @@ import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; import org.ofbiz.service.LocalDispatcher; - import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; @@ -90,15 +88,12 @@ if (menuFileDoc != null) { // read document and construct ModelMenu for each menu element Element rootElement = menuFileDoc.getDocumentElement(); - List menuElements = UtilXml.childElementList(rootElement, "menu"); - Iterator menuElementIter = menuElements.iterator(); - while (menuElementIter.hasNext()) { - Element menuElement = (Element) menuElementIter.next(); + for (Element menuElement: UtilXml.childElementList(rootElement, "menu")){ ModelMenu modelMenu = new ModelMenu(menuElement, delegator, dispatcher); modelMenu.setMenuLocation(menuLocation); - modelMenuMap.put(modelMenu.getName(), modelMenu); + modelMenuMap.put(modelMenu.getName(), modelMenu); } - } + } return modelMenuMap; } Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java Sat Nov 7 21:35:50 2009 @@ -71,6 +71,7 @@ return FreeMarkerWorker.getArg(args, key, ctx); } + @SuppressWarnings("unchecked") public Writer getWriter(final Writer out, Map args) { Map<String, Object> checkedArgs = UtilGenerics.checkMap(args); final StringBuilder buf = new StringBuilder(); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java Sat Nov 7 21:35:50 2009 @@ -26,20 +26,13 @@ import org.ofbiz.base.util.BshUtil; import org.ofbiz.base.util.Debug; -import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericEntityException; -import org.ofbiz.entity.GenericValue; -import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.condition.EntityOperator; -import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.widget.ModelWidget; -import org.ofbiz.widget.menu.ModelMenuItem.Link; import org.w3c.dom.Element; import bsh.EvalError; Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java Sat Nov 7 21:35:50 2009 @@ -365,7 +365,7 @@ // always use an empty string by default if (fieldString == null) fieldString = ""; - Class[] paramTypes = new Class[] {String.class}; + Class<?>[] paramTypes = new Class[] {String.class}; Object[] params = new Object[] {fieldString}; Class<?> valClass; Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/IterateSectionWidget.java Sat Nov 7 21:35:50 2009 @@ -21,7 +21,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Locale; @@ -110,14 +109,14 @@ Debug.logError("No object found for listName:" + listNameExdr.toString(), module); return; } - List theList = null; + List<?> theList = null; if (obj instanceof Map) { - Set entrySet = ((Map)obj).entrySet(); + Set<Map.Entry<String, Object>> entrySet = UtilGenerics.<Map<String, Object>>cast(obj).entrySet(); Object [] a = entrySet.toArray(); theList = Arrays.asList(a); isEntrySet = true; } else if (obj instanceof List) { - theList = (List)obj; + theList = (List<?>)obj; } else { Debug.logError("Object not list or map type", module); return; @@ -126,7 +125,7 @@ int startPageNumber = this.getPaginatorNumber(context); getListLimits(context, theList); int rowCount = 0; - Iterator iter = theList.iterator(); + Iterator<?> iter = theList.iterator(); int itemIndex = -1; int iterateIndex = 0; while (iter.hasNext()) { @@ -139,8 +138,9 @@ continue; } if (isEntrySet) { - contextMs.put(entryName, ((Map)item).get("value")); - contextMs.put(keyName, ((Map)item).get("key")); + Map.Entry<String, ?> entry = UtilGenerics.cast(item); + contextMs.put(entryName, entry.getValue()); + contextMs.put(keyName, entry.getKey()); } else { contextMs.put(entryName, item); } @@ -251,14 +251,14 @@ return actualPageSize; } - public void getListLimits(Map<String, Object> context, List<?> items) { + public <X> void getListLimits(Map<String, Object> context, List<X> items) { listSize = items.size(); if (paginate) { try { - Map params = (Map)context.get("parameters"); - String viewIndexString = (String) params.get("VIEW_INDEX" + "_" + getPaginatorNumber(context)); - String viewSizeString = (String) params.get("VIEW_SIZE" + "_" + getPaginatorNumber(context)); + Map<String, String> params = UtilGenerics.cast(context.get("parameters")); + String viewIndexString = params.get("VIEW_INDEX" + "_" + getPaginatorNumber(context)); + String viewSizeString = params.get("VIEW_SIZE" + "_" + getPaginatorNumber(context)); viewIndex = Integer.parseInt(viewIndexString); viewSize = Integer.parseInt(viewSizeString); } catch (Exception e) { Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java Sat Nov 7 21:35:50 2009 @@ -736,7 +736,7 @@ if (actualPageSize >= listSize && listSize >= 0) return; // needed for the "Page" and "rows" labels - Map uiLabelMap = (Map) context.get("uiLabelMap"); + Map<String, String> uiLabelMap = UtilGenerics.cast(context.get("uiLabelMap")); String ofLabel = ""; if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", module); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenViewHandler.java Sat Nov 7 21:35:50 2009 @@ -21,7 +21,6 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; -import java.util.Map; import javax.servlet.ServletContext; import javax.servlet.ServletOutputStream; @@ -33,23 +32,13 @@ import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilJ2eeCompat; -import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.template.FreeMarkerWorker; import org.ofbiz.webapp.view.AbstractViewHandler; import org.ofbiz.webapp.view.ViewHandlerException; -import org.xml.sax.SAXException; - -import org.ofbiz.widget.menu.MenuStringRenderer; -// TODO: uncomment these lines when the renderers are implemented -//import org.ofbiz.widget.menu.MacroMenuRenderer; -//import org.ofbiz.widget.tree.MacroTreeRenderer; -import org.ofbiz.widget.tree.TreeStringRenderer; import org.ofbiz.widget.form.FormStringRenderer; import org.ofbiz.widget.form.MacroFormRenderer; -import org.ofbiz.widget.screen.ScreenStringRenderer; -import org.ofbiz.widget.screen.MacroScreenRenderer; +import org.xml.sax.SAXException; import freemarker.template.TemplateException; import freemarker.template.utility.StandardCompress; Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java Sat Nov 7 21:35:50 2009 @@ -28,6 +28,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.string.FlexibleStringExpander; @@ -351,11 +352,11 @@ setWidgetBoundaryComments(context); // wrap the whole screen rendering in a transaction, should improve performance in querying and such - Map parameters = (Map) context.get("parameters"); + Map<String, String> parameters = UtilGenerics.cast(context.get("parameters")); boolean beganTransaction = false; int transactionTimeout = -1; if (parameters != null) { - String transactionTimeoutPar = (String) parameters.get("TRANSACTION_TIMEOUT"); + String transactionTimeoutPar = parameters.get("TRANSACTION_TIMEOUT"); if (transactionTimeoutPar != null) { try { transactionTimeout = Integer.parseInt(transactionTimeoutPar); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java Sat Nov 7 21:35:50 2009 @@ -361,7 +361,7 @@ // always use an empty string by default if (fieldString == null) fieldString = ""; - Class[] paramTypes = new Class[] {String.class}; + Class<?>[] paramTypes = new Class[] {String.class}; Object[] params = new Object[] {fieldString}; Class<?> valClass; Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java Sat Nov 7 21:35:50 2009 @@ -18,52 +18,24 @@ *******************************************************************************/ package org.ofbiz.widget.screen; -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.FileReader; import java.io.IOException; -import java.io.InputStream; import java.io.Serializable; -import java.io.StringWriter; -import java.io.Writer; -import java.io.FileOutputStream; -import java.io.ByteArrayInputStream; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.io.OutputStream; -import java.nio.ByteBuffer; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParserFactory; -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.sax.SAXResult; -import javax.xml.transform.sax.SAXSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; import javolution.util.FastList; -import org.apache.fop.apps.FOUserAgent; -import org.apache.fop.apps.Fop; -import org.apache.fop.apps.FopFactory; -import org.apache.fop.apps.MimeConstants; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.StringUtil; 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.UtilValidate; import org.ofbiz.base.util.UtilXml; @@ -74,7 +46,6 @@ import org.ofbiz.entity.GenericValue; import org.ofbiz.widget.ModelWidget; import org.ofbiz.widget.WidgetWorker; -import org.ofbiz.widget.fo.FoScreenRenderer; import org.ofbiz.widget.form.FormFactory; import org.ofbiz.widget.form.FormStringRenderer; import org.ofbiz.widget.form.ModelForm; @@ -87,22 +58,8 @@ import org.ofbiz.widget.tree.ModelTree; import org.ofbiz.widget.tree.TreeFactory; import org.ofbiz.widget.tree.TreeStringRenderer; -import org.ofbiz.widget.xml.XmlFormRenderer; -import org.ofbiz.webapp.control.RequestHandler; -import org.ofbiz.webapp.control.RequestHandlerException; -import org.ofbiz.webapp.view.ApacheFopWorker; -import org.ofbiz.webapp.view.FopRenderer; import org.w3c.dom.Element; -import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; - -import org.apache.fop.apps.FOUserAgent; -import org.apache.fop.apps.Fop; -import org.apache.fop.apps.FopFactory; -import org.apache.fop.apps.FormattingResults; -import org.apache.fop.apps.MimeConstants; -import org.apache.fop.apps.PageSequenceResults; /** @@ -550,7 +507,7 @@ context = MapStack.create(context); } - ((MapStack) context).push(); + UtilGenerics.<MapStack<String>>cast(context).push(); // build the widgetpath List<String> widgetTrail = UtilGenerics.toList(context.get("_WIDGETTRAIL_")); @@ -605,7 +562,7 @@ modelScreen.renderScreenString(writer, context, screenStringRenderer); if (protectScope) { - ((MapStack) context).pop(); + UtilGenerics.<MapStack<String>>cast(context).pop(); } } @@ -846,7 +803,7 @@ if (!(context instanceof MapStack)) { context = MapStack.create(context); } - ((MapStack) context).push(); + UtilGenerics.<MapStack<String>>cast(context).push(); } // try finding the formStringRenderer by name in the context in case one was prepared and put there @@ -875,7 +832,7 @@ } if (protectScope) { - ((MapStack) context).pop(); + UtilGenerics.<MapStack<String>>cast(context).pop(); } } @@ -933,7 +890,7 @@ if (!(context instanceof MapStack)) { context = MapStack.create(context); } - ((MapStack) context).push(); + UtilGenerics.<MapStack<String>>cast(context).push(); } String name = this.getName(context); @@ -984,7 +941,7 @@ } if (protectScope) { - ((MapStack) context).pop(); + UtilGenerics.<MapStack<String>>cast(context).pop(); } } @@ -1102,7 +1059,7 @@ // This is an important step to make sure that the current contentId is in the context // as templates that contain "subcontent" elements will expect to find the master // contentId in the context as "contentId". - ((MapStack) context).push(); + UtilGenerics.<MapStack<String>>cast(context).push(); context.put("contentId", expandedContentId); if (UtilValidate.isEmpty(expandedDataResourceId)) { @@ -1225,7 +1182,7 @@ screenStringRenderer.renderContentBody(writer, context, this); screenStringRenderer.renderContentEnd(writer, context, this); } - ((MapStack) context).pop(); + UtilGenerics.<MapStack<String>>cast(context).pop(); } catch (IOException e) { String errMsg = "Error rendering content with contentId [" + getContentId(context) + "]: " + e.toString(); Debug.logError(e, errMsg, module); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java Sat Nov 7 21:35:50 2009 @@ -20,9 +20,9 @@ import java.io.IOException; import java.net.URL; -import java.util.Iterator; import java.util.List; import java.util.Map; + import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.xml.parsers.ParserConfigurationException; @@ -34,7 +34,6 @@ import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.cache.UtilCache; - import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java Sat Nov 7 21:35:50 2009 @@ -18,7 +18,12 @@ *******************************************************************************/ package org.ofbiz.widget.screen; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; @@ -26,7 +31,6 @@ import javax.xml.transform.stream.StreamSource; import org.apache.fop.apps.Fop; - import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilProperties; @@ -34,8 +38,6 @@ import org.ofbiz.webapp.view.AbstractViewHandler; import org.ofbiz.webapp.view.ApacheFopWorker; import org.ofbiz.webapp.view.ViewHandlerException; -import org.ofbiz.widget.fo.FoFormRenderer; -import org.ofbiz.widget.fo.FoScreenRenderer; import org.ofbiz.widget.form.FormStringRenderer; import org.ofbiz.widget.form.MacroFormRenderer; import org.ofbiz.widget.html.HtmlScreenRenderer; Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java Sat Nov 7 21:35:50 2009 @@ -19,7 +19,6 @@ package org.ofbiz.widget.text; import java.io.IOException; -import java.util.Iterator; import java.util.List; import java.util.Map; Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java Sat Nov 7 21:35:50 2009 @@ -383,8 +383,7 @@ String pkName = getPkName(); String id = null; if (UtilValidate.isNotEmpty(this.entryName)) { - Map map = (Map)context.get(this.entryName); - id = (String)map.get(pkName); + id = UtilGenerics.<Map<String, String>>cast(context.get(this.entryName)).get(pkName); } else { id = (String) context.get(pkName); } @@ -475,7 +474,7 @@ String countFieldName = "childBranchCount"; Object obj = null; if (UtilValidate.isNotEmpty(this.entryName)) { - Map map = (Map) context.get(this.entryName); + Map<String, Object> map = UtilGenerics.cast(context.get(this.entryName)); if (map instanceof GenericValue) { ModelEntity modelEntity = ((GenericValue) map).getModelEntity(); if (modelEntity.isField(countFieldName)) { @@ -516,8 +515,7 @@ String pkName = this.getPkName(); String id = null; if (UtilValidate.isNotEmpty(this.entryName)) { - Map map = (Map) context.get(this.entryName); - id = (String) map.get(pkName); + id = UtilGenerics.<Map<String,String>>cast(context.get(this.entryName)).get(pkName); } else { id = (String) context.get(pkName); } @@ -559,8 +557,8 @@ Iterator<? extends Map<String, ? extends Object>> dataIter = subNode.getListIterator(); if (dataIter instanceof EntityListIterator) { EntityListIterator eli = (EntityListIterator) dataIter; - Map val = null; - while ((val = (Map) eli.next()) != null) { + Map<String, Object> val = null; + while ((val = eli.next()) != null) { Object [] arr = {node, val}; this.subNodeValues.add(arr); } @@ -572,7 +570,7 @@ } } else if (dataIter != null) { while (dataIter.hasNext()) { - Map val = (Map) dataIter.next(); + Map<String, ? extends Object> val = dataIter.next(); Object [] arr = {node, val}; this.subNodeValues.add(arr); } @@ -620,7 +618,7 @@ public boolean showPeers(int currentDepth, Map<String, Object> context) { int trailSize = 0; - List trail = UtilGenerics.checkList(context.get("targetNodeTrail")); + List<?> trail = UtilGenerics.checkList(context.get("targetNodeTrail")); int openDepth = modelTree.getOpenDepth(); int postTrailOpenDepth = modelTree.getPostTrailOpenDepth(); if (trail != null) trailSize = trail.size(); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java Sat Nov 7 21:35:50 2009 @@ -265,7 +265,7 @@ // always use an empty string by default if (fieldString == null) fieldString = ""; - Class[] paramTypes = new Class[] {String.class}; + Class<?>[] paramTypes = new Class[] {String.class}; Object[] params = new Object[] {fieldString}; Class<?> valClass; Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java?rev=833770&r1=833769&r2=833770&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/TreeFactory.java Sat Nov 7 21:35:50 2009 @@ -21,9 +21,8 @@ import java.io.IOException; import java.net.URL; import java.util.HashMap; -import java.util.Iterator; -import java.util.List; import java.util.Map; + import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.xml.parsers.ParserConfigurationException; @@ -34,7 +33,6 @@ import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; import org.ofbiz.service.LocalDispatcher; - import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; |
Free forum by Nabble | Edit this page |