com.dynamide.util
Class TemplateProvider

java.lang.Object
  extended by com.dynamide.DynamideObject
      extended by com.dynamide.util.TemplateProvider
All Implemented Interfaces:
IGet, org.webmacro.Provider

public class TemplateProvider
extends DynamideObject
implements org.webmacro.Provider

A Provider is an object responsible or loading and managing instances of a given type. The Provider is used by the Broker to look up objects on demand.

By implementing new Provider types and registering them with the broker via WebMacro.properties you can extend or change WebMacro's behavior.


Field Summary
static java.lang.String TEMPLATE_CACHE
           
 
Fields inherited from class com.dynamide.DynamideObject
m_id
 
Constructor Summary
TemplateProvider(java.lang.String type, java.lang.String templateRoot, boolean cache)
           
 
Method Summary
static void clearTemplateCache()
           
 void destroy()
          Close down this provider, freeing any allocated resources.
 void flush()
          Clear any cache this provider may be maintaining
 java.lang.Object get(java.lang.String query)
          Get the object associated with the specified query
 org.webmacro.Template getFromCache(java.lang.String query)
           
 java.lang.String getType()
          Return an array representing the types this provider serves up
 void init(org.webmacro.Broker b, org.webmacro.util.Settings config)
          Initialize this provider based on the specified config.
 
Methods inherited from class com.dynamide.DynamideObject
clearProfiler, dump, dump, dumpHTML, expand, finalize, findParentExpander, findParentPage, findParentSession, findTopParentPage, getCategoryID, getDotName, getID, getNextGetter, getObjectID, getOwner, getProfiler, isDebugEnabled, isInfoEnabled, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logWarn, logWarn, logWarn, logWarn, popLogContext, printf, printProfiler, profileEnter, profileLeave, pushLogContext, setDotName, setID, setNextGetter, setObjectID, setOwner, sprintf, useProfiler, walkParents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATE_CACHE

public static final java.lang.String TEMPLATE_CACHE
See Also:
Constant Field Values
Constructor Detail

TemplateProvider

public TemplateProvider(java.lang.String type,
                        java.lang.String templateRoot,
                        boolean cache)
Method Detail

getType

public java.lang.String getType()
Return an array representing the types this provider serves up

Specified by:
getType in interface org.webmacro.Provider

init

public void init(org.webmacro.Broker b,
                 org.webmacro.util.Settings config)
          throws org.webmacro.InitException
Initialize this provider based on the specified config.

Specified by:
init in interface org.webmacro.Provider
Throws:
org.webmacro.InitException

flush

public void flush()
Clear any cache this provider may be maintaining

Specified by:
flush in interface org.webmacro.Provider

destroy

public void destroy()
Close down this provider, freeing any allocated resources.

Specified by:
destroy in interface org.webmacro.Provider

get

public java.lang.Object get(java.lang.String query)
Get the object associated with the specified query

Specified by:
get in interface IGet
Specified by:
get in interface org.webmacro.Provider
Overrides:
get in class DynamideObject

clearTemplateCache

public static void clearTemplateCache()

getFromCache

public org.webmacro.Template getFromCache(java.lang.String query)
                                   throws org.webmacro.ResourceException
Throws:
org.webmacro.ResourceException


Copyright 2001-2013 DYNAMIDE.COM. All Rights Reserved.