public class ViewSpecification extends Object implements Serializable
// 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);
| Modifier and Type | Field and Description |
|---|---|
protected AttributeValue[] |
m_BindValues
Values for dynamic parameters in SearchTree
|
protected Long |
m_DOId
The DirectoryObject's id
|
protected boolean |
m_Replace
Replace an existing view
|
protected SearchSpecification |
m_SearchSpec
The SearchSpecification
|
protected Hashtable |
m_SelectList
This is hashed by class.
|
protected String |
m_ViewName
The name of the view
|
| Constructor and Description |
|---|
ViewSpecification(String viewName,
SearchSpecification sp)
Constructs a ViewSpecification object.
|
ViewSpecification(String viewName,
SearchSpecification sp,
boolean repView)
Constructs a ViewSpecification object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClass(LibrarySession sess,
String clsName,
String[] attrs)
Let's you add attributes into your view.
|
void |
addClass(LibrarySession sess,
String clsName,
String[] attrs,
String[] aliases)
Let's you add attributes into your view.
|
AttributeValue[] |
getBindValues()
Returns Bind Values that are used in this View Specification.
|
protected Long |
getDirectoryObject()
returns the directory object associated with this view.
|
SearchSpecification |
getSearchSpecification()
Returns the SearchSpecification of this view.
|
protected Hashtable |
getSelectList() |
protected String |
getViewName()
Returns the name of the view.
|
protected boolean |
isViewReplaceable()
Returns true if the ViewSpec is a Create or Replace operation.
|
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(String viewName)
Sets the name of this view.
|
void |
validate(LibrarySession sess)
Validates a View Specification.
|
protected String m_ViewName
protected Hashtable m_SelectList
protected Long m_DOId
protected SearchSpecification m_SearchSpec
protected boolean m_Replace
protected AttributeValue[] m_BindValues
public ViewSpecification(String viewName, SearchSpecification sp) throws IfsException
viewName - Name of the View to be created.sp - Use this SearchSpecification to create View.IfsExceptionpublic ViewSpecification(String viewName, SearchSpecification sp, boolean repView) throws IfsException
viewName - Name of the View to be created.sp - Use this SearchSpecification to create View.repView - If true, it is a Create Or Replace.IfsExceptionpublic void addClass(LibrarySession sess, String clsName, String[] attrs) throws IfsException
Calls addClass(LibrarySession, String, String[], String[]).
sess - Current SessionclsName - iFS Class Nameattrs - List of attributes from the above classIfsException - If the operation fails.public void addClass(LibrarySession sess, String clsName, String[] attrs, String[] aliases) throws IfsException
sess - Current SessionclsName - iFS Class Nameattrs - List of attributes from the above classaliases - List of Aliase for Column names in the view.IfsException - If the operation fails.protected Hashtable getSelectList()
public void setDirectoryObject(LibrarySession sess, DirectoryObject dObj) throws IfsException
sess - handle to the current session.dObj - A valid directory object.IfsException - If the operation fails.protected Long getDirectoryObject()
public void setSearchSpecification(SearchSpecification sp) throws IfsException
sp - New non null SearchSpecification.IfsException - If the operation fails.public SearchSpecification getSearchSpecification()
public void setViewName(String viewName) throws IfsException
viewName - New Name of the View (cannot be null).IfsException - If the operation Fails.protected String getViewName() throws IfsException
IfsExceptionpublic void replaceView(boolean replace)
throws IfsException
replace - If true, operation is Create or Replace.IfsException - if the operation fails.protected boolean isViewReplaceable()
throws IfsException
IfsExceptionpublic void setBindValues(AttributeValue[] bindVals) throws IfsException
bindVals - Array of Bind values.IfsException - if the operation fails.public AttributeValue[] getBindValues() throws IfsException
IfsExceptionpublic void validate(LibrarySession sess) throws IfsException
sess - Handle to the current session.IfsException - If the ViewSpecification is not valid.Copyright © 2025. All rights reserved.