WebLogic Integration


com.bea.eci.repository.helper
Class RepositoryActions

java.lang.Object
  |
  +--com.bea.eci.repository.helper.RepositoryActions
Direct Known Subclasses:
XMLRepositoryBean

public class RepositoryActions
extends java.lang.Object

This class provides methods for accessing and manipulating the XML Entity Repository. This version does not support repository object versioning - all methods deal with the latest version of objects in the repository.

Since:
WebLogic Process Integrator 2.0
Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.

Constructor Summary
RepositoryActions()
          Constructor for use from within an EJB.
RepositoryActions(java.lang.String dbUser, java.lang.String dbPswd, java.lang.String jdbcDriver, java.lang.String jdbcURL, java.lang.String jdbcServer)
           
 
Method Summary
 void addChildFolder(RepositoryFolderInfo child, RepositoryFolderInfo parent)
          Place an exiting folder inside another (existing) folder.
 void addEntityToFolder(XMLEntityInfo xei, RepositoryFolderInfo rfi)
          Place an existing entity in an existing folder.
 XMLEntityInfo createEntity(int type, java.lang.String name, java.lang.String desc, java.lang.String notes, java.lang.String content, RepositoryFolderInfo parent)
          Create a new XML entity in the repository, within an existing folder if desired.
 RepositoryFolderInfo createFolder(java.lang.String type, java.lang.String name, java.lang.String desc, java.lang.String notes, RepositoryFolderInfo parent)
          Creates a new folder in the repository.
 void deleteEntity(XMLEntityInfo xei)
          Completely remove an entity from the repository.
 void deleteFolder(RepositoryFolderInfo rfi)
          Delete a folder from the repository.
 java.util.List getAllEntities()
          Returns a list of all the entities in the repository.
 java.util.List getAllFolders()
          Returns a list of all the folders in the repository.
 java.util.List getChildDocs(RepositoryFolderInfo rfi)
          Obtains a list of entities that are children of a given folder.
 java.util.List getChildFolders(RepositoryFolderInfo rfi)
          Obtains a list of the child folders of a given folder.
 XMLEntityInfo getEntity(java.lang.String name)
          Retrieves an entity from the repository, including its content.
 XMLEntityInfo getEntity(java.lang.String name, int type)
          Retrieves an entity from the repository, including its content of the specified type.
 RepositoryFolderInfo getFolderInfo(java.lang.String name)
          Retrieves the information about a repository folder identified by its name.
 RepositoryFolderInfo getFolderInfo(java.lang.String type, java.lang.String name)
          Retrieves the information about a repository folder of a given name and type.
 javax.swing.tree.DefaultMutableTreeNode getObjectFolderTree(javax.swing.tree.DefaultMutableTreeNode top)
          Builds a tree structure of all the folders in the repository.
 void removeChildFolder(RepositoryFolderInfo child, RepositoryFolderInfo parent)
          Remove a reference between a child folder and its parent folder.
 void removeEntityFromFolder(XMLEntityInfo xei, RepositoryFolderInfo rfi)
          Remove an entity from a folder, but do not delete the entity.
 void renameEntity(java.lang.String curName, java.lang.String newName)
          Change the name of an entity.
 void renameFolder(java.lang.String curName, java.lang.String newName)
          Change the name of an folder.
 void updateEntity(XMLEntityInfo xei)
          Update an entity's description, notes and content fields.
 void updateFolder(RepositoryFolderInfo rfi)
          Update a folder's description and notes fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryActions

public RepositoryActions(java.lang.String dbUser,
                         java.lang.String dbPswd,
                         java.lang.String jdbcDriver,
                         java.lang.String jdbcURL,
                         java.lang.String jdbcServer)

RepositoryActions

