Modified: ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductContentWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductContentWrapper.java?rev=1777297&r1=1777296&r2=1777297&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductContentWrapper.java (original) +++ ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductContentWrapper.java Wed Jan 4 12:48:11 2017 @@ -173,7 +173,7 @@ public class ProductContentWrapper imple Map<String, Object> inContext = new HashMap<String, Object>(); inContext.put("product", product); inContext.put("productContent", productContent); - ContentWorker.renderContentAsText(dispatcher, delegator, productContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, partyId, roleTypeId, cache); + ContentWorker.renderContentAsText(dispatcher, productContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, partyId, roleTypeId, cache); return; } Modified: ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductPromoContentWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductPromoContentWrapper.java?rev=1777297&r1=1777296&r2=1777297&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductPromoContentWrapper.java (original) +++ ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductPromoContentWrapper.java Wed Jan 4 12:48:11 2017 @@ -180,7 +180,7 @@ public class ProductPromoContentWrapper Map<String, Object> inContext = new HashMap<String, Object>(); inContext.put("productPromo", productPromo); inContext.put("productPromoContent", productPromoContent); - ContentWorker.renderContentAsText(dispatcher, delegator, productPromoContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, partyId, roleTypeId, cache); + ContentWorker.renderContentAsText(dispatcher, productPromoContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, partyId, roleTypeId, cache); return; } Modified: ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java?rev=1777297&r1=1777296&r2=1777297&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java (original) +++ ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java Wed Jan 4 12:48:11 2017 @@ -258,7 +258,7 @@ public class DhlServices { inContext.put("postalCode", shipToAddress.getString("postalCode")); } try { - ContentWorker.renderContentAsText(dispatcher, delegator, templateName, outWriter, inContext, locale, "text/plain", null, null, false); + ContentWorker.renderContentAsText(dispatcher, templateName, outWriter, inContext, locale, "text/plain", null, null, false); } catch (Exception e) { Debug.logError(e, "Cannot get DHL Estimate: Failed to render DHL XML Request.", module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -753,7 +753,7 @@ public class DhlServices { inContext.put("notifyEmailAddress", recipientEmail); try { - ContentWorker.renderContentAsText(dispatcher, delegator, templateName, outWriter, inContext, locale, "text/plain", null, null, false); + ContentWorker.renderContentAsText(dispatcher, templateName, outWriter, inContext, locale, "text/plain", null, null, false); } catch (Exception e) { Debug.logError(e, "Cannot confirm DHL shipment: Failed to render DHL XML Request.", module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, Modified: ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/content/WorkEffortContentWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/content/WorkEffortContentWrapper.java?rev=1777297&r1=1777296&r2=1777297&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/content/WorkEffortContentWrapper.java (original) +++ ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/content/WorkEffortContentWrapper.java Wed Jan 4 12:48:11 2017 @@ -305,7 +305,7 @@ public class WorkEffortContentWrapper im Map<String, Object> inContext = new HashMap<String, Object>(); inContext.put("workEffort", workEffort); inContext.put("workEffortContent", workEffortContent); - ContentWorker.renderContentAsText(dispatcher, delegator, workEffortContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, null, null, false); + ContentWorker.renderContentAsText(dispatcher, workEffortContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, null, null, false); return; } @@ -341,7 +341,7 @@ public class WorkEffortContentWrapper im Map<String, Object> inContext = new HashMap<String, Object>(); inContext.put("workEffort", workEffort); inContext.put("workEffortContent", workEffortContent); - ContentWorker.renderContentAsText(dispatcher, delegator, workEffortContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, null, null, false); + ContentWorker.renderContentAsText(dispatcher, workEffortContent.getString("contentId"), outWriter, inContext, locale, mimeTypeId, null, null, false); contentList.add(outWriter.toString()); } } Modified: ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java?rev=1777297&r1=1777296&r2=1777297&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java (original) +++ ofbiz/trunk/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/WorkEffortKeywordIndex.java Wed Jan 4 12:48:11 2017 @@ -124,7 +124,7 @@ public class WorkEffortKeywordIndex { public static void addWeightedDataResourceString(GenericValue dataResource, int weight, List<String> strings, Delegator delegator, GenericValue workEffort) { Map<String, Object> workEffortCtx = UtilMisc.<String, Object>toMap("workEffort", workEffort); try { - String contentText = DataResourceWorker.renderDataResourceAsText(delegator, dataResource.getString("dataResourceId"), workEffortCtx, null, null, false); + String contentText = DataResourceWorker.renderDataResourceAsText(null, delegator, dataResource.getString("dataResourceId"), workEffortCtx, null, null, false); for (int i = 0; i < weight; i++) { strings.add(contentText); } @@ -135,7 +135,7 @@ public class WorkEffortKeywordIndex { } } public static void addWeightedKeywordSourceString(GenericValue value, String fieldName, List<String> strings) { - Delegator delegator = value.getDelegator(); + Delegator delegator = value.getDelegator(); if (value.getString(fieldName) != null) { int weight = 1; Modified: ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/content/ContentWorkerInterface.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/content/ContentWorkerInterface.java?rev=1777297&r1=1777296&r2=1777297&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/content/ContentWorkerInterface.java (original) +++ ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/content/ContentWorkerInterface.java Wed Jan 4 12:48:11 2017 @@ -40,9 +40,9 @@ public interface ContentWorkerInterface public String getMimeTypeIdExt(Delegator delegator, GenericValue view, Map<String, Object> ctx); // new rendering methods - public void renderContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException; - public String renderContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException; + public void renderContentAsTextExt(LocalDispatcher dispatcher, String contentId, Appendable out, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException; + public String renderContentAsTextExt(LocalDispatcher dispatcher, String contentId, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException; - public void renderSubContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, Appendable out, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException; - public String renderSubContentAsTextExt(LocalDispatcher dispatcher, Delegator delegator, String contentId, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException; + public void renderSubContentAsTextExt(LocalDispatcher dispatcher, String contentId, Appendable out, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException; + public String renderSubContentAsTextExt(LocalDispatcher dispatcher, String contentId, String mapKey, Map<String, Object> templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException; } Modified: ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/content/DataResourceWorkerInterface.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/content/DataResourceWorkerInterface.java?rev=1777297&r1=1777296&r2=1777297&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/content/DataResourceWorkerInterface.java (original) +++ ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/content/DataResourceWorkerInterface.java Wed Jan 4 12:48:11 2017 @@ -31,7 +31,4 @@ import org.apache.ofbiz.entity.Delegator public interface DataResourceWorkerInterface { public String renderDataResourceAsTextExt(Delegator delegator, String dataResourceId, Map<String, Object> templateContext, Locale locale, String targetMimeTypeId, boolean cache) throws GeneralException, IOException; - - public void renderDataResourceAsTextExt(Delegator delegator, String dataResourceId, Appendable out, Map<String, Object> templateContext, - Locale locale, String targetMimeTypeId, boolean cache) throws GeneralException, IOException; } Modified: ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java?rev=1777297&r1=1777296&r2=1777297&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java (original) +++ ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java Wed Jan 4 12:48:11 2017 @@ -394,7 +394,7 @@ public class MacroScreenRenderer impleme } } else if (UtilValidate.isNotEmpty(expandedContentId)) { if (WidgetContentWorker.getContentWorker() != null) { - renderedContent = WidgetContentWorker.getContentWorker().renderContentAsTextExt(dispatcher, delegator, expandedContentId, contentContext, locale, mimeTypeId, true); + renderedContent = WidgetContentWorker.getContentWorker().renderContentAsTextExt(dispatcher, expandedContentId, contentContext, locale, mimeTypeId, true); } else { Debug.logError("Not rendering content, WidgetContentWorker.contentWorker not found.", module); } @@ -409,7 +409,7 @@ public class MacroScreenRenderer impleme String editRequest = content.getEditRequest(context); if (UtilValidate.isNotEmpty(editRequest)) { if (WidgetContentWorker.getContentWorker() != null) { - WidgetContentWorker.getContentWorker().renderContentAsTextExt(dispatcher, delegator, "NOCONTENTFOUND", writer, contentContext, locale, mimeTypeId, true); + WidgetContentWorker.getContentWorker().renderContentAsTextExt(dispatcher, "NOCONTENTFOUND", writer, contentContext, locale, mimeTypeId, true); } else { Debug.logError("Not rendering content, WidgetContentWorker.contentWorker not found.", module); } @@ -512,7 +512,7 @@ public class MacroScreenRenderer impleme try { if (WidgetContentWorker.getContentWorker() != null) { - renderedContent = WidgetContentWorker.getContentWorker().renderSubContentAsTextExt(dispatcher, delegator, expandedContentId, expandedMapKey, contentContext, locale, mimeTypeId, true); + renderedContent = WidgetContentWorker.getContentWorker().renderSubContentAsTextExt(dispatcher, expandedContentId, expandedMapKey, contentContext, locale, mimeTypeId, true); //Debug.logInfo("renderedContent=" + renderedContent, module); } else { Debug.logError("Not rendering content, WidgetContentWorker.contentWorker not found.", module); @@ -521,7 +521,7 @@ public class MacroScreenRenderer impleme String editRequest = content.getEditRequest(context); if (UtilValidate.isNotEmpty(editRequest)) { if (WidgetContentWorker.getContentWorker() != null) { - WidgetContentWorker.getContentWorker().renderContentAsTextExt(dispatcher, delegator, "NOCONTENTFOUND", writer, contentContext, locale, mimeTypeId, true); + WidgetContentWorker.getContentWorker().renderContentAsTextExt(dispatcher, "NOCONTENTFOUND", writer, contentContext, locale, mimeTypeId, true); } else { Debug.logError("Not rendering content, WidgetContentWorker.contentWorker not found.", module); } Modified: ofbiz/trunk/specialpurpose/lucene/src/main/java/org/apache/ofbiz/content/search/ContentDocument.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/src/main/java/org/apache/ofbiz/content/search/ContentDocument.java?rev=1777297&r1=1777296&r2=1777297&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/lucene/src/main/java/org/apache/ofbiz/content/search/ContentDocument.java (original) +++ ofbiz/trunk/specialpurpose/lucene/src/main/java/org/apache/ofbiz/content/search/ContentDocument.java Wed Jan 4 12:48:11 2017 @@ -126,7 +126,7 @@ public class ContentDocument implements } String text; try { - text = ContentWorker.renderContentAsText(dispatcher, content.getDelegator(), contentId, null, locale, mimeTypeId, true); + text = ContentWorker.renderContentAsText(dispatcher, contentId, null, locale, mimeTypeId, true); } catch (GeneralException e) { Debug.logError(e, module); return false; Modified: ofbiz/trunk/specialpurpose/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java?rev=1777297&r1=1777296&r2=1777297&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java (original) +++ ofbiz/trunk/specialpurpose/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java Wed Jan 4 12:48:11 2017 @@ -18,6 +18,20 @@ *******************************************************************************/ package org.apache.ofbiz.content.search; +import java.io.IOException; +import java.sql.Timestamp; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.apache.lucene.document.Document; +import org.apache.lucene.document.DoublePoint; +import org.apache.lucene.document.Field; +import org.apache.lucene.document.LongPoint; +import org.apache.lucene.document.StringField; +import org.apache.lucene.document.TextField; +import org.apache.lucene.index.Term; import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.GeneralException; import org.apache.ofbiz.base.util.UtilDateTime; @@ -32,22 +46,6 @@ import org.apache.ofbiz.entity.condition import org.apache.ofbiz.entity.util.EntityQuery; import org.apache.ofbiz.entity.util.EntityUtil; import org.apache.ofbiz.entity.util.EntityUtilProperties; -import org.apache.lucene.document.Document; -//import org.apache.lucene.document.DoubleField; -import org.apache.lucene.document.DoublePoint; -import org.apache.lucene.document.Field; -//import org.apache.lucene.document.LongField; -import org.apache.lucene.document.LongPoint; -import org.apache.lucene.document.StringField; -import org.apache.lucene.document.TextField; -import org.apache.lucene.index.Term; - -import java.io.IOException; -import java.sql.Timestamp; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; public class ProductDocument implements LuceneDocument { private static final String module = ProductDocument.class.getName(); @@ -207,7 +205,7 @@ public class ProductDocument implements } try { Map<String, Object> drContext = UtilMisc.<String, Object>toMap("product", product); - String contentText = DataResourceWorker.renderDataResourceAsText(delegator, productContentAndInfo.getString("dataResourceId"), drContext, null, null, false); + String contentText = DataResourceWorker.renderDataResourceAsText(null, delegator, productContentAndInfo.getString("dataResourceId"), drContext, null, null, false); this.addTextFieldByWeight(doc, "content", contentText, null, weight, false, "fullText", delegator); } catch (IOException e1) { Debug.logError(e1, "Error getting content text to index", module); |
Free forum by Nabble | Edit this page |