atg.multisite
Class SiteManager

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.multisite.SiteManager
All Implemented Interfaces:
atg.multisite.MultisiteSnapshotDeploymentHandler, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, PropertiesChangedListener, java.util.EventListener

public class SiteManager
extends GenericService
implements PropertiesChangedListener, atg.multisite.MultisiteSnapshotDeploymentHandler

This carries out common actions on the siteRepository.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.lang.String mAdditionalProductionURLPropertyName
           
protected  java.lang.String mCloseDatePropertyName
           
protected  java.lang.String mCreatedByPropertyName
           
protected  java.lang.String mDefaultAccessLevelPropertyName
           
protected  java.lang.String mDefaultItemMappingName
           
protected  java.lang.String mEnabledPropertyName
           
protected  java.lang.String mLastModifiedByPropertyName
           
protected  java.lang.String mNamePropertyName
           
protected  java.lang.String mOpenDatePropertyName
           
protected  java.lang.String mPostClosingURLPropertyName
           
protected  java.lang.String mPreOpeningURLPropertyName
           
protected  java.lang.String mProductionURLPropertyName
           
protected  java.lang.String mSiteConfigurationItemDescriptorName
           
protected  java.lang.String mSiteDownURLPropertyName
           
protected  java.lang.String mSiteGroupItemDescriptorName
           
protected  java.lang.String mSiteGroupSitesPropertyName
           
protected static SiteManager mSiteManager
           
protected  java.lang.String mSitePriorityPropertyName
           
protected  MutableRepository mSiteRepository
           
protected  atg.multisite.SiteRepositoryChangedListener[] mSiteRepositoryChangedListeners
           
protected  SiteStateProcessor mSiteStateProcessor
           
protected  java.lang.String mSiteTemplateItemDescriptorName
           
protected  java.lang.String mSiteTemplateItemMappingIdPropertyName
           
protected  java.lang.String mSiteTemplatePropertyName
           
protected  java.lang.String mSiteTypePropertyName
           
protected  java.lang.String[] mSiteTypes
           
protected  javax.transaction.TransactionManager mTransactionManager
           
protected static java.lang.String RESOURCE_NAME
           
protected static java.util.ResourceBundle sResourceBundle
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
SiteManager()
           
 
Method Summary
 RepositoryItem createSite(java.lang.String pId)
          Creates a transient site in the siteRepository using the supplied ID, and then returns the transient repository item.
 void doStartService()
          This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.
 RepositoryItem[] filterDisabledSites(RepositoryItem[] pSites)
          Removes disabled sites from an array of site RepositoryItems.
 java.lang.String[] filterDisabledSites(java.lang.String[] pSiteIds)
          Removes disabled sites from an array of site IDs.
 RepositoryItem[] filterInactiveSites(RepositoryItem[] pSites)
          Removes inactive sites from an array of site RepositoryItems.
 java.lang.String[] filterInactiveSites(java.lang.String[] pSiteIds)
          Removes inactive sites from an array of site IDs.
