public class TaxonomyBuilder
extends java.lang.Object
Process:
generate()
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DTS_BUILDER_EXTENDED_LINKS_POLICY
The property DTS_BUILDER_EXTENDED_LINKS_POLICY defines how the tool creates new extended links inside
linkbase containers.
|
static java.lang.String |
DTS_BUILDER_EXTENDED_LINKS_POLICY_CREATE_NEW
This value of the Extended Links Policy indicates that a every instruction in the DTS Definition Language generates a new extended link within the parent container.
|
static java.lang.String |
DTS_BUILDER_EXTENDED_LINKS_POLICY_REUSE_EXISTING
This value of the Extended Links Policy indicates that a every instruction in the DTS Definition Language generates will try to
reuse existing extended links already created in the parent container.
|
static java.lang.String |
DTS_BUILDER_TARGET_OUT_OF_CURRENT_FILE_MESSAGE
This property control what message level is assigned to the event that occurs when, during the creation of an arc, a resource
referenced in the from or to (source or target of the relationship) is out of the file where the arc is created but the ID
of the target resource exists on another file.
|
static java.lang.String |
LOGGER_NAME
This is the logger name where this Taxonomy Builder sends logs to.
|
static java.lang.String |
PROPERTY_VALUE_ERROR
Property value for error messages.
|
static java.lang.String |
PROPERTY_VALUE_IGNORE
Property value for ignore messages.
|
static java.lang.String |
PROPERTY_VALUE_TRACE
Property value for trace messages.
|
static java.lang.String |
PROPERTY_VALUE_WARN
Property value for warning messages.
|
Constructor and Description |
---|
TaxonomyBuilder()
Creates a new TaxonomyBuilder instance.
|
TaxonomyBuilder(java.net.URI excelURI,
java.lang.String sheetInstructions)
Creates a new TaxonomyBuilder instance.
|
Modifier and Type | Method and Description |
---|---|
static void |
addToSchemaLocation(java.lang.String namespace,
java.lang.String absoluteURL,
GenerationContext gc)
Adds the schema to schemaLocation attribute if it is not already there.
|
static java.util.Properties |
createDefaultProperties()
Creates the default properties.
|
void |
generate()
Generates the new DTS using default values for all properties.
|
void |
generate(GenerationContext gc)
Generates the new DTS using the properties indicated and the workbook form the
GenerationContext. the instructions sheet will be taken from the constructor of this class
|
XBRLArcroleType |
getArcroleType(GenerationContext gc,
java.lang.String arcrole)
Returns an arcrole type in the DTS from the arcrole type URI
|
XMLFragment |
getConceptAtPoint(DTSContainer dts,
ExcelSheetPoint conceptPrefixPoint)
Search the DTS for a concept definition using the prefix and local name.
|
java.lang.String |
getContentAsStringFromTextOrRef(ExcelSheetPoint sp,
GenerationContext gc)
Returns the content of the cell in the sp parameter as text, if that cell content
is another cell reference, the reference is resolved to the final text and
returned.
|
java.net.URI |
getExcelURI()
Gets the excel uri.
|
GenerationContext |
getGenerationContext()
Generates the new DTS using the properties indicated.
|
GenerationContext |
getGenerationContext(java.util.Properties props)
Generates the new DTS using the properties indicated.
|
org.apache.log4j.Logger |
getLogger()
Access to the logger on this class.
|
javax.xml.namespace.QName |
getQName(java.lang.String token,
GenerationContext gc,
XBRLTaxonomy tx,
XBRLLinkbase lb)
Obtains a QName from the token string.
|
javax.xml.namespace.QName |
getQNameAtPoint(GenerationContext gc,
ExcelSheetPoint qnamePoint,
boolean bIsConcept)
Reads a concept reference as defined in the Taxonomy Builder documentation
The cell pointed to by the qnamePoint parameter is the concept prefix.
|
javax.xml.namespace.QName |
getQNameConcept(DTSContainer dts,
java.lang.String conceptPrefix,
java.lang.String conceptName)
Returns the QName of a concept already defined in one of the taxonomies in the DTS.
|
static XBRLXSDTypeDefinition |
getTypeDefinitionAtPoint(GenerationContext gc,
ExcelSheetPoint typePoint)
Gets the type definition at point.
|
static XMLFragment |
getXMLFragment(java.lang.String keyToken,
GenerationContext gc)
Obtains an XMLFragment from the DTS using either the cache of Generic Labels or the loc({href}) function.
|
static void |
main(java.lang.String[] args)
The main method.
|
javax.xml.namespace.QName |
putGlobalName(java.lang.String name,
javax.xml.namespace.QName q,
GenerationContext gc)
Adds an entry to the global table of names to QNames.
|
XBRLAttribute[] |
readAttributes(ExcelSheetPoint attSp,
GenerationContext gc,
boolean useContextTaxonomyNamespace,
java.lang.String[] validNoNamespaceAtts)
Obtain attributes for the new elements.
|
static void |
registerInstructionsFactory(java.lang.String clazz)
Instantiates and registers a new factory class for instructions.
|
void |
setExcelURI(java.net.URI excelURI)
Sets the excel uri.
|
void |
setSheetInstructions(java.lang.String sheetInstructions)
Sets the sheet instructions.
|
static void |
usage()
Usage.
|
public static final java.lang.String DTS_BUILDER_EXTENDED_LINKS_POLICY
"create-new": see DTS_BUILDER_EXTENDED_LINKS_POLICY_CREATE_NEW
"reuse-existing": see DTS_BUILDER_EXTENDED_LINKS_POLICY_REUSE_EXISTING
(default)
public static final java.lang.String DTS_BUILDER_EXTENDED_LINKS_POLICY_CREATE_NEW
public static final java.lang.String DTS_BUILDER_EXTENDED_LINKS_POLICY_REUSE_EXISTING
public static final java.lang.String DTS_BUILDER_TARGET_OUT_OF_CURRENT_FILE_MESSAGE
public static final java.lang.String PROPERTY_VALUE_WARN
public static final java.lang.String PROPERTY_VALUE_ERROR
public static final java.lang.String PROPERTY_VALUE_IGNORE
public static final java.lang.String PROPERTY_VALUE_TRACE
public static final java.lang.String LOGGER_NAME
public TaxonomyBuilder(java.net.URI excelURI, java.lang.String sheetInstructions) throws com.rs.lic.LicenseVerificationException
generate()
method will execute
the instructions in the sheet indicated in the sheetInstructions parameter.excelURI
- the excel urisheetInstructions
- name of the sheet with instructions to executecom.rs.lic.LicenseVerificationException
- if the user does not have rights to use this class or any problem with the license has occurredpublic TaxonomyBuilder() throws com.rs.lic.LicenseVerificationException
generate()
method will execute
the instructions in the sheet indicated in the sheetInstructions parameter.com.rs.lic.LicenseVerificationException
- if the user does not have rights to use this class or any problem with the license has occurredpublic void setExcelURI(java.net.URI excelURI)
excelURI
- the excelURI to setpublic java.net.URI getExcelURI()
public void setSheetInstructions(java.lang.String sheetInstructions)
sheetInstructions
- the sheetInstructions to setpublic static void registerInstructionsFactory(java.lang.String clazz) throws XBRLInitializationException
clazz
- the clazzXBRLInitializationException
- the XBRL initialization exceptionpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- the argumentsjava.lang.Exception
- the exceptionpublic void generate() throws TaxonomyBuilderException
TaxonomyBuilderException
- the taxonomy builder exceptionpublic org.apache.log4j.Logger getLogger()
public GenerationContext getGenerationContext() throws TaxonomyBuilderException
TaxonomyBuilderException
- the taxonomy builder exceptionpublic GenerationContext getGenerationContext(java.util.Properties props) throws TaxonomyBuilderException
props
- the propsTaxonomyBuilderException
- the taxonomy builder exceptionpublic static java.util.Properties createDefaultProperties()
public void generate(GenerationContext gc) throws TaxonomyBuilderException
gc
- the gcTaxonomyBuilderException
- the taxonomy builder exceptionpublic static void addToSchemaLocation(java.lang.String namespace, java.lang.String absoluteURL, GenerationContext gc)
The GenerationContext needs to have an existing not null value in gc.lb which is the current linkbase file being processed
namespace
- the namespaceabsoluteURL
- the absolute urlgc
- the gcpublic javax.xml.namespace.QName putGlobalName(java.lang.String name, javax.xml.namespace.QName q, GenerationContext gc)
name
- as string, this is the key for the QNameq
- as QName this is the QName the key refers to.public static XBRLXSDTypeDefinition getTypeDefinitionAtPoint(GenerationContext gc, ExcelSheetPoint typePoint)
gc
- the gctypePoint
- the type pointpublic XBRLArcroleType getArcroleType(GenerationContext gc, java.lang.String arcrole)
gc
- Generation contextarcrole
- the arcrole URI value as stringpublic static XMLFragment getXMLFragment(java.lang.String keyToken, GenerationContext gc)
keyToken
- the key tokengc
- the gcpublic javax.xml.namespace.QName getQName(java.lang.String token, GenerationContext gc, XBRLTaxonomy tx, XBRLLinkbase lb)
token
- the tokengc
- the GenerationContexttx
- in scope taxonomy if any (for resolution of namespaces), can be nulllb
- in scope linkbase if any (for resolution of namespaces), can be nullpublic XMLFragment getConceptAtPoint(DTSContainer dts, ExcelSheetPoint conceptPrefixPoint) throws SheetPointAccessException
dts
- DTSContainer for concept searchingconceptPrefixPoint
- SheetPoint for the prefixSheetPointAccessException
- if the concept is not found.public javax.xml.namespace.QName getQNameAtPoint(GenerationContext gc, ExcelSheetPoint qnamePoint, boolean bIsConcept) throws SheetPointAccessException
The cell pointed to by the qnamePoint parameter is the concept prefix. The following cell is the element name in the namespace defined by the prefix.
The method searches loaded namespaces for a namespace that corresponds to the prefix. Once one is found, a new QName is created on that namespace for that prefix using the name found in the following cell.
qnamePoint
- the cell where the prefix is definedbIsConcept
- the b is conceptSheetPointAccessException
- in case of problems reading the parameterspublic javax.xml.namespace.QName getQNameConcept(DTSContainer dts, java.lang.String conceptPrefix, java.lang.String conceptName)
dts
- the dtsconceptPrefix
- the concept prefixconceptName
- the concept namepublic XBRLAttribute[] readAttributes(ExcelSheetPoint attSp, GenerationContext gc, boolean useContextTaxonomyNamespace, java.lang.String[] validNoNamespaceAtts)
attSp
- the att spgc
- the GenerationContextuseContextTaxonomyNamespace
- a boolean value. when true, the taxonomy namespace will have priority when resolving prefixesvalidNoNamespaceAtts
- the valid no namespace attspublic static void usage()
public java.lang.String getContentAsStringFromTextOrRef(ExcelSheetPoint sp, GenerationContext gc) throws SheetPointException
sp
- the excel sheet point to start looking atgc
- the generation contextSheetPointException
- in case sp contains nothing (the cell does not exist with a content in the workbook)Copyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa