Dynamide Reference
A guide to syntax and objects available in various contexts in Dynamide.
The layout of the Dynamide RESOURCE_ROOT tree is described in the Assembly Documentation Within each Assembly, there is an apps directory, which contains web applications. This reference starts with the application directory. Please refer to the Assembly Documentation for information on how the Files and Objects below relate to the filesystem layout in Dynamide.
application directory Each application lives in a directory named after the application, under "apps/" in the Assembly. Each application directory contains: application.xml fielddefs.xml zero to many [page].xml files an optional "resources" directory with resource files. See the "resources/ directory" section.
resources/ directory Each application can have a resources directory, which should be named "resources". You can name child directories of the project anything you like, but if the directory is named "resources", then you can use Dynamide imports, which search the resource tree for files, so that common files can be factored out of the individual applications and into your Account (home dir), or even into imported libraries. All the Dynamide Widgets, for example, live in resources/widgets in the Dynamide library Assembly, and can be imported into your projects. Here are some resources that can go in the application resource directory:See the Assembly Documentation for more information.
resources/widgets Custom Widget xml files resources/css Cascading Style Sheet files resources/js Javascript files resources/html static HTML files resources/images image files resources/dialogs Dynamide page dialogs resources/intl/intlres-*.properties Internationalization lookup files XML/XSL files in any user-defined directory
application.xml File <fields> Element multiple <field> child Elements -- OR -- one attribute: filename="fielddefs.xml" <properties> Element <property> Elements special properties: poolable publishParams <event> Elements <pages> Element attribute: default <page>
fielddefs.xml File <field> Elements
[page].xml <properties> Element <property> Elements <widgets> Element <widget> elements <properties> Element <property> Elements (sets current property for *this* Widget instance) <event> Element attribute: language (currently supports: "beanshell", "tcl" one CDATA child Element <htmlsrc> attributes: isWebMacro "true" or "false" If true, the source will be evaluated in WebMacro first isXHTML "true" or "false" If true, the source will be loaded into a JDom DOM object (tempate expansion such as WebMacro comes first) href relative unix-style file path to htmlsrc
[widget].xml File <properties> Element <property> Elements (defines supported properties for this widget type and default values) special properties: name type <event> Elements attribute: language (currently supports: "beanshell", "tcl") one CDATA child Element <htmlsrc> Element attributes: isWebMacro "true" or "false" If true, the source will be evaluated in WebMacro first isXHTML "true" or "false" If true, the source will be loaded into a JDom DOM object (tempate expansion such as WebMacro comes first) href relative unix-style file path to htmlsrc
<event> Element attribute: language ["beanshell", "tcl"] one <CDATA> child Element If the language is "beanshell", then the event contains valid Beanshell script, an the following variables are defined: com.dynamide.event.ScriptEvent event com.dynamide.Session session
<htmlsrc> Element (in Widget and Page xml files) attribute: isWebmacro ["true", "false"] attribute: isXHTML ["true", "false"] attribute: href valid html valid xhtml valid webmacro WebMacro blocks can contain valid WebMacro, and have the following variables defined \$session \$page \$parent \$WEBMACRO_CONTEXT
external htmlsrc files valid html valid xhtml valid webmacro
Element Text representation is an XML Element. Here is an element with a single text node as a child: <value>My Value</value> Here is an element with a single attribute of "name", and no children:<page name="page1"></page> The run-time representation will be an org.jdom.Element. However, most Dynamide objects use XML as their persistent storage, and modify their properties in memory, so manipulating Dynamide objects such as Session, Page, and Widget by the DOM will not achieve the result you want. Instead, use the Javadoc to find the methods and properties you wish to set. These properties are available for the length of the application session, or, if you are in development, you can call various methods on the objects to save them to persistent storage, such as getFullXMLSource() and saveToFile(...) XML Attribute Text representation is an XML Element Attribute. Here is an element with a single attribute of "name", where the value of the attribute is "page1": <page name="page1"></page> boolean Legal values are true or false. As XML an attribute, the attribute value must be surrounded by single or double quotes.
default page Element Element false true, false If true, will be the default main page of the application. If not specified, the value is "false". a default page is served up when the application starts and the application_queryNextPage doesn't return a page. If there is no default, and application_queryNextPage returns no page in particular, the page order as specified by the order of the page Elements in the pages Element is used. event Element CDATA child element, plus attribute: language ("beanshell", "tcl") The event runs inside a wrapped function call. Variables defined in the event fall out of scope at the end of the event. Do not return any values with the return statement, simply use: return; fielddefs.xml file Attribute fielddefs.xml Points to the fielddefs.xml file, which should be in the project directory, the same directory as application.xml. page Element Element page Elements, e.g. <page name="page1"></page> If true, will be the default main page of the application. If not specified, the value is "false". pages Element Element pages Element "page" child Elements are supported. Lists the pages in the application. child Elements of the page element are ignored. the name attribute can contain relative path directories, if your pages live in directories. For example, if you have a directory structure like: apps/ myapp/ application.xml main.xml dir1/ page1.xml dir2/ page1.xml Then you can list: poolable boolean false true, false If true, the session will be re-useable at the end of the current http request. The session should not store per-use instance data, but should be reusable on each request. The session is useful for loading the pages is owns, so that serving pages is fast. User instance data should be put in an IContext or subsession. For the duration of the request, the \$session variable is single threaded and available to only one user and request, so the session can process information stored in contexts, subsession, cookies, database connections, etc. At the end of the request, if the session's "poolable" property is still true, then the session is repooled and will be handed out to the next request asking for the same URI. publishParams Element An XML representation of the com.dynamide.datatypes.PublishParamsDatatype type. Fill in this structure if you wish to be able to publish your application automatically. Published applications are collections of standard HTML files and can be served up from any web server. <property name="publishParams"> <datatype>com.dynamide.datatypes.PublishParamsDatatype</datatype> <value> <URL></URL> <URIPrefix></URIPrefix> <protocolHostPort></protocolHostPort> <defaultExtension>.html</defaultExtension> <publishPagesList>false</publishPagesList> <hideApplicationPath>false</hideApplicationPath> </value> </property>