protected  void fireSiteChangedEvent()
          Fires an event to registered SiteRepositoryChangedListeners indicating that the SiteRepository has been updated.
 RepositoryItem[] getActiveSites()
          Returns an array of site RepositoryItems for all active sites.
 RepositoryItem[] getActiveSitesByType(java.lang.String pType)
          Returns a RepositoryItem array containing active sites of the supplied type
 java.lang.String getAdditionalProductionURLPropertyName()
          Returns the name of the additionalPropertyURL property in the repository.
 RepositoryItem[] getAllSites()
          Queries the repository and returns an array of all site RepositoryItems.
 java.lang.String getCloseDatePropertyName()
          Returns the name of the propertyURL property in the repository.
 java.lang.String getCreatedByPropertyName()
          Returns the name of the created by property in the repository
 java.lang.String getDefaultAccessLevelPropertyName()
          Returns the default access level property name.
 java.lang.String getDefaultItemMappingName()
          Returns the default template item mapping name.
 RepositoryItem[] getDisabledSites()
          Returns sites from the SiteRepository whose enabled property is false.
 java.lang.String getEnabledPropertyName()
          Returns the name of the enabled property in the repository
 RepositoryItem[] getEnabledSites()
          Returns sites from the SiteRepository whose enabled property is true.
 RepositoryItem[] getInactiveSites()
          Returns an array of site RepositoryItems for all inactive sites.
 java.lang.String getLastModifiedByPropertyName()
          Returns the name of the last modified by property in the repository
 java.lang.String getNamePropertyName()
          Returns the name of the name property in the repository
 java.lang.String getOpenDatePropertyName()
          Returns the name of the openDate property in the repository.
 java.lang.String getPostClosingURLPropertyName()
          Returns the name of the postClosingURL property in the repository.
 java.lang.String getPreOpeningURLPropertyName()
          Returns the name of the preOpeningURL property in the repository.
 java.lang.String getProductionURLPropertyName()
          Returns the name of the propertyURL property in the repository.
 RepositoryItem getSite(java.lang.String pId)
          Returns the site RepositoryItem with the given id
 java.lang.String getSiteConfigurationItemDescriptorName()
          Returns the name of the site configuration item descriptor
 int getSiteCount()
          Query the repository a return a count of the site RepositoryItems.
 java.lang.String getSiteDownURLPropertyName()
          Returns the name of the siteDownURL property in the repository.
 java.lang.String getSiteGroupItemDescriptorName()
          Returns the name of the site group item descriptor
 java.lang.String getSiteGroupSitesPropertyName()
          Gets the name of the siteGroupSites property.
static SiteManager getSiteManager()
          Returns the statically accessible SiteManager instance
 java.lang.String getSitePriorityPropertyName()
          Returns the name of the site priority property in the repository
 MutableRepository getSiteRepository()
          Returns the SiteRepository.
 atg.multisite.SiteRepositoryChangedListener[] getSiteRepositoryChangedListeners()
          Returns the SiteRepositoryChangedListeners.
 RepositoryItem[] getSitesByState(boolean pActive)
          Returns sites which are either active or inactive, depending on whether pEnabled is true or false.
 RepositoryItem[] getSitesByTemplateId(java.lang.String pTemplateId)
          Returns SiteRepository items for all sites which are based on the given template
 RepositoryItem[] getSitesByType(java.lang.String pType)
          Returns SiteRepository items for all sites which are of the supplied types, containing sites which contain at least one of the provided site types.
 SiteStateProcessor getSiteStateProcessor()
          Gets the SiteStateProcessor component
 java.lang.String getSiteTemplateItemDescriptorName()
          Gets the name of the siteTemplate ItemDescriptor.
 java.lang.String getSiteTemplateItemMappingIdPropertyName()
          Returns the template item's itemMappingId property name.
 java.lang.String getSiteTemplatePropertyName()
          Returns the name of the site template property in the repository
 java.lang.String getSiteTypePropertyName()
          Returns the name of the site type property in the repository
 java.lang.String[] getSiteTypes()
          Returns all of the site types registered with the site Manager.
 RepositoryItem getTemplateFromSite(RepositoryItem pSite)
          Returns the template RepositoryItem associated with this site.
 java.util.Map<java.lang.String,java.lang.Object> getTemplatePropertyDefaultValues(RepositoryItem pSite)
          Gets the default values from the template associated with this site.
 javax.transaction.TransactionManager getTransactionManager()
          Returns the component that manages transaction boundaries.
 void handleMultisiteChangeEvent(java.lang.String pDeploymentId)
          Called whenever a deployment is made to the siteConfiguration item of the SiteRepository
 boolean isMultisiteEnabled()
          Indicates whether or not multi-site is enabled, i.e.
 boolean isSiteActive(RepositoryItem pSite)
          Returns true if the given RepositoryItem represents an active site
 boolean isSiteEnabled(RepositoryItem pSite)
          Returns true if the site's enabled property is set to true.
 void propertiesChanged(PropertiesChangedEvent pEvent)
          Called whenever a change is detected to a property value in the SiteRepository
 void saveSite(MutableRepositoryItem pSite)
          Saves a transient RepositoryItem to the SiteRepository
 void setAdditionalPropertyURLName(java.lang.String pAdditionalPropertyURLPropertyName)
          Sets the name of the additionalPropertyURL property in the repository
 void setCloseDatePropertyName(java.lang.String pCloseDatePropertyName)
          Sets the name of the propertyURL property in the repository
 void setCreatedByPropertyName(java.lang.String pCreatedByPropertyName)
          Sets the name of the created by property in the repository
 void setDefaultAccessLevelPropertyName(java.lang.String pDefaultAccessLevelPropertyName)
          Sets the default access level property name
 void setDefaultItemMappingName(java.lang.String pDefaultItemMappingName)
          Sets the default template item mapping name.
 void setEnabledPropertyName(java.lang.String pEnabledPropertyName)
          Sets the name of the enabled property in the repository
 void setLastModifiedByPropertyName(java.lang.String pLastModifiedByPropertyName)
          Sets the name of the last modified by property in the repository
 void setNamePropertyName(java.lang.String pNamePropertyName)
          Sets the name of the name property in the repository
 void setOpenDatePropertyName(java.lang.String pOpenDatePropertyName)
          Sets the name of the openDate property in the repository
 void setPostClosingURLPropertyName(java.lang.String pPostClosingURLPropertyName)
          Sets the name of the postClosingURL property in the repository
 void setPreOpeningURLPropertyName(java.lang.String pPreOpeningURLPropertyName)
          Sets the name of the preOpeningURL property in the repository
 void setProductionURLPropertyName(java.lang.String pProductionURLPropertyName)
          Sets the name of the productionURL property in the repository
 void setSiteConfigurationItemDescriptorName(java.lang.String pSiteConfigurationItemDescriptorName)
          Sets the name of the site configuration item descriptor
 void setSiteDownURLPropertyName(java.lang.String pSiteDownURLPropertyName)
          Sets the name of the siteDownURL property in the repository
 void setSiteGroupItemDescriptorName(java.lang.String pSiteGroupItemDescriptorName)
          Sets the name of the site group item descriptor
 void setSiteGroupSitesPropertyName(java.lang.String pSiteGroupSitesPropertyName)
          Sets the name of the siteGroupSites property.
 void setSitePriorityPropertyName(java.lang.String pSitePriorityPropertyName)
          Sets the name of the site priority property in the repository
 void setSiteRepository(MutableRepository pSiteRepository)
          Set the SiteRepository.
 void setSiteRepositoryChangedListeners(atg.multisite.SiteRepositoryChangedListener[] pSiteRepositoryChangedListeners)
          Set the SiteRepositoryChangedListeners.
 void setSiteStateProcessor(SiteStateProcessor pSiteStateProcessor)
          Sets the SiteStateProcessor component
 void setSiteTemplateItemDescriptorName(java.lang.String pSiteTemplateItemDescriptorName)
          Sets the name of the siteTemplateItemDescriptorName property.
 void setSiteTemplateItemMappingIdPropertyName(java.lang.String pSiteTemplateItemMappingIdPropertyName)
          Sets the template item's itemMappingId property name.
 void setSiteTemplatePropertyName(java.lang.String pSiteTemplatePropertyName)
          Sets the name of the site template property in the repository
 void setSiteTypePropertyName(java.lang.String pSiteTypePropertyName)
          Sets the name of the site type property in the repository
 void setSiteTypes(java.lang.String[] pSiteTypes)
          Sets the valid site type values.
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
          Set the component that manages transaction boundaries.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


RESOURCE_NAME

protected static final java.lang.String RESOURCE_NAME
See Also:
Constant Field Values

sResourceBundle

protected static java.util.ResourceBundle sResourceBundle

mSiteManager

protected static SiteManager mSiteManager

mSiteRepository

protected MutableRepository mSiteRepository

mSiteRepositoryChangedListeners

protected atg.multisite.SiteRepositoryChangedListener[] mSiteRepositoryChangedListeners

mSiteStateProcessor

protected SiteStateProcessor mSiteStateProcessor

mTransactionManager

protected javax.transaction.TransactionManager mTransactionManager

mSiteConfigurationItemDescriptorName

protected java.lang.String mSiteConfigurationItemDescriptorName

mSiteGroupItemDescriptorName

protected java.lang.String mSiteGroupItemDescriptorName

mCreatedByPropertyName

