de.interactive_instruments.ShapeChange.Target.Codelists
Class CodelistDictionariesML

java.lang.Object
  extended by de.interactive_instruments.ShapeChange.Target.Codelists.CodelistDictionariesML
All Implemented Interfaces:
Target

public class CodelistDictionariesML
extends Object
implements Target

Creation of ISO 19139 codelist dictionaries. If multilingual information is avaiable we create an ML_CodeListDictionary / ML_CodeDefinition, otherwise CodeListDictionary / CodeDefinition. The way how the (multilingual) information is stored in the model is specific to each application, so here is only a general structure of the dictionary creation, you have to overwrite create-methods according to your model.

Author:
olk

Field Summary
protected  String defaultLang
           
protected  String dlma
           
protected  String dlme
           
protected  String GCO_NSABBR
           
protected  String GMD_NSABBR
           
protected  String GML_NSABBR
           
protected  String GMX_NSABBR
           
protected  String[] langs
           
protected  Options options
           
protected  ShapeChangeResult result
           
protected  String sLangs
           
protected  String XLINK_NSABBR
           
 
Constructor Summary
CodelistDictionariesML()
          Ctor
 
Method Summary
protected  void addAttribute(Document document, Element e, String name, String value)
          Add attribute to an element
protected  void addDocumentNamespaceAttributes(Element ec, Document cDocument)
           
protected  void addDocumentSchemaLocAttribute(Element ec, Document cDocument)
           
protected  String createClCodeSpaceContent(ClassInfo ci)
           
protected  Element createCodelistDescription(String lang, ClassInfo ci, Document cDocument)
           
protected  Element createCodelistIdentifier(String lang, ClassInfo ci, Document cDocument)
           
protected  Element createCodelistName(String lang, ClassInfo ci, Document cDocument)
           
protected  String createCodesCodeSpaceContent(ClassInfo ci, PropertyInfo propi)
           
protected  void createDictionaryProperties(Element ec, ClassInfo ci, Document cDocument)
           
protected  Document createDocument()
           
protected  Element createDocumentNamespace(String gmlid, Document cDocument)
           
protected  Element createEntry(Document lDocument, ClassInfo ci, PropertyInfo propi, boolean local)
           
protected  HashSet<Element> createEntryAlternLangCode(Document lDocument, ClassInfo ci, PropertyInfo propi)
           
protected  Element createEntryDefinition(String lang, Document lDocument, ClassInfo ci, PropertyInfo propi, boolean altEntryLangsExist)
           
protected  Element createEntryDefinitionContent(Document lDocument, ClassInfo ci, PropertyInfo propi, HashSet<Element> eas)
           
protected  Element createEntryDescription(String lang, Document lDocument, ClassInfo ci, PropertyInfo propi)
           
protected  String createEntryIdentifier(String lang, ClassInfo ci, PropertyInfo propi)
           
protected  Element createEntryIdentifier(String lang, Document lDocument, ClassInfo ci, PropertyInfo propi)
           
protected  Element createEntryName(String lang, Document lDocument, ClassInfo ci, PropertyInfo propi)
           
protected  Element createMlDocumentNamespace(String gmlid, Document cDocument)
           
 int getTargetID()
           
 void initialise(PackageInfo p, Model m, Options o, ShapeChangeResult r, boolean diagOnly)
          Allows a target to perform the necessary initialization routines before processing.
protected  String omitNewlineChar(String in)
           
 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 write()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dlma

protected final String dlma
See Also:
Constant Field Values

dlme

protected final String dlme
See Also:
Constant Field Values

defaultLang

protected final String defaultLang
See Also:
Constant Field Values

GML_NSABBR

protected final String GML_NSABBR
See Also:
Constant Field Values

GMX_NSABBR

protected final String GMX_NSABBR
See Also:
Constant Field Values

GMD_NSABBR

protected final String GMD_NSABBR
See Also:
Constant Field Values

GCO_NSABBR

protected final String GCO_NSABBR
See Also:
Constant Field Values

XLINK_NSABBR

protected final String XLINK_NSABBR
See Also:
Constant Field Values

sLangs

protected String sLangs

langs

protected String[] langs

result

protected ShapeChangeResult result

options

protected Options options
Constructor Detail

CodelistDictionariesML

public CodelistDictionariesML()
Ctor

Method Detail

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

createDictionaryProperties

protected void createDictionaryProperties(Element ec,
                                          ClassInfo ci,
                                          Document cDocument)

createDocumentNamespace

protected Element createDocumentNamespace(String gmlid,
                                          Document cDocument)

createMlDocumentNamespace

protected Element createMlDocumentNamespace(String gmlid,
                                            Document cDocument)

addDocumentNamespaceAttributes

protected void addDocumentNamespaceAttributes(Element ec,
                                              Document cDocument)

addDocumentSchemaLocAttribute

protected void addDocumentSchemaLocAttribute(Element ec,
                                             Document cDocument)

createCodelistDescription

protected Element createCodelistDescription(String lang,
                                            ClassInfo ci,
                                            Document cDocument)

createCodelistIdentifier

protected Element createCodelistIdentifier(String lang,
                                           ClassInfo ci,
                                           Document cDocument)

createCodelistName

protected Element createCodelistName(String lang,
                                     ClassInfo ci,
                                     Document cDocument)

createEntry

protected Element createEntry(Document lDocument,
                              ClassInfo ci,
                              PropertyInfo propi,
                              boolean local)

createEntryAlternLangCode

protected HashSet<Element> createEntryAlternLangCode(Document lDocument,
                                                     ClassInfo ci,
                                                     PropertyInfo propi)
Parameters:
lDocument -
ci -
propi -
Returns:
HashSet of alternative language elements, if no alt. lang. exists: null

createEntryDefinitionContent

protected Element createEntryDefinitionContent(Document lDocument,
                                               ClassInfo ci,
                                               PropertyInfo propi,
                                               HashSet<Element> eas)

createEntryDefinition

protected Element createEntryDefinition(String lang,
                                        Document lDocument,
                                        ClassInfo ci,
                                        PropertyInfo propi,
                                        boolean altEntryLangsExist)

createEntryDescription

protected Element createEntryDescription(String lang,
                                         Document lDocument,
                                         ClassInfo ci,
                                         PropertyInfo propi)

createEntryIdentifier

protected Element createEntryIdentifier(String lang,
                                        Document lDocument,
                                        ClassInfo ci,
                                        PropertyInfo propi)

createEntryName

protected Element createEntryName(String lang,
                                  Document lDocument,
                                  ClassInfo ci,
                                  PropertyInfo propi)

createClCodeSpaceContent

protected String createClCodeSpaceContent(ClassInfo ci)

createCodesCodeSpaceContent

protected String createCodesCodeSpaceContent(ClassInfo ci,
                                             PropertyInfo propi)

createEntryIdentifier

protected String createEntryIdentifier(String lang,
                                       ClassInfo ci,
                                       PropertyInfo propi)

omitNewlineChar

protected String omitNewlineChar(String in)

write

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

getTargetID

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


Copyright © 2015. All rights reserved.