bea.com | products | dev2dev | support | askBEA |
![]() |
![]() |
|
![]() |
e-docs > WebLogic Platform > WebLogic Integration > BPM Topics > Programming BPM Client Apps > Managing the XML Repository |
Programming BPM Client Apps
|
Managing the XML Repository
The XML repository provides a data storage facility for the business process components of WebLogic Integration.
This section explains how to manage the XML repository, including the following topics:
For more information about the methods described in this section, see the com.bea.eci.repository.ejb.XMLRepository Javadoc.
Managing XML Repository Folders
The following sections describe how to create, update, display, and delete XML repository folders and subfolders.
Creating a Folder or Subfolder
To create a new folder or subfolder in the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository method:
public com.bea.wlpi.repository.helper.RepositoryFolderInfo createFolder (
java.lang.String type,
java.lang.String name,
java.lang.String desc,
java.lang.String notes,
com.bea.eci.repository.helper.RepositoryFolderInfo parent
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the createFolder() method parameters for which you must specify values.
This method returns a list of com.bea.eci.repository.helper.RepositoryFolderInfo objects. To access information about each folder, use the RepositoryFolder object methods described in RepositoryFolderInfo Object. For example, the following code creates a new folder named inventory within the folder factoryA. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the createFolder() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Getting All Folders and Subfolders To get a list of all folders and subfolders in the XML repository or a list of subfolders corresponding to a particular folder, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository methods, respectively: The following table describes the getChildFolders() method parameter for which you must specify a value.
RepositoryFolderInfo newFolder = xmlrepository.createFolder(
ObjectFolder, inventory, "Inventory of factory items.",
"This is a note.", "factoryA");public java.util.List getAllFolders(
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteExceptionpublic java.util.List getChildFolders(
com.bea.eci.repository.helper.RepositoryFolderInfo rfi
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
Each method returns a list of com.bea.eci.repository.helper.RepositoryFolderInfo objects, or an empty list, if none are defined. To access information about each folder, use the RepositoryFolder object methods described in RepositoryFolderInfo Object. For example, the following code gets a list of all folders. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. The following code gets a list of all subfolders for the specified parent, folderA: For more information about the getAllFolders() and getChildFolders() methods, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Getting Folder Tree To get a tree structure of all the folders in the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository method: The following table describes the getObjectFolderTree() method parameter for which you must specify a value.
List folders = xmlrepository.getAllFolders();
List subfolders = xmlrepository.getChildFolders("folderA");
public javax.swing.tree.DefaultMutableTreeNode getObjectFolderTree(
javax.swing.tree.DefaultMutableTreeNode node
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
This method returns a javax.swing.tree.DefaultMutableTreeNode representing the top node of the tree. Child folders of the specified node become the top-level folders in the tree. These folders are recursively populated with their respective children. Each child node consists of a DefaultMutableTreeNode object. For example, the following code builds a tree from the root node. root represents a DefaultMutableTreeNode that you want to appear as the root of the tree. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the getObjectFolderTree method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Getting Folder Information To get information for a folder in the XML repository, use one of the following com.bea.wlpi.eci.repository.ejb.XMLRepository methods. Method 1 Method 2 The following table describes the getFolderInfo() method parameters for which you must specify values.
javax.swing.tree.DefaultMutableTreeNode node =
xmlrepository.getObjectFolderTree(root);public com.bea.wlpi.eci.repository.helper.RepositoryFolderInfo getFolderInfo(
java.lang.String name
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteExceptionpublic com.bea.wlpi.eci.repository.helper.RepositoryFolderInfo getFolderInfo(
java.lang.String type,
java.lang.String name
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
Each method returns a com.bea.eci.repository.helper.RepositoryFolderInfo object, or null, if the specified folder is not defined. To access information about the folder, use the RepositoryFolder object methods described in RepositoryFolderInfo Object. For example, the following code gets the folder information for folderA. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the getFolderInfo() methods, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Reorganizing Folders To reorganize folders within the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository methods: The first method adds a child folder to a parent folder. The second removes a child folder from a parent folder. Note: When a folder is removed from a parent, it is not also deleted from the XML repository. The following table describes the addChildFolder() and removeChildFolder() method parameters for which you must specify values.
com.bea.eci.repository.helper.RepositoryFolderInfo folderInfo =
xmlrepository.getFolderInfo("folderA");public void addChildFolder(
com.bea.eci.repository.helper.RepositoryFolderInfo child,
com.bea.eci.repository.helper.RepositoryFolderInfo parent
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteExceptionpublic void removeChildFolder(
com.bea.eci.repository.helper.RepositoryFolderInfo child,
com.bea.eci.repository.helper.RepositoryFolderInfo parent
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
For example, the following code moves folderA into folderB. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. Similarly, the following code removes folderA from folderB: For more information about the addChildFolder() and removeChildFolder() methods, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Renaming a Folder To rename a folder in the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository method: The following table describes the renameFolder() method parameters for which you must specify values.
xmlrepository.addChildFolder("folderA", "folderB");
xmlrepository.removeChildFolder("folderA", "folderB");
public void renameFolder(
java.lang.String curname,
java.lang.String newName
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
For example, the following code renames the existing folder, folderA, as folderB. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the renameFolder() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Updating a Folder To update the description and/or notes fields for a folder in the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository method: The following table describes the updateFolder() method parameter for which you must specify a value.
xmlrepository.renameFolder(folderA, folderB);
public void updateFolder(
com.bea.eci.repository.helper.RepositoryFolderInfo rfi
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
For example, the following code updates the description and notes fields of an existing folder, as defined by the RepositoryFolderInfo object, folderInfo. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the updateFolder() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Deleting a Folder To delete a folder from the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository method: The following table describes the deleteFolder() method parameter for which you must specify a value.
xmlrepository.updateFolder(folderInfo);
public void deleteFolder(
com.bea.eci.repository.helper.RepositoryFolderInfo rfi
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
XML entities contained within the folder being deleted are not deleted from the XML repository. XML entities become entities at the top level of the hierarchy. For example, the following code deletes the folder defined by the RepositoryFolderInfo object, folderInfo. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the deleteFolder() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc.
xmlrepository.deleteFolder(folderInfo);
Managing XML Repository Entities
The following sections describe how to create, update, display, and delete XML repository entities.
Creating an Entity
To create an XML repository entity, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository method:
public com.bea.eci.repository.helper.XMLEntityInfo createEntity(
int type,
java.lang.String name,
java.lang.String desc,
java.lang.String notes,
java.lang.String content,
com.bea.eci.repository.helper.RepositoryFolderInfo parent
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the createEntity() method parameters for which you must specify values.
This method returns the com.bea.eci.repository.helper.XMLEntityInfo object corresponding to the new entity. To access information about the entity, use the XMLEntityInfo object methods described in XMLEntityInfo Object. For example, the following code creates a new XML entity named widgets in the inventory folder. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the createEntity() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Getting Entities To get a list of all entities in the XML repository, or a list of entities within a specified folder, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository methods, respectively: The following table describes the getChildDocs() method parameter for which you must specify a value.
XMLEntityInfo entity = xmlrepository.createEntity(Types.XML, "widgets", "widgets inventory", "This is a note.", inventory);
public java.util.List getAllEntities(
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteExceptionpublic java.util.List getChildDocs(
com.bea.eci.repository.helper.RepositoryFolderInfo rfi
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
Each method returns a list of com.bea.eci.repository.helper.XMLEntityInfo objects, or an empty list, if no entities are defined. The XMLEntityInfo objects do not contain the entity object contents; they contain only the name, type, and meta-data. To access information about each entity, use the XMLEntityInfo object methods described in XMLEntityInfo Object. For example, the following code gets a list of all entities. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. The following code gets a list of all entities within folderA: For more information about the getAllEntities() and getChildDocs() methods, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Getting Entity Information To get information for an entity in the XML repository, use one of the following com.bea.wlpi.eci.repository.ejb.XMLRepository methods. Method 1 Method 2 The first method supports entities with single-content fields. If multiple-content fields exist, the method returns only the contents of the first type encountered. The second method supports entities with multiple-content fields: it allows you to specify the type of content that you want to retrieve. The following table describes the getEntity() method parameters for which you must specify values.
List entities = xmlrepository.getAllEntities();
List entities = xmlrepository.getChildDocs("folderA");
public com.bea.wlpi.eci.repository.helper.XMLEntityInfo getEntity(
java.lang.String name
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteExceptionpublic com.bea.wlpi.eci.repository.helper.XMLEntityInfo getEntity(
java.lang.String name,
int type
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
Each method returns a com.bea.eci.repository.helper.XMLEntityInfo object, or null, if the specified entity is not defined. To access information about the entity, use the XMLEntityInfo object methods described in XMLEntityInfo Object. For example, the following code gets entity information for entityA. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the getEntity() methods, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Organizing Entities Within Folders To organize entities within folders in the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository methods: The first method adds an entity to a folder. The second method removes an entity from a folder. Note: When an entity is removed from a folder, it is not also deleted from the XML repository. The following table describes the addEntityToFolder() and removeEntityFromFolder() method parameters for which you must specify values.
com.bea.eci.repository.helper.XMLEntityInfo entityInfo =
xmlrepository.getEntity("entityA");public void addEntityToFolder(
com.bea.eci.repository.helper.XMLEntityInfo xei,
com.bea.eci.repository.helper.RepositoryFolderInfo rfi
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteExceptionpublic void removeEntityFromFolder(
com.bea.eci.repository.helper.XMLEntityInfo xei,
com.bea.eci.repository.helper.RepositoryFolderInfo rfi
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
For example, the following code moves entityA into folderA. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. Similarly, the following code removes entityA from folderA: For more information about the addEntityToFolder() and removeEntityFromFolder() methods, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Renaming an Entity To rename an entity in the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository method: The following table describes the renameEntity() method parameters for which you must specify values.
xmlrepository.addEntityToFolder("entityA", "folderA");
xmlrepository.removeEntityFromFolder("entityA", "folderA");
public void renameEntity(
java.lang.String curname,
java.lang.String newName
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
For example, the following code renames the existing entity, entityA, as entityB. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the renameEntity() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Updating an Entity To update the description, notes, and/or contents fields for an entity in the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository method: The following table describes the updateEntity() method parameter for which you must specify a value.
xmlrepository.renameEntity(entityA, entityB);
public void updateEntity(
com.bea.eci.repository.helper.XMLEntityInfo xei
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
You can update only a single-contents field, corresponding to the type specified in the type field of the XMLRepositoryInfo object, regardless of whether or not the entity has multiple content types. For example, the following code updates the description, notes, and contents fields of an existing entity, as defined by the XMLRepository object, entityInfo. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the updateEntity() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc. Deleting an Entity To delete an entity from the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository method: The following table describes the deleteEntity() method parameter for which you must specify a value.
xmlrepository.updateEntity(entityInfo);
public void deleteEntity(
com.bea.eci.repository.helper.XMLEntityInfo xei
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
For example, the following code deletes the folder defined by the XMLEntityInfo object, entityInfo. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB. For more information about the deleteEntity() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc.
xmlrepository.deleteEntity(entityInfo);
Getting the EJB Environment Variable Values
To get a list of the EJB environment variable values used for connections to the XML repository, use the following com.bea.wlpi.eci.repository.ejb.XMLRepository method:
public java.util.List getEnvVars(
) throws java.rmi.RemoteException
This method returns the following list of environment variable values used to connect to the repository, in the order specified:
For example, the following code gets a list of the environment variables being used. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB.
List envVars = xmlrepository.getEnvVars();
For more information about the getEnvVars() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc.
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |