Skip navigation links


com.fatwire.services
Interface SearchService

All Superinterfaces:
Service

public interface SearchService
extends Service

This service provides methods to perform search, create search query based "Smart Lists" and manage book-marked assets.

The service exposes methods to verify if search is enabled for an asset type. If it is enabled, what are the attributes on which it is enabled, i.e., which are the attributes based on which a search may be performed for a specified asset type.


Method Summary
 int addBookmarks(java.util.List<AssetId> assets)
          Bookmarks the specified assets.
 boolean deleteSmartList(long smartListId)
          Deletes a smart list.
 java.util.List<BookmarkBean> getBookmarks()
          Returns the list of bookmarks for the logged in user in the logged in site.
 java.util.List<AttributeDef> getSearchEnabledAttributes(java.lang.String type, java.lang.String subType)
          Returns a list of AttributeDef objects for the attributes on which search has been enabled.
 SmartList getSmartList(long smartListId)
          Returns the smart list with the specified id.
 java.util.List<SmartList> getSmartLists()
          Returns all smart lists for the logged in user in the logged in site.
 boolean isSearchEnabled(java.lang.String assetType)
          Returns true if search is enabled for the specified asset type.
 boolean removeBookmarks(java.util.List<AssetId> bookmarks)
          Removes the bookmark for the specified assets, if any.
 boolean saveSmartList(SmartList smartList, MessageCollectors.SmartListMessageCollector collector)
          Saves the specified smart list.
 java.util.List<ResultRow> search(long siteId, java.lang.String phrase, java.lang.String phraseOperation, java.util.List<TypeBean> assetTypes, java.lang.String searchfield, int maxResults, java.util.List<SortOrder> sortby)
          Returns search results for the specified search parameters.
 java.util.List<ResultRow> search(SearchCriteria searchCriteria, int maxResults, java.util.List<SortOrder> sortby)
          Returns search results for the specified search criteria.

 

Methods inherited from interface com.fatwire.services.Service
getManager, getResponse, setManager

 

Method Detail

isSearchEnabled

boolean isSearchEnabled(java.lang.String assetType)
                        throws ServiceException
Returns true if search is enabled for the specified asset type.
Parameters:
assetType - the asset type on which to check if search has been enabled.
Returns:
true if search is enabled on the asset type, false otherwise.
Throws:
ServiceException - wraps any exception underlying the service call.

getSearchEnabledAttributes

java.util.List<AttributeDef> getSearchEnabledAttributes(java.lang.String type,
                                                        java.lang.String subType)
                                                        throws ServiceException
Returns a list of AttributeDef objects for the attributes on which search has been enabled. If there are no attributes on which search is enabled, this method returns an empty list. This method assumes that search index has been enabled on the specified asset type. If search is not enabled on the specified asset type, the method returns an empty list.
Parameters:
type - the asset type to which the attributes belong.
subType - the sub-type (for asset maker assets) or definition (for Flex assets).
Returns:
list of AttributeDef instances for which search is enabled.
Throws:
ServiceException - wraps any exception underlying the service call.

search

java.util.List<ResultRow> search(long siteId,
                                 java.lang.String phrase,
                                 java.lang.String phraseOperation,
                                 java.util.List<TypeBean> assetTypes,
                                 java.lang.String searchfield,
                                 int maxResults,
                                 java.util.List<SortOrder> sortby)
                                 throws ServiceException
Returns search results for the specified search parameters.
Parameters:
siteId - the site on which to perform the search. Only assets available in this site will be returned.
phrase - search phrase.
phraseOperation - operation for the search to be performed on the phrase, e.g. CONTAINS, defaults to Operation.CONTAINS.
assetTypes - the type and sub-type of assets to search. If exactly one type sub-type combination is specified, this method uses the search index for that asset type. If the search index is not enabled, the method throws a ServiceException.
searchfield - the field to search for. If the field is not specified, the method uses the default search field configured for the index.
maxResults - maximum search results to be returned.
sortby - sort orders for sorting the results.
Returns:
search results.
Throws:
ServiceException - wraps any exception underlying the service call.
See Also:
Operation, SortOrder

search

java.util.List<ResultRow> search(SearchCriteria searchCriteria,
                                 int maxResults,
                                 java.util.List<SortOrder> sortby)
                                 throws ServiceException
Returns search results for the specified search criteria. Uses the Operation.CONTAINS operation for phrases in the search criteria. This method will use the asset type based search index if it is enabled for the asset type specified in the search criteria. Otherwise, it will use the Global Index. The default search field for the search index will be used for search.
Parameters:
searchCriteria - search criteria which can provide for search parameters like: the site on which to perform the search, search phrase, the type and sub-type of the assets to search,
maxResults - maximum search results to be returned.
sortby - sort orders for sorting the results.
Returns:
search results.
Throws:
ServiceException - wraps any exception underlying the service call.
See Also:
SearchCriteria, SortOrder

getSmartLists

java.util.List<SmartList> getSmartLists()
                                        throws ServiceException
Returns all smart lists for the logged in user in the logged in site.
Returns:
list of all smart lists.
Throws:
ServiceException - wraps any exception underlying the service call.

getSmartList

SmartList getSmartList(long smartListId)
                       throws ServiceException
Returns the smart list with the specified id.
Parameters:
smartListId - the id of the smart list to load.
Returns:
the smart list
Throws:
ServiceException - wraps any exception underlying the service call.

saveSmartList

boolean saveSmartList(SmartList smartList,
                      MessageCollectors.SmartListMessageCollector collector)
                      throws ServiceException
Saves the specified smart list. If the smart list does not specify an id (i.e., id = 0), a new smart list is created. However, this method checks that there is no other smart list with the specified name. IF the specified smart list has an id, this method will attempt to update the smart list with that name. The method will throw an exception in case of an id conflict.
Parameters:
smartList - the smart list to save.
SmartListMessageCollector - populates with messages.
Returns:
true if the smart list could be successfully saved, false otherwise.
Throws:
ServiceException - wraps any exception underlying the service call.

deleteSmartList

boolean deleteSmartList(long smartListId)
                        throws ServiceException
Deletes a smart list.
Parameters:
smartListId - id of the smart list to delete.
Returns:
true if the smart list could be successfully deleted, false otherwise.
Throws:
ServiceException - wraps any exception underlying the service call.

getBookmarks

java.util.List<BookmarkBean> getBookmarks()
                                          throws ServiceException
Returns the list of bookmarks for the logged in user in the logged in site.
Returns:
list of bookmarks.
Throws:
ServiceException - wraps any exception underlying the service call.

addBookmarks

int addBookmarks(java.util.List<AssetId> assets)
                 throws ServiceException
Bookmarks the specified assets. The method will ignore the assets if they do not exist or are voided.
Parameters:
assets - the assets to be bookmarked.
Returns:
count of the number of assets which could be successfully bookmarked.
Throws:
ServiceException - wraps any exception underlying the service call.

removeBookmarks

boolean removeBookmarks(java.util.List<AssetId> bookmarks)
                        throws ServiceException
Removes the bookmark for the specified assets, if any.
Parameters:
bookmarks - the assets for which the bookmarks need to be removed.
Returns:
true if the bookmark could be successfully removed, false otherwise.
Throws:
ServiceException - wraps any exception underlying the service call.

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.