Package com.tailf.ncs.template
Class Template
Object
com.tailf.ncs.template.Template
Template represents an NCS template, that is a template loaded
from the directory templates of the package.-
Constructor Summary
ConstructorsConstructorDescriptionTemplate(ServiceContext aServiceContext, String aTemplateName) Construct a Template.Template(NavuContext aContext, String aTemplateName) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(Maapi maapi, int tid, ConfPath rootPath, TemplateVariables variables) Apply a template in the specified contextvoidapply(NavuNode root, TemplateVariables variables) Apply a template in the specified contextstatic booleanexists(ServiceContext context, String template) Tests for existence of a template.static booleanstatic booleanexists(NavuContext context, String template) getTemplates(ServiceContext aServiceContext) Returns a set consisting of the loaded templates.getTemplates(Maapi maapi) getTemplates(NavuContext context) String[]
-
Constructor Details
-
Template
Construct a Template. Note that the template has to have already been loaded by NCS, otherwise an exception is thrown.- Parameters:
aServiceContext- the context is which this call is made.aTemplateName- name of the template.- Throws:
ConfException
-
Template
- Throws:
ConfException
-
-
Method Details
-
getTemplates
Returns a set consisting of the loaded templates.- Parameters:
aServiceContext- the context in which this call is made.- Returns:
Setof loaded templates.- Throws:
ConfException
-
getTemplates
- Throws:
ConfException
-
getVariables
- Throws:
ConfException
-
exists
Tests for existence of a template.- Parameters:
context- the context in which this call is made.template- name of the template.- Returns:
trueorfalsedepending on whether the template is loaded or not.- Throws:
ConfException
-
exists
- Throws:
ConfException
-
apply
public void apply(Maapi maapi, int tid, ConfPath rootPath, TemplateVariables variables) throws ConfException Apply a template in the specified context- Parameters:
maapi- a maapi connection to the NCS servertid- a transaction id which should be attached to the maapi connectionrootPath- the initial context and root context for evaluation of XPath expressionsvariables- a set of key value pairs where each key will be an XPath variable.- Throws:
ConfException
-