|
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.ViewSpecification
Use a ViewSpecification to create a SQL View. A SQL View is built from a SearchSpecification. Additional information that can be specifed is the viewName, and the columns to be retrived. After creating a ViewSpecification, use LibrarySession.createView() to create the view. Creation time security is applied to the view based on the session that is creating the view.
// Usage Examples // Let's assume we have already constructed a SearchSpecification. SearchSpecification searchSpec; // Construct ViewSpecification // At this point columns in view are all columns of result classes in search spec. // By default this will fail to create a new view if one exists already // with the same name. ViewSpecification viewSpec = new ViewSpecification("TestView", searchSpec); // Adding columns to the view. // List of columns that we want in the result String [] columns = new String[] {Document.NAME_ATTRIBUTE, Document.CREATEDATE_ATTRIBUTE}; // List of aliases (column titles) that we want in the result. // A null alias results in column name being used in the view. // These aliases are not be confused with aliases in SearchClassSpecification. String [] aliases = new String[] {null, "DOC_CREATE_DATE"}; viewSpec.addClass(m_Session, Document.CLASS_NAME, columns, aliases); // Repeat calls to addClass for each of different result classes as needed. // Setting up the view to replace an existing view with the same name viewSpec.replaceView(true); // Supplying bind values for any late bindings in the search spec // Note that, bind values are supplied view creation time, // and not at the time when the view is used. AttributeValue[] bindValues = new AttributeValue[2]; bindValues[0] = AttributeValue.newAttributeValue("Culinary"); bindValues[1] = AttributeValue.newAttributeValue("Bind Test%"); vsp.setBindValues(bindValues);
Constructor Summary | |
ViewSpecification(java.lang.String viewName,
SearchSpecification sp)
Constructs a ViewSpecification object. |
|
ViewSpecification(java.lang.String viewName,
SearchSpecification sp,
boolean repView)
Constructs a ViewSpecification object. |
Method Summary | |
void |
addClass(LibrarySession sess,
java.lang.String clsName,
java.lang.String[] attrs)
Let's you add attributes into your view. |
void |
addClass(LibrarySession sess,
java.lang.String clsName,
java.lang.String[] attrs,
java.lang.String[] aliases)
Let's you add attributes into your view. |
AttributeValue[] |
getBindValues()
Returns Bind Values that are used in this View Specification. |
SearchSpecification |
getSearchSpecification()
Returns the SearchSpecification of this view. |
void |
replaceView(boolean replace)
Makes this ViewSpec a Create or Replace View operation if replace is true. |
void |
setBindValues(AttributeValue[] bindVals)
If the ViewSpecification uses a Late Boudn SearchSpecification, use this function to supply Bind Values. |
void |
setDirectoryObject(LibrarySession sess,
DirectoryObject dObj)
Let's you set the DirectoryUser associated with the View. |
void |
setSearchSpecification(SearchSpecification sp)
Replaces the SearchSpecification of the view. |
void |
setViewName(java.lang.String viewName)
Sets the name of this view. |
Constructor Detail |
public ViewSpecification(java.lang.String viewName, SearchSpecification sp) throws IfsException
String
- Name of the View to be created.SearchSpecification
- Use this SearchSpecification to create View.public ViewSpecification(java.lang.String viewName, SearchSpecification sp, boolean repView) throws IfsException
String
- Name of the View to be created.SearchSpecification
- Use this SearchSpecification to create View.bool
- If true, it is a Create Or Replace.Method Detail |
public void addClass(LibrarySession sess, java.lang.String clsName, java.lang.String[] attrs) throws IfsException
Calls addClass(LibrarySession, String, String[], String[]).
LibrarySession
- CurrentSessionString
- iFS Class NameString[]
- List of attributes from the above classIfsException
- If the operation fails.public void addClass(LibrarySession sess, java.lang.String clsName, java.lang.String[] attrs, java.lang.String[] aliases) throws IfsException
LibrarySession
- CurrentSessionString
- iFS Class NameString[]
- List of attributes from the above classString[]
- List of Aliase for Column names in the view.IfsException
- If the operation fails.public void setDirectoryObject(LibrarySession sess, DirectoryObject dObj) throws IfsException
LibrarySession
- handle to the current session.DirectoryObject
- A valid directory object.IfsException
- If the operation fails.public void setSearchSpecification(SearchSpecification sp) throws IfsException
SearchSpecification
- New non null SearchSpecification.IfsException
- If the operation fails.public SearchSpecification getSearchSpecification()
public void setViewName(java.lang.String viewName) throws IfsException
String
- New Name of the View (cannot be null).public void replaceView(boolean replace) throws IfsException
boolean
- If true, operation is Create or Replace.IfsException
- if the operation fails.public void setBindValues(AttributeValue[] bindVals) throws IfsException
AttributeValue[]
- Array of Bind values.IfsException
- if the operation fails.public AttributeValue[] getBindValues() throws IfsException
|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |