Author: woonsan
Date: Thu Dec 17 12:02:08 2009
New Revision: 891662
URL: http://svn.apache.org/viewvc?rev=891662&view=rev
Log:
JS2-1057: Fixing keywords search
Modified:
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
Modified:
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java?rev=891662&r1=891661&r2=891662&view=diff
==============================================================================
---
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
(original)
+++
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
Thu Dec 17 12:02:08 2009
@@ -85,12 +85,12 @@
@GET
@Path("/application/{path:.*}")
- public PortletApplicationBeanCollection getPortletApplication(@Context
HttpServletRequest servletRequest,
- @Context UriInfo
uriInfo,
- @PathParam("path")
List<PathSegment> pathSegments,
- @QueryParam("query")
String queryParam,
- @QueryParam("begin")
String beginIndexParam,
- @QueryParam("max")
String maxResultsParam)
+ public PortletApplicationBeanCollection getPortletApplications(@Context
HttpServletRequest servletRequest,
+ @Context
UriInfo uriInfo,
+
@PathParam("path") List<PathSegment> pathSegments,
+
@QueryParam("query") String queryParam,
+
@QueryParam("begin") String beginIndexParam,
+
@QueryParam("max") String maxResultsParam)
{
String applicationName = null;
@@ -109,7 +109,8 @@
if (!StringUtils.isBlank(queryParam))
{
- String queryText = ParsedObject.FIELDNAME_TYPE + ":\"" +
ParsedObject.OBJECT_TYPE_PORTLET_APPLICATION + "\" AND " + queryParam;
+ String queryText =
+ ParsedObject.FIELDNAME_TYPE + ":\"" +
ParsedObject.OBJECT_TYPE_PORTLET_APPLICATION + "\" AND ( " + queryParam + " )";
SearchResults searchResults = searchEngine.search(queryText);
List<ParsedObject> searchResultList = searchResults.getResults();
paBeans.setTotalSize(searchResultList.size());
@@ -162,12 +163,12 @@
@GET
@Path("/definition/{path:.*}")
- public PortletDefinitionBeanCollection getPortletDefinition(@Context
HttpServletRequest servletRequest,
- @Context UriInfo
uriInfo,
- @PathParam("path")
List<PathSegment> pathSegments,
- @QueryParam("query")
String queryParam,
- @QueryParam("begin")
String beginIndexParam,
- @QueryParam("max")
String maxResultsParam)
+ public PortletDefinitionBeanCollection getPortletDefinitions(@Context
HttpServletRequest servletRequest,
+ @Context
UriInfo uriInfo,
+
@PathParam("path") List<PathSegment> pathSegments,
+
@QueryParam("query") String queryParam,
+
@QueryParam("begin") String beginIndexParam,
+
@QueryParam("max") String maxResultsParam)
{
String applicationName = null;
String definitionName = null;
@@ -198,7 +199,7 @@
String queryText =
ParsedObject.FIELDNAME_TYPE + ":\"" +
ParsedObject.OBJECT_TYPE_PORTLET + "\" " +
"AND NOT " + ParsedObject.FIELDNAME_TYPE + ":\"" +
ParsedObject.OBJECT_TYPE_PORTLET_APPLICATION + "\" " +
- "AND " + queryParam;
+ "AND ( " + queryParam + " )";
SearchResults searchResults = searchEngine.search(queryText);
List<ParsedObject> searchResultList = searchResults.getResults();
ArrayList<PortletDefinition> searchedPortletDefinitions = new
ArrayList<PortletDefinition>();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]