com.arsdigita.populate.apps
Class AbstractPopulateApp

java.lang.Object
  extended bycom.arsdigita.populate.apps.AbstractPopulateApp
All Implemented Interfaces:
PopulateApp

public abstract class AbstractPopulateApp
extends Object
implements PopulateApp

Author:
bche

Field Summary
protected  org.apache.log4j.Logger s_log
           
 
Constructor Summary
AbstractPopulateApp()
           
 
Method Summary
 void createApp(String sTitle, Application parent)
          Create the application with title, sTitle and parent Application, parent
 Application getApp()
          Returns the app instance created for populating data
abstract  ApplicationType getAppType()
          Returns the application type of the app we are creating and populating
abstract  String getArgsDescription()
          Returns a description of the arguments for populating this application
 String getBaseStringSeed()
          Gets the BaseStringSeed used in populating data
 AppPortlet getPortlet()
          Returns a new portlet for the populated application, if appropriate.
protected abstract  String getPortletType()
          Returns the BaseDataObjectType of the portlet that getPortlet() returns
abstract  void populateApp(List args)
          Populates the created app using the arguments in args.
 void setBaseStringSeed(String sSeed)
          Sets the BaseStringSeed to use in populating data
protected  void validateArgs(List args, int numArgs, String sMsg)
          Checks that the number of arguments in args is equal to numArgs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_log

protected org.apache.log4j.Logger s_log
Constructor Detail

AbstractPopulateApp

public AbstractPopulateApp()
Method Detail

setBaseStringSeed

public void setBaseStringSeed(String sSeed)
Description copied from interface: PopulateApp
Sets the BaseStringSeed to use in populating data

Specified by:
setBaseStringSeed in interface PopulateApp
Parameters:
sSeed - the seed value to use for generating String data in population

getBaseStringSeed

public String getBaseStringSeed()
Description copied from interface: PopulateApp
Gets the BaseStringSeed used in populating data

Specified by:
getBaseStringSeed in interface PopulateApp
Returns:
the BaseStringSeed used in populating data

createApp

public void createApp(String sTitle,
                      Application parent)
Description copied from interface: PopulateApp
Create the application with title, sTitle and parent Application, parent

Specified by:
createApp in interface PopulateApp
Parameters:
sTitle - the title of the new app to create and populate
parent - the parent application or null if there is none

populateApp

public abstract void populateApp(List args)
Description copied from interface: PopulateApp
Populates the created app using the arguments in args. This method runs in its own transaction

Specified by:
populateApp in interface PopulateApp
Parameters:
args - the arguments to use in populating the app

getArgsDescription

public abstract String getArgsDescription()
Description copied from interface: PopulateApp
Returns a description of the arguments for populating this application

Specified by:
getArgsDescription in interface PopulateApp
Returns:
description of the args to PopulateApp()

getApp

public Application getApp()
Description copied from interface: PopulateApp
Returns the app instance created for populating data

Specified by:
getApp in interface PopulateApp

getAppType

public abstract ApplicationType getAppType()
Description copied from interface: PopulateApp
Returns the application type of the app we are creating and populating

Specified by:
getAppType in interface PopulateApp
Returns:
the Application type we are creating and populating

validateArgs

protected void validateArgs(List args,
                            int numArgs,
                            String sMsg)
                     throws IllegalArgumentException
Checks that the number of arguments in args is equal to numArgs. Also checks that the args are all ints. Throws an IllegalArgumentException with sMsg if args not valid

Parameters:
args - List of arguments to check
numArgs - how many arguments should be there
sMsg - message to throw if the number of arguments is wrong
Throws:
IllegalArgumentException

getPortlet

public AppPortlet getPortlet()
Description copied from interface: PopulateApp
Returns a new portlet for the populated application, if appropriate. Otherwise returns null.

Specified by:
getPortlet in interface PopulateApp
Returns:
a new portlet for the populated application, if appropriate. Otherwise returns null.

getPortletType

protected abstract String getPortletType()
Returns the BaseDataObjectType of the portlet that getPortlet() returns

Returns:
the BaseDataObjectType of the portlet that getPortlet() returns


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC