You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2013/10/15 16:55:04 UTC
svn commit: r1532369 - in /ofbiz/trunk/specialpurpose/lucene: servicedef/
src/org/ofbiz/content/search/ src/org/ofbiz/content/test/
webapp/content/WEB-INF/ widget/
Author: jacopoc
Date: Tue Oct 15 14:55:03 2013
New Revision: 1532369
URL: http://svn.apache.org/r1532369
Log:
Misc fixes and renamed indexTree service/event/methods to indexContentTree in order to be more descriptive on their role in the system.
Modified:
ofbiz/trunk/specialpurpose/lucene/servicedef/services.xml
ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchEvents.java
ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java
ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java
ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/test/LuceneTests.java
ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/controller.xml
ofbiz/trunk/specialpurpose/lucene/widget/LuceneForms.xml
Modified: ofbiz/trunk/specialpurpose/lucene/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/servicedef/services.xml?rev=1532369&r1=1532368&r2=1532369&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/lucene/servicedef/services.xml Tue Oct 15 14:55:03 2013
@@ -23,8 +23,8 @@ under the License.
<vendor></vendor>
<version>1.0</version>
- <service name="indexTree" auth="true" engine="java" validate="true" transaction-timeout="7200"
- location="org.ofbiz.content.search.SearchServices" invoke="indexTree">
+ <service name="indexContentTree" auth="true" engine="java" validate="true" transaction-timeout="7200"
+ location="org.ofbiz.content.search.SearchServices" invoke="indexContentTree">
<description>Index content under publish point</description>
<attribute mode="IN" name="contentId" optional="false" type="String"/>
</service>
Modified: ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchEvents.java?rev=1532369&r1=1532368&r2=1532369&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchEvents.java (original)
+++ ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchEvents.java Tue Oct 15 14:55:03 2013
@@ -41,7 +41,7 @@ public class SearchEvents {
public static final String module = SearchEvents.class.getName();
- public static String indexTree(HttpServletRequest request, HttpServletResponse response) {
+ public static String indexContentTree(HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> result;
Map<String, Object> serviceInMap = new HashMap<String, Object>();
@@ -53,9 +53,9 @@ public class SearchEvents {
String siteId = (String)paramMap.get("contentId");
serviceInMap.put("contentId", siteId);
try {
- result = dispatcher.runSync("indexTree", serviceInMap);
+ result = dispatcher.runSync("indexContentTree", serviceInMap);
} catch (GenericServiceException e) {
- String errorMsg = "Error calling the indexTree service." + e.toString();
+ String errorMsg = "Error calling the indexContentTree service." + e.toString();
Debug.logError(e, errorMsg, module);
request.setAttribute("_ERROR_MESSAGE_", errorMsg + e.toString());
return "error";
Modified: ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java?rev=1532369&r1=1532368&r2=1532369&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java (original)
+++ ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java Tue Oct 15 14:55:03 2013
@@ -45,13 +45,13 @@ public class SearchServices {
public static final String module = SearchServices.class.getName();
public static final String resource = "ContentUiLabels";
- public static Map<String, Object> indexTree(DispatchContext dctx, Map<String, ? extends Object> context) {
+ public static Map<String, Object> indexContentTree(DispatchContext dctx, Map<String, ? extends Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dctx.getDelegator();
String siteId = (String) context.get("contentId");
Locale locale = (Locale) context.get("locale");
try {
- SearchWorker.indexTree(dispatcher, delegator, siteId);
+ SearchWorker.indexContentTree(dispatcher, delegator, siteId);
} catch (Exception e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
Modified: ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java?rev=1532369&r1=1532368&r2=1532369&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java (original)
+++ ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java Tue Oct 15 14:55:03 2013
@@ -44,7 +44,7 @@ public class SearchWorker {
public static final Version LUCENE_VERSION = Version.LUCENE_45;
- public static void indexTree(LocalDispatcher dispatcher, Delegator delegator, String siteId) throws Exception {
+ public static void indexContentTree(LocalDispatcher dispatcher, Delegator delegator, String siteId) throws Exception {
GenericValue content = delegator.makeValue("Content", UtilMisc.toMap("contentId", siteId));
List<GenericValue> siteList = ContentWorker.getAssociatedContent(content, "To", UtilMisc.toList("SUBSITE", "PUBLISH_LINK", "SUB_CONTENT"), null, UtilDateTime.nowTimestamp().toString(), null);
@@ -59,7 +59,7 @@ public class SearchWorker {
contentIdList.add(subContent.getString("contentId"));
}
indexContentList(dispatcher, delegator, contentIdList);
- indexTree(dispatcher, delegator, siteContentId);
+ indexContentTree(dispatcher, delegator, siteContentId);
}
}
}
Modified: ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/test/LuceneTests.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/test/LuceneTests.java?rev=1532369&r1=1532368&r2=1532369&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/test/LuceneTests.java (original)
+++ ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/test/LuceneTests.java Tue Oct 15 14:55:03 2013
@@ -64,12 +64,7 @@ public class LuceneTests extends OFBizTe
Map<String, Object> ctx = new HashMap<String, Object>();
ctx.put("contentId", "WebStoreCONTENT");
ctx.put("userLogin", userLogin);
- Map<String, Object> resp = dispatcher.runSync("indexTree", ctx);
-
- assertEquals(7, resp.get("goodIndexCount"));
-
- List<String> badIndexList = UtilGenerics.checkList(resp.get("badIndexList"));
- assertEquals(8, badIndexList.size());
+ Map<String, Object> resp = dispatcher.runSync("indexContentTree", ctx);
}
public void testSearchTermHand() throws Exception {
Modified: ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/controller.xml?rev=1532369&r1=1532368&r2=1532369&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/lucene/webapp/content/WEB-INF/controller.xml Tue Oct 15 14:55:03 2013
@@ -31,9 +31,9 @@ under the License.
<!-- Request Mappings -->
<request-map uri="AdminSearch"><security https="true" auth="true"/><response name="success" type="view" value="AdminSearch"/></request-map>
<request-map uri="AdminIndex"><security https="true" auth="true"/><response name="success" type="view" value="AdminIndex"/></request-map>
- <request-map uri="indexTree">
+ <request-map uri="indexContentTree">
<security https="true" auth="true"/>
- <event invoke="indexTree" path="org.ofbiz.content.search.SearchEvents" type="java"/>
+ <event invoke="indexContentTree" path="org.ofbiz.content.search.SearchEvents" type="java"/>
<response name="success" type="view" value="AdminIndex"/>
<response name="error" type="view" value="AdminIndex"/>
</request-map>
Modified: ofbiz/trunk/specialpurpose/lucene/widget/LuceneForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/widget/LuceneForms.xml?rev=1532369&r1=1532368&r2=1532369&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/lucene/widget/LuceneForms.xml (original)
+++ ofbiz/trunk/specialpurpose/lucene/widget/LuceneForms.xml Tue Oct 15 14:55:03 2013
@@ -20,7 +20,7 @@ under the License.
<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
- <form name="IndexContentDocuments" target="indexTree" title="" type="single" header-row-style="header-row" default-table-style="basic-table">
+ <form name="IndexContentDocuments" target="indexContentTree" title="" type="single" header-row-style="header-row" default-table-style="basic-table">
<field name="submitButton" title="${uiLabelMap.ContentIndexAll}" widget-style="smallSubmit" position="1"><submit button-type="button"/></field>
<field name="contentId" position="2"><text size="50" default-value="WebStoreCONTENT"/></field>
</form>