protected java.lang.String mCreatedByPropertyName

mSiteGroupSitesPropertyName

protected java.lang.String mSiteGroupSitesPropertyName

mSiteTemplateItemDescriptorName

protected java.lang.String mSiteTemplateItemDescriptorName

mEnabledPropertyName

protected java.lang.String mEnabledPropertyName

mLastModifiedByPropertyName

protected java.lang.String mLastModifiedByPropertyName

mNamePropertyName

protected java.lang.String mNamePropertyName

mSitePriorityPropertyName

protected java.lang.String mSitePriorityPropertyName

mSiteTemplatePropertyName

protected java.lang.String mSiteTemplatePropertyName

mSiteTypePropertyName

protected java.lang.String mSiteTypePropertyName

mAdditionalProductionURLPropertyName

protected java.lang.String mAdditionalProductionURLPropertyName

mProductionURLPropertyName

protected java.lang.String mProductionURLPropertyName

mOpenDatePropertyName

protected java.lang.String mOpenDatePropertyName

mCloseDatePropertyName

protected java.lang.String mCloseDatePropertyName

mSiteDownURLPropertyName

protected java.lang.String mSiteDownURLPropertyName

mPreOpeningURLPropertyName

protected java.lang.String mPreOpeningURLPropertyName

mPostClosingURLPropertyName

protected java.lang.String mPostClosingURLPropertyName

mDefaultItemMappingName

protected java.lang.String mDefaultItemMappingName

mSiteTemplateItemMappingIdPropertyName

protected java.lang.String mSiteTemplateItemMappingIdPropertyName

mDefaultAccessLevelPropertyName

protected java.lang.String mDefaultAccessLevelPropertyName

mSiteTypes

protected java.lang.String[] mSiteTypes
Constructor Detail

SiteManager

public SiteManager()
Method Detail

getSiteManager

public static SiteManager getSiteManager()
Returns the statically accessible SiteManager instance


getSiteRepository

public MutableRepository getSiteRepository()
Returns the SiteRepository.


setSiteRepository

public void setSiteRepository(MutableRepository pSiteRepository)
Set the SiteRepository.

Parameters:
pSiteRepository - The SiteRepository instance to use.

getSiteRepositoryChangedListeners

public atg.multisite.SiteRepositoryChangedListener[] getSiteRepositoryChangedListeners()
Returns the SiteRepositoryChangedListeners.


setSiteRepositoryChangedListeners

public void setSiteRepositoryChangedListeners(atg.multisite.SiteRepositoryChangedListener[] pSiteRepositoryChangedListeners)
Set the SiteRepositoryChangedListeners.

Parameters:
pSiteRepositoryChangedListeners - The array of change listeners.

getSiteStateProcessor

public SiteStateProcessor getSiteStateProcessor()
Gets the SiteStateProcessor component


setSiteStateProcessor

public void setSiteStateProcessor(SiteStateProcessor pSiteStateProcessor)
Sets the SiteStateProcessor component

Parameters:
pSiteStateProcessor -

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Returns the component that manages transaction boundaries.


setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Set the component that manages transaction boundaries.

Parameters:
pTransactionManager - the manager component

getSiteConfigurationItemDescriptorName

public java.lang.String getSiteConfigurationItemDescriptorName()
Returns the name of the site configuration item descriptor


setSiteConfigurationItemDescriptorName

public void setSiteConfigurationItemDescriptorName(java.lang.String pSiteConfigurationItemDescriptorName)
Sets the name of the site configuration item descriptor


getSiteGroupItemDescriptorName

public java.lang.String getSiteGroupItemDescriptorName()
Returns the name of the site group item descriptor


setSiteGroupItemDescriptorName

public void setSiteGroupItemDescriptorName(java.lang.String pSiteGroupItemDescriptorName)
Sets the name of the site group item descriptor


getCreatedByPropertyName

public java.lang.String getCreatedByPropertyName()
Returns the name of the created by property in the repository


setCreatedByPropertyName

public void setCreatedByPropertyName(java.lang.String pCreatedByPropertyName)
Sets the name of the created by property in the repository


setSiteGroupSitesPropertyName

