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

java.lang.Object
  extended by org.springframework.roo.addon.surf.page.PageCommands
All Implemented Interfaces:
org.springframework.roo.shell.CommandMarker

public class PageCommands
extends Object
implements org.springframework.roo.shell.CommandMarker

Commands for managing Surf pages.

Since:
1.0
Author:
Yong Qu

Constructor Summary
PageCommands(PageOperations pageOperations)
           
 
Method Summary
 boolean isPageOperationAvailable()
          Checks availability of page related commands.
 SortedSet<String> listSurfPageAssociations(String sourceId)
          Lists associated pages of the page with a specified id.
 SortedSet<String> listSurfPages()
          Lists all pages in your Surf project.
 void newPage(String pageId, String pagePath, String templateInstance, String template, String urls, String title)
          Adds a new page to the Surf project.
 void newPageAssociation(String sourcePageId, String destPageId, String name, String type)
          Adds a new Surf page association between two pages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageCommands

public PageCommands(PageOperations pageOperations)
Parameters:
pageOperations -
Method Detail

isPageOperationAvailable

public boolean isPageOperationAvailable()
Checks availability of page related commands.

Returns:
true if page related commands are available at this moment.

newPage

public void newPage(String pageId,
                    String pagePath,
                    String templateInstance,
                    String template,
                    String urls,
                    String title)
Adds a new page to the Surf project. Page can be created either based on an existing template instance or an existing template.

Parameters:
pageId - Page id e.g. testpage.
pagePath - Page path e.g. pages, pages\mypage etc.
templateInstance - Template instance id.
template - Template id.
urls - List of urls that the new page will be mapped to. Urls should be separated by comma.
title - Page title.

newPageAssociation

public void newPageAssociation(String sourcePageId,
                               String destPageId,
                               String name,
                               String type)
Adds a new Surf page association between two pages.

Parameters:
sourcePageId - Source page id.
descPageId - Destination page id.
name - Optional page association name.
type - Option page association type (default value is "child").

listSurfPages

public SortedSet<String> listSurfPages()
Lists all pages in your Surf project.

Returns:
List of all pages.

listSurfPageAssociations

public SortedSet<String> listSurfPageAssociations(String sourceId)
Lists associated pages of the page with a specified id.

Parameters:
sourceId - Source page id.
Returns:
List of associated pages.


Copyright © 2009 SpringSource, Inc. All Rights Reserved.