Interface SiteService
- All Known Implementing Classes:
SiteServiceImpl
public interface SiteService
Most of the methods below return a Site
which is not attached to a Hibernate session (which is what is referred
to as 'non-persistent'). While this prevents LazyInitializationExceptions that might occur if there is not continually a
Hibernate session, this also means that while the results of these will return you an instance, you might need to
look the entity back up from the database to refresh it.
Note also that when resolving sites (via the BroadleafSiteResolver
) the usual case is to return a non-persistent
version not attached to a Hibernate session.
- Author:
- Phillip Verheyden (phillipuniverse)
-
Method Summary
Modifier and TypeMethodDescriptionCreates an instance ofCatalog
.Creates an instance of Site.Creates an instance ofSiteCatalogXref
.Deprecated.Finds all catalogsReturns all of the active sites in the system and does not attach them to a Hibernate sessionReturns all of the active sites in the system that are still attached to a Hibernate sessionfindCatalogById
(Long id) Finds a catalog by its id.findCatalogByName
(String name) Deprecated.useretrieveNonPersistentDefaultSite()
insteadRetrieves the non-persistent version of the default siteFinds a site by the given domain name and returns a non-persistent versionRetrieves a site by its primary key disconnected from a Hibernate sessionretrieveNonPersistentSiteByIdentifer
(String identifier) Finds a site by itsSite.getSiteIdentifierValue()
and return an entity that is not attached to the Hibernate sessionRetrieves the default site attached to a Hibernate sessionFinds a site by the domain name which is still attached to a Hibernate sessionRetrieves a site by its primary key whose return value is still attached to a Hibernate sessionretrievePersistentSiteByIdentifier
(String identifier) Finds a site by itsSite.getSiteIdentifierValue()
retrieveSiteByDomainName
(String domain) Deprecated.useretrieveNonPersistentSiteByDomainName(String)
insteadretrieveSiteById
(Long id) Deprecated.useretrieveNonPersistentSiteById(Long)
insteadSaves the given catalog and returns the merged instanceDeprecated.usesaveAndReturnNonPersisted(Site)
insteadSave updates to a site and returns a non-persistent instancesaveAndReturnPersisted
(Site site) Save updates to a site and return the persistent instance attached to a Hibernate session
-
Method Details
-
createSite
Site createSite()Creates an instance of Site. Default implementation delegates toSiteDao.create()
.- Returns:
-
retrieveSiteById
Deprecated.useretrieveNonPersistentSiteById(Long)
insteadFind a site by its id and returns a non-persistent version- Parameters:
id
-- Returns:
-
retrieveNonPersistentSiteById
Retrieves a site by its primary key disconnected from a Hibernate session -
retrievePersistentSiteById
Retrieves a site by its primary key whose return value is still attached to a Hibernate session -
retrieveSiteByDomainName
Deprecated.useretrieveNonPersistentSiteByDomainName(String)
insteadFind a site by its domain and returns a non-persistent version- Parameters:
domain
-- Returns:
-
retrieveNonPersistentSiteByDomainName
Finds a site by the given domain name and returns a non-persistent version -
retrievePersistentSiteByDomainName
Finds a site by the domain name which is still attached to a Hibernate session- Parameters:
domain
-- Returns:
-
retrieveNonPersistentSiteByIdentifer
Finds a site by itsSite.getSiteIdentifierValue()
and return an entity that is not attached to the Hibernate session- Parameters:
identifier
- theSite.getSiteIdentifierValue()
to look for
-
retrievePersistentSiteByIdentifier
Finds a site by itsSite.getSiteIdentifierValue()
- Parameters:
identifier
- theSite.getSiteIdentifierValue()
to look for
-
save
Deprecated.usesaveAndReturnNonPersisted(Site)
insteadSave updates to a site and returns a cloned instance- Parameters:
site
-- Returns:
-
saveAndReturnNonPersisted
Save updates to a site and returns a non-persistent instance- Parameters:
site
-- Returns:
-
saveAndReturnPersisted
Save updates to a site and return the persistent instance attached to a Hibernate session- Parameters:
site
-- Returns:
-
retrieveDefaultSite
Deprecated.useretrieveNonPersistentDefaultSite()
insteadReturns a clone of the default site.- Returns:
-
retrieveNonPersistentDefaultSite
Site retrieveNonPersistentDefaultSite()Retrieves the non-persistent version of the default site -
retrievePersistentDefaultSite
Site retrievePersistentDefaultSite()Retrieves the default site attached to a Hibernate session -
findAllActiveSites
Deprecated.usefindAllNonPersistentActiveSites()
instead- Returns:
- a List of non-persistent versions of all sites in the system
-
findAllNonPersistentActiveSites
Returns all of the active sites in the system and does not attach them to a Hibernate session -
findAllPersistentActiveSites
Returns all of the active sites in the system that are still attached to a Hibernate session -
findCatalogById
Finds a catalog by its id.- Parameters:
id
-- Returns:
- the catalog
-
findCatalogByName
-
createCatalog
Catalog createCatalog()Creates an instance ofCatalog
. Default implementation delegates toSiteDao.createCatalog()
.- Returns:
- the catalog
-
createSiteCatalog
SiteCatalogXref createSiteCatalog()Creates an instance ofSiteCatalogXref
. Default implementation delegates toSiteDao.createSiteCatalog()
- Returns:
- the site catalog
-
save
Saves the given catalog and returns the merged instance- Parameters:
catalog
-- Returns:
-
findAllCatalogs
Finds all catalogs- Returns:
- the list of catalogs
-
findAllNonPersistentActiveSites()
instead