portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r891662 - /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PortletRegistryService.java
Date Thu, 17 Dec 2009 12:02:09 GMT
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: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message