public class WebsiteManager extends Object implements IWebsiteManagerSPI
Modifier and Type | Class and Description |
---|---|
static class |
WebsiteManager.UnmodifiableWebsite
Unmodifiable
Website implementation. |
Constructor and Description |
---|
WebsiteManager() |
Modifier and Type | Method and Description |
---|---|
void |
changeChannelWebsite(String channelId,
IWebsite newWebsite,
IWebsite oldWebsite,
boolean changeEvenIfIsWebsiteRoot)
|
void |
deletePageWebResources(String pageId)
Deletes the given page
web resources . |
IWebsite |
get(String id)
Returns the
website with the given identifier. |
List<IWebsite> |
getAllWebsites()
Returns all websites existent in the portal.
|
IWebsite |
getDefaultWebsite()
Returns the website flagged as the default website.
|
IWebsiteBaseURL |
getWebsiteBaseURL(HttpServletRequest request)
Returns the website's base URL that a request corresponds to.
|
IWebsiteBaseURL |
getWebsiteBaseURL(URI uri)
Returns the website base URL that serves the given URI or
null if there's no base URL that serves the given URI.If the given URI is not absolute or is opaque, null will be returned.This method will not fallback to default website if no website can relativize the given URI. |
URI |
getWebsiteBaseURLAsURI(URI uri)
Returns the website base URL as a URI that serves the given URI or
null if there's no base URL that serves the given URI.If the given URI is not absolute or is opaque, null will be returned.This method will not fallback to default website if no website can relativize the given URI. |
IWebsite |
getWebsiteByChannelId(String channelId)
Returns the website that the specific channel belongs to.
|
IWebsite |
getWebsiteByChannelId(String channelId,
FlushModeType flushModeType)
Returns the website that the specific channel belongs to using the
specified
FlushModeType . |
IWebsite |
getWebsiteByChannelIdNonRecursively(String channelId,
FlushModeType flushModeType)
Returns the channel's
Website non-recursively (i.e. |
boolean |
isWebsiteRoot(String channelId)
Returns whether the given channel is a website root.
|
void |
moveServiceInstanceFiles(String serviceInstanceId,
IWebsite newWebsite,
IWebsite oldWebsite,
ITransaction transaction)
Moves the service instance files from the old website to the new one.
|
void |
setDefaultWebsite(IWebsite website)
Sets which website is the default website.
|
public List<IWebsite> getAllWebsites() throws PortalException
Caches the list so that no further database access is needed to access them.
These objects are readonly. Any invocation to any methods that change these websites or their URLs will raise an UnsupportedOperationException
.
PortalException
public IWebsite getDefaultWebsite() throws PortalException
IWebsiteManagerSPI
getDefaultWebsite
in interface IWebsiteManagerSPI
null
if there is no website
set as the default.PortalException
IWebsite.isDefaultWebsite()
,
IWebsiteManagerSPI.setDefaultWebsite(IWebsite)
public void setDefaultWebsite(IWebsite website) throws PortalException
IWebsiteManagerSPI
If there is any website currently flagged as the default website, it will no longer be the default website. The given website (if any) will be set as the default website.
setDefaultWebsite
in interface IWebsiteManagerSPI
website
- the website to be the default, or null
for no
website to be the default.AccessDeniedException
- if the user does not have permission to
change the default website.PortalException
IWebsite.isDefaultWebsite()
,
IWebsiteManagerSPI.getDefaultWebsite()
public IWebsite getWebsiteByChannelId(String channelId) throws PortalException
IWebsiteManagerSPI
The specified channel and its ancestral are searched for the first channel that corresponds to a website root. The channel belongs to that website, and it is returned.
If neither the channel or its ancestral is a website root, then the
channel does not belong to any website, and null
is returned.
getWebsiteByChannelId
in interface IWebsiteManagerSPI
channelId
- the channel identifier.null
if the
channel does not belong to any website.PortalObjectNotFoundException
- if the channel does not exist.PortalException
public IWebsiteBaseURL getWebsiteBaseURL(HttpServletRequest request) throws PortalException
IWebsiteManager
If the request does not correspond to any configured website base URL
but there is a website configured as default, a website base URL
will be dynamically generated and returned, referencing the
default website in IWebsiteBaseURL.getWebsite()
,
as if it was an additional base URL of the default website.
If the request does not corresponds to any configured website base URL
and there is no website configured as default, null
is returned.
getWebsiteBaseURL
in interface IWebsiteManager
request
- the request.null
if no website base URL
corresponds to the request.PortalException
public IWebsite get(String id) throws PortalException
website
with the given identifier.id
- the website identifier.website
with the given identifier.PortalException
public IWebsite getWebsiteByChannelIdNonRecursively(String channelId, FlushModeType flushModeType) throws PortalException
Website
non-recursively (i.e. doesn't
search for a website through the channel's parents).channelId
- the channel identifier.flushModeType
- the FlushModeType
to be used in query, or null
to not set any in query.Website
non-recursively (i.e. doesn't
search for a website through the channel's parents).PortalException
public IWebsite getWebsiteByChannelId(String channelId, FlushModeType flushModeType) throws PortalException
FlushModeType
.channelId
- the channel identifier.flushModeType
- the FlushModeType
to be used in query, or null
to not set any in query.null
if the
channel does not belong to any website.PortalObjectNotFoundException
- if the channel does not exist.PortalException
public void changeChannelWebsite(String channelId, IWebsite newWebsite, IWebsite oldWebsite, boolean changeEvenIfIsWebsiteRoot) throws PortalException
Website
and use the new Website
.channelId
- the channel identifier.newWebsite
- the new website the channel belongs to.oldWebsite
- the old website the channel belonged to.changeEvenIfIsWebsiteRoot
- indicates whether the changes should be performed even if the
given channel is a website root.PortalException
public void moveServiceInstanceFiles(String serviceInstanceId, IWebsite newWebsite, IWebsite oldWebsite, ITransaction transaction) throws PortalException
serviceInstanceId
- the service instance identifier.newWebsite
- the new website.oldWebsite
- the old website.transaction
- the transaction.PortalException
public void deletePageWebResources(String pageId) throws PortalException
web resources
.pageId
- the page identifier.PortalException
public boolean isWebsiteRoot(String channelId) throws PortalException
channelId
- the channel identifier.PortalException
public IWebsiteBaseURL getWebsiteBaseURL(URI uri) throws PortalException
IWebsiteManager
null
if there's no base URL that serves the given URI.null
will be returned.getWebsiteBaseURL
in interface IWebsiteManager
uri
- the URI.null
if there's no base URL that serves the given URI.PortalException
public URI getWebsiteBaseURLAsURI(URI uri) throws PortalException
IWebsiteManager
null
if there's no base URL that serves the given URI.null
will be returned.getWebsiteBaseURLAsURI
in interface IWebsiteManager
uri
- the URI.null
if there's no base URL that serves the given URI.PortalException
LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.