Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.search
Class ViewSpecification

    java.lang.Object
      oracle.ifs.search.ViewSpecification

All Implemented Interfaces:
  java.io.Serializable

    public class ViewSpecification

extends java.lang.Object
implements java.io.Serializable

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);

See Also:
  Serialized Form
(Published)

Field Summary
`protected AttributeValue[]` | `m_BindValues` Values for dynamic parameters in SearchTree
`protected java.lang.Long` | `m_DOId` The DirectoryObject's id
`protected boolean` | `m_Replace` Replace an existing view
`protected SearchSpecification` | `m_SearchSpec` The SearchSpecification
`protected java.util.Hashtable` | `m_SelectList` This is hashed by class.
`protected java.lang.String` | `m_ViewName` The name of the view

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.
`protected java.lang.Long` | `getDirectoryObject()` returns the directory object associated with this view.
`SearchSpecification` | `getSearchSpecification()` Returns the SearchSpecification of this view.
`protected java.util.Hashtable` | `getSelectList()`
`protected java.lang.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(java.lang.String viewName)` Sets the name of this view.
`void` | `validate(LibrarySession sess)` Validates a View Specification.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_ViewName

    protected java.lang.String m_ViewName

  Description copied from class: `ViewSpecification`
  The name of the view

  (Unpublished)

### m_SelectList

    protected java.util.Hashtable m_SelectList

  Description copied from class: `ViewSpecification`
  This is hashed by class. For each an array of Columns is stored.

  (Unpublished)

### m_DOId

    protected java.lang.Long m_DOId

  Description copied from class: `ViewSpecification`
  The DirectoryObject's id

  (Unpublished)

### m_SearchSpec

    protected SearchSpecification m_SearchSpec

  Description copied from class: `ViewSpecification`
  The SearchSpecification

  (Unpublished)

### m_Replace

    protected boolean m_Replace

  Description copied from class: `ViewSpecification`
  Replace an existing view

  (Unpublished)

### m_BindValues

    protected AttributeValue[] m_BindValues

  Description copied from class: `ViewSpecification`
  Values for dynamic parameters in SearchTree

  (Unpublished)

Constructor Detail

### ViewSpecification

    public ViewSpecification(java.lang.String viewName,
                             SearchSpecification sp)
                      throws IfsException

  Constructs a ViewSpecification object. All result Classes from the search specification appear in the view by default. If you need to customize the attributes that a view should have, use addClass() method.

  Parameters:
    `viewName` - Name of the View to be created.
    `sp` - Use this SearchSpecification to create View.
  Throws:
    `IfsException`
  (Published)

### ViewSpecification

    public ViewSpecification(java.lang.String viewName,
                             SearchSpecification sp,
                             boolean repView)
                      throws IfsException

  Constructs a ViewSpecification object. All result Classes from the search specification appear in the view by default. If you need to customize the attributes that a view should have, use addClass() method. Last parameter specifies if the new View replaces an existing view or not.

  Parameters:
    `viewName` - Name of the View to be created.
    `sp` - Use this SearchSpecification to create View.
    `repView` - If true, it is a Create Or Replace.
  Throws:
    `IfsException`
  (Published)

Method Detail

### addClass

    public void addClass(LibrarySession sess,
                         java.lang.String clsName,
                         java.lang.String[] attrs)
                  throws IfsException

  Description copied from class: `ViewSpecification`
  Let's you add attributes into your view. This is the way to provide the columns that appear in the view. If addClass() is not called, all attributes from ResultClasses of Search Specification will appear in the view. If addClass() method is used, then only those attributes which are specified using addClass() will be prseent in the view.

  Calls addClass(LibrarySession, String, String[], String[]).

  Parameters:
    `sess` - Current Session
    `clsName` - iFS Class Name
    `attrs` - List of attributes from the above class
  Throws:
    `IfsException` - If the operation fails.
  (Published)

