*/
@Override
public Document getXmlContent() {
ActionSequenceJCRHelper actionHelper = new ActionSequenceJCRHelper( getSession() );
IActionSequence actionSequence =
actionHelper.getActionSequence( ActionInfo.buildSolutionPath( solution, path, actionName ), getLoggingLevel(),
RepositoryFilePermission.READ );
if ( actionSequence == null ) {
// TODO log this
error( Messages.getInstance().getString( "InputForm.ERROR_0004_ACTION_NOT_FOUND" ) + solution + path + actionName ); //$NON-NLS-1$
return null;
}
List actions = actionSequence.getActionDefinitionsAndSequences();
ISolutionActionDefinition action = (ISolutionActionDefinition) actions.get( 0 );
Node node = action.getComponentSection();
if ( node == null ) {
error( Messages.getInstance().getString( "InputForm.ERROR_0005_INBOX_DEFINITION_MISSING" ) + solution + path + actionName ); //$NON-NLS-1$
return null;
}
if ( templateName == null ) {
// see if the template is specified in the action document
Node templateNode = node.selectSingleNode( "//template" ); //$NON-NLS-1$
if ( templateNode != null ) {
templateName = templateNode.getText();
}
if ( templateName == null ) {
error( Messages.getInstance().getString( "InputForm.ERROR_0006_TEMPLATE_NOT_SPECIFIED" ) ); //$NON-NLS-1$
return null;
}
}
Node xFormNode = node.selectSingleNode( "//xForm" ); //$NON-NLS-1$
try {
String actionTitle = actionSequence.getTitle();
if ( actionTitle != null ) {
setXslProperty( "title", actionTitle ); //$NON-NLS-1$
}
String description = actionSequence.getDescription();
if ( description != null ) {
setXslProperty( "description", description ); //$NON-NLS-1$
}
String xFormHtml = XForm.transformSnippet( xFormNode, getSession(), new SolutionURIResolver() );