|
WebLogic Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.eci.repository.helper.RepositoryActions
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.
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)
Constructor for use from a 2-tier client. |
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 |
public RepositoryActions(java.lang.String dbUser, java.lang.String dbPswd, java.lang.String jdbcDriver, java.lang.String jdbcURL, java.lang.String jdbcServer)
RepositoryActions
object that allows the repository to be
accessed directly by creating a JDBC connection. The parameters specify
the information used to create a JDBC connection, which, in turn, is
used to create a RepositorySession
for accessing the
repository.
The JDBC connection is made as follows:
Properties p = new Properties();
p.put("user", dbUser);
p.put("password", dbPswd);
p.put("server", jdbcServer);
Driver d = (Driver)Class.forName(driver).newInstance();
Connection con = d.connect(jdbcURL, p);
For a repository backed by MS SQLServer, using the WLS 6.0
jDriver, the values would be similar to:
dbUser = wlpi
dbPswd = password
jdbcDriver = weblogic.jdbc.mssqlserver4.Driver
jdbcURL = jdbc:weblogic:mssqlserver4
jdbcServer = WLPI@localhost:1433
dbUser
- a String
containing the DB user ID used to
connect to the database.dbPswd
- a String
containing the database user's
passwordjdbcDriver
- a String
containing the class name of the
JDBC driverjdbcURL
- a String
containing the URL of the JDBC
driver.jdbcServer
- a String
containing the name of the
database containing the repository tablespublic RepositoryActions()
String
environment variable
"connection" and must also have one of the following sets of
variables (all of type String
):
OR
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 |
public java.util.List getChildFolders(RepositoryFolderInfo rfi) throws RepositoryException
ObjectFolder
are
returned in the list.
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.List
of RepositoryFolderInfo
objects, one for each child folder, or an empty list if the folder
doesn't contain any child folders.public java.util.List getChildDocs(RepositoryFolderInfo rfi) throws RepositoryException
rfi
- a RepositoryFolderInfo
object representing the
folder for which the children are obtained - if null
the
entities not contained in any folder are retrieved.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.public void removeChildFolder(RepositoryFolderInfo child, RepositoryFolderInfo parent) throws RepositoryException
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.public void addChildFolder(RepositoryFolderInfo child, RepositoryFolderInfo parent) throws RepositoryException
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.public void deleteFolder(RepositoryFolderInfo rfi) throws RepositoryException
rfi
- the RepositoryFolderInfo
object representing the
ObjectFolder
that will be deleted.public RepositoryFolderInfo createFolder(java.lang.String type, java.lang.String name, java.lang.String desc, java.lang.String notes, RepositoryFolderInfo parent) throws RepositoryException
name
- a non-null String
containing the name of the
folder being created. The name must be unique within the repository
for all ObjectFolder
s.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.RepositoryFolderInfo
object representing the
newly created folder.public void updateFolder(RepositoryFolderInfo rfi) throws RepositoryException
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.public void removeEntityFromFolder(XMLEntityInfo xei, RepositoryFolderInfo rfi) throws RepositoryException
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.public void addEntityToFolder(XMLEntityInfo xei, RepositoryFolderInfo rfi) throws RepositoryException
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.public void updateEntity(XMLEntityInfo xei) throws RepositoryException
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.public void renameEntity(java.lang.String curName, java.lang.String newName) throws RepositoryException
curName
- a String
containing the current name of the
entity.newName
- a String
containing the entity's new name.public void renameFolder(java.lang.String curName, java.lang.String newName) throws RepositoryException
curName
- a String
containing the current name of the
folder.newName
- a String
containing the folder's new name.public void deleteEntity(XMLEntityInfo xei) throws RepositoryException
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.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
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.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
.public XMLEntityInfo getEntity(java.lang.String name) throws RepositoryException
name
- a String
containing the name of the
TextDocument
to retrieve.XMLEntityInfo
object representing the entity in
the repository, complete with content, or null
if the
entity was not found.public XMLEntityInfo getEntity(java.lang.String name, int type) throws RepositoryException
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:
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.public RepositoryFolderInfo getFolderInfo(java.lang.String type, java.lang.String name) throws RepositoryException
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.ObjectFolder
s) -
any other type will return null
.name
- a String
containing the name of the folder for
which information is being retrieved.RepositoryFolderInfo
object representing the
folder identified by name
and type
, or
null
if the identified folder is not defined in the
repository.public RepositoryFolderInfo getFolderInfo(java.lang.String name) throws RepositoryException
name
- a String
containing the name of the folder for
which information is being retrieved.RepositoryFolderInfo
object representing an
ObjectFolder
identified by name
, or
null
if the folder is not defined in the repository.public javax.swing.tree.DefaultMutableTreeNode getObjectFolderTree(javax.swing.tree.DefaultMutableTreeNode top) throws RepositoryException
DefaultMutableTreeNode
objects with the user object
a RepositoryFolderInfo
object.
top
- a DefaultMutableTreeNode
that represents the
root of the repository.DefaultMutableTreeNode
representing the
top
with all the children (folder) nodes.public java.util.List getAllEntities() throws RepositoryException
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.public java.util.List getAllFolders() throws RepositoryException
List
of RepositoryFolderInfo
objects
one for each ObjectFolder
defined in the repository. If no
folders are defined an empty list is returned.
|
WebLogic Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |