com.ibm.designer.domino.xsp.api.util
Class XPagesDataUtil

java.lang.Object
  extended by com.ibm.designer.domino.xsp.api.util.XPagesDataUtil

public class XPagesDataUtil
extends java.lang.Object

A utility class that allows users to obtain information about design elements in a Domino Database.


Field Summary
protected static java.lang.String CONNECTION_ENUM_TYPE
           
protected static java.lang.String DFLT_LOCAL_CONNVIEW
           
protected static int DFLT_LOCAL_SERVERCOL
           
protected static int DFLT_REMOTE_SERVERCOL
           
protected static java.lang.String DFLT_SERVER_CONNVIEW
           
static java.lang.String LOCAL_CLIENT
          A string representing a local server.
static java.lang.String LOCAL_CLIENT_SERVER
          The string value used to represent a local server programatically
 
Constructor Summary
XPagesDataUtil()
           
 
Method Summary
static java.util.List<FacesDefinition> getAllDataSourcesFromRegistry(FacesRegistry registry)
          Given the FacesRegistry this method will return the definition of all tags that may be used as data sources.
static java.util.Map<java.lang.String,java.lang.Object> getChildrenForComplexProperty(DataNode panelNode, java.lang.String property, FacesRegistry registry)
           
static java.util.List<FacesDefinition> getChildrenForComplexProperty(FacesRegistry registry, java.lang.String namespace, java.lang.String localName, java.lang.String property)
           
static java.util.List<java.lang.String> getDatabaseForms(java.lang.String server, java.lang.String database, boolean lastAlias)
          Returns a list of form names for the Domino Forms found in the specified database.
static StringLookup getDatabaseViews(java.lang.String server, java.lang.String database)
          Returns a lookup of view names for the given database and server
static java.util.Map<java.lang.String,XPagesKey> getDataContextsFromRegistry(FacesRegistry registry, DesignerProject project)
           
static java.util.Map<java.lang.String,XPagesKey> getDataSourcesFromRegistry(FacesRegistry registry)
           
static java.util.List<FacesDefinition> getDocumentDataSources(FacesRegistry registry)
          Returns a list of data sources that support document data.
