The workbench is a preinstalled and configured NetKernel module that provides a safe and convenient area to experiment with NetKernel concepts.
The workbench is located in the /modules/workbench directory underneath the directory where you installed NetKernel. Use the workbench module to experiment with various scripting lanaguages (DPML, JavaScript, BeanShell, Python, Java, Ruby and Groovy), prototype applications, build components, and more.
Feel free to edit the example files or add your own. However, be careful not to modify the following:
The workbench module is configured to expose the address space ../workbench/. Notice the URL in your browser that displays this page. Your code will be accessible within this ../workbench URL address such as ../workbench/myscripts/test.bsh. For example, if you are running in the standard installation of NetKernel and your browser is running on the same machine, the URL is http://localhost:8080/workbench.
For your experimentation work, you may want to create a directory called "myscripts" in the ../workbench directory. Your resources will then be externally available in your browser as http://localhost:8080/workbench/myscripts/. For example, if you create a groovy script '/workbench/myscripts/index.gy' you can execute it by accessing http://localhost:8080/workbench/myscripts/index.gy in your browser.
Developing scripts in NetKernel is an easy process and you may develop your code in a variety of programming languages. To help you get started, several examples are included in the workbench module.
The DPML programming language is xxx
The following DPML examples are ready to run:
URL | Source | Description |
/workbench/example_dpml/helloWorld.idoc | [source] | Returns a static XML document. |
/workbench/example_dpml/basic_xslt.idoc | [source] | Executes a single XSLT transform. |
/workbench/example_dpml/two_stage_transform.idoc | [source] | Executes a two stage XSLT transform pipeline. |
/workbench/example_dpml/helloParams.idoc | [source] | Echos an active URI parameter argument. |
The JavaScript programming language is xxx
The following JavaScript program is ready to run:
URL | Source | Description |
/workbench/example_javascript/XSLTJavascript.js | [source] | Performs an XSLT transform. |
BeanShell is a interpreted version of the Java programming language.
The following BeanShell programs are ready to run:
URL | Source | Description |
/workbench/example_beanshell/BeanshellHelloWorld.bsh | [source] | Return a static XML document |
/workbench/example_beanshell/HilbertSpaceSVG.bsh | [source] | Generates a HilbertCurve as SVG then pipes it into Batik, an SVG to Image convertor. |
/workbench/example_beanshell/DynamicSound.bsh | [source] | Generates a .WAV file. |
/workbench/example_beanshell/script.bsh | [source] | Performs a simple XML pipeline |
Ruby is a popular scripting language.
The following Ruby programs are ready to run:
URL | Source | Description |
/workbench/example_ruby/RubyHelloWorld.rb | [source] | Hello World |
/workbench/example_ruby/OccursTestHarness.rb | [source] | Word Frequency Counter |
The Groovy programming language will become a standard scripting language in Java environments.
The following Groovy programs are ready to be run:
URL | Source | Description |
/workbench/example_groovy/XSLTGroovy.groovy | [source] | Performs an XSLT transform. |
/workbench/example_groovy/GroovyXMLGPathExample.groovy | [source] | Demonstrates Groovy's GPath XML manipulation API. |
Python is a popular scripting language.
The following Python program is ready to run:
URL | Source | Description |
/workbench/example_python/XSLTPython.py | [source] | A Python script that performs an XSLT transform. |
The Java programming language can also be used as a dynamic language.
The following Java programs can be edited and will be automatically compiled when run:
URL | Source | Description |
/workbench/example_java/JavaHelloWorld.java | [source] | Returns a simple message. |
NetKernel includes the XRL mapping and linking technology
URL | Source | Description |
/workbench/xrldemo/part0/index | [no source available] | XRL demo part0 |
/workbench/xrldemo/part1/index | [no source available] | XRL demo part1 |
/workbench/xrldemo/part2/index | [no source available] | XRL demo part2 |
/workbench/xrldemo/part3/index | [no source available] | XRL demo part3 |
/workbench/xrldemo/part4/index | [no source available] | XRL demo part4 |
/workbench/xrldemo/part5/index | [no source available] | XRL demo part5 |
Workbench is configured provide all core, xml, and system technologies to workbench programs by importing the following:
urn:org:ten60:netkernel:app:xbin | urn:org:ten60:netkernel:lib:xlib | urn:org:ten60:netkernel:ext:xquery |
urn:org:ten60:netkernel:ext:xrl | urn:org:ten60:netkernel:ext:script | urn:org:ten60:netkernel:ext:xhtml |
urn:org:ten60:netkernel:tpt:http | urn:org:ten60:netkernel:mod:db | urn:org:ten60:netkernel:ext:session |
urn:org:ten60:netkernel:mod:ws | urn:org:ten60:netkernel:mod:webdav | urn:org:ten60:netkernel:mod:xforms |
urn:org:ten60:netkernel:ext:xquery | urn:org:ten60:netkernel:ext:xunit | urn:org:ten60:netkernel:ext:xsecurity |
urn:org:ten60:netkernel:mod:lucene | urn:org:ten60:netkernel:ext:sys | urn:org:ten60:util:image |
urn:org:ten60:netkernel:ext:dpml | urn:org:ten60:netkernel:ext:xml:core | urn:org:ten60:netkernel:ext:xml:ura |
urn:org:ten60:netkernel:ext:layer1 |
The workbench module is deployed in the Front-End Fulcrum module, and is exported via the HTTP transport running on port 8080. The Fulcrum module is configured so that all POST and GET parameters are dynamically converted to an active URI argument named "param". When present, this parameter can be accessed within a script with the URI "this:param:param".
This section provides information about how the workbench module is configured.
The workbench module is configured to map program code to the appropriate language runtime executors. This mapping is done based on the file name extensions within the workbench module's modules.xml file. The following table lists the file name extension and the associated programming language:
extension | language runtime |
.idoc | Declarative Markup Language Runtime (DPML) |
.bsh | Scripted Java (Beanshell) |
.js | Javascript |
.python | Jython (Python) |
.groovy .gy | Groovy |