Author: jonesde
Date: Mon Feb 9 11:58:47 2009 New Revision: 742413 URL: http://svn.apache.org/viewvc?rev=742413&view=rev Log: Changed ContentWrapper classes to use the new StringWrapper class; some cleanups required like not trying to Base64 and URLEncoder encode the strings coming out of it, instead change those back to a String so that the general html encoder will get them Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWrapper.java ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy ofbiz/trunk/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigItemContentWrapper.java ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/content/WorkEffortContentWrapper.java Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWrapper.java?rev=742413&r1=742412&r2=742413&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWrapper.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWrapper.java Mon Feb 9 11:58:47 2009 @@ -18,12 +18,14 @@ *******************************************************************************/ package org.ofbiz.content.content; +import org.ofbiz.base.util.StringUtil; + /** * ContentWrapper Interface */ public interface ContentWrapper { - public String get(String contentTypeId); + public StringUtil.StringWrapper get(String contentTypeId); } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy?rev=742413&r1=742412&r2=742413&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy Mon Feb 9 11:58:47 2009 @@ -114,8 +114,7 @@ mainDetailImage = productContentWrapper.get("DETAIL_IMAGE_URL"); if (mainDetailImage) { mainDetailImageUrl = ContentUrlTag.getContentPrefix(request) + mainDetailImage; - mainDetailImageUrl = URLEncoder.encode(Base64.base64Encode(mainDetailImage), "UTF-8"); - context.mainDetailImageUrl = mainDetailImageUrl; + context.mainDetailImageUrl = mainDetailImageUrl.toString(); } // get next/previous information for category @@ -307,9 +306,7 @@ // append the content prefix if (detailImage) { - detailImageUrl = ContentUrlTag.getContentPrefix(request) + detailImage; - // base64 encode the image url for a little protection - detailImageUrl = URLEncoder.encode(Base64.base64Encode(detailImageUrl), "UTF-8"); + detailImageUrl = (ContentUrlTag.getContentPrefix(request) + detailImage).toString(); } if (largeImage) { largeImageUrl = ContentUrlTag.getContentPrefix(request) + largeImage; Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java?rev=742413&r1=742412&r2=742413&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java Mon Feb 9 11:58:47 2009 @@ -73,8 +73,8 @@ return getPartyContentAsText(party, contentTypeId, locale, mimeTypeId, party.getDelegator(), dispatcher, useCache); } - public String get(String contentTypeId) { - return get(contentTypeId, true); + public StringUtil.StringWrapper get(String contentTypeId) { + return StringUtil.makeStringWrapper(get(contentTypeId, true)); } public String getId(String contentTypeId) { Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java?rev=742413&r1=742412&r2=742413&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java Mon Feb 9 11:58:47 2009 @@ -31,6 +31,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; @@ -74,8 +75,8 @@ this.mimeTypeId = "text/html"; } - public String get(String prodCatContentTypeId) { - return getProductCategoryContentAsText(productCategory, prodCatContentTypeId, locale, mimeTypeId, productCategory.getDelegator(), dispatcher); + public StringUtil.StringWrapper get(String prodCatContentTypeId) { + return StringUtil.makeStringWrapper(getProductCategoryContentAsText(productCategory, prodCatContentTypeId, locale, mimeTypeId, productCategory.getDelegator(), dispatcher)); } public static String getProductCategoryContentAsText(GenericValue productCategory, String prodCatContentTypeId, HttpServletRequest request) { Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigItemContentWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigItemContentWrapper.java?rev=742413&r1=742412&r2=742413&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigItemContentWrapper.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/config/ProductConfigItemContentWrapper.java Mon Feb 9 11:58:47 2009 @@ -45,6 +45,7 @@ /** * Product Config Item Content Worker: gets product content to display */ +@SuppressWarnings("serial") public class ProductConfigItemContentWrapper implements java.io.Serializable { public static final String module = ProductConfigItemContentWrapper.class.getName(); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java?rev=742413&r1=742412&r2=742413&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java Mon Feb 9 11:58:47 2009 @@ -31,6 +31,7 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; @@ -78,12 +79,12 @@ this.mimeTypeId = "text/html"; } - public String get(String productContentTypeId) { + public StringUtil.StringWrapper get(String productContentTypeId) { if (this.product == null) { Debug.logWarning("Tried to get ProductContent for type [" + productContentTypeId + "] but the product field in the ProductContentWrapper is null", module); return null; } - return getProductContentAsText(this.product, productContentTypeId, locale, mimeTypeId, this.product.getDelegator(), dispatcher); + return StringUtil.makeStringWrapper(getProductContentAsText(this.product, productContentTypeId, locale, mimeTypeId, this.product.getDelegator(), dispatcher)); } public static String getProductContentAsText(GenericValue product, String productContentTypeId, HttpServletRequest request) { Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/content/WorkEffortContentWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/content/WorkEffortContentWrapper.java?rev=742413&r1=742412&r2=742413&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/content/WorkEffortContentWrapper.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/content/WorkEffortContentWrapper.java Mon Feb 9 11:58:47 2009 @@ -32,6 +32,7 @@ import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.entity.model.ModelUtil; import org.ofbiz.entity.model.ModelEntity; +import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilValidate; @@ -81,8 +82,8 @@ * @param contentTypeId Type of content to return * @return String containing the content data */ - public String get(String contentTypeId) { - return get(contentTypeId, true); + public StringUtil.StringWrapper get(String contentTypeId) { + return StringUtil.makeStringWrapper(get(contentTypeId, true)); } /** |
Free forum by Nabble | Edit this page |