de.interactive_instruments.ShapeChange.Target.FeatureCatalogue
Class FeatureCatalogue

java.lang.Object
  extended by de.interactive_instruments.ShapeChange.Target.FeatureCatalogue.FeatureCatalogue
All Implemented Interfaces:
MessageSource, DeferrableOutputWriter, SingleTarget, Target

public class FeatureCatalogue
extends Object
implements SingleTarget, MessageSource, DeferrableOutputWriter

Author:
Clemens Portele (portele interactive-instruments de), Johannes Echterhoff (echterhoff interactive-instruments de)

Field Summary
static String DOCX_PLACEHOLDER
          The string used as placeholder in the docx template.
static String DOCX_TEMPLATE_URL
           
static String localizationMessagesDefaultUri
          Default URI defining the location of the localizationMessages.xml file in XSLT(s).
static String localizationXslDefaultUri
          Default URI defining the location of the localization.xsl file.
static int STATUS_WRITE_HTML
           
static int STATUS_WRITE_PDF
           
static int STATUS_WRITE_RTF
           
static int STATUS_WRITE_XML
           
static int TARGET_FeatureCatalogue
           
 
Constructor Summary
FeatureCatalogue()
           
 
Method Summary
protected  void addAttribute(Document document, Element e, String name, String value)
          Add attribute to an element
protected  Document createDocument()
           
 int getTargetID()
           
 void initialise(Options o, ShapeChangeResult r)
          Perform any initialization required to perform the deferred write.
 void initialise(PackageInfo p, Model m, Options o, ShapeChangeResult r, boolean diagOnly)
          Allows a target to perform the necessary initialization routines before processing.
 String message(int mnr)
           This method returns messages belonging to the Feature Catalogue target by their message number.
protected  String messageText(int mnr)
          This is the message text provision proper.
 void process(ClassInfo ci)
          The converter will call this method for each class belonging to the package given during initialization (see Target.initialise(de.interactive_instruments.ShapeChange.Model.PackageInfo, de.interactive_instruments.ShapeChange.Model.Model, de.interactive_instruments.ShapeChange.Options, de.interactive_instruments.ShapeChange.ShapeChangeResult, boolean)).
 void reset()
          All relevant fields of the target will be reset, so that it is ready for processing selected schemas based upon a specific target configuration.
 void write()
           
 void writeAll(ShapeChangeResult r)
          Instructs the target to output the processing results.
 void writeOutput()
          Execute the deferred write of the desired output.
 void xsltWrite(File transformationSource, String xsltfileName, File transformationTarget)
           
 void xsltWrite(String xmlName, String xsltfileName, String outfileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TARGET_FeatureCatalogue

public static final int TARGET_FeatureCatalogue
See Also:
Constant Field Values

STATUS_WRITE_PDF

public static final int STATUS_WRITE_PDF
See Also:
Constant Field Values

STATUS_WRITE_HTML

public static final int STATUS_WRITE_HTML
See Also:
Constant Field Values

STATUS_WRITE_XML

public static final int STATUS_WRITE_XML
See Also:
Constant Field Values

STATUS_WRITE_RTF

public static final int STATUS_WRITE_RTF
See Also:
Constant Field Values

localizationMessagesDefaultUri

public static final String localizationMessagesDefaultUri
Default URI defining the location of the localizationMessages.xml file in XSLT(s). This can be overridden via the configuration parameter 'localizationMessagesUri'.

See Also:
Constant Field Values

localizationXslDefaultUri

public static final String localizationXslDefaultUri
Default URI defining the location of the localization.xsl file. This can be overridden via the configuration parameter 'xslLocalizationUri'.

See Also:
Constant Field Values

DOCX_PLACEHOLDER

public static final String DOCX_PLACEHOLDER
The string used as placeholder in the docx template. The paragraph this placeholder text belongs to will be replaced with the feature catalogue.

See Also:
Constant Field Values

DOCX_TEMPLATE_URL

public static final String DOCX_TEMPLATE_URL
See Also:
Constant Field Values
Constructor Detail

FeatureCatalogue

public FeatureCatalogue()
Method Detail

getTargetID

public int getTargetID()
Specified by:
getTargetID in interface Target

reset

public void reset()
Description copied from interface: SingleTarget
All relevant fields of the target will be reset, so that it is ready for processing selected schemas based upon a specific target configuration.

The Converter will reset SingleTargets whenever it processes a target configuration.

Specified by:
reset in interface SingleTarget

initialise

public void initialise(PackageInfo p,
                       Model m,
                       Options o,
                       ShapeChangeResult r,
                       boolean diagOnly)
                throws ShapeChangeAbortException
Description copied from interface: Target
Allows a target to perform the necessary initialization routines before processing.

Will be called by the Converter for each selected schema (see Model.selectedSchemas() and PackageInfo.isSchema()).

Specified by:
initialise in interface Target
Parameters:
p - a schema from the model selected via the configuration (see Model.selectedSchemas()) - not necessarily always an application schema
Throws:
ShapeChangeAbortException
See Also:
Model.selectedSchemas(), PackageInfo.isSchema()

addAttribute

protected void addAttribute(Document document,
                            Element e,
                            String name,
                            String value)
Add attribute to an element


createDocument

protected Document createDocument()

process

public void process(ClassInfo ci)
Description copied from interface: Target
The converter will call this method for each class belonging to the package given during initialization (see Target.initialise(de.interactive_instruments.ShapeChange.Model.PackageInfo, de.interactive_instruments.ShapeChange.Model.Model, de.interactive_instruments.ShapeChange.Options, de.interactive_instruments.ShapeChange.ShapeChangeResult, boolean)).

NOTE: will be called not only for the classes directly contained in the package, but also all sub-packages belonging to the same targetNamespace!

Specified by:
process in interface Target

write

public void write()
Specified by:
write in interface Target

writeAll

public void writeAll(ShapeChangeResult r)
Description copied from interface: SingleTarget
Instructs the target to output the processing results.

Will be called by the Converter after initialization and processing for all of the selected schema has been performed.

Specified by:
writeAll in interface SingleTarget
See Also:
Model.selectedSchemas()

xsltWrite

public void xsltWrite(String xmlName,
                      String xsltfileName,
                      String outfileName)
Parameters:
xmlName - Name of the XML file to use as the source of the transformation
xsltfileName - Name of the main XSLT file for the transformation
outfileName - Name of the transformation target file.

xsltWrite

public void xsltWrite(File transformationSource,
                      String xsltfileName,
                      File transformationTarget)

message

public String message(int mnr)

This method returns messages belonging to the Feature Catalogue target by their message number. The organization corresponds to the logic in module ShapeChangeResult. All functions in that class, which require an message number can be redirected to the function at hand.

Specified by:
message in interface MessageSource
Parameters:
mnr - Message number
Returns:
Message text, including $x$ substitution points.

messageText

protected String messageText(int mnr)
This is the message text provision proper. It returns a message for a number.

Parameters:
mnr - Message number
Returns:
Message text or null

writeOutput

public void writeOutput()
Description copied from interface: DeferrableOutputWriter
Execute the deferred write of the desired output.

Specified by:
writeOutput in interface DeferrableOutputWriter

initialise

public void initialise(Options o,
                       ShapeChangeResult r)
Description copied from interface: DeferrableOutputWriter
Perform any initialization required to perform the deferred write.

Specified by:
initialise in interface DeferrableOutputWriter


Copyright © 2015. All rights reserved.