|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.tum.in.targeteam.client.SimplePoolInterface
A SimplePoolManager supports basic functions for managing an associated pool. The following functions are not supported by this class:
id attribute to the module
element in the corresponding module content. Note that the name
is added as id attribute to all atom
elements created by the Integrator.
extension attribute.
| Field Summary |
| Fields inherited from interface de.tum.in.targeteam.pool.TransactionMethods |
CREATE_ALTERNATIVE, DELETE, INSERT_CHILD_ATOM, INSERT_CHILD_MODULE, PREPARE, REMOVE_CHILD_ATOM, REMOVE_CHILD_MODULE, SET_ATOM_CONTENT, SET_ATTR_VALUE, SET_MODULE_CONTENT, STABILIZE |
| Constructor Summary | |
SimplePoolInterface(PoolManager poolManager,
boolean remote)
Class constructor. |
|
| Method Summary | |
void |
addAtomChild(java.lang.String name,
java.lang.String child)
Adds the atom child as child to the module
name. |
void |
addModuleChild(java.lang.String name,
java.lang.String child)
Adds the module child as child to the module
name. |
void |
createAtom(java.lang.String name)
Creates a new atom. |
void |
createAtomFormat(java.lang.String name,
java.lang.String ext,
java.lang.String contentfile,
java.lang.String attrs)
Creates a new alternative format of an atom and imports its initial content. |
void |
createCourse(java.lang.String name,
java.lang.String module)
Creates a new course. |
void |
createModule(java.lang.String name)
Creates a new module. |
void |
deactivate()
Deactivate the Interface by unexporting the PMClient. |
void |
deleteAtom(java.lang.String name)
Deletes an atom and all its alternative formats. |
void |
deleteCourse(java.lang.String name)
Deletes a course with its content and error log. |
void |
deleteModule(java.lang.String name)
Deletes a module and its content. |
java.lang.String |
describeAtom(java.lang.String name)
Gets a description of the Atom with name.
|
java.lang.String |
describeCourse(java.lang.String name)
Gets a description of the Course with name.
|
java.lang.String |
describeModule(java.lang.String name)
Gets a description of the module with name.
|
java.lang.String |
describePool()
Gets a description of the pool. |
void |
exportAtom(java.lang.String name)
Exports the atom name. |
void |
exportAtoms(java.lang.String regexp)
Exports several atoms in the pool. |
void |
exportModule(java.lang.String name)
Exports the content of the module name to the file name.tml. |
void |
exportModule(java.lang.String name,
java.lang.String filename)
Exports the content of the module name to a file. |
void |
exportModules(java.lang.String regexp)
Exports the content of several modules in the pool. |
void |
importAtom(java.lang.String name)
Imports the atom name. |
void |
importAtoms(java.lang.String regexp)
Imports several atoms in the pool. |
void |
importModule(java.lang.String name)
Imports the content of the module name from the file name.tml. |
java.lang.String |
importModule(java.lang.String name,
java.lang.String filename)
Imports the content of the module name from a file. |
void |
importModules(java.lang.String regexp)
Imports the content of several modules in the pool. |
void |
prepareChildren(java.lang.String name)
Prepares the children of a module and exports the corresponding pseudo document to the directory specified by the option targeteam.exportdir. |
void |
prepareCourse(java.lang.String name)
Prepares a course and exports the result to the directory specified by the option targeteam.coursedir. |
void |
removeAtomChild(java.lang.String name,
java.lang.String i)
Removes the ith atom child of the module
name. |
void |
removeModuleChild(java.lang.String name,
java.lang.String i)
Removes the ith module child of the module
name. |
void |
rotateAtomChildren(java.lang.String name,
java.lang.String cycle)
Reorders atom children of the module name. |
void |
rotateModuleChildren(java.lang.String name,
java.lang.String cycle)
Reorders module children of the module name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimplePoolInterface(PoolManager poolManager,
boolean remote)
throws java.io.IOException
poolManager - the pool to be accessed, wrapped by its manager.
May be null if needed only for inspecting the classe's methods,
not for real use.remote - whether the pool manager is remote.| Method Detail |
public void deactivate()
public void createModule(java.lang.String name)
throws ArgumentException,
TransactionException,
java.io.IOException
name - the name for referencing the module.
ArgumentException - If there is already a module with
name in the pool or if name is null.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void createAtom(java.lang.String name)
throws ArgumentException,
TransactionException,
java.io.IOException
name - the name for referencing the atom.
ArgumentException - If there is already a module with
name in the pool or if name is null.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void deleteModule(java.lang.String name)
throws ArgumentException,
TransactionException,
java.io.IOException
The module can only be deleted if it is not used as a child of another module or as the associated module of a course.
All versions of the content are deleted which are not shared with any other module.
name - the name of the module to be deleted. If the name
is not unique in the pool, only one module with this
name will be deleted.
ArgumentException - If there is no module with
name in the pool or if name is null
or if the module is still used as a child
of at least one other module in the pool or as the root
module of a course in the pool.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void deleteAtom(java.lang.String name)
throws ArgumentException,
TransactionException,
java.io.IOException
The atom can only be deleted if it is not used as a child of a module in the pool.
name - the name of the atom to be deleted. If the name
is not unique in the pool, only one atom with this
name will be deleted.
ArgumentException - If there is no atom with
name in the pool or if name is null
or if the atom is still used as a child
of at least one module in the pool or in the last
preparation of at least one course.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void createAtomFormat(java.lang.String name,
java.lang.String ext,
java.lang.String contentfile,
java.lang.String attrs)
throws ArgumentException,
TransactionException,
java.io.IOException
name - the atom name. If the name
is not unique in the pool, an arbitrary atom with this
name will be used.ext - the extension for referencing the format.contentfile - the file from which the initial format content
is imported.attrs - the attributes. This is a string containing the attribute
settings in XML notation. Example:
"type=\"image/gif\" derived-from=\"fig\" derived-by=\"xv\"
ArgumentException - If there is no atom with
name in the pool or if a parameter is null
or if there is already a format of atom
name with extension ext in the pool
or if the contentfile does not exist
or if there is a syntax error in attrs.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
contentfile.
public void addModuleChild(java.lang.String name,
java.lang.String child)
throws ArgumentException,
TransactionException,
java.io.IOException
child as child to the module
name. If the names child or name
are not unique among the modules in the pool, arbitrary modules with
these names are used. The module is added behind the last existing
child module.
This method checks for cycles. If (in the current versions), the
module with name is a descendant of the child module,
an exception is signaled.
name - the name of the module to become the parent.child - the name of the module to be added as child.
ArgumentException - If one of the parameters is null or
if there is no module with
name or child in the pool
or if the module with name
is (in the current versions) a descendant of the child
module.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void addAtomChild(java.lang.String name,
java.lang.String child)
throws ArgumentException,
TransactionException,
java.io.IOException
child as child to the module
name. If the names child or name
are not unique among the modules in the pool, an arbitrary atom or
module with the name is used. The atom is added behind the last existing
child atom.
name - the name of the module to become the parent.child - the name of the atom to be added as child.
ArgumentException - If one of the parameters is null or
if there is no module with
name or child in the pool
or if the module with name
is (in the current versions) a descendant of the child
module.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void removeModuleChild(java.lang.String name,
java.lang.String i)
throws ArgumentException,
TransactionException,
java.io.IOException
ith module child of the module
name. The child modules after the removed child
are moved one place to the front.
name - the name of the parent module. If the name
is not unique in the pool, an arbitrary module with this
name will be used.i - the index (as a String) of the child to be removed. The
first child has index 0. Negative indices are treated
as 0. If the index is too large, nothing happens.
ArgumentException - If the name is null or
if there is no module with name in the pool
or if i is no valid number.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void removeAtomChild(java.lang.String name,
java.lang.String i)
throws ArgumentException,
TransactionException,
java.io.IOException
ith atom child of the module
name. The child atoms after the removed child
are moved one place to the front.
name - the name of the parent module. If the name
is not unique in the pool, an arbitrary module with this
name will be used.i - the index (as a String) of the child to be removed. The
first child has index 0. Negative indices are treated
as 0. If the index is too large, nothing happens.
ArgumentException - If the name is null or
if there is no module with name in the pool
or if i is no valid number.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void rotateModuleChildren(java.lang.String name,
java.lang.String cycle)
throws ArgumentException,
TransactionException,
java.io.IOException
name. The children are "rotated" according to the
index sequence specified in cycle. This means, the child
at the first index in cycle is moved to the second
index in cycle, the child at the second index is
moved to the third index, etc. and the child at the last index is
moved to the first index. If the cycle has length 0 or 1, nothing happens.
The cycle is specified as a String, containing positive integer values separated by white space.
name - the name of the parent module. If the name
is not unique in the pool, an arbitrary module with this
name will be used.cycle - the index sequence specifying the rotation. The first child
has index 0.
ArgumentException - If one of the parameters is null or
if there is no module with name in the pool or
If one of the indices in cycle
is larger than the index of the last module child of
the module with name or
if there is a syntax error in cycle.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void rotateAtomChildren(java.lang.String name,
java.lang.String cycle)
throws ArgumentException,
TransactionException,
java.io.IOException
name. The children are "rotated" according to the
index sequence specified in cycle. This means, the child
at the first index in cycle is moved to the second
index in cycle, the child at the second index is
moved to the third index, etc. and the child at the last index is
moved to the first index. If the cycle has length 0 or 1, nothing happens.
The cycle is specified as a String, containing positive integer values separated by white space.
name - the name of the parent module. If the name
is not unique in the pool, an arbitrary module with this
name will be used.cycle - the index sequence specifying the rotation. The first child
has index 0.
ArgumentException - If one of the parameters is null or
if there is no module with name in the pool or
If one of the indices in cycle
is larger than the index of the last module child of
the module with name or
if there is a syntax error in cycle.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void exportModule(java.lang.String name,
java.lang.String filename)
throws ArgumentException,
java.io.IOException
name to a file. If the file exists, it is replaced.
If no file name is specified, name is used with the
extension "tml". If a file name is specified, it must be a local
name. The file is always put into the directory specified by the
option targeteam.exportdir.
The encoding to be used in the file is taken from the option targeteam.encoding. A corresponding XML declaration is added to the file.
name - the name of the module to be exported. If the name
is not unique in the pool, an arbitrary module with this
name will be used.filename - the filename where the content is stored. This
must be a local name. If it is null,
name is used with extension "tml".
ArgumentException - If name is null or
if there is no module with name in the
pool, or if filename contains a directory part.
java.io.IOException - If an error occurred when writing the content
file.
public void exportModule(java.lang.String name)
throws ArgumentException,
java.io.IOException
name to the file name.tml. If the file
exists, it is replaced. The file is put into the directory specified
by the option targeteam.exportdir.
The encoding to be used in the file is taken from the option targeteam.encoding. A corresponding XML declaration is added to the file.
name - the name of the module to be exported. If the name
is not unique in the pool, an arbitrary module with this
name will be used.
ArgumentException - If name is null or
if there is no module with name in the pool.
java.io.IOException - If an error occurred when writing the content
file.
public void exportModules(java.lang.String regexp)
throws ArgumentException,
java.io.IOException
The encoding to be used in the file is taken from the option targeteam.encoding. A corresponding XML declaration is added to the file.
regexp - the regular expression (in Perl5 syntax) for
matching the names of the modules to be exported.
ArgumentException - If regexp is null.
java.io.IOException - If an error occurred when writing the content
file.
public java.lang.String importModule(java.lang.String name,
java.lang.String filename)
throws ArgumentException,
TransactionException,
java.io.IOException
name from a file. The existing content is replaced.
If no file name is specified, name is used with the
extension "tml". If a file name is specified, it must be a local
name. The file is always accessed in the directory specified by the
option targeteam.importdir.
If the file contains an xml declaration with an encoding declaration, the encoding is taken from the declaration. Otherwise, UTF-8 is assumed.
The xml declaration is stripped from the content. If the file contains a document type definition, this is ignored and also stripped.
The file content is always validated against the internal Targeteam DTD for module contents. If the content is not valid, a message describing the error(s) is output and the content in the pool is not replaced.
name - the name of the module to be imported. If the name
is not unique in the pool, an arbitrary module with this
name will be used.filename - the filename where the content is stored. This
must be a local name. If it is null,
name is used with extension "tml".
ArgumentException - If name is null.
or if there is no module with name in the pool or
if the file does not exist, or if filename contains a
directory part.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred when reading the content
file or accessing the external pool representation.
public void importModule(java.lang.String name)
throws ArgumentException,
TransactionException,
java.io.IOException
name from the file name.tml. The existing
content is replaced. The file is accessed in the directory specified
by the option targeteam.importdir.
If the file contains an xml declaration with an encoding declaration, the encoding is taken from the declaration. Otherwise, UTF-8 is assumed.
The xml declaration is stripped from the content. If the file contains a document type definition, this is ignored and also stripped.
The file content is always validated against the internal Targeteam DTD for module contents. If the content is not valid, a message describing the error(s) is output and the content in the pool is not replaced.
name - the name of the module to be imported. If the name
is not unique in the pool, an arbitrary module with this
name will be used.
ArgumentException - If name is null.
or if there is no module with name in the pool or
if the file does not exist.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred when reading the content
file or accessing the external pool representation..
public void importModules(java.lang.String regexp)
throws ArgumentException,
java.io.IOException
If a file contains an xml declaration with an encoding declaration, the encoding is taken from the declaration. Otherwise, UTF-8 is assumed.
The xml declaration is stripped from the content. If the file contains a document type definition, this is ignored and also stripped.
The file content is always validated against the internal Targeteam DTD for module contents. If the content is not valid, a message describing the error(s) is output and the content in the pool is not replaced.
regexp - the regular expression (in Perl5 syntax) for
matching the names of the modules to be imported. The match is
performed based on the existing modules in the course, not on the
existing files in the import directory!
ArgumentException - If regexp is null.
java.io.IOException - If an error occurred when accessing the
external pool representation.
public void exportAtom(java.lang.String name)
throws ArgumentException,
java.io.IOException
name. All formats of the atom are exported
to the directory specified by the option
targeteam.exportdir. For each format a file is
created, using the atom name and the format extension.
If corresponding files exist in the directory, they are replaced.
If an extension is not unique among the atom formats, an arbitrary format with this extension is exported.
name - the name of the atom to be exported. If the name
is not unique in the pool, an arbitrary atom with this
name will be used.
ArgumentException - If name is null.
or if there is no module with name in the pool
java.io.IOException - If an error occurred when writing the files.
public void exportAtoms(java.lang.String regexp)
throws ArgumentException,
java.io.IOException
If an extension is not unique among the formats of an atom, an arbitrary format with this extension is exported.
ArgumentException - If regexp is null.
java.io.IOException - If an error occurred when writing the files.
public void importAtom(java.lang.String name)
throws ArgumentException,
TransactionException,
java.io.IOException
name. All formats of the atom are
imported from the directory specified by the option
targeteam.importdir. For each format the file is
read, which has the atom name and the format extension.
If for a format no such file is found, the import is aborted and
all formats of the atom remain unchanged.
If an extension
is not unique among the formats, all formats with the same extension are
imported from the same file.
name - the name of the atom to be imported. If the name
is not unique in the pool, an arbitrary atom with this
name will be used.
ArgumentException - If name is null or
if there is no module with name in the pool.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred when reading the files.
public void importAtoms(java.lang.String regexp)
throws ArgumentException,
java.io.IOException
regexp - the regular expression (in Perl5 syntax) for
matching the names of the atoms to be imported. The match is
performed based on the existing atoms in the course, not on the
existing files in the import directory!
ArgumentException - If regexp is null.
java.io.IOException - If an error occurred when accessing the
external pool representation.
public void createCourse(java.lang.String name,
java.lang.String module)
throws ArgumentException,
TransactionException,
java.io.IOException
name - the name for referencing the course.module - the name of the module to associate with the
course. If the module name
is not unique in the pool, an arbitrary module with this
name will be used.
ArgumentException - If one of the parameters is null or
if there is already a course with
name in the pool or
if there is no module with
module in the pool.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void deleteCourse(java.lang.String name)
throws ArgumentException,
TransactionException,
java.io.IOException
name - the name of the course to be deleted. If the name
is not unique in the pool, only one module with this
name will be deleted.
ArgumentException - If the name is null or
if there is no Course with
name in the pool.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred accessing the
external pool representation.
public void prepareCourse(java.lang.String name)
throws ArgumentException,
PreparationException,
TransactionException,
java.io.IOException
The encoding to be used for writing the TeachML content is taken from the option targeteam.encoding.
name - the name of the course to be prepared. If the name
is not unique in the pool, an arbitrary course with this
name will be prepared.
ArgumentException - If the name is null or
if there is no Course with
name in the pool.
PreparationException - If there was an error during preparation.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred when writing files.
public void prepareChildren(java.lang.String name)
throws ArgumentException,
PreparationException,
TransactionException,
java.io.IOException
The encoding to be used for writing the pseudo document is taken from the option targeteam.encoding.
name - the name of the module for which to prepare the
children. If the name
is not unique in the pool, an arbitrary module with this
name will be used.
ArgumentException - If the name is null or
if there is no Module with
name in the pool.
PreparationException - If there was an error during preparation.
TransactionException - If the pool is currently processed
by another client.
java.io.IOException - If an error occurred when writing files.
public java.lang.String describeModule(java.lang.String name)
throws ArgumentException,
java.io.IOException
name.
The description contains the names of all child modules and atoms,
the names of all parent modules, the names of courses using the
module directly or indirectly, and all attributes with their values.
name - the name of the module. If the name
is not unique in the pool, an arbitrary module with this
name will be described.
ArgumentException - If the name is null or
if there is no module with name in the pool.
java.io.IOException - If an error occurs when accessing the
external pool representation.
public java.lang.String describeAtom(java.lang.String name)
throws ArgumentException,
java.io.IOException
name.
The description contains the extensions and attributes of all formats,
the names of all parent modules, the names of courses using the
atom directly or indirectly, and all attributes with their values.
name - the name of the atom. If the name
is not unique in the pool, an arbitrary atom with this
name will be described.
ArgumentException - If the name is null or
if there is no atom with name in the pool.
java.io.IOException - If an error occurs when accessing the
external pool representation.
public java.lang.String describeCourse(java.lang.String name)
throws ArgumentException,
java.io.IOException
name.
The description contains the name of the associated module,
the date of the last preparation, and the names of all atoms
used in the last prepared content.
name - the name of the course. If the name
is not unique in the pool, an arbitrary course with this
name will be described.
ArgumentException - If the name is null or
if there is no course with name in the pool.
java.io.IOException - If an error occurs when accessing the
external pool representation.
public java.lang.String describePool()
throws java.io.IOException
java.io.IOException - If an error occurs when accessing the
external pool representation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||