Package org.alfresco.rest.v0
Class SearchAPI
java.lang.Object
org.alfresco.rest.core.v0.BaseAPI
org.alfresco.rest.v0.SearchAPI
Helper methods for performing search using various Alfresco search APIs.
- Since:
- 2.5
- Author:
- Kristijan Conkas
-
Nested Class Summary
Nested classes/interfaces inherited from class org.alfresco.rest.core.v0.BaseAPI
BaseAPI.PermissionType, BaseAPI.RETENTION_SCHEDULE, BaseAPI.RM_ACTIONS, BaseAPI.RMProperty -
Field Summary
Fields inherited from class org.alfresco.rest.core.v0.BaseAPI
ACTIONS_API, contentService, LOGGER, NODE_PREFIX, NODE_REF_WORKSPACE_SPACES_STORE, RM_ACTIONS_API, RM_SITE_ID, SHARE_ACTION_API, UPDATE_METADATA_API -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.json.JSONObjectfacetedSearch(String username, String password, List<org.apache.http.NameValuePair> parameters) Generic faceted search.org.json.JSONObjectfacetedSearchForTerm(String searchUser, String searchPassword, String searchTerm) Execute faceted search for term.org.json.JSONObjectliveSearchForDocuments(String searchUser, String searchPassword, String searchTerm) Execute share live search for documents.liveSearchForDocumentsAsUser(String username, String password, String term) Helper method to search for documents as a user using share live search.org.json.JSONObjectrmSearch(String username, String password, String site, String query, String filters, String sortby) Generic rm search.searchForDocumentsAsUser(String username, String password, String term) Helper method to search for documents as a user using faceted search.searchForNodeNamesAsUser(String username, String password, String query, String sortby, boolean includeCategories, boolean includeFolders) Search as a user for nodes on site "rm" matching query, using SearchAPI.RM_DEFAULT_RECORD_FILTERS and sorted by sortbysearchForNodePropertyAsUser(String username, String password, String nodeRef, String propertyName, String query, String sortby, boolean includeCategories, boolean includeFolders) Search as a user for nodes on site "rm" matching query, using SearchAPI.RM_DEFAULT_RECORD_FILTERS and sorted by sortby and returns the property value for the given nodeRef and property nameMethods inherited from class org.alfresco.rest.core.v0.BaseAPI
addPropertyToRequest, deleteItem, doDeleteRequest, doGetRequest, doPostJsonRequest, doPostRequest, doPutJsonRequest, doPutRequest, doSlingshotPostJsonRequest, facetedRequest, getFilePlanPath, getItemNodeRef, getNodeRefSpacesStore, getObjectByPath, getPropertyValue, getPropertyValue, getPropertyValues, getPropertyValuesByUniquePropertyValue
-
Constructor Details
-
SearchAPI
public SearchAPI()
-
-
Method Details
-
rmSearch
public org.json.JSONObject rmSearch(String username, String password, String site, String query, String filters, String sortby) Generic rm search.- Parameters:
username-password-site-query-filters-sortby-- Returns:
- search results (see API reference for more details), null for any errors
-
searchForNodeNamesAsUser
public List<String> searchForNodeNamesAsUser(String username, String password, String query, String sortby, boolean includeCategories, boolean includeFolders) Search as a user for nodes on site "rm" matching query, using SearchAPI.RM_DEFAULT_RECORD_FILTERS and sorted by sortby- Parameters:
username-password-query-sortby-- Returns:
- list of node names
-
searchForNodePropertyAsUser
public String searchForNodePropertyAsUser(String username, String password, String nodeRef, String propertyName, String query, String sortby, boolean includeCategories, boolean includeFolders) Search as a user for nodes on site "rm" matching query, using SearchAPI.RM_DEFAULT_RECORD_FILTERS and sorted by sortby and returns the property value for the given nodeRef and property name- Parameters:
username-password-query-sortby-includeCategories-includeFolders-- Returns:
- list of node properties
-
facetedSearch
public org.json.JSONObject facetedSearch(String username, String password, List<org.apache.http.NameValuePair> parameters) Generic faceted search.- Parameters:
username-password-parameters-- Returns:
- search results (see API reference for more details), null for any errors
-
liveSearchForDocuments
public org.json.JSONObject liveSearchForDocuments(String searchUser, String searchPassword, String searchTerm) Execute share live search for documents.- Parameters:
searchUser-searchPassword-searchTerm-- Returns:
- search results (see API reference for more details)
-
facetedSearchForTerm
public org.json.JSONObject facetedSearchForTerm(String searchUser, String searchPassword, String searchTerm) Execute faceted search for term.- Parameters:
searchUser-searchPassword-searchTerm-- Returns:
- search results (see API reference for more details)
-
searchForDocumentsAsUser
Helper method to search for documents as a user using faceted search.- Parameters:
username- to search aspassword- for usernameterm- search term- Returns:
- list of document names found
-
liveSearchForDocumentsAsUser
public List<String> liveSearchForDocumentsAsUser(String username, String password, String term) throws org.json.JSONException Helper method to search for documents as a user using share live search.- Parameters:
username- to search aspassword- for usernameterm- search term- Returns:
- list of document names found
- Throws:
org.json.JSONException
-