|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ifs.search.SearchSpecification | +--oracle.ifs.search.AttributeSearchSpecification
An AttributeSpecification represents a non Context Search. The Specification contains the ClassSpecification, SortSpecification and SearchQualification. This class should be used when your searches contain only Attribute based conditions and no context based conditions.
// Usage Examples // How to build a Attribute Search specification // Construct the AttributeSearchSpecification. AttributeSearchSpecification asp = new AttributeSearchSpecification(); // Let's assume we have the 3 parts needed. // They are SearchClassSpecification - SELECT list and FROM list // SearchQualification - WHERE condition // SearchSortSpecification - ORDER BY clause SearchClassSpecification someSearchSpec = ...; SearchSortSpecification someSortSpec = ... ; SearchQualification someSearchQual = ...; LibrarySession sess = ...; // Set the search class spec asp.setSearchClassSpecification(someSearchSpec); // Set the search qualification asp.setSearchQualification(someSearchQual); // Set the sort specification asp.setSearchSortSpecification(someSortSpec); // Now we are ready to build a Search or create a View. // Building a search Search someSearch = new Search(sess, asp); // Or creating a view ViewSpecification viewSpec = new ViewSpecification("TestView", asp); // --------------------------------------------------------------- // Complete example of a Search using AttributeSearchSpecification // --------------------------------------------------------------- // Let's build a search that looks for all DOCUMENTS with a given // ACL and are named FOO. // Let's build the WHERE condition first. // It will be - DOC.ACL = GIVEN-ACL and DOC.NAME='FOO' // DOC.ACL = GIVEN-ACL AttributeQualification aq1 = new AttributeQualification(); aq1.setAttribute(PublicObject.ACL_ATTRIBUTE); aq1.setOperatorType(AttributeQualification.EQUAL); aq1.setValue(AttributeValue.newAttributeValue(acl)); // DOC.NAME= 'FOO' AttributeQualification aq2 = new AttributeQualification(); aq2.setAttribute(PublicObject.NAME_ATTRIBUTE); aq2.setOperatorType(AttributeQualification.EQUAL); aq2.setValue("FOO"); // Put them together with an AND. With that our // SearchQualification is ready. SearchClause sc = new SearchClause(aq1, aq2, SearchClause.AND); // Let's build the SearchClassSpecification SearchClassSpecification classSpec = new SearchClassSpecification(); classSpec.addSearchClass(Document.CLASS_NAME); // Let's build the SearchSortSpecification // Let' sort by create date SearchSortSpecification sortSpec = new SearchSortSpecification(); sortSpec.add(PublicObject.CREATEDATE_ATTRIBUTE, true); // Now that all 3 components are built, it is time to build // AttributeSearchSpecification,nd attache the 3 components. AttributeSearchSpecification sp = new AttributeSearchSpecification(); sp.setSearchClassSpecification(classSpec); sp.setSearchQualification(sc); sp.setSearchSortSpecification(sortSpec) // Now we are ready to construct the search object. // You can even build a view at this point using ViewSpecification. Search s = new Search(m_Session, sp); // Open the search. This runs the query. s.open(); // At this point you can do next() on the Search and get the SearchResultObject // for each row in searcn result. After processing the results, remember to close // the search. // close s.close();
SearchClassSpecification
,
SearchSortSpecification
,
SearchQualification
, Serialized FormConstructor Summary | |
AttributeSearchSpecification()
|
Method Summary | |
java.lang.Object |
clone()
Returns a clone of this AttributeSearchSpecification. |
SearchClassSpecification |
getSearchClassSpecification()
Gets SearchClassSpecification of this search. |
SearchQualification |
getSearchQualification()
Returns the SearchQualification of this search. |
SearchSortSpecification |
getSearchSortSpecification()
Gets the SearchSortSpecification for this object. |
void |
setSearchClassSpecification(SearchClassSpecification scp)
Sets the SearchClassSpecification for this Search. |
void |
setSearchQualification(SearchQualification s)
Sets the SearchQualification. |
void |
setSearchSortSpecification(SearchSortSpecification sortSpec)
Sets the SearchSortSpecification. |
Constructor Detail |
public AttributeSearchSpecification()
Method Detail |
public void setSearchClassSpecification(SearchClassSpecification scp) throws IfsException
scp
- SearchClassSpecificationIfsException
- if the operation failspublic void setSearchQualification(SearchQualification s) throws IfsException
s
- SearchQualification representing SearchTreeIfsException
- if the operation failspublic SearchQualification getSearchQualification()
public void setSearchSortSpecification(SearchSortSpecification sortSpec) throws IfsException
SearchSortSpecification
- SearchSortSpecification describing Sort behavior.IfsException
- if the operation failspublic SearchSortSpecification getSearchSortSpecification() throws IfsException
public SearchClassSpecification getSearchClassSpecification() throws IfsException
getSearchClassSpecification
in class SearchSpecification
IfsException
- if the operation failspublic java.lang.Object clone()
clone
in class SearchSpecification
|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |