OBEROn SDK

com.oberon.ooql.sdk
Class View

java.lang.Object
  extended by com.oberon.ooql.sdk.OBBase
      extended by com.oberon.ooql.sdk.AdminBase
          extended by com.oberon.ooql.sdk.View
All Implemented Interfaces:
java.io.Serializable

public class View
extends AdminBase
implements java.io.Serializable

View: represents a [User] View used to show object properties in tabled format

Version:
5.0
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_VIEW
           
static java.lang.String[] vDefaultFields
           
static java.lang.String[] vDefaultNames
           
 
Fields inherited from class com.oberon.ooql.sdk.AdminBase
bsOptions, HIDDEN_OPTION
 
Constructor Summary
View()
           
View(java.lang.String name)
          Define a new View associated to all users
View(java.lang.String name, java.lang.String userName)
          Define a new View associated to a specific User
 
Method Summary
 void addColumn(Column column)
          Appends a new Column to the View
 void addColumnAfter(Column column, java.lang.String refColumn)
          Add a Column after another reference Column
 void addColumnBefore(Column column, java.lang.String refColumn)
          Add a Column before another reference Column
 java.lang.String compareUpdate(View refView, boolean checkImage, boolean overwrite, boolean force, Framework framework)
          Return/apply the OOQL command to update this View object and let it become equals to another reference object.
 void compose(ObjectObj rootObject, java.util.Vector<java.lang.Object> objects, Selector selector, java.io.DataOutputStream outStream, Framework framework)
          Compose the View for the current User and for a set of objects extracted by navigation of a root element
 void compose(java.util.Vector<java.lang.Object> objects, Selector selector, java.io.DataOutputStream outStream, Framework framework)
          Compose the View for the current User and for a set of objects extracted with a query
 void create(boolean overwrite, boolean force, Framework framework)
          Create a new View object on the database
 void create(Framework framework)
          Create a new View object on the database
 void destroy(Framework framework)
          Remove the View object from the database.
 void fromXML(org.jdom.Element rootElement)
          Load the View object from XML element tree
 void fromXML(org.jdom.Element rootElement, boolean loadColumns)
          Load the View object from XML element tree
 java.util.Vector<java.lang.String> getAccessColumnNames(int accessType, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Get all View Column names for which the framework User has access
 java.util.Vector<Column> getAccessColumns(int accessType, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Get all View Column for which the framework User has access
 java.lang.String getAccessColumnsAsString(int accessType, java.util.Vector<java.lang.Object> filterArgs, Framework framework, java.lang.String delim)
          Get all View Column names for which the framework User has access as a single string
 Column getColumn(int columnId)
          Get a View Column with the given internal id
 Column getColumn(java.lang.String columnName)
          Get a View Column with the given name
 Column getColumnAt(int index)
          Get a View Column at given position index
 java.util.Vector<java.lang.String> getColumnIDs()
          Get all View Column internal ids
 java.util.Vector<java.lang.String> getColumnNames()
          Get all View Column names
 int getColumnPos(java.lang.String columnName)
          Get the Column position inside the View
 java.util.Vector<Column> getColumns()
          Get all View Columns
 java.lang.String getColumnsAsString(java.lang.String delim)
          Get all View Column names as a single string
 java.lang.String getCreateCommand(boolean force)
          Return the OOQL command to create this View object with the settled properties
 java.lang.String getCreateCommand(boolean force, boolean overwrite)
          Return the OOQL command to create this View object with the settled properties
static View getDefaultView()
          Get the default view for Objects
 java.lang.String getFilterParameters()
          Get the list of parameters used by Column extraction Programs
 java.lang.String getFormat()
          Get the View format
 java.lang.String getProperty(java.lang.String propertyName, java.util.Vector<java.lang.Object> filterArgs, java.lang.String token, Framework framework)
          Get a property for this View object by its OOQL identifier
 java.lang.String getSaveCommand(boolean force)
          Return the OOQL command to update this View object with the modified properties.
 java.util.Vector<?> getTargetNames(java.lang.String composedName, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Return a Vector of administrative object names extracted by using an OOQL selector
 java.lang.String getUser()
          Get the User associated to this View
 java.util.Vector<ViewUserColumn> getUserColumns(ObjectObj rootObject, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Get all ViewUserColumn for which the framework User has the visibility for navigation of a root object
 java.util.Vector<ViewUserColumn> getUserColumns(java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Get all ViewUserColumn for which the framework User has the visibility
 java.util.Vector<ViewUserColumn> getUserColumnsWithData(ObjectObj rootObject, java.util.Vector<java.lang.Object> objects, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Get data related to View-Columns for navigation
 java.util.Vector<ViewUserColumn> getUserColumnsWithData(java.util.Vector<java.lang.Object> objects, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Get data related to View-Columns for query result
 int getUserId()
          Get the internal id of User associated to this View
static java.util.Vector<java.lang.String> getUserViews(Framework framework)
          Get the framework User views.
 void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the View object: connect the memory instance with the database instance
 void moveColumn(java.lang.String columnName, boolean after)
          Move a View Column
static View open(java.lang.String name, Framework framework)
          Open a general View and read its properties from the database
static View open(java.lang.String name, java.lang.String userName, Framework framework)
          Open a View for a given user and read its properties from the database
static View open(java.lang.String name, java.lang.String userName, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open a View for a given user and read its properties from the database
 void removeColumn(Column column)
          Remove a Column from the View
 void removeColumn(java.lang.String columnName)
          Remove a Column from the View
 void setColumns(java.util.Vector<Column> columns)
          Set all View Columns
 void setFilterParameters(java.lang.String parameters)
          Set a list of parameters used by Column extraction Programs
 void setFormat(java.lang.String format)
          Set the View format.
 void setUser(java.lang.String userName)
          Set the User associated to this View
 void setUserId(int userID)
          Set the internal id of User associated to this View
 java.lang.String toString()
          Return the View object basic properties as a single String
 java.lang.String toString(Framework framework)
          Return the View object extended properties as a single String
 org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the View object properties as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the View object properties as XML element tree
 void unlink(Framework framework)
          Close the object: disconnect the memory instance from the database instance
 void updateColumns(java.util.Vector<Column> columns)
          Update the columns on the basis of a given list
 void write(boolean force, Framework framework)
          Update the View object to the database
 void write(Framework framework)
          Update the View object to the database
 
Methods inherited from class com.oberon.ooql.sdk.AdminBase
addFeature, changedApplication, checkChangeName, checkCounters, checkCounters, getAdminType, getApplication, getCommonProperty, getCommonTargetNames, getCounters, getCreateBasicCommand, getCreateCommand, getCrtDate, getDescription, getEditBasicCommand, getFeature, getFeatures, getFeaturesAsString, getImage, getImage, getImage, getImageData, getImageFile, getModDate, getModUser, getName, getOldName, getPlainFeatures, getSaveCommand, getSVNRevision, getXMLFeatureList, hasImage, isHidden, setApplication, setCounters, setCrtDate, setDescription, setHidden, setImage, setImageData, setImageFile, setModDate, setModUser, setName, setSVNRevision, show, show, toCommonXML, toXML
 
Methods inherited from class com.oberon.ooql.sdk.OBBase
addChange, addUniqueChange, ChangesFromXML, ChangesToXML, getChanges, getChangesAsString, getId, isLinked, removeChange, resetChanges, setId, setLinked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_VIEW

public static final java.lang.String DEFAULT_VIEW
See Also:
Constant Field Values

vDefaultNames

public static final java.lang.String[] vDefaultNames

vDefaultFields

public static final java.lang.String[] vDefaultFields
Constructor Detail

View

public View()

View

public View(java.lang.String name)
     throws OberonException
Define a new View associated to all users

Parameters:
name - the View name
Throws:
OberonException - if the name contains invalid characters

View

public View(java.lang.String name,
            java.lang.String userName)
     throws OberonException
Define a new View associated to a specific User

Parameters:
name - the View name
userName - the User name
Throws:
OberonException - if the name contains invalid characters
Method Detail

open

public static View open(java.lang.String name,
                        Framework framework)
                 throws OberonException
Open a general View and read its properties from the database

Parameters:
name - the View name
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

open

public static View open(java.lang.String name,
                        java.lang.String userName,
                        Framework framework)
                 throws OberonException
Open a View for a given user and read its properties from the database

Parameters:
name - the View name
userName - the User name
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

open

public static View open(java.lang.String name,
                        java.lang.String userName,
                        Framework framework,
                        java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
                 throws OberonException
Open a View for a given user and read its properties from the database

Parameters:
name - the View name
userName - the User name
framework - the current framework
counters - administrative object synch counters (if null read them from database)
Throws:
OberonException - usually due to DB SQL exceptions
Since:
4.0

getDefaultView

public static View getDefaultView()
                           throws OberonException
Get the default view for Objects

Throws:
OberonException

link

public void link(Framework framework,
                 java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          throws OberonException
Open the View object: connect the memory instance with the database instance

Specified by:
link in class AdminBase
Parameters:
framework - the current framework
counters - administrative object synch counters (if null read them from database)
Throws:
OberonException - usually due to DB SQL exceptions

create

public void create(Framework framework)
            throws OberonException
Create a new View object on the database

Specified by:
create in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

create

public void create(boolean overwrite,
                   boolean force,
                   Framework framework)
            throws OberonException
Create a new View object on the database

Parameters:
overwrite - if true overwrite the View when it already exists
force - if true ignores optional features
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions
Since:
1.6

write

public void write(Framework framework)
           throws OberonException
Update the View object to the database

Specified by:
write in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

write

public void write(boolean force,
                  Framework framework)
           throws OberonException
Update the View object to the database

Parameters:
force - if true ignores optional features
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions
Since:
1.6

compose

public void compose(java.util.Vector<java.lang.Object> objects,
                    Selector selector,
                    java.io.DataOutputStream outStream,
                    Framework framework)
             throws java.io.IOException,
                    OberonException
Compose the View for the current User and for a set of objects extracted with a query

Parameters:
objects - vector of objects; each element can be:
String -> the ObjectObj ID
String[4] -> the tuple [class,name,revision,ID] of ObjectObj as result of a query
selector - selection parameters and input arguments
outStream - the stream for the results (if null the result is stored into the framework)
framework - the current framework
Throws:
java.io.IOException - when the output stream return an exception
OberonException - for all other problems
Since:
4.1
See Also:
getUserColumns(Vector, Framework), getUserColumnsWithData(Vector, Vector, Framework), Framework.getResult()

compose

public void compose(ObjectObj rootObject,
                    java.util.Vector<java.lang.Object> objects,
                    Selector selector,
                    java.io.DataOutputStream outStream,
                    Framework framework)
             throws java.io.IOException,
                    OberonException
Compose the View for the current User and for a set of objects extracted by navigation of a root element

Parameters:
rootObject - the navigation root element whose properties are used to filter columns on the basis of filter parameters
objects - vector of objects; each element can be:
String[2] -> the couple of ObjectObj and Link IDs
String[8] -> the tuple [level,versus,linktype,class,name,revision,object ID,link ID] as result of ObjectObj navigation
selector - selection parameters and input arguments
outStream - the stream for the results (if null the result is stored into the framework)
framework - the current framework
Throws:
java.io.IOException - when the output stream return an exception
OberonException - for all other problems
Since:
4.1
See Also:
getUserColumns(Vector, Framework), getUserColumnsWithData(Vector, Vector, Framework), Framework.getResult()

unlink

public void unlink(Framework framework)
            throws OberonException
Close the object: disconnect the memory instance from the database instance

Specified by:
unlink in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

destroy

public void destroy(Framework framework)
             throws OberonException
Remove the View object from the database.

Specified by:
destroy in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

setUser

public void setUser(java.lang.String userName)
Set the User associated to this View


getUser

public java.lang.String getUser()
Get the User associated to this View


setUserId

public void setUserId(int userID)
Set the internal id of User associated to this View


getUserId

public int getUserId()
Get the internal id of User associated to this View


setFilterParameters

public void setFilterParameters(java.lang.String parameters)
Set a list of parameters used by Column extraction Programs

Parameters:
parameters - OOQL parameters space separated

getFilterParameters

public java.lang.String getFilterParameters()
Get the list of parameters used by Column extraction Programs


setFormat

public void setFormat(java.lang.String format)
               throws OberonException
Set the View format. Available tags:
<tS[section]> : view translation default section

Throws:
OberonException

getFormat

public java.lang.String getFormat()
Get the View format


getColumnPos

public int getColumnPos(java.lang.String columnName)
Get the Column position inside the View

Parameters:
columnName - the Column name

addColumn

public void addColumn(Column column)
               throws OberonException
Appends a new Column to the View

Throws:
OberonException

addColumnBefore

public void addColumnBefore(Column column,
                            java.lang.String refColumn)
                     throws OberonException
Add a Column before another reference Column

Parameters:
column - the Column to add
refColumn - the reference Column name
Throws:
OberonException - when the reference Column is not found

addColumnAfter

public void addColumnAfter(Column column,
                           java.lang.String refColumn)
                    throws OberonException
Add a Column after another reference Column

Parameters:
column - the Column to add
refColumn - the reference Column name
Throws:
OberonException - when the reference Column is not found

moveColumn

public void moveColumn(java.lang.String columnName,
                       boolean after)
Move a View Column

Parameters:
columnName - the Column name
after - if true move the Column after else move it before the current position

removeColumn

public void removeColumn(Column column)
Remove a Column from the View


removeColumn

public void removeColumn(java.lang.String columnName)
Remove a Column from the View


setColumns

public void setColumns(java.util.Vector<Column> columns)
Set all View Columns

Parameters:
columns - a vector of Columns

updateColumns

public void updateColumns(java.util.Vector<Column> columns)
                   throws OberonException
Update the columns on the basis of a given list

Parameters:
columns - list of Columns
Throws:
OberonException
Since:
4.0

getColumns

public java.util.Vector<Column> getColumns()
Get all View Columns

Returns:
a Vector of Columns

getColumnAt

public Column getColumnAt(int index)
Get a View Column at given position index


getColumn

public Column getColumn(java.lang.String columnName)
Get a View Column with the given name


getColumn

public Column getColumn(int columnId)
Get a View Column with the given internal id


getColumnNames

public java.util.Vector<java.lang.String> getColumnNames()
Get all View Column names

Returns:
a Vector Column names

getColumnIDs

public java.util.Vector<java.lang.String> getColumnIDs()
Get all View Column internal ids

Returns:
a Vector of ids

getColumnsAsString

public java.lang.String getColumnsAsString(java.lang.String delim)
Get all View Column names as a single string

Parameters:
delim - the colum name separator

getAccessColumns

public java.util.Vector<Column> getAccessColumns(int accessType,
                                                 java.util.Vector<java.lang.Object> filterArgs,
                                                 Framework framework)
Get all View Column for which the framework User has access

Parameters:
accessType - the access type ( Column.COLUMNACCESS_SEEABLE / Column.COLUMNACCESS_MODIFIABLE )
filterArgs - input arguments used by the Column access Program

getAccessColumnNames

public java.util.Vector<java.lang.String> getAccessColumnNames(int accessType,
                                                               java.util.Vector<java.lang.Object> filterArgs,
                                                               Framework framework)
Get all View Column names for which the framework User has access

Parameters:
accessType - the access type ( Column.COLUMNACCESS_SEEABLE / Column.COLUMNACCESS_MODIFIABLE )
filterArgs - input arguments used by the Column access Program

getUserViews

public static java.util.Vector<java.lang.String> getUserViews(Framework framework)
                                                       throws java.lang.Exception
Get the framework User views.

Parameters:
framework - the current framework
Returns:
vector of the View names
Throws:
java.lang.Exception
Since:
4.0

getAccessColumnsAsString

public java.lang.String getAccessColumnsAsString(int accessType,
                                                 java.util.Vector<java.lang.Object> filterArgs,
                                                 Framework framework,
                                                 java.lang.String delim)
Get all View Column names for which the framework User has access as a single string

Parameters:
accessType - the access type ( Column.COLUMNACCESS_SEEABLE / Column.COLUMNACCESS_MODIFIABLE )
filterArgs - input arguments used by the Column access Program
delim - the Column name separator

getUserColumns

public java.util.Vector<ViewUserColumn> getUserColumns(java.util.Vector<java.lang.Object> filterArgs,
                                                       Framework framework)
                                                throws OberonException
Get all ViewUserColumn for which the framework User has the visibility

Parameters:
filterArgs - input arguments used by the Column access Program
framework - the current framework
Returns:
Vector of ViewUserColumn
Throws:
OberonException
Since:
4.1

getUserColumns

public java.util.Vector<ViewUserColumn> getUserColumns(ObjectObj rootObject,
                                                       java.util.Vector<java.lang.Object> filterArgs,
                                                       Framework framework)
                                                throws OberonException
Get all ViewUserColumn for which the framework User has the visibility for navigation of a root object

Parameters:
rootObject - the navigation root element whose properties are used to filter columns on the basis of filter parameters
filterArgs - input arguments used by the Column access Program
framework - the current framework
Returns:
Vector of ViewUserColumn
Throws:
OberonException
Since:
4.0

getUserColumnsWithData

public java.util.Vector<ViewUserColumn> getUserColumnsWithData(java.util.Vector<java.lang.Object> objects,
                                                               java.util.Vector<java.lang.Object> filterArgs,
                                                               Framework framework)
                                                        throws OberonException
Get data related to View-Columns for query result

Parameters:
objects - vector of objects; each element can be:
String -> the ObjectObj ID
String[4] -> the tuple [class,name,revision,ID] of ObjectObj as result of a query
filterArgs - input arguments used by the Column access Program
framework - the User framework
Returns:
Vector of ViewUserColumn
Throws:
OberonException - usually due to DB SQL exceptions
Since:
4.0

getUserColumnsWithData

public java.util.Vector<ViewUserColumn> getUserColumnsWithData(ObjectObj rootObject,
                                                               java.util.Vector<java.lang.Object> objects,
                                                               java.util.Vector<java.lang.Object> filterArgs,
                                                               Framework framework)
                                                        throws OberonException
Get data related to View-Columns for navigation

Parameters:
rootObject - the navigation root element whose properties are used to filter columns on the basis of filter parameters
objects - vector of objects; each element can be:
String[2] -> the couple of ObjectObj and Link IDs
String[8] -> the tuple [level,versus,linktype,class,name,revision,object ID,link ID] as result of rootObject navigation
filterArgs - input arguments used by the Column access Program
framework - the User framework
Returns:
Vector of ViewUserColumn
Throws:
OberonException - usually due to DB SQL exceptions
Since:
4.0

getProperty

public java.lang.String getProperty(java.lang.String propertyName,
                                    java.util.Vector<java.lang.Object> filterArgs,
                                    java.lang.String token,
                                    Framework framework)
Get a property for this View object by its OOQL identifier

Specified by:
getProperty in class OBBase
Parameters:
propertyName - OOQL property identifier/name (example: user , column ...)
filterArgs - extra arguments used to compute properties
token - separator token for complex properties
framework - the current framework
Returns:
the property value

getTargetNames

public java.util.Vector<?> getTargetNames(java.lang.String composedName,
                                          java.util.Vector<java.lang.Object> filterArgs,
                                          Framework framework)
Return a Vector of administrative object names extracted by using an OOQL selector

Specified by:
getTargetNames in class OBBase
Parameters:
composedName - OOQL property identifier/name (example: column, column[colName], .. )
filterArgs - extra arguments used to compute properties
framework - the current framework
Returns:
a Vector of target names, used to extract their (sub)properties values

toString

public java.lang.String toString()
Return the View object basic properties as a single String

Overrides:
toString in class AdminBase

toString

public java.lang.String toString(Framework framework)
Return the View object extended properties as a single String

Overrides:
toString in class AdminBase
Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(Framework framework)
Return the View object properties as XML element tree

Specified by:
toXML in class AdminBase
Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(boolean getImage,
                              boolean fullDump,
                              Framework framework)
Return the View object properties as XML element tree

Specified by:
toXML in class AdminBase
Parameters:
fullDump - true to include detailed information
framework - the current framework
getImage - true to include "imagedata" element with the base64 encoded image data

fromXML

public void fromXML(org.jdom.Element rootElement)
Load the View object from XML element tree

Overrides:
fromXML in class AdminBase

fromXML

public void fromXML(org.jdom.Element rootElement,
                    boolean loadColumns)
Load the View object from XML element tree

Parameters:
loadColumns - if true load the View Columns

getCreateCommand

public java.lang.String getCreateCommand(boolean force)
Return the OOQL command to create this View object with the settled properties

Specified by:
getCreateCommand in class AdminBase
Parameters:
force - if true append the "force" options at the end

getCreateCommand

public java.lang.String getCreateCommand(boolean force,
                                         boolean overwrite)
Return the OOQL command to create this View object with the settled properties

Parameters:
overwrite - if true add the overwrite option to the command

getSaveCommand

public java.lang.String getSaveCommand(boolean force)
Return the OOQL command to update this View object with the modified properties.
If the object is new, it returns the create command.

Specified by:
getSaveCommand in class AdminBase
Parameters:
force - if true append the "force" options at the end

compareUpdate

public java.lang.String compareUpdate(View refView,
                                      boolean checkImage,
                                      boolean overwrite,
                                      boolean force,
                                      Framework framework)
                               throws OberonException
Return/apply the OOQL command to update this View object and let it become equals to another reference object.
This method is useful to import objects from an XML file.

Parameters:
refView - the reference View object
checkImage - if true compare also the image icon
overwrite - if true update the database object instance
force - if true ignores optional properties
framework - the current framework
Throws:
OberonException
See Also:
fromXML(Element)

OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.