org.springframework.roo.addon.surf.page
Class PageOperations

java.lang.Object
  extended by org.springframework.roo.addon.surf.page.PageOperations

public class PageOperations
extends Object

Provides Surf Page related operations.

Since:
1.0
Author:
Yong Qu

Constructor Summary
PageOperations(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
 void createPage(String pageId, String pagePath, String templateInstance, String templatePath, String urls, String title)
          Creates a new Surf page using a specified template instance or template.
 void createPageAssociation(String name, String srcPageId, String desPageId, String type)
          Creates a new page association.
 void createPageAssociationAsFile(String name, String srcPageId, String desPageId, String type)
          Creates a new legacy page association which is stored as a seperated XML file.
 org.springframework.roo.file.monitor.event.FileDetails findSurfPageById(String pageId)
          Finds Surf page by id.
 org.springframework.roo.file.monitor.event.FileDetails findSurfPageByPath(String path)
          Find Surf page by path.
 String getInstanceTemplatePath(String instanceName)
          Returns template path of the given template instance.
 String getPageXmlRootPath()
           
 Hashtable<String,org.springframework.roo.file.monitor.event.FileDetails> getSurfPages()
          Returns PageId/FileDetails pairs of Surf pages.
 String getTemplateInstance(String pageName)
          Returns template instance path of a given page.
 String getTemplatePath(String pageId)
          Returns template path of a Surf page with a given id.
 boolean isPageOperationAvailable()
          Checks if page related operations are available.
 boolean isSurfPageAvailable(String pageId)
          Returns true if the page id is available.
 SortedSet<String> listSurfPageAssociations(String pageId)
          Lists associated pages of a specified Surf page.
 SortedSet<String> listSurfPages()
          Returns ids and paths of all Surf pages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageOperations

public PageOperations(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

isPageOperationAvailable

public boolean isPageOperationAvailable()
Checks if page related operations are available.

Returns:
true if page related operations are available

createPage

public void createPage(String pageId,
                       String pagePath,
                       String templateInstance,
                       String templatePath,
                       String urls,
                       String title)
Creates a new Surf page using a specified template instance or template.

Parameters:
pageId - Page Id.
pagePath - Page path.
templateInstance - Name of the template instance for creating the new page.
templatePath - Path of the template for creating the new page.
urls - Page urls.
title - Page title.

listSurfPages

public SortedSet<String> listSurfPages()
Returns ids and paths of all Surf pages.

Returns:
Id/path list of all Surf pages..

isSurfPageAvailable

public boolean isSurfPageAvailable(String pageId)
Returns true if the page id is available.

Parameters:
pageId - Page Id.
Returns:
True if the page id is available.

listSurfPageAssociations

public SortedSet<String> listSurfPageAssociations(String pageId)
Lists associated pages of a specified Surf page.

Parameters:
pageId - Page id.
Returns:
Lists of associated pages.

getTemplateInstance

public String getTemplateInstance(String pageName)
Returns template instance path of a given page.

Parameters:
pagePath - Page path.
Returns:
Template instance path.

getInstanceTemplatePath

public String getInstanceTemplatePath(String instanceName)
Returns template path of the given template instance.

Parameters:
instanceName - Template instance name.
Returns:
Template path.

getTemplatePath

public String getTemplatePath(String pageId)
Returns template path of a Surf page with a given id.

Parameters:
pageId - Page Id.
Returns:
Page template path.

createPageAssociationAsFile

public void createPageAssociationAsFile(String name,
                                        String srcPageId,
                                        String desPageId,
                                        String type)
Creates a new legacy page association which is stored as a seperated XML file.

Parameters:
name - Association name.
srcPageId - Source page id.
desPageId - Destination page id.
type - Association type.

createPageAssociation

public void createPageAssociation(String name,
                                  String srcPageId,
                                  String desPageId,
                                  String type)
Creates a new page association.

Parameters:
name - Association name.
srcPageId - Source page id.
desPageId - Destination page id.
type - Association type.

findSurfPageByPath

public org.springframework.roo.file.monitor.event.FileDetails findSurfPageByPath(String path)
Find Surf page by path.

Parameters:
path - Page path.
Returns:
Surf page.

findSurfPageById

public org.springframework.roo.file.monitor.event.FileDetails findSurfPageById(String pageId)
Finds Surf page by id.

Parameters:
pageId - Page Id
Returns:
Surf page.

getSurfPages

public Hashtable<String,org.springframework.roo.file.monitor.event.FileDetails> getSurfPages()
Returns PageId/FileDetails pairs of Surf pages.

Returns:
List of PageId/FileDetails pairs of Surf pages.

getPageXmlRootPath

public String getPageXmlRootPath()


Copyright © 2009 SpringSource, Inc. All Rights Reserved.