### addClass

    public void addClass(LibrarySession sess,
                         java.lang.String clsName,
                         java.lang.String[] attrs,
                         java.lang.String[] aliases)
                  throws IfsException

  Description copied from class: `ViewSpecification`
  Let's you add attributes into your view. This is the way to provide the columns that appear in the view. If addClass() is not called, all attributes from ResultClasses of Search Specification will appear in the view. If addClass() method is used, then only those attributes which are specified using addClass() will be prseent in the view. This function also let's you customize the names of columns appearing in the view by providing Aliases.

  Parameters:
    `sess` - Current Session
    `clsName` - iFS Class Name
    `attrs` - List of attributes from the above class
    `aliases` - List of Aliase for Column names in the view.
  Throws:
    `IfsException` - If the operation fails.
  (Published)

### getSelectList

    protected java.util.Hashtable getSelectList()

  (Unpublished)

### setDirectoryObject

    public void setDirectoryObject(LibrarySession sess,
                                   DirectoryObject dObj)
                            throws IfsException

  Description copied from class: `ViewSpecification`
  Let's you set the DirectoryUser associated with the View. Objects that can be discovered by this user will be present in the view.

  Parameters:
    `sess` - handle to the current session.
    `dObj` - A valid directory object.
  Throws:
    `IfsException` - If the operation fails.
  (Published)

### getDirectoryObject

    protected java.lang.Long getDirectoryObject()

  Description copied from class: `ViewSpecification`
  returns the directory object associated with this view.

  (Unpublished)

### setSearchSpecification

    public void setSearchSpecification(SearchSpecification sp)
                                throws IfsException

  Description copied from class: `ViewSpecification`
  Replaces the SearchSpecification of the view.

  Parameters:
    `sp` - New non null SearchSpecification.
  Throws:
    `IfsException` - If the operation fails.
  (Published)

### getSearchSpecification

    public SearchSpecification getSearchSpecification()

  Description copied from class: `ViewSpecification`
  Returns the SearchSpecification of this view.

  (Published)

### setViewName

    public void setViewName(java.lang.String viewName)
                     throws IfsException

  Description copied from class: `ViewSpecification`
  Sets the name of this view.

  Parameters:
    `viewName` - New Name of the View (cannot be null).
  Throws:
    `IfsException` - If the operation Fails.
  (Published)

### getViewName

    protected java.lang.String getViewName()
                                    throws IfsException

  Description copied from class: `ViewSpecification`
  Returns the name of the view.

  Throws:
    `IfsException`
  (Unpublished)

### replaceView

    public void replaceView(boolean replace)
                     throws IfsException

  Description copied from class: `ViewSpecification`
  Makes this ViewSpec a Create or Replace View operation if replace is true.

  Parameters:
    `replace` - If true, operation is Create or Replace.
  Throws:
    `IfsException` - if the operation fails.
  (Published)

### isViewReplaceable

    protected boolean isViewReplaceable()
                                 throws IfsException

  Description copied from class: `ViewSpecification`
  Returns true if the ViewSpec is a Create or Replace operation.

  Throws:
    `IfsException`
  (Unpublished)

### setBindValues

    public void setBindValues(AttributeValue[] bindVals)
                       throws IfsException

  Description copied from class: `ViewSpecification`
  If the ViewSpecification uses a Late Boudn SearchSpecification, use this function to supply Bind Values.

  Parameters:
    `bindVals` - Array of Bind values.
  Throws:
    `IfsException` - if the operation fails.
  (Published)

### getBindValues

    public AttributeValue[] getBindValues()
                                   throws IfsException

  Description copied from class: `ViewSpecification`
  Returns Bind Values that are used in this View Specification.

  Throws:
    `IfsException`
  (Published)

### validate

    public void validate(LibrarySession sess)
                  throws IfsException

  Description copied from class: `ViewSpecification`
  Validates a View Specification. If the ViewSpec is not valid, this throws an exception.

  Parameters:
    `sess` - Handle to the current session.
  Throws:
    `IfsException` - If the ViewSpecification is not valid.
  (Unpublished)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD