From commits-return-7412-apmail-ofbiz-commits-archive=ofbiz.apache.org@ofbiz.apache.org Mon Jun 02 05:27:46 2008 Return-Path: Delivered-To: apmail-ofbiz-commits-archive@www.apache.org Received: (qmail 87692 invoked from network); 2 Jun 2008 05:27:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jun 2008 05:27:46 -0000 Received: (qmail 52868 invoked by uid 500); 2 Jun 2008 05:27:48 -0000 Delivered-To: apmail-ofbiz-commits-archive@ofbiz.apache.org Received: (qmail 52812 invoked by uid 500); 2 Jun 2008 05:27:47 -0000 Mailing-List: contact commits-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ofbiz.apache.org Delivered-To: mailing list commits@ofbiz.apache.org Received: (qmail 52720 invoked by uid 99); 2 Jun 2008 05:27:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jun 2008 22:27:47 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 05:26:55 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 754532388A7E; Sun, 1 Jun 2008 22:27:15 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r662328 [4/5] - in /ofbiz/trunk: applications/content/src/org/ofbiz/content/content/ applications/content/src/org/ofbiz/content/data/ framework/base/src/base/org/ofbiz/base/util/template/ framework/widget/src/org/ofbiz/widget/ framework/wid... Date: Mon, 02 Jun 2008 05:27:13 -0000 To: commits@ofbiz.apache.org From: jacopoc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080602052715.754532388A7E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java?rev=662328&r1=662327&r2=662328&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java Sun Jun 1 22:27:12 2008 @@ -61,7 +61,7 @@ this.response = response; } - public void appendOfbizUrl(Writer writer, String location) throws IOException { + public void appendOfbizUrl(Appendable writer, String location) throws IOException { ServletContext ctx = (ServletContext) request.getAttribute("servletContext"); if (ctx == null) { //if (Debug.infoOn()) Debug.logInfo("in appendOfbizUrl, ctx is null(0): buffer=" + buffer.toString() + " location:" + location, ""); @@ -86,10 +86,10 @@ if (s.indexOf("null") >= 0) { //if (Debug.infoOn()) Debug.logInfo("in appendOfbizUrl(3), url: " + s, ""); } - writer.write(s); + writer.append(s); } - public void appendContentUrl(Writer writer, String location) throws IOException { + public void appendContentUrl(Appendable writer, String location) throws IOException { ServletContext ctx = (ServletContext) this.request.getAttribute("servletContext"); if (ctx == null) { //if (Debug.infoOn()) Debug.logInfo("in appendContentUrl, ctx is null(0): buffer=" + buffer.toString() + " location:" + location, ""); @@ -111,28 +111,28 @@ } StringBuffer buffer = new StringBuffer(); ContentUrlTag.appendContentPrefix(this.request, buffer); - writer.write(buffer.toString()); - writer.write(location); + writer.append(buffer.toString()); + writer.append(location); } - public void appendTooltip(Writer writer, Map context, ModelMenuItem modelMenuItem) throws IOException { + public void appendTooltip(Appendable writer, Map context, ModelMenuItem modelMenuItem) throws IOException { // render the tooltip String tooltip = modelMenuItem.getTooltip(context); if (UtilValidate.isNotEmpty(tooltip)) { - writer.write(""); + writer.append("\""); + writer.append(tooltip); + writer.append(""); } } - public void renderFormatSimpleWrapperRows(Writer writer, Map context, Object menuObj) throws IOException { + public void renderFormatSimpleWrapperRows(Appendable writer, Map context, Object menuObj) throws IOException { List menuItemList = ((ModelMenu)menuObj).getMenuItemList(); Iterator menuItemIter = menuItemList.iterator(); @@ -144,7 +144,7 @@ } } - public void renderMenuItem(Writer writer, Map context, ModelMenuItem menuItem) throws IOException { + public void renderMenuItem(Appendable writer, Map context, ModelMenuItem menuItem) throws IOException { //Debug.logInfo("in renderMenuItem, menuItem:" + menuItem.getName() + " context:" + context ,""); boolean hideThisItem = isHideIfSelected(menuItem, context); @@ -165,19 +165,19 @@ style = menuItem.getDisabledTitleStyle(); } - writer.write(" "); + writer.append(">"); Link link = menuItem.getLink(); //if (Debug.infoOn()) Debug.logInfo("in HtmlMenuRendererImage, link(0):" + link,""); @@ -185,7 +185,7 @@ renderLink(writer, context, link); } - writer.write(""); + writer.append(""); appendWhitespace(writer); } @@ -215,7 +215,7 @@ return divStr; } */ - public void renderMenuOpen(Writer writer, Map context, ModelMenu modelMenu) throws IOException { + public void renderMenuOpen(Appendable writer, Map context, ModelMenu modelMenu) throws IOException { if (!userLoginIdHasChanged) { userLoginIdHasChanged = userLoginIdHasChanged(); @@ -223,30 +223,30 @@ //Debug.logInfo("in HtmlMenuRenderer, userLoginIdHasChanged:" + userLoginIdHasChanged,""); renderBeginningBoundaryComment(writer, "Menu Widget", modelMenu); - writer.write(""); + writer.append(">"); String menuTitle = modelMenu.getTitle(context); if (UtilValidate.isNotEmpty(menuTitle)) { appendWhitespace(writer); - writer.write("

" + menuTitle + "

"); + writer.append("

" + menuTitle + "

"); } appendWhitespace(writer); - writer.write("
    "); + writer.append("
      "); appendWhitespace(writer); } @@ -254,17 +254,17 @@ /* (non-Javadoc) * @see org.ofbiz.widget.menu.MenuStringRenderer#renderMenuClose(java.io.Writer, java.util.Map, org.ofbiz.widget.menu.ModelMenu) */ - public void renderMenuClose(Writer writer, Map context, ModelMenu modelMenu) throws IOException { + public void renderMenuClose(Appendable writer, Map context, ModelMenu modelMenu) throws IOException { String fillStyle = modelMenu.getFillStyle(); if (UtilValidate.isNotEmpty(fillStyle)) { - writer.write("
       
      "); + writer.append("
       
      "); } //String menuContainerStyle = modelMenu.getMenuContainerStyle(context); - writer.write("
    "); + writer.append("
"); appendWhitespace(writer); - writer.write("
"); + writer.append("
"); appendWhitespace(writer); - writer.write(""); + writer.append(""); appendWhitespace(writer); renderEndingBoundaryComment(writer, "Menu Widget", modelMenu); @@ -280,11 +280,11 @@ } } - public void renderFormatSimpleWrapperOpen(Writer writer, Map context, ModelMenu modelMenu) throws IOException { + public void renderFormatSimpleWrapperOpen(Appendable writer, Map context, ModelMenu modelMenu) throws IOException { //appendWhitespace(writer); } - public void renderFormatSimpleWrapperClose(Writer writer, Map context, ModelMenu modelMenu) throws IOException { + public void renderFormatSimpleWrapperClose(Appendable writer, Map context, ModelMenu modelMenu) throws IOException { //appendWhitespace(writer); } @@ -359,7 +359,7 @@ return title; } - public void renderLink(Writer writer, Map context, ModelMenuItem.Link link) throws IOException { + public void renderLink(Appendable writer, Map context, ModelMenuItem.Link link) throws IOException { ModelMenuItem menuItem = link.getLinkMenuItem(); String target = link.getTarget(context); if (menuItem.getDisabled()) { @@ -367,12 +367,12 @@ } if (UtilValidate.isNotEmpty(target)) { // open tag - writer.write(""); + writer.append("\">"); } // the text Image img = link.getImage(); if (img == null) - writer.write(link.getText(context)); + writer.append(link.getText(context)); else renderImage(writer, context, img); if (UtilValidate.isNotEmpty(target)) { // close tag - writer.write(""); + writer.append(""); } } - public void renderImage(Writer writer, Map context, ModelMenuItem.Image image) throws IOException { + public void renderImage(Appendable writer, Map context, ModelMenuItem.Image image) throws IOException { // open tag - writer.write(""); + writer.append("/>"); } } 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=662328&r1=662327&r2=662328&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 Sun Jun 1 22:27:12 2008 @@ -67,14 +67,14 @@ return "hsr" + elementId; } - public void renderSectionBegin(Writer writer, Map context, ModelScreenWidget.Section section) throws IOException { + public void renderSectionBegin(Appendable writer, Map context, ModelScreenWidget.Section section) throws IOException { renderBeginningBoundaryComment(writer, section.isMainSection?"Screen":"Section Widget", section); } - public void renderSectionEnd(Writer writer, Map context, ModelScreenWidget.Section section) throws IOException { + public void renderSectionEnd(Appendable writer, Map context, ModelScreenWidget.Section section) throws IOException { renderEndingBoundaryComment(writer, section.isMainSection?"Screen":"Section Widget", section); } - public void renderContainerBegin(Writer writer, Map context, ModelScreenWidget.Container container) throws IOException { + public void renderContainerBegin(Appendable writer, Map context, ModelScreenWidget.Container container) throws IOException { String containerId = container.getId(context); String autoUpdateTarget = container.getAutoUpdateTargetExdr(context); HttpServletRequest request = (HttpServletRequest) context.get("request"); @@ -86,95 +86,95 @@ ServletContext ctx = (ServletContext) request.getAttribute("servletContext"); RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_"); - writer.write(""); + writer.append(""); appendWhitespace(writer); } - writer.write(""); + writer.append(">"); appendWhitespace(writer); } - public void renderContainerEnd(Writer writer, Map context, ModelScreenWidget.Container container) throws IOException { - writer.write(""); + public void renderContainerEnd(Appendable writer, Map context, ModelScreenWidget.Container container) throws IOException { + writer.append(""); appendWhitespace(writer); } - public void renderScreenletBegin(Writer writer, Map context, boolean collapsed, ModelScreenWidget.Screenlet screenlet) throws IOException { + public void renderScreenletBegin(Appendable writer, Map context, boolean collapsed, ModelScreenWidget.Screenlet screenlet) throws IOException { HttpServletRequest request = (HttpServletRequest) context.get("request"); HttpServletResponse response = (HttpServletResponse) context.get("response"); ModelScreenWidget.Menu tabMenu = screenlet.getTabMenu(); if (tabMenu != null) { tabMenu.renderWidgetString(writer, context, this); } - writer.write("
"); + writer.append(">"); appendWhitespace(writer); String title = screenlet.getTitle(context); ModelScreenWidget.Menu navMenu = screenlet.getNavigationMenu(); ModelScreenWidget.Form navForm = screenlet.getNavigationForm(); if (UtilValidate.isNotEmpty(title) || navMenu != null || navForm != null || screenlet.collapsible()) { - writer.write("
"); + writer.append("
"); appendWhitespace(writer); - writer.write("
    "); + writer.append("
      "); appendWhitespace(writer); if (UtilValidate.isNotEmpty(title)) { - writer.write("
    • "); - writer.write(title); - writer.write("
    • "); + writer.append("
    • "); + writer.append(title); + writer.append("
    • "); appendWhitespace(writer); } if (screenlet.collapsible()) { String toolTip = null; Map uiLabelMap = (Map) context.get("uiLabelMap"); Map requestParameters = new HashMap((Map)context.get("requestParameters")); - writer.write("
    •  
    • "); + writer.append("> "); appendWhitespace(writer); } if (!collapsed) { @@ -188,20 +188,20 @@ renderScreenletPaginateMenu(writer, context, navForm); } } - writer.write("
    "); + writer.append("
"); appendWhitespace(writer); - writer.write("
"); + writer.append("
"); appendWhitespace(writer); - writer.write("
"); + writer.append("
"); appendWhitespace(writer); if (screenlet.padded()) { - writer.write("
"); + writer.append("
"); appendWhitespace(writer); } } } - protected void renderScreenletPaginateMenu(Writer writer, Map context, ModelScreenWidget.Form form) throws IOException { + protected void renderScreenletPaginateMenu(Appendable writer, Map context, ModelScreenWidget.Form form) throws IOException { HttpServletResponse response = (HttpServletResponse) context.get("response"); HttpServletRequest request = (HttpServletRequest) context.get("request"); ModelForm modelForm = form.getModelForm(context); @@ -285,69 +285,69 @@ // The current screenlet title bar navigation syling requires rendering // these links in reverse order // Last button - writer.write("
  • " + modelForm.getPaginateLastLabel(context) + ""); + writer.append(rh.makeLink(request, response, linkText)); + writer.append("\">" + modelForm.getPaginateLastLabel(context) + ""); } else { // disabled button - writer.write(" disabled\">" + modelForm.getPaginateLastLabel(context)); + writer.append(" disabled\">" + modelForm.getPaginateLastLabel(context)); } - writer.write("
  • "); + writer.append(""); appendWhitespace(writer); // Next button - writer.write("
  • " + modelForm.getPaginateNextLabel(context) + ""); + writer.append(rh.makeLink(request, response, linkText)); + writer.append("\">" + modelForm.getPaginateNextLabel(context) + ""); } else { // disabled button - writer.write(" disabled\">" + modelForm.getPaginateNextLabel(context)); + writer.append(" disabled\">" + modelForm.getPaginateNextLabel(context)); } - writer.write("
  • "); + writer.append(""); appendWhitespace(writer); if (listSize > 0) { - writer.write("
  • "); - writer.write((lowIndex + 1) + " - " + (lowIndex + actualPageSize ) + " " + ofLabel + " " + listSize); - writer.write("
  • "); + writer.append("
  • "); + writer.append((lowIndex + 1) + " - " + (lowIndex + actualPageSize ) + " " + ofLabel + " " + listSize); + writer.append("
  • "); appendWhitespace(writer); } // Previous button - writer.write("
  • 0) { - writer.write("\">" + modelForm.getPaginatePreviousLabel(context) + ""); + writer.append(rh.makeLink(request, response, linkText)); + writer.append("\">" + modelForm.getPaginatePreviousLabel(context) + ""); } else { // disabled button - writer.write(" disabled\">" + modelForm.getPaginatePreviousLabel(context)); + writer.append(" disabled\">" + modelForm.getPaginatePreviousLabel(context)); } - writer.write("
  • "); + writer.append(""); appendWhitespace(writer); // First button - writer.write("
  • 0) { - writer.write("\">" + modelForm.getPaginateFirstLabel(context) + ""); + writer.append(rh.makeLink(request, response, linkText)); + writer.append("\">" + modelForm.getPaginateFirstLabel(context) + ""); } else { - writer.write(" disabled\">" + modelForm.getPaginateFirstLabel(context)); + writer.append(" disabled\">" + modelForm.getPaginateFirstLabel(context)); } - writer.write("
  • "); + writer.append(""); appendWhitespace(writer); } - public void renderScreenletSubWidget(Writer writer, Map context, ModelScreenWidget subWidget, ModelScreenWidget.Screenlet screenlet) throws GeneralException, IOException { + public void renderScreenletSubWidget(Appendable writer, Map context, ModelScreenWidget subWidget, ModelScreenWidget.Screenlet screenlet) throws GeneralException, IOException { if (subWidget.equals(screenlet.getNavigationForm())) { HttpServletRequest request = (HttpServletRequest) context.get("request"); HttpServletResponse response = (HttpServletResponse) context.get("response"); @@ -364,12 +364,12 @@ } } - public void renderScreenletEnd(Writer writer, Map context, ModelScreenWidget.Screenlet screenlet) throws IOException { + public void renderScreenletEnd(Appendable writer, Map context, ModelScreenWidget.Screenlet screenlet) throws IOException { if (screenlet.padded()) { - writer.write("
    "); + writer.append("
    "); appendWhitespace(writer); } - writer.write("
    "); + writer.append(""); appendWhitespace(writer); } @@ -377,11 +377,11 @@ public ScreenletMenuRenderer(HttpServletRequest request, HttpServletResponse response) { super(request, response); } - public void renderMenuOpen(Writer writer, Map context, ModelMenu modelMenu) {} - public void renderMenuClose(Writer writer, Map context, ModelMenu modelMenu) {} + public void renderMenuOpen(Appendable writer, Map context, ModelMenu modelMenu) {} + public void renderMenuClose(Appendable writer, Map context, ModelMenu modelMenu) {} } - public void renderLabel(Writer writer, Map context, ModelScreenWidget.Label label) throws IOException { + public void renderLabel(Appendable writer, Map context, ModelScreenWidget.Label label) throws IOException { String labelText = label.getText(context); if (UtilValidate.isEmpty(labelText)) { // nothing to render @@ -391,63 +391,63 @@ String style = label.getStyle(context); String id = label.getId(context); if (UtilValidate.isNotEmpty(style) || UtilValidate.isNotEmpty(id) ) { - writer.write(""); + writer.append(">"); // the text - writer.write(labelText); + writer.append(labelText); // close tag - writer.write(""); + writer.append(""); } else { - writer.write(labelText); + writer.append(labelText); } appendWhitespace(writer); } - public void renderLink(Writer writer, Map context, ModelScreenWidget.Link link) throws IOException { + public void renderLink(Appendable writer, Map context, ModelScreenWidget.Link link) throws IOException { // open tag - writer.write(""); + writer.append(">"); // the text ModelScreenWidget.Image img = link.getImage(); if (img == null) - writer.write(link.getText(context)); + writer.append(link.getText(context)); else renderImage(writer, context, img); // close tag - writer.write(""); + writer.append(""); appendWhitespace(writer); } - public void renderImage(Writer writer, Map context, ModelScreenWidget.Image image) throws IOException { + public void renderImage(Appendable writer, Map context, ModelScreenWidget.Image image) throws IOException { // open tag - writer.write(""); + writer.append("/>"); appendWhitespace(writer); } - public void renderContentBegin(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException { + public void renderContentBegin(Appendable writer, Map context, ModelScreenWidget.Content content) throws IOException { String editRequest = content.getEditRequest(context); String editContainerStyle = content.getEditContainerStyle(context); String enableEditName = content.getEnableEditName(context); @@ -583,13 +583,13 @@ if (Debug.verboseOn()) Debug.logVerbose("directEditRequest:" + editRequest, module); if (UtilValidate.isNotEmpty(editRequest) && "true".equals(enableEditValue)) { - writer.write(" "); + writer.append(" "); appendWhitespace(writer); } } - public void renderContentBody(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException { + public void renderContentBody(Appendable writer, Map context, ModelScreenWidget.Content content) throws IOException { Locale locale = UtilMisc.ensureLocale(context.get("locale")); //Boolean nullThruDatesOnly = new Boolean(false); String mimeTypeId = "text/html"; @@ -639,7 +639,7 @@ renderedContent = UtilFormatOut.encodeXmlValue(renderedContent); } - writer.write(renderedContent); + writer.append(renderedContent); } } catch(GeneralException e) { @@ -653,7 +653,7 @@ } } - public void renderContentEnd(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException { + public void renderContentEnd(Appendable writer, Map context, ModelScreenWidget.Content content) throws IOException { //Debug.logInfo("renderContentEnd, context:" + context, module); String expandedContentId = content.getContentId(context); @@ -678,16 +678,16 @@ RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_"); String urlString = rh.makeLink(request, response, editRequest, false, false, false); String linkString = "" + editMode + ""; - writer.write(linkString); + writer.append(linkString); } if (UtilValidate.isNotEmpty(editContainerStyle)) { - writer.write(""); + writer.append(""); } appendWhitespace(writer); } } - public void renderContentFrame(Writer writer, Map context, ModelScreenWidget.Content content) throws IOException { + public void renderContentFrame(Appendable writer, Map context, ModelScreenWidget.Content content) throws IOException { String dataResourceId = content.getDataResourceId(context); // String urlString = "/content/control/ViewSimpleContent?dataResourceId=" + dataResourceId; @@ -707,26 +707,26 @@ RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_"); String fullUrlString = rh.makeLink(request, response, urlString, true, false, false); String linkString = "