public class Template extends Object
Template
represents an NCS template, that is a template loaded
from the directory templates
of the package.Constructor and Description |
---|
Template(Maapi aMaapi,
String aTemplateName) |
Template(NavuContext aContext,
String aTemplateName) |
Template(ServiceContext aServiceContext,
String aTemplateName)
Construct a Template.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(Maapi maapi,
int tid,
ConfPath rootPath,
TemplateVariables variables)
Apply a template in the specified context
|
void |
apply(NavuNode root,
TemplateVariables variables)
Apply a template in the specified context
|
static boolean |
exists(Maapi maapi,
String template) |
static boolean |
exists(NavuContext context,
String template) |
static boolean |
exists(ServiceContext context,
String template)
Tests for existence of a template.
|
static Set<String> |
getTemplates(Maapi maapi) |
static Set<String> |
getTemplates(NavuContext context) |
static Set<String> |
getTemplates(ServiceContext aServiceContext)
Returns a set consisting of the loaded templates.
|
String[] |
getVariables() |
public Template(ServiceContext aServiceContext, String aTemplateName) throws ConfException
aServiceContext
- the context is which this call is made.aTemplateName
- name of the template.ConfException
public Template(NavuContext aContext, String aTemplateName) throws ConfException
ConfException
public Template(Maapi aMaapi, String aTemplateName) throws ConfException
ConfException
public static Set<String> getTemplates(ServiceContext aServiceContext) throws ConfException
aServiceContext
- the context in which this call is made.Set
of loaded templates.ConfException
public static Set<String> getTemplates(NavuContext context) throws ConfException
ConfException
public static Set<String> getTemplates(Maapi maapi) throws ConfException
ConfException
public String[] getVariables() throws ConfException
ConfException
public static boolean exists(ServiceContext context, String template) throws ConfException
context
- the context in which this call is made.template
- name of the template.true
or false
depending on whether the
template is loaded or not.ConfException
public static boolean exists(NavuContext context, String template) throws ConfException
ConfException
public static boolean exists(Maapi maapi, String template) throws ConfException
ConfException
public void apply(NavuNode root, TemplateVariables variables) throws ConfException
root
- 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.ConfException
public void apply(Maapi maapi, int tid, ConfPath rootPath, TemplateVariables variables) throws ConfException
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.ConfException