|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.omdocjdom.mbase.OmdocJdomMBase
public class OmdocJdomMBase
This class is the base class of a remake of the lost FileMBase approach (which was based
on Xerces DOM structure), this one is based on the JDOM package and its extension in the org.activemath.omdocjdom.package package.
It can serve requests as defined in the MBaseRef interface
through the use of OmdocJdomMBaseRef class. It can also serve as a good validator of IDs
where IDs used follow the syntax described under the ID class.
It also has a little API for reloading documents and other debugging output. See the command-line
invocation of this method or of the MBaseBuilder class, which serves as main
configuration engine. The class here is mainly to enable reading methods and is the one used by
All documents (hence ids) produced here contain a constant collection, i.e. a source-descriptor, so that clients refer to the same source, it is given by parameters of the builder or is "thisMBase".
All access methods synchronized on a read-write lock, {@link #lock}, thereby allowing rebuilds performed securely.
| Field Summary | |
|---|---|
MBaseBuilder |
builder
|
static String |
CVS_ID
|
ReadWriteLock |
lock
|
ElementFromIDTable |
table
|
| Constructor Summary | |
|---|---|
OmdocJdomMBase(ElementFromIDTable table,
MBaseBuilder builder)
|
|
OmdocJdomMBase(Subconfiguration config)
|
|
| Method Summary | |
|---|---|
void |
addOMdoc(File file)
Adds the named file and rebuilds. |
String |
getAttribute(MBaseID id,
String attName)
|
MBaseID |
getCanonicalID(MBaseID givenID)
Identifies the given element and returns the ID read from there. |
OJElement |
getChildren(MBaseID mbaseid,
String xPathReducedExpression)
|
Collection |
getCollectionsProvided()
|
Hashtable |
getCommonName(MBaseID id)
|
org.jdom.Element |
getCompleteDCMetadata(MBaseID id)
|
Collection |
getDefinitions(MBaseID symbolID,
Collection collections)
Reads the "inversed-dependency" elements of type "DEFINES" in metadata/extradata that are built by MBaseBuilder then filters out those whose "of" is not in the collections
given as parameter. |
Collection |
getDependencies(MBaseID id)
|
Collection |
getDepsOrInvDeps(MBaseID mbaseID,
String depName)
Returns a collection of MBaseRef.Dependency objects. |
org.jdom.Element |
getFormalContent(MBaseID id)
|
Collection |
getForWhat(MBaseID id)
|
Collection |
getInversedDependency(MBaseID mbaseID,
String wantedType)
Returns a List of the MBaseIDs that have inversed-dependencies of the given type in the given element. |
org.jdom.Element |
getMetadata(MBaseID id)
|
Collection |
getProofs(MBaseID assertionID,
Collection collections)
Reads the "inversed-dependency" elements of type "PROVES" in metadata/extradata that are built by MBaseBuilder then filters out those whose "of" is not in the collections
given as parameter. |
Collection |
getRelated(MBaseID id,
Collection collections)
Reads the "inversed-dependency" elements in metadata/extradata that are built by MBaseBuilder then filters out those whose "of" is not in the collections given as parameter. |
OJDocument |
getStructuredListOfConcepts(Collection collections)
|
List |
getTextualContent(MBaseID id)
|
MBaseID |
getTheory(MBaseID id)
|
String |
getTypeString(MBaseID id)
|
boolean |
isUpAndRunning()
Returns true only if there was no exception during the last build process. |
Iterator |
listItems(MBaseID mbaseID)
Iterates over the element itself and its children listing the IDs of this element. |
Set |
listTheories(Collection collections)
Goes through the list of IDs collecting all the theories in the given collection. |
static void |
main(String[] args)
|
ID |
makeID(MBaseID id)
This makes an ID of an MBaseID but ignores the collection part of the ID as
it supposes a dispatch has been made already before if there were different collections. |
MBaseID |
makeMBaseID(ID id)
Makes a simple shadow MBaseID out of an ID... |
MBaseID |
makeMBaseID(MBaseID baseID,
ID id)
Checks weather the collection name of id matches the collection name of this one then returns something with the collectio name of baseID, otherwise builds another collection name. |
String |
possiblyRemoveBasePath(File file)
|
void |
reload()
Does the same as reload(java.util.List) except with no error-accumulator. |
void |
reload(List errorAccumulator)
Checks the modification dates of the files that were recorded, reloads the newer files, drops the too old files and rebuilds. |
void |
removeOMdoc(File file)
Removes the named file and rebuilds. |
Iterator |
searchIDs(String idSubstring)
A quite inefficient method to search for IDs, a tree or index would be needed, moreover, asynchronous result serving should be done one day. |
Collection |
searchText(String textToSearch)
|
| 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 final ElementFromIDTable table
public final MBaseBuilder builder
public final ReadWriteLock lock
| Constructor Detail |
|---|
public OmdocJdomMBase(ElementFromIDTable table,
MBaseBuilder builder)
public OmdocJdomMBase(Subconfiguration config)
throws Exception
Exception| Method Detail |
|---|
public static void main(String[] args)
throws Exception
Exception
public Collection getInversedDependency(MBaseID mbaseID,
String wantedType)
mbaseID - Missing description of ParameterwantedType - Missing description of Parameter
public Collection getDepsOrInvDeps(MBaseID mbaseID,
String depName)
throws MBaseException
MBaseRef.Dependency objects.
mbaseID - Missing description of ParameterdepName - Missing description of Parameter
MBaseException
public Collection getDependencies(MBaseID id)
throws MBaseException
MBaseException
public Collection getRelated(MBaseID id,
Collection collections)
throws MBaseException
MBaseBuilder then filters out those whose "of" is not in the collections given as parameter.
id - Missing description of Parametercollections - Missing description of Parameter
MBaseException
public Collection getDefinitions(MBaseID symbolID,
Collection collections)
MBaseBuilder then filters out those whose "of" is not in the collections
given as parameter.
symbolID - Missing description of Parametercollections - Missing description of Parameter
public Collection getProofs(MBaseID assertionID,
Collection collections)
MBaseBuilder then filters out those whose "of" is not in the collections
given as parameter.
assertionID - Missing description of Parametercollections - Missing description of Parameter
public List getTextualContent(MBaseID id)
throws MBaseItemNotFoundException
MBaseItemNotFoundException
public org.jdom.Element getFormalContent(MBaseID id)
throws MBaseException
MBaseException
public org.jdom.Element getMetadata(MBaseID id)
throws MBaseItemNotFoundException
MBaseItemNotFoundException
public org.jdom.Element getCompleteDCMetadata(MBaseID id)
throws MBaseItemNotFoundException
MBaseItemNotFoundException
public MBaseID getTheory(MBaseID id)
throws MBaseItemNotFoundException
id - Missing description of Parameter
MBaseItemNotFoundException - Missing description of Exception
public Hashtable getCommonName(MBaseID id)
throws MBaseItemNotFoundException
id - Missing description of Parameter
MBaseItemNotFoundException - Missing description of Exception
public String getAttribute(MBaseID id,
String attName)
throws MBaseItemNotFoundException
MBaseItemNotFoundException
public String getTypeString(MBaseID id)
throws MBaseItemNotFoundException
id - Missing description of Parameter
MBaseItemNotFoundException - Missing description of Exception
public Collection getForWhat(MBaseID id)
throws MBaseItemNotFoundException
MBaseItemNotFoundException
public OJElement getChildren(MBaseID mbaseid,
String xPathReducedExpression)
throws MBaseItemNotFoundException
MBaseItemNotFoundException
public OJDocument getStructuredListOfConcepts(Collection collections)
throws MBaseException
MBaseExceptionpublic boolean isUpAndRunning()
public Collection getCollectionsProvided()
public MBaseID getCanonicalID(MBaseID givenID)
throws MBaseItemNotFoundException
givenID - Missing description of Parameter
MBaseItemNotFoundException - Missing description of Exception
public void reload()
throws org.jdom.JDOMException,
NoSuchIDException,
IOException
reload(java.util.List) except with no error-accumulator.
org.jdom.JDOMException
NoSuchIDException
IOException
public void reload(List errorAccumulator)
throws org.jdom.JDOMException,
NoSuchIDException,
IOException
MBaseErrorReporter and its
configuration throught MBaseBuilder.
errorAccumulator - A list where error records will be added-to. Can be null.
(see MBaseErrorReporter#makeAsRecord()).
org.jdom.JDOMException - Missing description of Exception
NoSuchIDException - Missing description of Exception
IOException - Missing description of Exception
public void removeOMdoc(File file)
throws IOException,
NoSuchIDException
file - Missing description of Parameter
IOException - Missing description of Exception
NoSuchIDException - Missing description of Exception
public void addOMdoc(File file)
throws NoSuchIDException,
org.jdom.JDOMException,
IOException,
Exception
file - Missing description The feature to be added to the OMdoc
attribute
NoSuchIDException - Missing description of Exception
org.jdom.JDOMException - Missing description of Exception
IOException - Missing description of Exception
Exception
public MBaseID makeMBaseID(MBaseID baseID,
ID id)
baseID - Missing description of Parameterid - Missing description of Parameter
public MBaseID makeMBaseID(ID id)
id - Missing description of Parameter
public ID makeID(MBaseID id)
ID of an MBaseID but ignores the collection part of the ID as
it supposes a dispatch has been made already before if there were different collections.
id - Missing description of Parameter
public Iterator listItems(MBaseID mbaseID)
throws MBaseException
mbaseID - Missing description of Parameter
MBaseID objects.
MBaseExceptionpublic Set listTheories(Collection collections)
ElementFromIDTable would use a better storage.
collections - Missing description of Parameter
public Collection searchText(String textToSearch)
public Iterator searchIDs(String idSubstring)
idSubstring - Missing description of Parameter
public String possiblyRemoveBasePath(File file)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||