Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

oracle.jdeveloper.template
Class TemplateManager

java.lang.Object
  extended by oracle.jdeveloper.template.TemplateManager
Direct Known Subclasses:
TemplateManagerImpl

public abstract class TemplateManager
extends java.lang.Object

Facade for managing Application and Project Templates. The TemplateManager contains template stores, each represented by a TemplateData object. A default TemplateData store is created by TemplateManager which holds all the templates loaded via the template hook in all the extension manifests.

The default TemplateData store is the parent of other registered TemplateData stores, so a call to findTemplateById() on a registered TemplateData will search that store first, and then the default TemplateData.

See Also:
TemplateData, AbstractTemplate, ProjectTemplate, ApplicationTemplate, DefaultTemplateData

Constructor Summary
protected TemplateManager()
          Use TemplateManager.getInstance() to retrieve an instance of a Template Manager.
 
Method Summary
abstract  void addTemplateData(TemplateData templateData)
          Add a new TemplateData.
abstract  void clear()
          Purge all registered TemplateData, except the default TemplateData.
abstract  java.util.List<AbstractTemplate> findTemplateById(java.lang.String id)
          Search and returns a list of templates from all TemplateData stores starting with the default TemplateData that match id.
abstract  java.util.List<TemplateData> getAllTemplateData()
          List of all templates from all TemplateData objects, starting with the default TemplateData.
abstract  java.util.List<AbstractTemplate> getAllTemplates()
          Get all templates.
abstract  java.util.List<ApplicationTemplate> getApplicationTemplates()
          Get a list of all Application templates registered with this TemplateManager.
abstract  DefaultTemplateData getDefaultTemplateData()
          Get the default TemplateData store.
static TemplateManager getInstance()
          Get an instance of the Template Manager.
abstract  java.util.logging.Logger getLogger()
          A Logger to log template-related messages.
abstract  java.util.List<ProjectTemplate> getProjectTemplates()
          Get a list of all Project templates registered with this TemplateManager.
abstract  TemplateData getTemplateData(java.net.URL url)
          Return TemplateData identified by a specific URL.
abstract  void load(java.net.URL url)
          Load contents from a URL.
abstract  void registerTemplate(AbstractTemplate template)
          Register a template into the default TemplateData.
abstract  void registerTemplate(HashStructure hash)
          Register a HashSructure representing a template into the default Template.
abstract  TemplateData removeTemplateData(TemplateData templateData)
          Remove a TemplateData.
abstract  TemplateData removeTemplateData(java.net.URL url)
          Remove a template data store identified by a URL.
abstract  void save(java.net.URL url)
          Save contents of TemplateManager to a URL.
abstract  void setDefaultTemplateData(DefaultTemplateData td)
          Set the default TemplateData store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateManager

protected TemplateManager()
Use TemplateManager.getInstance() to retrieve an instance of a Template Manager.

Method Detail

getInstance

public static TemplateManager getInstance()
Get an instance of the Template Manager.

Returns:
TempalteManager

getProjectTemplates

public abstract java.util.List<ProjectTemplate> getProjectTemplates()
Get a list of all Project templates registered with this TemplateManager. Sorting order is same as described in getAllTemplates()

Returns:
See Also:
getAllTemplates()

getApplicationTemplates

public abstract java.util.List<ApplicationTemplate> getApplicationTemplates()
Get a list of all Application templates registered with this TemplateManager. Sorting order is same as described in getAllTemplates()

Returns:

getAllTemplates

public abstract java.util.List<AbstractTemplate> getAllTemplates()
Get all templates. The list includes the default TemplateData store, as well as all other registered TemplateData stores. List is unsorted and appears in the order in which the corresponding TemplateData stores were registered.


getDefaultTemplateData

public abstract DefaultTemplateData getDefaultTemplateData()
Get the default TemplateData store. This store contains templates loaded by the Template hook via the extension manifests. Templates registered using the registerTemplate() method also get added to the default TemplateData.

Returns:

setDefaultTemplateData

public abstract void setDefaultTemplateData(DefaultTemplateData td)
Set the default TemplateData store.

Parameters:
td -

addTemplateData

public abstract void addTemplateData(TemplateData templateData)
Add a new TemplateData. All TemplateData objects added to a TemplateManager instances must have unique URLs.

Parameters:
templateData -
Throws:
java.lang.IllegalArgumentException - if a TemplateData with null or duplicate URL is passed.

removeTemplateData

public abstract TemplateData removeTemplateData(TemplateData templateData)
Remove a TemplateData. This cannot be used to remove the default TemplateData.

Parameters:
templateData -
Returns:
the removed TemplateData, or null if not found.

removeTemplateData

public abstract TemplateData removeTemplateData(java.net.URL url)
Remove a template data store identified by a URL.

Parameters:
url - unique key url. The URL should be an exact literal match.
Returns:

findTemplateById

public abstract java.util.List<AbstractTemplate> findTemplateById(java.lang.String id)
Search and returns a list of templates from all TemplateData stores starting with the default TemplateData that match id.

Use template.getParent() to find out which store each template belongs to.

Parameters:
id -
Returns:

getAllTemplateData

public abstract java.util.List<TemplateData> getAllTemplateData()
List of all templates from all TemplateData objects, starting with the default TemplateData.


getTemplateData

public abstract TemplateData getTemplateData(java.net.URL url)
Return TemplateData identified by a specific URL. To retrieve thed default TemplateData, use getDefaultTemplateData()

Parameters:
url -
Returns:

registerTemplate

public abstract void registerTemplate(AbstractTemplate template)
Register a template into the default TemplateData.

Parameters:
template -

registerTemplate

public abstract void registerTemplate(HashStructure hash)
Register a HashSructure representing a template into the default Template.

Parameters:
hash -

save

public abstract void save(java.net.URL url)
                   throws java.io.IOException
Save contents of TemplateManager to a URL.

Parameters:
url -
Throws:
java.io.IOException

load

public abstract void load(java.net.URL url)
                   throws java.io.IOException
Load contents from a URL.

Parameters:
url -
Throws:
java.io.IOException

clear

public abstract void clear()
Purge all registered TemplateData, except the default TemplateData.


getLogger

public abstract java.util.logging.Logger getLogger()
A Logger to log template-related messages.

Returns:
java.util.logging.Logger

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

Copyright © 1997, 2011, Oracle. All rights reserved.