org.springframework.roo.addon.surf.component
Class ComponentCommands

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

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

Commands for managing Surf components.

Since:
1.0
Author:
Yong Qu

Constructor Summary
ComponentCommands(ComponentOperations componentOperations)
           
 
Method Summary
 boolean isSurfComponentOperationsAvailable()
          Checks availability of component related commands.
 Collection<String> listSurfComponents(String scopeId, String pageId, String templateId)
          Lists all Surf components in current Surf project.
 Collection<String> listSurfComponentTypes()
          Lists all Surf component types.
 void newComponent(String pageId, String regionId, String url, String options)
          Adds a new Surf component to the current Surf project.
 void newComponentProperty(String componentInstanceId, String propList)
          Creates a new property for Surf component.
 void newComponentResource(String componentInstanceId, String attributeList, String contentBody)
          Creates a new resource for the Surf component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentCommands

public ComponentCommands(ComponentOperations componentOperations)
Parameters:
componentOperations -
Method Detail

isSurfComponentOperationsAvailable

public boolean isSurfComponentOperationsAvailable()
Checks availability of component related commands.

Returns:
true if the component related commands available at this moment.

listSurfComponentTypes

public Collection<String> listSurfComponentTypes()
Lists all Surf component types.

Returns:
List of Surf component types.

listSurfComponents

public Collection<String> listSurfComponents(String scopeId,
                                             String pageId,
                                             String templateId)
Lists all Surf components in current Surf project.

Parameters:
scope - Component scope.
pageId - Page id.
templateId - Template id.
Returns:
List of Surf components.

newComponent

public void newComponent(String pageId,
                         String regionId,
                         String url,
                         String options)
Adds a new Surf component to the current Surf project.

Parameters:
pageId - Page id.
regionId - Region id.
url - Component url.
options - Other options for the component.

newComponentResource

public void newComponentResource(String componentInstanceId,
                                 String attributeList,
                                 String contentBody)
Creates a new resource for the Surf component.

Parameters:
componentInstanceId - Component instance id.
attributeList - Attribute list. The input format is attr1:val1|attr2:val2.
contentBody - Content body.

newComponentProperty

public void newComponentProperty(String componentInstanceId,
                                 String propList)
Creates a new property for Surf component.

Parameters:
componentInstanceId - Component instance id.
propList - Property list. The input format is name1:val1|name22:val2.


Copyright © 2009 SpringSource, Inc. All Rights Reserved.