Document Analyzers

org.topcased.traceability.engine.documentAnalyzers

0.2.2

Document Analyzers extension point

Document analyzers extension point allows to define analyzers with conversion methods to transform some files into the XML format needed as entry point of TRAMway. The XML generated should respect the XML schema ttm.xsd. Analyzers also allow to define Edition methods to launch the external tool from TRAMway.

Document analyzers structure

A document analyzers extensions will contain analyzers and do not have required attributes. id and name are optional.

Document analyzer structure

A Document analyzer has an ID and a name. A Document analyzer has a sequence of conversion methods. A Document analyzer has a sequence of edition methods. A Document analyzer can be associated to an owningClass that must implements 'org.topcased.traceability.engine.tte.analyzers.IAnalyzer' interface which allows to define required methods to do the conversion.

Conversion method structure

Each method has a name and a version which concatenation using '_' character give the method identifier. Each method can accept some arguments that could be used to do the conversion.

Edition method structure

Each method has a name and a version which concatenation using '_' character give the method identifier.

<!ELEMENT extension (documentAnalyzer)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT conversionMethod EMPTY>

<!ATTLIST conversionMethod

name      CDATA #REQUIRED

version   CDATA #REQUIRED

arguments CDATA #IMPLIED>


<!ELEMENT documentAnalyzer (conversionMethod+ , editionMethod+)>

<!ATTLIST documentAnalyzer

id          CDATA #REQUIRED

name        CDATA #REQUIRED

owningClass CDATA #REQUIRED>


<!ELEMENT editionMethod EMPTY>

<!ATTLIST editionMethod

name    CDATA #REQUIRED

version CDATA #REQUIRED>


Extension declaration example

 

<extension point=

"org.topcased.traceability.engine.documentAnalyzer"

>

<documentAnalyzer id=

"org.topcased.traceability.engine.documentAnalyzer.default"

owningClass=

"tte.analyzers.basics.DefaultAnalyzer"

name=

"Default Analyzer"

>

<conversionMethod name=

"defaultConversion"

version=

"1.0.0"

/>

<editionMethod name=

"defaultEdition"

version=

"1.0.0"

/>

</documentAnalyzer>

</extension>

    /**
     * Runs the conversion of the method which id is in parameter.
     * @param id is the method id
     * @param inFile is the source file
     * @param outFile is the file that will contains the result of conversion
     * @param conversionDefaultArguments is a string tha represents common arguments
     *          from the conversion Method declaration
     * @param documentSpecificArguments is the string that represents the arguments
     *          added to the document properties
     *  that will be understood by the conversion method (can be null)
     * @param the document that will be converted
     * @throws AnalyzerMethodException if an exception occurs
     *  during instanciation of OwningClass
     * @throws ConversionException if an occurs during the conversion
     */
    void executeConversionMethodID(String id,
            File inFile,
            File outFile,
            String conversionDefaultArguments,
            Document document) throws AnalyzerMethodException,
                                ConversionException;

    /**
     * Runs the edition method which id is in parameter.
     * @param the id of executed method
     * @param the document that will be edited
     * @param the element that be searched
     * @throws AnalyzerMethodException if an exception occurs
     *  during instanciation of OwningClass
     * @throws EditionException if an occurs during the conversion
     */
    void executeEditionMethodID(String id, Document document, Element element) 
     throws AnalyzerMethodException, EditionException;