|
Collaboration API Documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.filenet.bso.api.collaboration.TextTemplate
The TextTemplate
class uses a text template and a map of parameters, interprets
the template looking for special template instructions, and returns either a resulting input
stream or a string.
To use it, use code like this
// set up parameters for template HashMap params = new HashMap(); params.put("doc", doc); params.put("folder", folder); params.put("time", time()); TextTemplate tt = new TextTemplate(store, null, null); // interpret the template InputStream in = tt.getStream("mytemplate", params);
The application ID and time zone information are not required; if not available, the application ID is determined from the store's session and the time zone from either the application ID, or, if not found, from the server. Normally, the application ID affects which localized template file is selected and both the locale and the time zone affect some formatting, but certain installations might all be in the same locale and time zone or the template might be written in such a way that this is not significant.
Constructor Summary | |
TextTemplate(com.filenet.wcm.api.ObjectStore store,
java.lang.String applicationID,
java.util.TimeZone timeZone)
Construct a TextTemplate instance. |
Method Summary | |
java.lang.String |
getApplicationID()
Return the current application ID. |
byte[] |
getInclude(java.lang.String name,
java.lang.String applicationID)
Return a byte array representing the text of a template include. |
boolean |
getIsDebug()
Return whether debugging mode is currently set or not. |
com.filenet.wcm.api.TransportInputStream |
getStream(int templateCode,
java.util.Map parameters)
Return a JavaAPI TransportInputStream representing the interpretation of a
template given its template code and parameters. |
com.filenet.wcm.api.TransportInputStream |
getStream(java.lang.String templateName,
java.util.Map parameters)
|
java.lang.String |
getString(int templateCode,
java.util.Map parameters)
|
java.lang.String |
getString(java.lang.String templateName,
java.util.Map parameters)
|
void |
setApplicationID(java.lang.String applicationID)
Set the application ID, which is used in looking up the correct template and also to find "localized" versions of the same application for locale lookups. |
void |
setIsDebug(boolean isDebug)
Set or clear debugging mode. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TextTemplate(com.filenet.wcm.api.ObjectStore store, java.lang.String applicationID, java.util.TimeZone timeZone)
TextTemplate
instance.store
- the object store where collaboration email information can be foundapplicationID
- the name of the application. This will also be used to find different
localized versions of the same application. This may be null
, in which case the
appID of the store
's JavaAPI session is used instead.Method Detail |
public java.lang.String getApplicationID()
public void setApplicationID(java.lang.String applicationID)
null
, then the
appID of the object store's JavaAPI session is used instead.applicationID
- the new application ID to usepublic boolean getIsDebug()
true
if in debugging mode, false
otherwisepublic void setIsDebug(boolean isDebug)
isDebug
- if true
, sets debugging mode; if false
,
resets itpublic byte[] getInclude(java.lang.String name, java.lang.String applicationID)
getInclude
in interface com.filenet.bso.api.collaboration.impl.templates.TemplateInclude
name
- the name of the include/template fileapplicationID
- the name of the application (used during template lookup)public com.filenet.wcm.api.TransportInputStream getStream(int templateCode, java.util.Map parameters) throws TemplateException
TransportInputStream
representing the interpretation of a
template given its template code and parameters.templateCode
- the code for this templateparameters
- values to use when interpreting the templateTemplateException
- public com.filenet.wcm.api.TransportInputStream getStream(java.lang.String templateName, java.util.Map parameters) throws TemplateException
public java.lang.String getString(int templateCode, java.util.Map parameters)
public java.lang.String getString(java.lang.String templateName, java.util.Map parameters)
|
Collaboration API Documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |