cometa.exist
Class MetadataDB

java.lang.Object
  extended by cometa.exist.MetadataDB
All Implemented Interfaces:
java.io.Serializable

public class MetadataDB
extends java.lang.Object
implements java.io.Serializable

This class contains all the method that allow to communicate with the metadata database (we are using eXist, for more information plese refer to the database documentation.) Note: the fields of this class must be configured when the framework is installed.

See Also:
Serialized Form

Constructor Summary
MetadataDB()
          It creates a new instance of
 
Method Summary
 java.util.ArrayList<java.lang.String> getAllMethods()
          Returns all the methods stored in the metadata database.
 org.xmldb.api.base.Collection getCollection(java.lang.String collection)
          Returns a database collection (a set of XML documents).
 org.xmldb.api.modules.XMLResource getDocument(java.lang.String doc, org.xmldb.api.base.Collection col)
          Returns a document in the eXist XMLResource format.
static java.lang.String getLogFile()
           
static java.lang.String getMethodCollection()
           
 Method getMethodObject(org.xmldb.api.modules.XMLResource xmlMethod, boolean validateXML)
          Transforms a method XMLResource into a method object (JAXB).
 Method getMethodObjectWithID(java.lang.String methodID, boolean validateXML)
          Returns a method instance (thanks to the JAXB architecture), given its ID (String).
static java.lang.String getMethodSchema()
           
 org.xmldb.api.modules.XMLResource getMethodWithID(java.lang.String methodID)
          Returns a method in the eXist XMLResource format, given its ID (String).
 Product getProductObject(org.xmldb.api.modules.XMLResource xmlProduct, boolean validateXML)
          Transforms a product XMLResource into a product object (JAXB).
 Product getProductObjectWithID(java.lang.String productID, boolean validateXML)
          Returns a product instance (thanks to the JAXB architecture), given its ID (String).
static java.lang.String getProductSchema()
           
static java.lang.String getProductsCollection()
           
 org.xmldb.api.modules.XMLResource getProductWithID(java.lang.String productID)
          Returns a product in the eXist XMLResource format, given its ID (String).
static java.lang.String getResultsCollection()
           
static java.lang.String getURI()
           
static java.lang.String getValidationCollection()
           
static java.lang.String getValidationDirectory()
           
static ValidateXML getValidator()
           
static java.lang.String getXmlFilesWorkingDirectory()
           
static void setValidator(ValidateXML aValidator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataDB

public MetadataDB()
It creates a new instance of
MetadataDB
.

Method Detail

getDocument

public org.xmldb.api.modules.XMLResource getDocument(java.lang.String doc,
                                                     org.xmldb.api.base.Collection col)
Returns a document in the eXist XMLResource format.

Parameters:
doc - The document name.
col - The collection name.
Returns:
It returns an
XMLResource
for the required document.

getCollection

public org.xmldb.api.base.Collection getCollection(java.lang.String collection)
Returns a database collection (a set of XML documents).

Parameters:
collection - The collection's name.
Returns:
It returns the required collection.

getAllMethods

public java.util.ArrayList<java.lang.String> getAllMethods()
Returns all the methods stored in the metadata database. This method is used to retrieve the available combination method when the frameowrk is started.

Returns:
It returns an ArrayList of strings representing the IDs of the available combination method.

getMethodWithID

public org.xmldb.api.modules.XMLResource getMethodWithID(java.lang.String methodID)
Returns a method in the eXist XMLResource format, given its ID (String).

Parameters:
methodID - The ID of the required method.
Returns:
It returns the
XMLResource
for the required ID.

getMethodObjectWithID

public Method getMethodObjectWithID(java.lang.String methodID,
                                    boolean validateXML)
Returns a method instance (thanks to the JAXB architecture), given its ID (String).

Parameters:
methodID - The method ID.
validateXML - A boolean value that indicates wether the method metadata has to be checked against the corresponding XML Schema or not.
Returns:
It returns a method object (see JAXB).

getProductWithID

public org.xmldb.api.modules.XMLResource getProductWithID(java.lang.String productID)
Returns a product in the eXist XMLResource format, given its ID (String).

Parameters:
productID - The product ID.
Returns:
It returns the
XMLResource
for the required ID.

getProductObjectWithID

public Product getProductObjectWithID(java.lang.String productID,
                                      boolean validateXML)
Returns a product instance (thanks to the JAXB architecture), given its ID (String).

Parameters:
productID - The product ID.
validateXML - A boolean value that indicates wether the product metadata has to be checked against the corresponding XML Schema or not.
Returns:
It returns a product object (see JAXB).

getMethodObject

public Method getMethodObject(org.xmldb.api.modules.XMLResource xmlMethod,
                              boolean validateXML)
Transforms a method XMLResource into a method object (JAXB). If the parameter validateXML is set to true, it verifies the XML metadata against its XML Schema.

Parameters:
xmlMethod - The
XML Resource
for the method to be translated.
validateXML - A boolean value that indicates wether the method metadata has to be checked against the corresponding XML Schema or not.
Returns:
It returns a method object (see JAXB).

getProductObject

public Product getProductObject(org.xmldb.api.modules.XMLResource xmlProduct,
                                boolean validateXML)
Transforms a product XMLResource into a product object (JAXB). If the parameter validateXML is set to true, it verifies the XML metadata against its XML Schema.

Parameters:
xmlProduct - The
XML Resource
for the product to be translated.
validateXML - A boolean value that indicates wether the product metadata has to be checked against the corresponding XML Schema or not.
Returns:
It returns a product object (see JAXB).

getMethodCollection

public static java.lang.String getMethodCollection()

getProductsCollection

public static java.lang.String getProductsCollection()

getResultsCollection

public static java.lang.String getResultsCollection()

getXmlFilesWorkingDirectory

public static java.lang.String getXmlFilesWorkingDirectory()

getURI

public static java.lang.String getURI()

getValidationCollection

public static java.lang.String getValidationCollection()

getProductSchema

public static java.lang.String getProductSchema()

getMethodSchema

public static java.lang.String getMethodSchema()

getValidator

public static ValidateXML getValidator()

setValidator

public static void setValidator(ValidateXML aValidator)

getValidationDirectory

public static java.lang.String getValidationDirectory()

getLogFile

public static java.lang.String getLogFile()