org.springframework.roo.addon.surf.template
Class TemplateOperations

java.lang.Object
  extended by org.springframework.roo.addon.surf.template.TemplateOperations

public class TemplateOperations
extends Object

Provides Surf Template operations.

Since:
1.0
Author:
Yong Qu

Constructor Summary
TemplateOperations(org.springframework.roo.process.manager.FileManager fileManager, org.springframework.roo.project.PathResolver pathResolver, org.springframework.roo.metadata.MetadataService metadataService, org.springframework.roo.project.ProjectOperations projectOperations)
           
 
Method Summary
 org.springframework.roo.file.monitor.event.FileDetails findSurfTemplateByPath(String path)
           
 org.springframework.roo.file.monitor.event.FileDetails findSurfTemplateInstanceByName(String name)
           
 Hashtable<String,org.springframework.roo.file.monitor.event.FileDetails> getSurfTemplateInstances()
          Returns list of template instances.
 String getTemplatePath(org.springframework.roo.file.monitor.event.FileDetails fileIdentifier)
           
 String getTemplatePath(String instanceName)
           
 boolean isSurfTemplateAvailable(String templatePath)
          Checks if the template exists.
 boolean isSurfTemplateInstanceAvailable(String templatePath)
          Checks if the template exists.
 boolean isTemplateOperationAvailable()
          Checks if template related operations are available.
 SortedSet<org.springframework.roo.file.monitor.event.FileDetails> listSurfTemplateFiles()
          Returns list of all available templates.
 SortedSet<String> listSurfTemplateInstances()
          Returns list of all available template instances.
 SortedSet<String> listSurfTemplateNames()
           
 SortedSet<String> listSurfTemplatePaths()
           
 Hashtable<String,RegionConfig> listSurfTemplateRegions(String templatePath)
          Returns configurations of all regions belongs to the template.
 SortedSet<String> listSurfTemplates()
          Returns list of all available templates.
 boolean newTemplate(String templatePath)
          Creates a new template.
 boolean newTemplateInstance(String id, String path, String templatePath)
          Creates a new template instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateOperations

public TemplateOperations(org.springframework.roo.process.manager.FileManager fileManager,
                          org.springframework.roo.project.PathResolver pathResolver,
                          org.springframework.roo.metadata.MetadataService metadataService,
                          org.springframework.roo.project.ProjectOperations projectOperations)
Parameters:
fileManager -
pathResolver -
metadataService -
projectOperations -
Method Detail

isTemplateOperationAvailable

public boolean isTemplateOperationAvailable()
Checks if template related operations are available.

Returns:
true if template related operations are available.

getTemplatePath

public String getTemplatePath(org.springframework.roo.file.monitor.event.FileDetails fileIdentifier)
Parameters:
fileIdentifier -
Returns:

findSurfTemplateByPath

public org.springframework.roo.file.monitor.event.FileDetails findSurfTemplateByPath(String path)
Parameters:
path -
Returns:

listSurfTemplateNames

public SortedSet<String> listSurfTemplateNames()
Returns:

listSurfTemplatePaths

public SortedSet<String> listSurfTemplatePaths()
Returns:

listSurfTemplateFiles

public SortedSet<org.springframework.roo.file.monitor.event.FileDetails> listSurfTemplateFiles()
Returns list of all available templates.

Returns:
List of templates.

listSurfTemplates

public SortedSet<String> listSurfTemplates()
Returns list of all available templates.

Returns:
List of templates.

isSurfTemplateInstanceAvailable

public boolean isSurfTemplateInstanceAvailable(String templatePath)
Checks if the template exists.

Parameters:
templatePath - Template path.
Returns:
True if the template exists. False if it doesn't.

isSurfTemplateAvailable

public boolean isSurfTemplateAvailable(String templatePath)
Checks if the template exists.

Parameters:
templatePath - Template path.
Returns:
True if the template exists. False if it doesn't.

findSurfTemplateInstanceByName

public org.springframework.roo.file.monitor.event.FileDetails findSurfTemplateInstanceByName(String name)

listSurfTemplateInstances

public SortedSet<String> listSurfTemplateInstances()
Returns list of all available template instances.

Returns:
List of template instances.

listSurfTemplateRegions

public Hashtable<String,RegionConfig> listSurfTemplateRegions(String templatePath)
Returns configurations of all regions belongs to the template.

Parameters:
templatePath - Template path.
Returns:
List of template regions.

getTemplatePath

public String getTemplatePath(String instanceName)
Parameters:
instanceName -
Returns:

newTemplate

public boolean newTemplate(String templatePath)
Creates a new template.

Parameters:
templatePath - Template path.
Returns:

newTemplateInstance

public boolean newTemplateInstance(String id,
                                   String path,
                                   String templatePath)
Creates a new template instance.

Parameters:
id - Template instance id.
path - Template instance path.
templatePath - Template path.
Returns:
true if a new template instance is created.

getSurfTemplateInstances

public Hashtable<String,org.springframework.roo.file.monitor.event.FileDetails> getSurfTemplateInstances()
Returns list of template instances.

Returns:
List of template instances.


Copyright © 2009 SpringSource, Inc. All Rights Reserved.