![]() |
![]() |
|
|
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.
Table 17-1 createFolder() Method Parameters
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.
RepositoryFolderInfo newFolder = xmlrepository.createFolder(
ObjectFolder, inventory, "Inventory of factory items.",
"This is a note.", "factoryA");
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:
public java.util.List getAllFolders(
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
public java.util.List getChildFolders(
com.bea.eci.repository.helper.RepositoryFolderInfo rfi
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the getChildFolders() method parameter for which you must specify a value.
Table 17-2 getChildFolders() Method Parameter
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.
List folders = xmlrepository.getAllFolders();
The following code gets a list of all subfolders for the specified parent, folderA:
List subfolders = xmlrepository.getChildFolders("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:
public javax.swing.tree.DefaultMutableTreeNode getObjectFolderTree(
javax.swing.tree.DefaultMutableTreeNode node
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the getObjectFolderTree() method parameter for which you must specify a value.
Table 17-3 getObjectFolderTree() Method Parameter
Parameter |
Description |
Valid Values |
---|---|---|
node |
Root node of the XML repository. |
A DefaultMutableTreeNode object that represents the root of the XML repository. |
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.
javax.swing.tree.DefaultMutableTreeNode node =
xmlrepository.getObjectFolderTree(root);
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
public com.bea.wlpi.eci.repository.helper.RepositoryFolderInfo getFolderInfo(
java.lang.String name
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
Method 2
public 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
The following table describes the getFolderInfo() method parameters for which you must specify values.
Table 17-4 getFolderInfo() Method Parameters
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.
com.bea.eci.repository.helper.RepositoryFolderInfo folderInfo =
xmlrepository.getFolderInfo("folderA");
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:
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.RemoteException
public 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
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.
Table 17-5 addChildFolder() and removeChildFolder() Method Parameters
For example, the following code moves folderA into folderB. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB.
xmlrepository.addChildFolder("folderA", "folderB");
Similarly, the following code removes folderA from folderB:
xmlrepository.removeChildFolder("folderA", "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:
public void renameFolder(
java.lang.String curname,
java.lang.String newName
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the renameFolder() method parameters for which you must specify values.
Table 17-6 renameFolder() Method Parameters
For example, the following code renames the existing folder, folderA, as folderB. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB.
xmlrepository.renameFolder(folderA, folderB);
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:
public void updateFolder(
com.bea.eci.repository.helper.RepositoryFolderInfo rfi
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the updateFolder() method parameter for which you must specify a value.
Table 17-7 updateFolder() Method Parameter
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.
xmlrepository.updateFolder(folderInfo);
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:
public void deleteFolder(
com.bea.eci.repository.helper.RepositoryFolderInfo rfi
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the deleteFolder() method parameter for which you must specify a value.
Table 17-8 deleteFolder() Method Parameter
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.
xmlrepository.deleteFolder(folderInfo);
For more information about the deleteFolder() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc.
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.
Table 17-9 createEntity() Method Parameters
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.
XMLEntityInfo entity = xmlrepository.createEntity(Types.XML, "widgets", "widgets inventory", "This is a note.", inventory);
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:
public java.util.List getAllEntities(
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
public java.util.List getChildDocs(
com.bea.eci.repository.helper.RepositoryFolderInfo rfi
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the getChildDocs() method parameter for which you must specify a value.
Table 17-10 getChildDocs() Method Parameter
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.
List entities = xmlrepository.getAllEntities();
The following code gets a list of all entities within folderA:
List entities = xmlrepository.getChildDocs("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
public com.bea.wlpi.eci.repository.helper.XMLEntityInfo getEntity(
java.lang.String name
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
Method 2
public com.bea.wlpi.eci.repository.helper.XMLEntityInfo getEntity(
java.lang.String name,
int type
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
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.
Table 17-11 getEntity() Method Parameters
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.
com.bea.eci.repository.helper.XMLEntityInfo entityInfo =
xmlrepository.getEntity("entityA");
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:
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.RemoteException
public 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
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.
Table 17-12 addEntityToFolder() and removeEntityFromFolder() Method Parameters
For example, the following code moves entityA into folderA. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB.
xmlrepository.addEntityToFolder("entityA", "folderA");
Similarly, the following code removes entityA from folderA:
xmlrepository.removeEntityFromFolder("entityA", "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:
public void renameEntity(
java.lang.String curname,
java.lang.String newName
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the renameEntity() method parameters for which you must specify values.
Table 17-13 renameEntity() Method Parameters
For example, the following code renames the existing entity, entityA, as entityB. In this example, xmlrepository represents the EJBObject reference to the XMLRepository EJB.
xmlrepository.renameEntity(entityA, entityB);
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:
public void updateEntity(
com.bea.eci.repository.helper.XMLEntityInfo xei
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the updateEntity() method parameter for which you must specify a value.
Table 17-14 updateEntity() Method Parameters
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.
xmlrepository.updateEntity(entityInfo);
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:
public void deleteEntity(
com.bea.eci.repository.helper.XMLEntityInfo xei
) throws com.bea.eci.repository.helper.RepositoryException,
java.rmi.RemoteException
The following table describes the deleteEntity() method parameter for which you must specify a value.
Table 17-15 deleteEntity() Method Parameters
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.
xmlrepository.deleteEntity(entityInfo);
For more information about the deleteEntity() method, see the com.bea.eci.repository.ejb.XMLRepository Javadoc.
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.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|