|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SearchFolder
The SearchFolder class is a "smart" object for metadata searches. It is used to save a search's details to metadata and also for retrieving those search details from the metadata. This interface is used to describe the SearchFolder actions and processes.
The SearchFolder is created using the SearchFactory createSearchFolder() methods. There are 2 signatures for this method. The first signature creates the SearchFolder with a new default Search. In the second signature, the user passes in an existing Search to associate to this SearchFolder. The Search is used to define and run a search. For more details, see: Examples of creating and using a Search object
The following is an example of creating a SearchFolder smart object from an existing Search object:
Search search = SearchFactory.createSearch(server); //where "server" is the ServerInterface . . //Assumes you populated and ran the search in this Search class . . //Setup to save this SearchFolder in the "My Folder" folder in the SAS folders tree. String path = "/Users/sasadm/My Folder(Folder)"; PathUrl pathURL = PathUrl.newPathUrlFromAbsolutePath(server, path); FolderInterface folder = (FolderInterface)server.getObjectByPath(pathURL); //create SearchFolder named "Searcher1" in the "My Folder" folder. SearchFolder mySearchFolder = SearchFactory.createSearchFolder("Searcher1", folder, search); //Set an optional description on the SearchFolder smart object mySearchFolder.setDescription("Searcher1 is a search of all public types by Object Name (Sample)"); //Add optional keywords to the SearchFolder smart object ArrayList |
The following is an example of retrieving an existing SearchFolder and simply displaying the object results (Name, Type, and Metadata object id):
//Query a SearchFolder named "MySearch" from the metadata (assume this is saved). //findSearchFolder() is a testing method that just queries for the smart object using //the informationService.search() method. Is is used for this example only and we assume the //user will query for the existing SearchFolder object as they see fit. SearchFolder searchObj = findSearchFolder(informationService, user, "MySearch"); //Will retrieve the search results for the saved search. It will run the search if the results //are not already in memory. List |
The following is an example of retrieving an existing SearchFolder, changing some search criteria, rerunning the search and simply displaying the object results (Name, Type, and Metadata object id):
//Query a SearchFolder named "MySearch" from the metadata (assume this is saved). //findSearchFolder() is a testing method that just queries for the smart object using //the informationService.search() method. Is is used for this example only and we assume the //user will query for the existing SearchFolder object as they see fit. SearchFolder searchObj = findSearchFolder(informationService, user, "MySearch"); Search search = searchObj.getSearch(); //Change that we only want to see the first 10 resulting object search.getResultDetails().setResultLimit(10); //Assume we were searching all Public Types in the saved search. Now we just want //to search for Job and Library types. List |
You can also use the standard information service methods to create smart objects, including this SearchFolder, but it is up to the user to understand how to do this and to make sure they set all required information to create a valid and useable SearchFolder.
Field Summary |
---|
Fields inherited from interface com.sas.services.information.metadata.MetadataInterface |
---|
METADATA_STATE_DELETED, METADATA_STATE_DESTROYED, METADATA_STATE_NEW, METADATA_STATE_NORMAL, PERMISSION_READMETADATA, PERMISSION_WRITEMETADATA |
Method Summary | |
---|---|
Search |
getSearch()
Retrieve the Search object which drives the search for this SearchFolder. |
java.util.List<PublicObjectInterface> |
getSearchResults()
Retrieve the search results from metadata. |
java.util.List<PublicObjectInterface> |
search()
Run an existing search from this SearchFolder. |
Methods inherited from interface com.sas.services.information.publicobject.PublicObjectContainerInterface |
---|
getChildAt, getChildCount, getChildren, getChildren, newChild |
Methods inherited from interface com.sas.services.information.publicobject.PublicObjectInterface |
---|
addProcessorInterface, getContainer, getIdentifier, getName, getObjectURI, getPathUrl, getProcessorInterface, getTypeDescriptor |
Method Detail |
---|
java.util.List<PublicObjectInterface> getSearchResults() throws ServiceException, java.rmi.RemoteException
ServiceException
- for any service related failure in this method
java.rmi.RemoteException
- for RMI network errorsSearch getSearch() throws ServiceException, java.rmi.RemoteException
ServiceException
- for any service related failure in this method
java.rmi.RemoteException
- for RMI network errorsjava.util.List<PublicObjectInterface> search() throws ServiceException, java.rmi.RemoteException
ServiceException
- for any service related failure in this method
If a ServiceException is thrown, you must perform a rollback to close the transaction.
java.rmi.RemoteException
- in the event of remote object failure.
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |