public class JahiaSitesService extends JahiaService
| Modifier and Type | Class and Description |
|---|---|
class |
JahiaSitesService.SiteDefaultLanguageBySiteKeyCacheEntryFactory |
class |
JahiaSitesService.SiteKeyByServerNameCacheEntryFactory
Factory to fill the site key by server name cache.
|
| Modifier and Type | Field and Description |
|---|---|
protected EhCacheProvider |
ehCacheProvider |
protected JahiaGroupManagerService |
groupService |
protected JCRSessionFactory |
sessionFactory |
static String |
SITES_JCR_PATH |
static String |
SYSTEM_SITE_KEY |
settingsBean| Modifier and Type | Method and Description |
|---|---|
JahiaSite |
addSite(JahiaUser currentUser,
String title,
String serverName,
String siteKey,
String descr,
Locale selectedLocale,
String selectTmplSet,
String[] modulesToDeploy,
String firstImport,
org.springframework.core.io.Resource fileImport,
String fileImportName,
Boolean asAJob,
Boolean doImportServerPermissions,
String originatingJahiaRelease)
Deprecated.
since 7.2.2.0. Use the
addSite(SiteCreationInfo) instead |
JahiaSite |
addSite(JahiaUser currentUser,
String title,
String serverName,
String siteKey,
String descr,
Locale selectedLocale,
String selectTmplSet,
String[] modulesToDeploy,
String firstImport,
org.springframework.core.io.Resource fileImport,
String fileImportName,
Boolean asAJob,
Boolean doImportServerPermissions,
String originatingJahiaRelease,
org.springframework.core.io.Resource legacyMappingFilePath,
org.springframework.core.io.Resource legacyDefinitionsFilePath)
Deprecated.
since 7.2.2.0. Use the
addSite(SiteCreationInfo) instead |
JahiaSite |
addSite(JahiaUser currentUser,
String title,
String serverName,
String siteKey,
String descr,
Locale selectedLocale,
String selectTmplSet,
String[] modulesToDeploy,
String firstImport,
org.springframework.core.io.Resource fileImport,
String fileImportName,
Boolean asAJob,
Boolean doImportServerPermissions,
String originatingJahiaRelease,
org.springframework.core.io.Resource legacyMappingFilePath,
org.springframework.core.io.Resource legacyDefinitionsFilePath,
JCRSessionWrapper session)
Deprecated.
since 7.2.2.0. Use the
addSite(SiteCreationInfo, JCRSessionWrapper) instead |
JahiaSite |
addSite(JahiaUser currentUser,
String title,
String serverName,
String siteKey,
String descr,
Locale selectedLocale,
String selectTmplSet,
String firstImport,
org.springframework.core.io.Resource fileImport,
String fileImportName,
Boolean asAJob,
Boolean doImportServerPermissions,
String originatingJahiaRelease)
Deprecated.
since 7.2.2.0. Use the
addSite(SiteCreationInfo) instead |
JahiaSite |
addSite(SiteCreationInfo info)
Creates the site using the specified data.
|
JahiaSite |
addSite(SiteCreationInfo info,
JCRSessionWrapper session)
Creates the site using the specified data.
|
void |
deployModules(JahiaSite site,
String[] modulesToDeploy,
JCRSessionWrapper session) |
static void |
flushSitesInternalCaches()
Flush the sites internal caches ( site key by server name & default language by site key).
|
JahiaSite |
getDefaultSite() |
JahiaSite |
getDefaultSite(JCRSessionWrapper session) |
JCRSiteNode |
getFirstSiteFound(JCRSessionWrapper session,
String... skippedSites)
Returns first found site node under
/sites considering the list of sites to be skipped. |
static JahiaSitesService |
getInstance()
Retrieves the unique instance of this singleton class.
|
int |
getNbSites()
Deprecated.
since Jahia 8.0.0.0 use
getSiteCount(boolean) instead |
JahiaSite |
getSite(String name)
return a site looking at it's name
|
JahiaSite |
getSiteByKey(String siteKey)
return a site bean looking at it key
|
JCRSiteNode |
getSiteByKey(String siteKey,
JCRSessionWrapper session) |
JahiaSite |
getSiteByServerName(String serverName)
Find a site by it's server name value
|
JCRSiteNode |
getSiteByServerName(String serverName,
JCRSessionWrapper session) |
long |
getSiteCount(boolean includeSystemSite)
This method count the sites with or without the systemsite
|
String |
getSiteDefaultLanguage(String siteKey) |
String |
getSitenameByServerName(String serverName) |
List<String> |
getSitesNames()
return the list of all sites names
|
List<JCRSiteNode> |
getSitesNodeList()
return the list of all sites
|
List<JCRSiteNode> |
getSitesNodeList(JCRSessionWrapper session) |
String |
getValidSiteKeyCharacters() |
void |
invalidateCache(JahiaSite site)
Invalidates the cache for the specified site.
|
void |
invalidateCache(String siteKey,
List<String> serverNames)
Invalidates the cache for the specified site.
|
void |
invalidateCache(String siteKey,
String serverName) |
boolean |
isServerNameValid(String serverName) |
boolean |
isSiteKeyValid(String siteKey) |
void |
removeSite(JahiaSite siteToRemove)
Remove a site; if the removed site is the default one:
- the first other site found will become the default
- if no other site found, no default site anymore
|
void |
setDefaultSite(JahiaSite site) |
void |
setDefaultSite(JahiaSite site,
JCRSessionWrapper session) |
void |
setEhCacheProvider(EhCacheProvider ehCacheProvider) |
void |
setGroupService(JahiaGroupManagerService groupService) |
void |
setSessionFactory(JCRSessionFactory sessionFactory) |
void |
setValidServerNameRegex(String validServerNameRegex) |
void |
setValidSiteKeyCharacters(String validSiteKeyCharacters) |
boolean |
siteExists(String siteKey,
JCRSessionWrapper session) |
void |
start() |
void |
stop() |
void |
updateModules(JahiaSite site,
List<String> newModuleIds,
JCRSessionWrapper session) |
boolean |
updateSystemSiteLanguages(JahiaSite site,
JCRSessionWrapper session) |
void |
updateSystemSitePermissions(JahiaSite site)
Update a JahiaSite definition
|
void |
updateSystemSitePermissions(JahiaSite site,
JCRSessionWrapper session) |
getSettingsBean, setSettingsBeanpublic static final String SYSTEM_SITE_KEY
public static final String SITES_JCR_PATH
protected JahiaGroupManagerService groupService
protected JCRSessionFactory sessionFactory
protected EhCacheProvider ehCacheProvider
public void setGroupService(JahiaGroupManagerService groupService)
public void setSessionFactory(JCRSessionFactory sessionFactory)
public static JahiaSitesService getInstance()
public List<String> getSitesNames()
public List<JCRSiteNode> getSitesNodeList() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic List<JCRSiteNode> getSitesNodeList(JCRSessionWrapper session) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic JCRSiteNode getFirstSiteFound(JCRSessionWrapper session, String... skippedSites) throws javax.jcr.RepositoryException
/sites considering the list of sites to be skipped.session - current JCR sessionskippedSites - an array of site keys for sites to be skipped/sites considering the list of sites to be skippedjavax.jcr.RepositoryException - in case of an errorpublic void start()
throws JahiaInitializationException
start in class JahiaServiceJahiaInitializationExceptionpublic void stop()
stop in class JahiaServicepublic JahiaSite getSiteByKey(String siteKey) throws JahiaException
siteKey - the site keyJahiaExceptionpublic JCRSiteNode getSiteByKey(String siteKey, JCRSessionWrapper session) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic boolean siteExists(String siteKey, JCRSessionWrapper session) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic JahiaSite getSiteByServerName(String serverName) throws JahiaException
serverName - the server name to look forJahiaException - thrown if there was a problem communicating with the
database.public JCRSiteNode getSiteByServerName(String serverName, JCRSessionWrapper session) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic String getSitenameByServerName(String serverName) throws JahiaException
JahiaExceptionpublic JahiaSite getSite(String name) throws JahiaException
name - the site nameJahiaException@Deprecated public JahiaSite addSite(JahiaUser currentUser, String title, String serverName, String siteKey, String descr, Locale selectedLocale, String selectTmplSet, String firstImport, org.springframework.core.io.Resource fileImport, String fileImportName, Boolean asAJob, Boolean doImportServerPermissions, String originatingJahiaRelease) throws JahiaException, IOException
addSite(SiteCreationInfo) insteadJahiaExceptionIOException@Deprecated public JahiaSite addSite(JahiaUser currentUser, String title, String serverName, String siteKey, String descr, Locale selectedLocale, String selectTmplSet, String[] modulesToDeploy, String firstImport, org.springframework.core.io.Resource fileImport, String fileImportName, Boolean asAJob, Boolean doImportServerPermissions, String originatingJahiaRelease) throws JahiaException, IOException
addSite(SiteCreationInfo) insteadJahiaExceptionIOException@Deprecated public JahiaSite addSite(JahiaUser currentUser, String title, String serverName, String siteKey, String descr, Locale selectedLocale, String selectTmplSet, String[] modulesToDeploy, String firstImport, org.springframework.core.io.Resource fileImport, String fileImportName, Boolean asAJob, Boolean doImportServerPermissions, String originatingJahiaRelease, org.springframework.core.io.Resource legacyMappingFilePath, org.springframework.core.io.Resource legacyDefinitionsFilePath) throws JahiaException, IOException
addSite(SiteCreationInfo) insteadJahiaExceptionIOException@Deprecated public JahiaSite addSite(JahiaUser currentUser, String title, String serverName, String siteKey, String descr, Locale selectedLocale, String selectTmplSet, String[] modulesToDeploy, String firstImport, org.springframework.core.io.Resource fileImport, String fileImportName, Boolean asAJob, Boolean doImportServerPermissions, String originatingJahiaRelease, org.springframework.core.io.Resource legacyMappingFilePath, org.springframework.core.io.Resource legacyDefinitionsFilePath, JCRSessionWrapper session) throws JahiaException, IOException
addSite(SiteCreationInfo, JCRSessionWrapper) insteadJahiaExceptionIOExceptionpublic JahiaSite addSite(SiteCreationInfo info) throws JahiaException, IOException
info - the site creation informationJahiaException - in case of site creation issuesIOException - in case of I/O errorspublic JahiaSite addSite(SiteCreationInfo info, JCRSessionWrapper session) throws JahiaException, IOException
info - the site creation informationsession - the current JCR session to use for site creationJahiaException - in case of site creation issuesIOException - in case of I/O errorspublic void deployModules(JahiaSite site, String[] modulesToDeploy, JCRSessionWrapper session)
public void updateModules(JahiaSite site, List<String> newModuleIds, JCRSessionWrapper session)
public void removeSite(JahiaSite siteToRemove) throws JahiaException
siteToRemove - the JahiaSite bean to be removedJahiaExceptionpublic void updateSystemSitePermissions(JahiaSite site) throws JahiaException
site - the site bean objectJahiaExceptionpublic void updateSystemSitePermissions(JahiaSite site, JCRSessionWrapper session) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException@Deprecated public int getNbSites() throws JahiaException
getSiteCount(boolean) insteadJahiaExceptionpublic long getSiteCount(boolean includeSystemSite)
includeSystemSite - true if you want to include the systemsite in the resultpublic JahiaSite getDefaultSite()
public JahiaSite getDefaultSite(JCRSessionWrapper session) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void setDefaultSite(JahiaSite site)
public void setDefaultSite(JahiaSite site, JCRSessionWrapper session) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void invalidateCache(JahiaSite site) throws JahiaException
site - the site bean objectJahiaExceptionpublic void invalidateCache(String siteKey, List<String> serverNames)
siteKey - the key of the siteserverNames - the server names of the sitepublic boolean isSiteKeyValid(String siteKey)
public boolean isServerNameValid(String serverName)
public boolean updateSystemSiteLanguages(JahiaSite site, JCRSessionWrapper session)
public String getSiteDefaultLanguage(String siteKey) throws JahiaException
JahiaExceptionpublic static void flushSitesInternalCaches()
public void setEhCacheProvider(EhCacheProvider ehCacheProvider)
public void setValidServerNameRegex(String validServerNameRegex)
public String getValidSiteKeyCharacters()
public void setValidSiteKeyCharacters(String validSiteKeyCharacters)
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.