|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.omdocjdom.mbase.MBaseBuilder
public class MBaseBuilder
This class is responsible for building the JDOM documents
(more precisely the OJDocument with elements of class
MBaseItem) and to build the table
of id and the dependencies information.
This is then used to create the OmdocJdomMBase.
One such element is need for each new instances of OmdocJdomMBase.
Invocation of this class can be done through two ways: either through a command-line invocation
(this OmdocJdomMBase's main invocation is coming to the one here) or through properties.
| Nested Class Summary | |
|---|---|
protected class |
MBaseBuilder.MBaseFactory
|
| Field Summary | |
|---|---|
protected Exception |
buildException
|
static int |
CORRECT_ABSOLUTE
|
static int |
CORRECT_NONE
|
static int |
CORRECT_RELATIVE
|
static String |
CVS_ID
|
| Constructor Summary | |
|---|---|
MBaseBuilder(Subconfiguration props)
Complete constructor from the properties which are properties to override makeDefaultProperties(). |
|
| Method Summary | |
|---|---|
OmdocJdomMBase |
buildMBase()
Makes the whole construction from a set of files given as String paths. |
void |
fixRef(OJElement elt,
OJElement fromWhere,
String attName,
ID resolvedID)
Sets the value of the attribute of name attName to be the URI pointed by resolvedID according to the correction politics as stored in correction variable. |
List |
getDocuments()
|
Exception |
getException()
|
OmdocJdomMBase |
getMBase()
Returns the mbase that has been prepared. |
MBaseRef |
getSurroundingMBaseRef()
Gets the surrounding MBaseRef used to check the existence
of items outside of the currently loaded MBase. |
protected void |
initSaxBuilder()
|
static void |
main(String[] args)
Main invocation of the MBase. |
static void |
printUsage(OutputStream outStream)
Prints the usage text. |
void |
rebuild()
This method calls all the table and dependency rebuilding mechanisms. |
void |
reloadOMdocs()
Reloads the OMDocs stored in the paths variable. |
protected boolean |
runLastThings()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CVS_ID
public static final int CORRECT_RELATIVE
public static final int CORRECT_ABSOLUTE
public static final int CORRECT_NONE
protected Exception buildException
| Constructor Detail |
|---|
public MBaseBuilder(Subconfiguration props)
throws Exception
makeDefaultProperties().
Note that the builder is then only ready to be fed with documents.
Properties that can be set are the following (note that the
ActiveMath manager uses the prefix OmdocJdomMbase:
collectionName
defines the collection-name to use (only one is supported for now)
path.*
defines the paths to the files or directories that have to be loaded.
An example is:path.metrics = /omdoc1/metricspath.topologicalSpaces = /omdoc1/topology/topologicalSpaces.omdoc.omdoc
in this directory and its subdirectories will be loaded.Subconfiguration.getPath(java.lang.String) is used.
(this allows, within ActiveMath at least, to use the
path.metrics.refType = absolute or
path.metrics.refType = inTemp auxiliary properties).
errorReporter.throwExceptions:
stops the building process at first error,
reporting on it. (default is false)
errorReporter.runRhino:
starts the rhino java script engine at the end of the build
process, reading from stdin
(and may suspend the process if it is background as it is
reading from stdin).
(default is false)
errorReporter.details:
if set to true, displays even the content of
the element where the fault is found.
(default is false)
errorReporter.warnOnGuess:
If set to true, displays the guess warnings where the references
pointing inappropriately to an element are replaced by their shortest
references. This is very verbose often.
(default is true)
errorReporter.printStackTrace:
If set to true, displays the stack-trace of the exception.
Useful when having troubles with input/output.
(default is false)
errorReporter.verbosity:
A number that, if non-null, can be used to output debugging messages.
(default is 0)
errorReporter.maxErrors
A number that indicates the maximum number of errors
displayed. Default is 20. A value of -1 indicates to never stop.
reformulate_uris
Can have the value absolute, relative, or none.surrounding (defaults to have it empty)
no or does not exist it means that
no surrounding MBaseRef
is wished.service, the Subconfiguration.getService(java.lang.String)
will be used with interface name MBaseRef is then used.
Note that may lead to cyclic service building.create then the
ConfiguredObjectMaker service is requested
on the subtree surrounding of this configuration.
(hence the .class property and others are then used)
surrounding.class
server.port
If different than -1, starts an OJXMLRPCmbaseServer
on the given port. Default is port 27000.
See the public methods of this class for accessible method-calls.
The impossibility to open such a port simply prints an error and a stacktrace,
which means you should be sure the port is free before planning to start a useful
server on this port.
This class uses the MBaseRef service
to be used as surrounding MBaseRef allowing the items not in the
being loaded database to be checked for their existance in the other database.
Exception| Method Detail |
|---|
public static void main(String[] args)
throws Exception
Exceptionprotected boolean runLastThings()
public static void printUsage(OutputStream outStream)
public void reloadOMdocs()
throws IOException
paths variable.
IOException
public OmdocJdomMBase buildMBase()
throws NoSuchIDException,
IOException
NoSuchIDException
IOExceptionpublic OmdocJdomMBase getMBase()
public Exception getException()
public List getDocuments()
protected void initSaxBuilder()
public MBaseRef getSurroundingMBaseRef()
MBaseRef used to check the existence
of items outside of the currently loaded MBase.
public void rebuild()
throws NoSuchIDException
NoSuchIDException
public void fixRef(OJElement elt,
OJElement fromWhere,
String attName,
ID resolvedID)
correction variable.
That is to say the attribute value is replaced by the absolute URI if correction is CORRECT_ABSOLUTE,
to the shortest URI (as given by ID.expressShortestRef(org.activemath.omdocjdom.OJElement, org.activemath.omdocjdom.OJElement)) if correction is CORRECT_RELATIVE
or doesn't do anything if the correction is CORRECT_NONE.
This method does not complain and catches all exceptions... It is expected that a prior resolver has already complained.
elt - The elment to change (or add) the attributefromWhere - The element from where the reference is taken (probably same as elt, used to express shortest path in relative IDs)attName - The name of the attribute to fixresolvedID - The ID resolved appropriately to all possible rules or heuristics
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||