Merged 5.2.N (5.2.1) to HEAD (5.2)

130187 gjames: Merged searchapi (5.2.1) to 5.2.N (5.2.1)
      129890 gjames: SEARCH-116: Implementing defaults


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130338 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-09-06 22:05:50 +00:00
parent a4d3b2e60c
commit b8802af7f4
6 changed files with 197 additions and 7 deletions

View File

@@ -0,0 +1,82 @@
/*-
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.api.search.model;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonProperty;
import java.util.List;
/**
* POJO class representing the search Defaults
*/
public class Default
{
private final List<String> textAttributes;
private final String defaultFTSOperator;
private final String defaultFTSFieldOperator;
private final String namespace;
private final String defaultFieldName;
@JsonCreator
public Default(@JsonProperty("textAttributes") List<String> textAttributes,
@JsonProperty("defaultFTSOperator") String defaultFTSOperator,
@JsonProperty("defaultFTSFieldOperator") String defaultFTSFieldOperator,
@JsonProperty("namespace") String namespace,
@JsonProperty("defaultFieldName") String defaultFieldName)
{
this.textAttributes = textAttributes;
this.defaultFTSOperator = defaultFTSOperator;
this.defaultFTSFieldOperator = defaultFTSFieldOperator;
this.namespace = namespace;
this.defaultFieldName = defaultFieldName;
}
public List<String> getTextAttributes()
{
return textAttributes;
}
public String getDefaultFTSOperator()
{
return defaultFTSOperator;
}
public String getDefaultFTSFieldOperator()
{
return defaultFTSFieldOperator;
}
public String getNamespace()
{
return namespace;
}
public String getDefaultFieldName()
{
return defaultFieldName;
}
}

View File

@@ -44,21 +44,24 @@ public class SearchQuery
private final List<String> include;
private final List<SortDef> sort;
private final List<Template> templates;
private final Default defaults;
public static final SearchQuery EMPTY = new SearchQuery(null, null, null, null, null);
public static final SearchQuery EMPTY = new SearchQuery(null, null, null, null, null,null);
@JsonCreator
public SearchQuery(@JsonProperty("query") Query query,
@JsonProperty("paging") Paging paging,
@JsonProperty("include") List<String> include,
@JsonProperty("sort") List<SortDef> sort,
@JsonProperty("templates") List<Template> templates)
@JsonProperty("templates") List<Template> templates,
@JsonProperty("defaults") Default defaults)
{
this.query = query;
this.paging = paging;
this.include = include;
this.sort = sort;
this.templates = templates;
this.defaults = defaults;
}
public Query getQuery()
@@ -83,4 +86,9 @@ public class SearchQuery
{
return templates;
}
public Default getDefaults()
{
return defaults;
}
}