XBRLAPI rendering sample application
Author: Steve Yang (steve2yang at yahoo.com)
Contributor: Geoff Shuetrim (geoff at galexy.net)
What is it?
This is a sample Java application demonstrating the usage of XBRLAPI and its various modules. The Rendering Sample Application loads instance document using XBRLAPI and renders the document according to XBRL Inline Specification 0.64.
The purpose of this module is to give developers step by step instructions to discover a taxonomy set and use the XBRLAPI to store the instance documents and traverse through the various presentation networks to build rendering solutions. This sample application also demonstrates how to build XBRL Inline documents using XBRL API.
The example uses the open source Freemarker template system to simplify the documentation of the desired rendering of the information in the XBRL instance being processed.
The rendered output that can be produced from this Freemarker template defining the report rendering and this target XBRL instance with a presentation linkbase included as an additional URL starting point for DTS discovery. Note that the example rendering only shows the rendered output from a single presentation network. Running the example in full creates a significantly larger report rendering.
Where is it?
The home page for the XBRL API project can be found on the XBRLAPI project web site (http://www.xbrlapi.org/). There you also find information on how to download the latest release as well as all the other information you might need regarding this project.
You can browse the source code in SVN.
Requirements
- A Java 1.5 or later compatible virtual machine for your operating system.
- Xerces 2.6.2 or later version jar file.
- Saxon 9.0 or later version jar file.
- Saxon DOM 9.0 or later version jar file.
- Saxon S9API 9.0 or later version jar file.
- Log4j 1.2.15 or later version jar file.
- Freemarker 2.3.14 or later version jar file.
- XBRLAPI module-examples jar file.
- XBRLAPI module-utilities jar file.
- XBRLAPI module-xmlbase jar file.
- XBRLAPI module-xlink jar file.
- XBRLAPI module-xpointer jar file.
- XBRLAPI module-api jar file.
- XBRLAPI module-bdb-xml jar file.
- A working installation of the Oracle Berkeley XML Database.
You can download the required XBRLAPI JARs from Sourceforge. You can get suggestions on necessary installation and configuration steps from http://www.xbrlapi.org/.
You can get the other jar files from the XBRLAPI SVN repository.
Commandline Arguments:
Java Virtual Machine (JVM) Arguments:
-Dlog4j.configuration=<location of log4j.properties> -Djava.library.path=<Berkeley DB XML 2.3.10/lib> -classpath=<java class paths>
Setting up the classpath can be nightmare in Java. If you are using the Sun Java 1.6 binaries, then it is worth taking a
look at the Sun classpath instructions.
If those are not giving you joy, then take a look at two blogs
(dirkeiler and
Mark Reinhold’s Blog). These discuss
issues with getting the -classpath parameter working with wildcards.
Program execution involves:
java <JVM ARGUMENTS> org.xbrlapi.data.bdbxml.examples.render.Run <OPTIONS> <URLS>
Where the URLs are the URLs of additional starting points for DTS discovery and the mandatory options are:
- -database [the directory that will hold the actual database data (rather than the Oracle Berkeley XML database binaries)]
- -container [the name of the file in the -database directory that will contain the data]
- -cache [the directory containing the document cache]
- -template [the file location of the Freemarker template]*
- -target [the URL of the XBRL instance to be rendered]
- -output [the output file to produce]
* MS Windows issue: for reasons that remain unknown, the rendering example can have trouble loading Freemarker templates
if they are located in the root directory of a MS Windows drive. Thus, a template location of C:\template.ftl
will fail while a location C:\templates.template.ftl will work.
Licensing and legal issues
XBRLAPI examples are released under the lesser GPL license.