com.arsdigita.web
Class ApplicationSetup

java.lang.Object
  extended bycom.arsdigita.web.ApplicationSetup

public class ApplicationSetup
extends Object

Automates the creation and setup of ApplicationTypes.

ApplicationSetup setup = new ApplicationSetup(s_log); setup.setApplicationObjectType(SomeApp.BASE_DATA_OBJECT_TYPE); setup.setKey("some-app"); setup.setTitle("Some App"); setup.setInstantiator(new ACSObjectInstantiator() { protected DomainObject doNewInstance(DataObject dataObject) { return new SomeApp(dataObject); } }); setup.run();
Important note. When Applications are used in the context of old-style apps that use SiteNodes and PackageTypes, it is important to use the setKey("some-string-key") so that your new applications can interoperate fluidly with the legacy applications. Use of the setKey method ensures that your application will, behind the scenes, use site nodes and package instances, in addition to the Application object, to represent each new mountable application. As a result, legacy code for managing and dispatching applications will work with both your old and your new applications.

Version:
$Id: //core-platform/dev/src/com/arsdigita/web/ApplicationSetup.java#9 $
Author:
Justin Ross <jross@redhat.com>
See Also:
ApplicationType

Field Summary
protected  org.apache.log4j.Category m_category
           
protected  String m_description
           
protected  String m_dispatcherClass
           
protected  DomainObjectInstantiator m_instantiator
           
protected  boolean m_isSingleton
           
protected  boolean m_isWorkspaceApplication
           
protected  String m_key
           
protected  PackageType m_packageType
           
protected  String m_stylesheet
           
protected  String m_title
           
protected  String m_typeName
           
static String versionId
           
 
Constructor Summary
ApplicationSetup(org.apache.log4j.Category category)
           
 
Method Summary
protected  void notice(String message)
           
protected  ApplicationType process()
           
 ApplicationType run()
          After all the properties are set, validates and installs the specified application type.
 void setApplicationObjectType(String typeName)
          Sets the object type of the application instances this application type represents.
 void setDescription(String description)
          Sets the description of the installed application type.
 void setDispatcherClass(String dispatcherClass)
          Sets the dispatcher to use for appliactions of this type.
 void setInstantiator(DomainObjectInstantiator instantiator)
          Sets the instantiator used by DomainObjectFactory to resurrect specific domain classes from data objects.
 void setKey(String key)
          Sets a key for use in creating a package type and, later, site node objects, as used by older applications, to match the new application type.
 void setPackageType(PackageType packageType)
          Sets the package type to use to represent your application under the older package instance and site node approach.
 void setPortalApplication(boolean isWorkspaceApplication)
          Marks this applications of this type as ones that do or do not belong to a "portal", a special application type that collects child applications together for presentation and navigation purposes.
 void setSingleton(boolean isSingleton)
          Sets whether there can be more than one application of this type in the system.
 void setStylesheet(String stylesheet)
          Sets the stylesheet to use for applications of this type.
 void setTitle(String title)
          Sets the title of the installed application type.
 void setWorkspaceApplication(boolean isWorkspaceApplication)
          This method is an alternative to setPortalApplication(boolean).
protected  List validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

m_category

protected org.apache.log4j.Category m_category

m_title

protected String m_title

m_description

protected String m_description

m_typeName

protected String m_typeName

m_instantiator

protected DomainObjectInstantiator m_instantiator

m_key

protected String m_key

m_packageType

protected PackageType m_packageType

m_isWorkspaceApplication

protected boolean m_isWorkspaceApplication

m_isSingleton

protected boolean m_isSingleton

m_stylesheet

protected String m_stylesheet

m_dispatcherClass

protected String m_dispatcherClass
Constructor Detail

ApplicationSetup

public ApplicationSetup(org.apache.log4j.Category category)
Method Detail

setKey

public void setKey(String key)
Sets a key for use in creating a package type and, later, site node objects, as used by older applications, to match the new application type.

Parameters:
key - the String key to use to generate a package type corresponding to the new application type

setPackageType

public void setPackageType(PackageType packageType)
Sets the package type to use to represent your application under the older package instance and site node approach.

Parameters:
packageType - a PackageType to use behind the new application type

setTitle

public void setTitle(String title)
Sets the title of the installed application type.


setDescription

public void setDescription(String description)
Sets the description of the installed application type.


setApplicationObjectType

public void setApplicationObjectType(String typeName)
Sets the object type of the application instances this application type represents.


setInstantiator

public void setInstantiator(DomainObjectInstantiator instantiator)
Sets the instantiator used by DomainObjectFactory to resurrect specific domain classes from data objects.


setWorkspaceApplication

public void setWorkspaceApplication(boolean isWorkspaceApplication)
This method is an alternative to setPortalApplication(boolean). It does the same thing.


setPortalApplication

public void setPortalApplication(boolean isWorkspaceApplication)
Marks this applications of this type as ones that do or do not belong to a "portal", a special application type that collects child applications together for presentation and navigation purposes. By default, this value is true.


setSingleton

public void setSingleton(boolean isSingleton)
Sets whether there can be more than one application of this type in the system. The default is false.


setStylesheet

public void setStylesheet(String stylesheet)
Sets the stylesheet to use for applications of this type.


setDispatcherClass

public void setDispatcherClass(String dispatcherClass)
Sets the dispatcher to use for appliactions of this type.


notice

protected void notice(String message)

run

public ApplicationType run()
After all the properties are set, validates and installs the specified application type.


validate

protected List validate()

process

protected ApplicationType process()


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