static java.lang.String getKeyForXspDefinition(org.w3c.dom.Element elem, FacesRegistry registry)
          Returns a proposed var name for the given data source element (e.g.
static java.lang.String[] getServerAndDbNameFromString(java.lang.String bangedName)
          Parses the server name and db name from the given string
static java.lang.String getServerName(java.lang.String server)
          Returns the usable server name.
protected static java.lang.String getServerView(java.lang.String server)
           
protected static int getServerViewCol(java.lang.String server)
           
protected static lotus.domino.Session getSession()
           
static boolean getViewColAddStatus(lotus.domino.ViewColumn viewCol)
          This function checks if the viewColumns in Domino have autogenerated values.
static java.lang.String[][] getViewColumns(java.lang.String server, java.lang.String database, java.lang.String viewName)
          Returns an two dimensional array that contains the names of the columns in a given view.
static java.util.List<FacesDefinition> getViewPanelDataSources(FacesRegistry registry)
          Given the FacesRegistry this method will return the definition of all tags that provide view data.
static java.util.Map<java.lang.String,XPagesKey> getXPagesKeysFromRegistry(FacesRegistry registry, java.lang.String nsURI, java.lang.String tagName, java.lang.String prop)
           
protected static boolean isLocalClient(java.lang.String server)
           
static java.lang.String[] sortDataSourcesWithDominoFirst(java.util.Map<java.lang.String,XPagesKey> dataSources)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_CLIENT

public static final java.lang.String LOCAL_CLIENT
A string representing a local server.

See Also:
Constant Field Values

LOCAL_CLIENT_SERVER

public static final java.lang.String LOCAL_CLIENT_SERVER
The string value used to represent a local server programatically

See Also:
Constant Field Values

DFLT_LOCAL_CONNVIEW

protected static final java.lang.String DFLT_LOCAL_CONNVIEW
See Also:
Constant Field Values

DFLT_LOCAL_SERVERCOL

protected static final int DFLT_LOCAL_SERVERCOL
See Also:
Constant Field Values

DFLT_SERVER_CONNVIEW

protected static final java.lang.String DFLT_SERVER_CONNVIEW
See Also:
Constant Field Values

DFLT_REMOTE_SERVERCOL

protected static final int DFLT_REMOTE_SERVERCOL
See Also:
Constant Field Values

CONNECTION_ENUM_TYPE

protected static final java.lang.String CONNECTION_ENUM_TYPE
See Also:
Constant Field Values
Constructor Detail

XPagesDataUtil

public XPagesDataUtil()
Method Detail

getAllDataSourcesFromRegistry

public static java.util.List<FacesDefinition> getAllDataSourcesFromRegistry(FacesRegistry registry)
Given the FacesRegistry this method will return the definition of all tags that may be used as data sources.

Parameters:
registry - the FacesRegistry for the current application
Returns:
a list of data sources

getViewPanelDataSources

public static java.util.List<FacesDefinition> getViewPanelDataSources(FacesRegistry registry)
Given the FacesRegistry this method will return the definition of all tags that provide view data.

Parameters:
registry - the FacesRegistry for the current application
Returns:
a list of 'view' data sources
See Also:
TabularDataSource

getChildrenForComplexProperty

public static java.util.Map<java.lang.String,java.lang.Object> getChildrenForComplexProperty(DataNode panelNode,
                                                                                             java.lang.String property,
                                                                                             FacesRegistry registry)
Parameters:
panelNode - parent data node
property - parent data node's complex property
registry - xsp registry
Returns:
map of elements that are children of the panelNode's complex property. The key is the value of the PROPERTY-TO-DISPLAY designer extension or "var" property if PROPERTY-TO-DISPLAY is not defined

getChildrenForComplexProperty

public static java.util.List<FacesDefinition> getChildrenForComplexProperty(FacesRegistry registry,
                                                                            java.lang.String namespace,
                                                                            java.lang.String localName,
                                                                            java.lang.String property)
Parameters:
registry - faces registry
namespace - of the node which children to be read
localName - of the node which children to be read
property - name of the complex property e.g. "data" or "dataContext" of the "xp:view" and "xp:panel"
Returns:
the list of faces definitions that are children of the complex property of the given definition.

getDatabaseForms

public static java.util.List<java.lang.String> getDatabaseForms(java.lang.String server,
                                                                java.lang.String database,
                                                                boolean lastAlias)
                                                         throws com.ibm.designer.domino.xsp.dominoutils.DominoImportException
Returns a list of form names for the Domino Forms found in the specified database.

Parameters:
server -
database -
lastAlias - - if true return the last alias of the form. If false return the display name of the form.
Returns:
List of type String, each of which is a last Alias of a form. If there is no alias, use the display name.
Throws:
com.ibm.designer.domino.xsp.dominoutils.DominoImportException

getDatabaseViews

public static StringLookup getDatabaseViews(java.lang.String server,
                                            java.lang.String database)
                                     throws com.ibm.designer.domino.xsp.dominoutils.DominoImportException
Returns a lookup of view names for the given database and server

Parameters:
server - the server name
database - the database name
Returns:
Throws:
com.ibm.designer.domino.xsp.dominoutils.DominoImportException

getDataContextsFromRegistry

public static java.util.Map<java.lang.String,XPagesKey> getDataContextsFromRegistry(FacesRegistry registry,
                                                                                    DesignerProject project)
Parameters:
registry - faces regitry
Returns:
Map of the data context to be generated on the page. The key is the "Display Name" taken from the designer extension. The value is the String[] that represents faces definition; first element is the namespaceURI, second is the localName

getDataSourcesFromRegistry

public static java.util.Map<java.lang.String,XPagesKey> getDataSourcesFromRegistry(FacesRegistry registry)
Parameters:
registry - faces regitry
Returns:
Map of the data sources to be generated on the page. The key is the "Display Name" taken from the designer extension. The value is the String[] that represents faces definition; first element is the namespaceURI, second is the localName

getDocumentDataSources

public static java.util.List<FacesDefinition> getDocumentDataSources(FacesRegistry registry)
Returns a list of data sources that support document data.

Parameters:
registry - an instance of the FacesRegistry
Returns:
a list of document data source definitions
See Also:
DocDataSource

getKeyForXspDefinition

public static java.lang.String getKeyForXspDefinition(org.w3c.dom.Element elem,
                                                      FacesRegistry registry)
Returns a proposed var name for the given data source element (e.g. dominoDocument, dominoView etc).

Parameters:
elem -
registry -
Returns:

getServerAndDbNameFromString

public static java.lang.String[] getServerAndDbNameFromString(java.lang.String bangedName)
Parses the server name and db name from the given string

Parameters:
bangedName -
Returns:
String[] If the 'bangedName' contains !! then it contains server and db name The text before !! is assumed to be the server and is contained at index 0 The text after !! is assumed to be the db name and is contained at index 1

getServerName

public static java.lang.String getServerName(java.lang.String server)
Returns the usable server name. If using the client, the input server name can be "Local" or "", "" is used in the Notes Session.


getServerView

protected static java.lang.String getServerView(java.lang.String server)

getServerViewCol

protected static int getServerViewCol(java.lang.String server)

getSession

protected static lotus.domino.Session getSession()
                                          throws java.lang.Throwable
Throws:
java.lang.Throwable

getViewColAddStatus

public static boolean getViewColAddStatus(lotus.domino.ViewColumn viewCol)
This function checks if the viewColumns in Domino have autogenerated values. If the values are autoGenerated using either of the formula or function @DocNumber : #in View @DocChildren : # of Responses1


getViewColumns

public static java.lang.String[][] getViewColumns(java.lang.String server,
                                                  java.lang.String database,
                                                  java.lang.String viewName)
                                           throws com.ibm.designer.domino.xsp.dominoutils.DominoImportException
Returns an two dimensional array that contains the names of the columns in a given view.

Parameters:
server -
database -
viewName -
Returns:
Throws:
com.ibm.designer.domino.xsp.dominoutils.DominoImportException

getXPagesKeysFromRegistry

public static java.util.Map<java.lang.String,XPagesKey> getXPagesKeysFromRegistry(FacesRegistry registry,
                                                                                  java.lang.String nsURI,
                                                                                  java.lang.String tagName,
                                                                                  java.lang.String prop)
Parameters:
registry - faces registry
nsURI - namespace uri for the parent definition
tagName - tag name of the parent definiton
prop - name of the complex property of the parent definiton
Returns:
Map of the faces definitions that are children of the parent. The key is the "Display Name" taken from the designer extension. The value is the String[] that represents faces definition; first element is the namespaceURI, second is the localName

sortDataSourcesWithDominoFirst

public static java.lang.String[] sortDataSourcesWithDominoFirst(java.util.Map<java.lang.String,XPagesKey> dataSources)

isLocalClient

protected static boolean isLocalClient(java.lang.String server)