com.arsdigita.web
Class Application

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.kernel.Resource
                  extended bycom.arsdigita.web.Application
Direct Known Subclasses:
Admin, SiteMap

public class Application
extends Resource

A base class for defining a web application. An application has three important aspects:

  1. Each is a data partition. An application is like a folder: it contains a user-driven subset of the objects in the system. For instance, the travel forum has its own posts and the cooking forum has its own posts, even though both forums are the same type.
  2. Each has its own configuration. An application may be independently configured to change its behavior.
  3. Each corresponds to a top-level UI. An application has an associated self-contained UI, a servlet. Generally, this UI will work off of the application's content (from the data partition) and configuration. The main dispatcher knows about applications and dispatches to their servlets directly.

Version:
$Id: //core-platform/dev/src/com/arsdigita/web/Application.java#11 $
Author:
Jim Parsons, Justin Ross

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String PRIMARY_URL
           
static String versionId
           
 
Fields inherited from class com.arsdigita.kernel.Resource
CHILD_RESOURCE, DESCRIPTION, PARENT_RESOURCE, RESOURCE_TYPE, TIMESTAMP, TITLE
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
protected Application(DataObject dataObject)
           
protected Application(OID oid)
           
 
Method Summary
 void afterDelete()
           
protected  void beforeSave()
           
static Application createApplication(ApplicationType type, String fragment, String title, Application parent)
           
static Application createApplication(String typeName, String fragment, String title, Application parent)
           
static Application createRootApplication(ApplicationType type, String title)
           
 List getAncestorApplications()
           
 ApplicationType getApplicationType()
           
protected  String getBaseDataObjectType()
          Returns the base data object type for this domain object class.
static String getCanonicalURL(String url)
          Returns a canonical application URL.
 ApplicationCollection getChildApplications()
           
 ApplicationCollection getChildApplicationsForType(String applicationType)
           
static Application getContainingApplication(ACSObject obj)
           
 String getContextPath()
           
static Application getCurrentApplication(javax.servlet.http.HttpServletRequest req)
          Deprecated. Use WebContext.getApplication() instead.
 PackageType getPackageType()
           
 Application getParentApplication()
           
 String getPath()
          Returns the path to this application through the dispatcher.
 String getPrimaryURL()
          Deprecated. Use getPath() instead.
 Collection getRelevantPrivileges()
           
 String getServletPath()
           
 SiteNode getSiteNode()
           
 String getStylesheetPath()
           
static boolean isInstalled(String applicationObjectType, String path)
           
static ApplicationCollection retrieveAllApplications()
           
static Application retrieveApplication(BigDecimal id)
           
static Application retrieveApplication(DataObject dobj)
           
static Application retrieveApplication(OID oid)
           
static Application retrieveApplicationForPath(String path)
           
static Application retrieveApplicationForSiteNode(SiteNode siteNode)
           
protected  void setApplicationType(ApplicationType applicationType)
           
 void setParentApplication(Application application)
           
 void setPath(String path)
          Sets the dispatcher path of this application.
 
Methods inherited from class com.arsdigita.kernel.Resource
afterSave, createResource, createResource, getChildResources, getContainer, getContainingResource, getDescription, getDisplayName, getParentResource, getResourceType, getTimestamp, getTitle, isContainerModified, retrieveAllResources, retrieveResource, retrieveResource, retrieveResource, setDescription, setParentResource, setResourceType, setTitle
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, beforeDelete, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

PRIMARY_URL

public static final String PRIMARY_URL
See Also:
Constant Field Values

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values
Constructor Detail

Application

protected Application(DataObject dataObject)

Application

protected Application(OID oid)
               throws DataObjectNotFoundException
Method Detail

getBaseDataObjectType

protected String getBaseDataObjectType()
Description copied from class: DomainObject
Returns the base data object type for this domain object class. Intended to be overrided by subclasses whenever the subclass will only work if their primary data object is of a certain base type.

Overrides:
getBaseDataObjectType in class Resource

createRootApplication

public static Application createRootApplication(ApplicationType type,
                                                String title)

createApplication

public static Application createApplication(ApplicationType type,
                                            String fragment,
                                            String title,
                                            Application parent)

createApplication

public static Application createApplication(String typeName,
                                            String fragment,
                                            String title,
                                            Application parent)

retrieveApplication

public static Application retrieveApplication(BigDecimal id)

retrieveApplication

public static Application retrieveApplication(OID oid)

retrieveApplication

public static Application retrieveApplication(DataObject dobj)

getContainingApplication

public static final Application getContainingApplication(ACSObject obj)

retrieveApplicationForSiteNode

public static Application retrieveApplicationForSiteNode(SiteNode siteNode)

retrieveApplicationForPath

public static Application retrieveApplicationForPath(String path)

getApplicationType

public ApplicationType getApplicationType()

setApplicationType

protected void setApplicationType(ApplicationType applicationType)

getPackageType

public PackageType getPackageType()

getParentApplication

public Application getParentApplication()

getAncestorApplications

public List getAncestorApplications()

setParentApplication

public void setParentApplication(Application application)

getChildApplications

public ApplicationCollection getChildApplications()

getChildApplicationsForType

public ApplicationCollection getChildApplicationsForType(String applicationType)

getSiteNode

public SiteNode getSiteNode()

getCurrentApplication

public static Application getCurrentApplication(javax.servlet.http.HttpServletRequest req)
Deprecated. Use WebContext.getApplication() instead.


getPrimaryURL

public String getPrimaryURL()
Deprecated. Use getPath() instead.

Returns the path to this application through the dispatcher. This path ends in a slash. Returns null if the application has no path.


getPath

public final String getPath()
Returns the path to this application through the dispatcher. The path does not end in a slash. This method will not return null.


setPath

public final void setPath(String path)
Sets the dispatcher path of this application. The


getRelevantPrivileges

public Collection getRelevantPrivileges()

retrieveAllApplications

public static ApplicationCollection retrieveAllApplications()

isInstalled

public static boolean isInstalled(String applicationObjectType,
                                  String path)

getCanonicalURL

public static String getCanonicalURL(String url)
Returns a canonical application URL. This is a utility method that constructs a URL fragment (just the path relative to the protocol and server) by trimming the with both leading and trailing slashes.


getContextPath

public String getContextPath()

getServletPath

public String getServletPath()

getStylesheetPath

public String getStylesheetPath()

beforeSave

protected void beforeSave()
Overrides:
beforeSave in class Resource

afterDelete

public void afterDelete()
Overrides:
afterDelete in class DomainObject


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