Dashboard > OpenFAST > ... > FifteenMinuteGettingStarted > TemplateReferences
OpenFAST Log In | Sign Up   View a printable version of the current page.
TemplateReferences
Added by Jacob Northey, last edited by Jacob Northey on Jul 09, 2008  (view change)
Labels: 
(None)

Template References

Template references allow commonly occurring elements to be defined once in a single template and reused in other templates. When loading multiple templates that include template references, referenced templates must be loaded first or defined higher up in a message template definition.

XMLMessageTemplateLoader

The XMLMessageTemplateLoaderloads message templates defined in XML. The loader does not currently use Schema validation to verify the message template definitions.

A single instance of this class will keep track of the message templates that it has loaded from previous calls to the loadmethod. Therefore template references do not have to reference templates defined within the same file. In the case where templates referenced have not been loaded from the same loader, the setTemplateRepository method can be used to set the repository where the referenced templates are stored.

Loading Templates Between Multiple Loaders

Given two template loaders, A and B: In the case where a template being loaded by B references a template loaded by A, the following code will successully locate the referenced template.

MessageTemplateLoader A = new XMLMessageTemplateLoader();
MessageTemplate[] Atemplates = A.load(aStream);
MessageTemplateLoader B = new XMLMessageTemplateLoader();
B.setTemplateRepository(A.getTemplateRegistry());
MessageTemplate[] Btemplates = B.load(bStream);

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.1.5a Build:#411 Mar 16, 2006) - Bug/feature request - Contact Administrators

SourceForge.net Logo