Merge from SEAMIST3

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10731 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2008-09-04 11:09:45 +00:00
parent ae909e7413
commit a1bcf7419c
88 changed files with 2794 additions and 729 deletions

View File

@@ -24,56 +24,22 @@
*/
package org.alfresco.cmis.search;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.search.MLAnalysisMode;
import org.alfresco.repo.search.impl.querymodel.QueryOptions;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.search.QueryParameterDefinition;
/**
* The options for a CMIS query
*
* @author andyh
*/
public class CMISQueryOptions
public class CMISQueryOptions extends QueryOptions
{
public enum Connective
{
AND, OR;
}
public enum CMISQueryMode
{
STRICT;
}
private String query;
private List<StoreRef> stores = new ArrayList<StoreRef>(1);
private int maxItems = -1;
private int skipCount = 0;
private Connective defaultFTSConnective = Connective.AND;
private Connective defaultFTSFieldConnective = Connective.AND;
private CMISQueryMode queryMode = CMISQueryMode.STRICT;
private int fetchSize = 1000;
private List<Locale> locales = new ArrayList<Locale>(1);
private MLAnalysisMode mlAnalaysisMode = MLAnalysisMode.EXACT_LANGUAGE_AND_ALL;
private List<QueryParameterDefinition> queryParameterDefinitions = new ArrayList<QueryParameterDefinition>(4);
private boolean includeInTransactionData = true;
/**
* Create a CMISQueryOptions instance with the default options other than the query and store ref.
* The query will be run using the locale returned by I18NUtil.getLocale()
@@ -94,135 +60,12 @@ public class CMISQueryOptions
*/
public CMISQueryOptions(String query, StoreRef storeRef, Locale locale)
{
this.query = query;
this.stores.add(storeRef);
this.locales.add(locale);
super(query, storeRef, locale);
}
/**
* Get the query string
*
* @return the query
*/
public String getQuery()
{
return query;
}
/**
* Set the query string
*
* @param query the query to set
*/
public void setQuery(String query)
{
this.query = query;
}
/**
* Get the list of stores in which to run the query.
* Only one store is supported at the momentOnly one store is supported at the moment
*
* @return the stores
*/
public List<StoreRef> getStores()
{
return stores;
}
/**
* Set the stores against which to run the query.
* Only one store is supported at the moment.
*
* @param stores the stores to set
*/
public void setStores(List<StoreRef> stores)
{
this.stores = stores;
}
/**
* Get the max number of rows for the result set
* 0 or less is unlimited
*
* @return the maxItems
*/
public int getMaxItems()
{
return maxItems;
}
/**
* Set the max number of rows for the result set
* 0 or less is unlimited
*
* @param maxItems the maxItems to set
*/
public void setMaxItems(int maxItems)
{
this.maxItems = maxItems;
}
/**
* Get the skip count - the number of rows to skip at the start of the query.
*
* @return the skipCount
*/
public int getSkipCount()
{
return skipCount;
}
/**
* Set the skip count - the number of rows to skip at the start of the query.
*
* @param skipCount the skipCount to set
*/
public void setSkipCount(int skipCount)
{
this.skipCount = skipCount;
}
/**
* Get the default connective used when OR and AND are not specified for the FTS contains() function.
*
* @return the defaultFTSConnective
*/
public Connective getDefaultFTSConnective()
{
return defaultFTSConnective;
}
/**
* Set the default connective used when OR and AND are not specified for the FTS contains() function.
*
* @param defaultFTSConnective the defaultFTSConnective to set
*/
public void setDefaultFTSConnective(Connective defaultFTSConnective)
{
this.defaultFTSConnective = defaultFTSConnective;
}
/**
* As getDefaultFTSConnective() but for field groups
*
* @return the defaultFTSFieldConnective
*/
public Connective getDefaultFTSFieldConnective()
{
return defaultFTSFieldConnective;
}
/**
* As setDefaultFTSConnective() but for field groups
*
* @param defaultFTSFieldConnective the defaultFTSFieldConnective to set
*/
public void setDefaultFTSFieldConnective(Connective defaultFTSFieldConnective)
{
this.defaultFTSFieldConnective = defaultFTSFieldConnective;
}
/**
* Get the query mode.
*
@@ -242,110 +85,4 @@ public class CMISQueryOptions
{
this.queryMode = queryMode;
}
/**
* Get the fetch size
* 0 - no prefetch
* -1 - prefetch all
*
* @return the fetchSize
*/
public int getFetchSize()
{
return fetchSize;
}
/**
* Set the fetch size
* 0 - no prefetch
* -1 - prefetch all
*
* @param fetchSize the fetchSize to set
*/
public void setFetchSize(int fetchSize)
{
this.fetchSize = fetchSize;
}
/**
* Get the list of locales to use for the query
*
* @return the locales
*/
public List<Locale> getLocales()
{
return locales;
}
/**
* sSet the list of locales to use for the query
*
* @param locales the locales to set
*/
public void setLocales(List<Locale> locales)
{
this.locales = locales;
}
/**
* Get the mode for multi-lingual text analaysis
*
* @return the mlAnalaysisMode
*/
public MLAnalysisMode getMlAnalaysisMode()
{
return mlAnalaysisMode;
}
/**
* Set the mode for multi-lingual text analaysis
*
* @param mlAnalaysisMode the mlAnalaysisMode to set
*/
public void setMlAnalaysisMode(MLAnalysisMode mlAnalaysisMode)
{
this.mlAnalaysisMode = mlAnalaysisMode;
}
/**
* Get the query parameters
*
* @return the queryParameterDefinitions
*/
public List<QueryParameterDefinition> getQueryParameterDefinitions()
{
return queryParameterDefinitions;
}
/**
* Set the query parameters
*
* @param queryParameterDefinitions the queryParameterDefinitions to set
*/
public void setQueryParameterDefinitions(List<QueryParameterDefinition> queryParameterDefinitions)
{
this.queryParameterDefinitions = queryParameterDefinitions;
}
/**
* Does the search include any changes made in the current transaction?
*
* @return the includeInTransactionData
*/
public boolean isIncludeInTransactionData()
{
return includeInTransactionData;
}
/**
* Set to true if the search include any changes made in the current transaction.
*
* @param includeInTransactionData the includeInTransactionData to set
*/
public void setIncludeInTransactionData(boolean includeInTransactionData)
{
this.includeInTransactionData = includeInTransactionData;
}
}