cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1547756 - in /cxf/trunk/rt/rs/extensions/search/src: main/java/org/apache/cxf/jaxrs/ext/search/SearchContextImpl.java test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java
Date Wed, 04 Dec 2013 10:41:14 GMT
Author: sergeyb
Date: Wed Dec  4 10:41:14 2013
New Revision: 1547756

URL: http://svn.apache.org/r1547756
Log:
[CXF-5430] Making a parser property simpler

Modified:
    cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchContextImpl.java
    cxf/trunk/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java

Modified: cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchContextImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchContextImpl.java?rev=1547756&r1=1547755&r2=1547756&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchContextImpl.java
(original)
+++ cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/SearchContextImpl.java
Wed Dec  4 10:41:14 2013
@@ -42,6 +42,7 @@ public class SearchContextImpl implement
 
     public static final String SEARCH_QUERY = "_search";
     public static final String SHORT_SEARCH_QUERY = "_s";
+    public static final String CUSTOM_SEARCH_PARSER_PROPERTY = "search.parser";
     public static final String CUSTOM_SEARCH_QUERY_PARAM_NAME = "search.query.parameter.name";
     private static final String USE_PLAIN_QUERY_PARAMETERS = "search.use.plain.queries";
     private static final String USE_ALL_QUERY_COMPONENT = "search.use.all.query.component";
@@ -171,7 +172,7 @@ public class SearchContextImpl implement
                                                    Map<String, String> beanProperties,
                                                    Map<String, String> parserProperties)
{
         
-        Object parserProp = message.getContextualProperty(SearchConditionParser.class.getName());
+        Object parserProp = message.getContextualProperty(CUSTOM_SEARCH_PARSER_PROPERTY);
         if (parserProp != null) {
             return getCustomParser(parserProp);
         }

Modified: cxf/trunk/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java?rev=1547756&r1=1547755&r2=1547756&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java
(original)
+++ cxf/trunk/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java
Wed Dec  4 10:41:14 2013
@@ -30,7 +30,7 @@ public class SearchContextImplCustomPars
     public void testQuery() {
         Message m = new MessageImpl();
         m.put(SearchContextImpl.CUSTOM_SEARCH_QUERY_PARAM_NAME, "$customfilter");
-        m.put(SearchConditionParser.class.getName(), new CustomParser());
+        m.put(SearchContextImpl.CUSTOM_SEARCH_PARSER_PROPERTY, new CustomParser());
         m.put(Message.QUERY_STRING, "$customfilter=color is red");
         SearchCondition<Color> sc = new SearchContextImpl(m).getCondition(Color.class);
         



Mime
View raw message