public RepositoryActions()
Constructor for use from within an EJB. The EJB's environment must contain the String environment variable "connection" and must also have one of the following sets of variables (all of type String):
  • jdbc/className
  • jdbc/url
  • jdbc/server
  • jdbc/user
  • jdbc/pswd
  • OR

  • datasource/name
  • The "connection" variable specifies the database connection method used by the com.bea.repository.RepositorySession object: a value of "2-tier" (ignoring case) will result in an attempt to create a JDBC connection directly from within the EJB using the values contained in the "jdbc/xxx" variables. Any other value for "connection" will result in the connections through the WLS "JDBCTxDataSource" having the JNDI name specified by the "datasource/name" environment variable (which must match the JNDI name of the datasource). Note: Only the data source method is supported - there is no guarentee that the JDBC method will work, as the JDBC connection is created from within the EJB.
    Method Detail

    getChildFolders

    public java.util.List getChildFolders(RepositoryFolderInfo rfi)
                                   throws RepositoryException
    Obtains a list of the child folders of a given folder. Currently only child folders of type ObjectFolder are returned in the list.

    Parameters:
    rfi - a RepositoryFolderInfo object representing the folder for which the children are being obtained (the parent). If null all top-level (without a parent) folders are retrieved.
    Returns:
    a List of RepositoryFolderInfo objects, one for each child folder, or an empty list if the folder doesn't contain any child folders.

    getChildDocs

    public java.util.List getChildDocs(RepositoryFolderInfo rfi)
                                throws RepositoryException
    Obtains a list of entities that are children of a given folder.

    Parameters:
    rfi - a RepositoryFolderInfo object representing the folder for which the children are obtained - if null the entities not contained in any folder are retrieved.
    Returns:
    a List of XMLEntityInfo objects, one for each child object, or an empty list if the folder doesn't contain any children. The type field of each XMLEntityInfo object is set based on the type of the com.bea.repository.RepositoryVersionedObject's first retrieved content. The XMLEntityInfo objects do not contain the contents of the object, only the name, type, and meta-data associated with the entity.

    removeChildFolder

    public void removeChildFolder(RepositoryFolderInfo child,
                                  RepositoryFolderInfo parent)
                           throws RepositoryException
    Remove a reference between a child folder and its parent folder. This does not delete the child folder from the repository - it only removes the the reference between the parent and child. The child folder becomes a top-level folder (parent-less) if there are no other folders refering to the child, or it remains a child of the other folders that refer to it.

    Parameters:
    child - the RepositoryFolderInfo object representing the child folder being dereferenced from the parent.
    parent - the RepositoryFolderInfo object representing the parent folder from which the child is being dereferenced.

    addChildFolder

    public void addChildFolder(RepositoryFolderInfo child,
                               RepositoryFolderInfo parent)
                        throws RepositoryException
    Place an exiting folder inside another (existing) folder. This simply creates a reference from the parent to the child folder.

    Parameters:
    child - a RepositoryFolderInfo object representing the folder being placed in another folder.
    parent - a RepositoryFolderInfo object representing the folder that the child is being placed into.

    deleteFolder

    public void deleteFolder(RepositoryFolderInfo rfi)
                      throws RepositoryException
    Delete a folder from the repository. The folder may not have any child folders, and any XML entities in the folder will become orphaned - they will remain defined in the repository and simply not be associated with the folder being deleted, i.e. they will appear as top-level entities if they are not children of any other folders or will simply remain chilren of any other folders they are in.

    Parameters:
    rfi - the RepositoryFolderInfo object representing the ObjectFolder that will be deleted.

    createFolder

    public RepositoryFolderInfo createFolder(java.lang.String type,
                                             java.lang.String name,
                                             java.lang.String desc,
                                             java.lang.String notes,
                                             RepositoryFolderInfo parent)
                                      throws RepositoryException
    Creates a new folder in the repository. Optionally, the newly created folder is made a child folder of a specified folder.

    Parameters:
    name - a non-null String containing the name of the folder being created. The name must be unique within the repository for all ObjectFolders.
    desc - a String containing a description of the folder being created. May be null.
    notes - a String containing notes about the folder being created. May be null.
    parent - a RepositoryFolderInfo object representing an existing object folder that the newly created folder will be a child of, or null to create the new folder as a top-level (parentless) folder.
    Returns:
    a RepositoryFolderInfo object representing the newly created folder.

    updateFolder

    public void updateFolder(RepositoryFolderInfo rfi)
                      throws RepositoryException
    Update a folder's description and notes fields.

    Parameters:
    rfi - a RepositoryFolderInfo object with the name and type fields identifying the folder to be updated, and the description and notes fields containing the new data. Note: The name and type fields must identify a folder existing in the repository.

    removeEntityFromFolder

    public void removeEntityFromFolder(XMLEntityInfo xei,
                                       RepositoryFolderInfo rfi)
                                throws RepositoryException
    Remove an entity from a folder, but do not delete the entity. The entity's reference to the parent folder is removed causing the entity to no loger be a child of the specified folder - it will remain a child of any other folders it references as a parent folder or will become parent-less (top-level) if it has no other references to parent folders.

    Parameters:
    xei - an XMLEntityInfo object representing the entity to be removed from the specified folder.
    rfi - a RepositoryFolderInfo object representing the folder from which the entity will be removed.

    addEntityToFolder

    public void addEntityToFolder(XMLEntityInfo xei,
                                  RepositoryFolderInfo rfi)
                           throws RepositoryException
    Place an existing entity in an existing folder. This simply creates a reference between the folder and the entity.

    Parameters:
    xei - an XMLEntityInfo object representing the entity being placed in the folder.
    rfi - a RepositoryFolderInfo object representing the folder into which the entity is being placed.

    updateEntity

    public void updateEntity(XMLEntityInfo xei)
                      throws RepositoryException
    Update an entity's description, notes and content fields. Note : the repository supports entities having multiple contents but this method only supports a single content type for the entity: that being the type obtained from the passed in object - it is not possible to change the entity's type using this method, if, for example, the entity is of type DTD, the content of type DTD will be updated regardless of other contents that may be associated with the entity.

    Parameters:
    xei - an XMLEntityInfo object that represents an existing entity in the repository - the name field must identify and existing entity and the type field specifies the entit's content that will be updated - the description, notes, and content fields contain the new values the entity will be updated with.

    renameEntity

    public void renameEntity(java.lang.String curName,
                             java.lang.String newName)
                      throws RepositoryException
    Change the name of an entity.

    Parameters:
    curName - a String containing the current name of the entity.
    newName - a String containing the entity's new name.

    renameFolder

    public void renameFolder(java.lang.String curName,
                             java.lang.String newName)
                      throws RepositoryException
    Change the name of an folder.

    Parameters:
    curName - a String containing the current name of the folder.
    newName - a String containing the folder's new name.

    deleteEntity

    public void deleteEntity(XMLEntityInfo xei)
                      throws RepositoryException
    Completely remove an entity from the repository. This will remove the entity from all folders it is a child of and delete the entity from the repository.

    Parameters:
    xei - an XMLEntityInfo object representing the entity that will be removed from the repository. The only required field is name, which uniquely identifies the entity.

    createEntity

    public XMLEntityInfo createEntity(int type,
                                      java.lang.String name,
                                      java.lang.String desc,
                                      java.lang.String notes,
                                      java.lang.String content,
                                      RepositoryFolderInfo parent)
                               throws RepositoryException
    Create a new XML entity in the repository, within an existing folder if desired. The entity created will have a sinlge associated content, if content is provided.

    Parameters:
    type - an int containing the type of the entity being created.
    name - a String containing the name of the entity being created.
    desc - a String containing a description of the entity being created.
    notes - a String containing notes about the entity being created.
    parent - a RepositoryFolderInfo object representing the folder in which the entity should be placed. May be null if the entity is simple being created without a parent folder.
    Returns:
    an XMLEntityInfo object representing the entity that was created, or null if the entity was not found. Note: the type of this object will be forced to Types.NO_CONTENT if the content field is null.

    getEntity

    public XMLEntityInfo getEntity(java.lang.String name)
                            throws RepositoryException
    Retrieves an entity from the repository, including its content. This method only supports entities having a single content associated with them - if the named entity has multiple contents only the first retrieved content type is returned.

    Parameters:
    name - a String containing the name of the TextDocument to retrieve.
    Returns:
    an XMLEntityInfo object representing the entity in the repository, complete with content, or null if the entity was not found.

    getEntity

    public XMLEntityInfo getEntity(java.lang.String name,
                                   int type)
                            throws RepositoryException
    Retrieves an entity from the repository, including its content of the specified type. This method supports entities having multple contents.

    Parameters:
    name - a String contianing the name of the TextDocument to retrieve.
    type - a int containing the content type, as defined in com.bea.eci.repository.helper.Types, to retrieve. Note : only the following content types are supported:
  • Types.DTD
  • Types.MFL
  • Types.TEXT
  • Types.XML
  • Types.XML_SCHEMA
  • Types.XSLT
  • Types.NO_CONTENT
  • Returns:
    an XMLEntityInfo object representing the entity in the repository identified by name and type, or null if the specified entity is not defined in the repository.

    getFolderInfo

    public RepositoryFolderInfo getFolderInfo(java.lang.String type,
                                              java.lang.String name)
                                       throws RepositoryException
    Retrieves the information about a repository folder of a given name and type.

    Parameters:
    type - a String containing the type of the repository folder. Value from com.bea.eci.repository.helper.Types. Note : Only folders of type com.bea.eci.repository.helper.Types.OBJECT_FOLDER are currently supported (com.bea.repository.ObjectFolders) - any other type will return null.
    name - a String containing the name of the folder for which information is being retrieved.
    Returns:
    a RepositoryFolderInfo object representing the folder identified by name and type, or null if the identified folder is not defined in the repository.

    getFolderInfo

    public RepositoryFolderInfo getFolderInfo(java.lang.String name)
                                       throws RepositoryException
    Retrieves the information about a repository folder identified by its name.

    Parameters:
    name - a String containing the name of the folder for which information is being retrieved.
    Returns:
    a RepositoryFolderInfo object representing an ObjectFolder identified by name, or null if the folder is not defined in the repository.

    getObjectFolderTree

    public javax.swing.tree.DefaultMutableTreeNode getObjectFolderTree(javax.swing.tree.DefaultMutableTreeNode top)
                                                                throws RepositoryException
    Builds a tree structure of all the folders in the repository. The children of the supplied node are all the top-level (without parent) folders repository. Each of the child nodes is recursively populated with nodes representing thier respective children. The children nodes are all DefaultMutableTreeNode objects with the user object a RepositoryFolderInfo object.

    Parameters:
    top - a DefaultMutableTreeNode that represents the root of the repository.
    Returns:
    a new DefaultMutableTreeNode representing the top with all the children (folder) nodes.

    getAllEntities

    public java.util.List getAllEntities()
                                  throws RepositoryException
    Returns a list of all the entities in the repository.

    Returns:
    a List of XMLEntityInfo objects one for each TextDocument defined in the repository - if no entities are defined an empty list is returned. The XMLEntityInfo objects do not contain the content, only the name, type, and meta-data are provided.

    getAllFolders

    public java.util.List getAllFolders()
                                 throws RepositoryException
    Returns a list of all the folders in the repository.

    Returns:
    a List of RepositoryFolderInfo objects one for each ObjectFolder defined in the repository. If no folders are defined an empty list is returned.

    WebLogic Integration

    WebLogic Integration (WLI)