public void setSiteGroupSitesPropertyName(java.lang.String pSiteGroupSitesPropertyName)
Sets the name of the siteGroupSites property.

Parameters:
pSiteGroupSitesPropertyName - The name of the siteGroupSites property.

getSiteGroupSitesPropertyName

public java.lang.String getSiteGroupSitesPropertyName()
Gets the name of the siteGroupSites property.

Returns:
The name of the siteGroupSites property.

setSiteTemplateItemDescriptorName

public void setSiteTemplateItemDescriptorName(java.lang.String pSiteTemplateItemDescriptorName)
Sets the name of the siteTemplateItemDescriptorName property.

Parameters:
pSiteTemplateItemDescriptorName - The name of the siteTemplate ItemDescriptor.

getSiteTemplateItemDescriptorName

public java.lang.String getSiteTemplateItemDescriptorName()
Gets the name of the siteTemplate ItemDescriptor.

Returns:
The name of the siteTemplate ItemDescriptor.

getEnabledPropertyName

public java.lang.String getEnabledPropertyName()
Returns the name of the enabled property in the repository


setEnabledPropertyName

public void setEnabledPropertyName(java.lang.String pEnabledPropertyName)
Sets the name of the enabled property in the repository


getLastModifiedByPropertyName

public java.lang.String getLastModifiedByPropertyName()
Returns the name of the last modified by property in the repository


setLastModifiedByPropertyName

public void setLastModifiedByPropertyName(java.lang.String pLastModifiedByPropertyName)
Sets the name of the last modified by property in the repository


getNamePropertyName

public java.lang.String getNamePropertyName()
Returns the name of the name property in the repository


setNamePropertyName

public void setNamePropertyName(java.lang.String pNamePropertyName)
Sets the name of the name property in the repository


getSitePriorityPropertyName

public java.lang.String getSitePriorityPropertyName()
Returns the name of the site priority property in the repository


setSitePriorityPropertyName

public void setSitePriorityPropertyName(java.lang.String pSitePriorityPropertyName)
Sets the name of the site priority property in the repository


getSiteTemplatePropertyName

public java.lang.String getSiteTemplatePropertyName()
Returns the name of the site template property in the repository


setSiteTemplatePropertyName

public void setSiteTemplatePropertyName(java.lang.String pSiteTemplatePropertyName)
Sets the name of the site template property in the repository


getSiteTypePropertyName

public java.lang.String getSiteTypePropertyName()
Returns the name of the site type property in the repository


setSiteTypePropertyName

public void setSiteTypePropertyName(java.lang.String pSiteTypePropertyName)
Sets the name of the site type property in the repository


getAdditionalProductionURLPropertyName

public java.lang.String getAdditionalProductionURLPropertyName()
Returns the name of the additionalPropertyURL property in the repository.


setAdditionalPropertyURLName

public void setAdditionalPropertyURLName(java.lang.String pAdditionalPropertyURLPropertyName)
Sets the name of the additionalPropertyURL property in the repository


getProductionURLPropertyName

public java.lang.String getProductionURLPropertyName()
Returns the name of the propertyURL property in the repository.


setProductionURLPropertyName

public void setProductionURLPropertyName(java.lang.String pProductionURLPropertyName)
Sets the name of the productionURL property in the repository


getOpenDatePropertyName

public java.lang.String getOpenDatePropertyName()
Returns the name of the openDate property in the repository.


setOpenDatePropertyName

public void setOpenDatePropertyName(java.lang.String pOpenDatePropertyName)
Sets the name of the openDate property in the repository


getCloseDatePropertyName

public java.lang.String getCloseDatePropertyName()
Returns the name of the propertyURL property in the repository.


setCloseDatePropertyName

public void setCloseDatePropertyName(java.lang.String pCloseDatePropertyName)
Sets the name of the propertyURL property in the repository


getSiteDownURLPropertyName

public java.lang.String getSiteDownURLPropertyName()
Returns the name of the siteDownURL property in the repository.


setSiteDownURLPropertyName

public void setSiteDownURLPropertyName(java.lang.String pSiteDownURLPropertyName)
Sets the name of the siteDownURL property in the repository


getPreOpeningURLPropertyName

public java.lang.String getPreOpeningURLPropertyName()
Returns the name of the preOpeningURL property in the repository.


