public class SiteDAO extends AbstractLogEnabled implements Serviceable, Component
| Modifier and Type | Field and Description |
|---|---|
private static List<String> |
__FORBIDDEN_SITE_NAMES |
private CurrentUserProvider |
_currentUserProvider |
private GroupDirectoryContextHelper |
_groupDirectoryContextHelper |
private I18nUtils |
_i18nUtils |
private PageElementCache |
_inputDataCache |
private ObservationManager |
_observationManager |
private PopulationContextHelper |
_populationContextHelper |
private RebuildLiveComponent |
_rebuildLiveComponent |
private AmetysObjectResolver |
_resolver |
private SiteConfigurationExtensionPoint |
_siteConfiguration |
private SiteManager |
_siteManager |
private SiteTypesExtensionPoint |
_siteTypesEP |
private PageElementCache |
_zoneItemCache |
static String |
DEFAULT_SITE_TYPE_ID
Id of the default site type
|
static String |
ROLE
Avalon Role
|
| Constructor and Description |
|---|
SiteDAO() |
| Modifier and Type | Method and Description |
|---|---|
private Collection<String> |
_getChildrenSiteNames(Site site)
Get all children site's names of a site
|
protected void |
_setParameters(Site site,
Map<String,Object> values,
Map<String,Errors> allErrors)
Set the site parameters
|
Map<String,Object> |
buildLive()
Rebuild the live of a site, index all sitemaps and reset cache.
|
void |
buildLive(String siteName)
Rebuild the live of a site, index all sitemaps and reset cache.
|
List<String> |
clearAllCaches()
Clear cache of all sites.
|
void |
clearCache(Site site)
Clear cache of a site
|
void |
clearCache(String siteName)
Clear site's cache
|
Map<String,Object> |
configureSite(String siteName,
Map<String,Object> values)
Configure site
|
Map<String,Object> |
copySite(String parentId,
String name,
String id)
Create a site by copy of another.
|
Map<String,Object> |
createSite(String parentId,
String name,
String type,
boolean renameIfExists)
Creates a new site
|
void |
deleteSite(String siteId)
Delete a site
|
String |
getRootId()
Get the root id
|
Map<String,Object> |
getSiteInfos(Site site)
Get the site's properties
|
Map<String,Object> |
getSiteInfos(String name)
Get the site's properties
|
Map<String,Object> |
getSitesInfos(List<String> names)
Get the properties of given sites
|
Map<String,Object> |
moveSite(String targetId,
List<String> ids)
Move sites
|
void |
service(ServiceManager smanager) |
getLogger, setLoggerpublic static final String DEFAULT_SITE_TYPE_ID
private static final List<String> __FORBIDDEN_SITE_NAMES
private SiteManager _siteManager
private AmetysObjectResolver _resolver
private ObservationManager _observationManager
private CurrentUserProvider _currentUserProvider
private PageElementCache _inputDataCache
private PageElementCache _zoneItemCache
private RebuildLiveComponent _rebuildLiveComponent
private SiteConfigurationExtensionPoint _siteConfiguration
private SiteTypesExtensionPoint _siteTypesEP
private I18nUtils _i18nUtils
private PopulationContextHelper _populationContextHelper
private GroupDirectoryContextHelper _groupDirectoryContextHelper
public SiteDAO()
public void service(ServiceManager smanager) throws ServiceException
service in interface ServiceableServiceExceptionpublic Map<String,Object> getSitesInfos(List<String> names)
names - the site namespublic Map<String,Object> getSiteInfos(String name)
name - the site namepublic Map<String,Object> getSiteInfos(Site site)
site - the sitepublic Map<String,Object> createSite(String parentId, String name, String type, boolean renameIfExists)
parentId - The id of parent site. Can be null to create a root site.name - The site's nametype - The site's typerenameIfExists - Set to true to automatically rename the site if already existspublic Map<String,Object> copySite(String parentId, String name, String id) throws Exception
parentId - The id of parent site. Can be null to create a root site.name - the name of site to createid - the id of site to copyException - if an error ocurred while populating new sitepublic void deleteSite(String siteId) throws RepositoryException
siteId - The id of site to deleteRepositoryException - if an error occurred during deletionpublic void buildLive(String siteName) throws Exception
siteName - The site nameException - if an error occurredpublic Map<String,Object> buildLive() throws Exception
Exception - if an error occurredpublic Map<String,Object> moveSite(String targetId, List<String> ids) throws AmetysRepositoryException, RepositoryException
targetId - The targetids - the ids of sites to moveAmetysRepositoryException - if an error occursRepositoryException - if an error occurspublic void clearCache(String siteName) throws Exception
siteName - The site nameException - if an error occurred during cache deletionpublic List<String> clearAllCaches()
public void clearCache(Site site) throws Exception
site - the siteException - if an error occurredpublic Map<String,Object> configureSite(String siteName, Map<String,Object> values) throws Exception
siteName - The site name.values - the configuration's valuesException - if an error occurredprotected void _setParameters(Site site, Map<String,Object> values, Map<String,Errors> allErrors)
site - the sitevalues - the parameters' valuesallErrors - the parameters' errorsprivate Collection<String> _getChildrenSiteNames(Site site)
site - The site