setPreOpeningURLPropertyName

public void setPreOpeningURLPropertyName(java.lang.String pPreOpeningURLPropertyName)
Sets the name of the preOpeningURL property in the repository


getPostClosingURLPropertyName

public java.lang.String getPostClosingURLPropertyName()
Returns the name of the postClosingURL property in the repository.


setPostClosingURLPropertyName

public void setPostClosingURLPropertyName(java.lang.String pPostClosingURLPropertyName)
Sets the name of the postClosingURL property in the repository


getDefaultItemMappingName

public java.lang.String getDefaultItemMappingName()
Returns the default template item mapping name.


setDefaultItemMappingName

public void setDefaultItemMappingName(java.lang.String pDefaultItemMappingName)
Sets the default template item mapping name.


getSiteTemplateItemMappingIdPropertyName

public java.lang.String getSiteTemplateItemMappingIdPropertyName()
Returns the template item's itemMappingId property name.


setSiteTemplateItemMappingIdPropertyName

public void setSiteTemplateItemMappingIdPropertyName(java.lang.String pSiteTemplateItemMappingIdPropertyName)
Sets the template item's itemMappingId property name.


getDefaultAccessLevelPropertyName

public java.lang.String getDefaultAccessLevelPropertyName()
Returns the default access level property name.


setDefaultAccessLevelPropertyName

public void setDefaultAccessLevelPropertyName(java.lang.String pDefaultAccessLevelPropertyName)
Sets the default access level property name


getSiteTypes

public java.lang.String[] getSiteTypes()
Returns all of the site types registered with the site Manager.

Returns:
The array of valid site type names.

setSiteTypes

public void setSiteTypes(java.lang.String[] pSiteTypes)
Sets the valid site type values.

Parameters:
pSiteTypes - The array of valid site type names.

doStartService

public void doStartService()
                    throws ServiceException
Description copied from class: GenericService
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. The Service should override this method to start any processes it requires.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

getSitesByTemplateId

public RepositoryItem[] getSitesByTemplateId(java.lang.String pTemplateId)
                                      throws RepositoryException
Returns SiteRepository items for all sites which are based on the given template

Parameters:
pTemplateId - the ID of the site template.
Throws:
RepositoryException

getSitesByType

public RepositoryItem[] getSitesByType(java.lang.String pType)
                                throws RepositoryException
Returns SiteRepository items for all sites which are of the supplied types, containing sites which contain at least one of the provided site types.

Parameters:
pType - the site type
Throws:
RepositoryException

getTemplatePropertyDefaultValues

public java.util.Map<java.lang.String,java.lang.Object> getTemplatePropertyDefaultValues(RepositoryItem pSite)
                                                                                  throws RepositoryException
Gets the default values from the template associated with this site. These are returned in a map keyed by property name.

Parameters:
pSite -
Returns:
the default values, keyed by property name
Throws:
RepositoryException

getTemplateFromSite

public RepositoryItem getTemplateFromSite(RepositoryItem pSite)
                                   throws RepositoryException
Returns the template RepositoryItem associated with this site.

Parameters:
pSite -
Returns:
template RepositoryItem
Throws:
RepositoryException

getActiveSites

public RepositoryItem[] getActiveSites()
                                throws RepositoryException
Returns an array of site RepositoryItems for all active sites. This is the same as calling getSitesByState(true), and is provided for convenience.

Returns:
array of site RepositoryItems, or null if none are found.
Throws:
RepositoryException

getActiveSitesByType

public RepositoryItem[] getActiveSitesByType(java.lang.String pType)
                                      throws RepositoryException
Returns a RepositoryItem array containing active sites of the supplied type

Parameters:
pType - the site types
Returns:
array of Site repository items
Throws:
RepositoryException

getInactiveSites

public RepositoryItem[] getInactiveSites()
                                  throws RepositoryException
Returns an array of site RepositoryItems for all inactive sites. This is the same as calling getSitesByState(false), and is provided for convenience.

Returns:
array of site RepositoryItems, or null if none are found.
Throws:
RepositoryException

getSitesByState

public RepositoryItem[] getSitesByState(boolean pActive)
                                 throws RepositoryException
Returns sites which are either active or inactive, depending on whether pEnabled is true or false.

Parameters:
pActive - return sites which are enabled or disabled.
Returns:
array of site RepositoryItems
Throws:
RepositoryException

getDisabledSites

public RepositoryItem[] getDisabledSites()
                                  throws RepositoryException
Returns sites from the SiteRepository whose enabled property is false.

Returns:
disabled site repository items
Throws:
RepositoryException

getEnabledSites

public RepositoryItem[] getEnabledSites()
                                 throws RepositoryException
Returns sites from the SiteRepository whose enabled property is true.

Returns:
enabled site repository items
Throws:
RepositoryException

isMultisiteEnabled

public final boolean isMultisiteEnabled()
Indicates whether or not multi-site is enabled, i.e. are there any sites registered in the site repository

Returns:
true if at least one site exists

isSiteActive

public boolean isSiteActive(RepositoryItem pSite)
Returns true if the given RepositoryItem represents an active site

Returns:
boolean

isSiteEnabled

public boolean isSiteEnabled(RepositoryItem pSite)
Returns true if the site's enabled property is set to true.

Parameters:
pSite -
Returns:
boolean

filterInactiveSites

public java.lang.String[] filterInactiveSites(java.lang.String[] pSiteIds)
Removes inactive sites from an array of site IDs.

Parameters:
pSiteIds - An array of site IDs.
Returns:
An array of site IDs, only including active sites.

filterInactiveSites

public RepositoryItem[] filterInactiveSites(RepositoryItem[] pSites)
Removes inactive sites from an array of site RepositoryItems.

Parameters:
pSites - An array of Sits.
Returns:
An array of Sites, only including active sites.

filterDisabledSites

public java.lang.String[] filterDisabledSites(java.lang.String[] pSiteIds)
Removes disabled sites from an array of site IDs.

Parameters:
pSiteIds - An array of site IDs.
Returns:
An array of site IDs, only including active sites.

filterDisabledSites

public RepositoryItem[] filterDisabledSites(RepositoryItem[] pSites)
Removes disabled sites from an array of site RepositoryItems.

Parameters:
pSites - An array of Sits.
Returns:
An array of Sites, only including active sites.

createSite

public RepositoryItem createSite(java.lang.String pId)
                          throws RepositoryException
Creates a transient site in the siteRepository using the supplied ID, and then returns the transient repository item. The caller can then set additional property values before adding the item to the repository.

Parameters:
pId - the id for the site
Returns:
a transient site RepositoryItem
Throws:
RepositoryException

saveSite

public void saveSite(MutableRepositoryItem pSite)
              throws RepositoryException
Saves a transient RepositoryItem to the SiteRepository

Parameters:
pSite - the site RepositoryItem
Throws:
RepositoryException

getSite

public RepositoryItem getSite(java.lang.String pId)
                       throws RepositoryException
Returns the site RepositoryItem with the given id

Parameters:
pId - the repository id
Returns:
the site RepositoryItem
Throws:
RepositoryException

getAllSites

public RepositoryItem[] getAllSites()
                             throws RepositoryException
Queries the repository and returns an array of all site RepositoryItems.

Returns:
null if no sites could be found
Throws:
RepositoryException - if there is an error while performing the query operation

getSiteCount

public final int getSiteCount()
                       throws RepositoryException
Query the repository a return a count of the site RepositoryItems.

Returns:
the count of sites
Throws:
RepositoryException - if there is an error while performing the query operation

propertiesChanged

public void propertiesChanged(PropertiesChangedEvent pEvent)
Called whenever a change is detected to a property value in the SiteRepository

Specified by:
propertiesChanged in interface PropertiesChangedListener

handleMultisiteChangeEvent

public void handleMultisiteChangeEvent(java.lang.String pDeploymentId)
Called whenever a deployment is made to the siteConfiguration item of the SiteRepository

Specified by:
handleMultisiteChangeEvent in interface atg.multisite.MultisiteSnapshotDeploymentHandler

fireSiteChangedEvent

protected void fireSiteChangedEvent()
Fires an event to registered SiteRepositoryChangedListeners indicating that the SiteRepository has been updated.