public class ChannelManager extends Object implements IChannelManagerSPI, IWebResourceFactory
IChannelManagerSPI.IgnoreOnExportImportResult
Constructor and Description |
---|
ChannelManager() |
Modifier and Type | Method and Description |
---|---|
String |
add(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction)
Add a Channel.
|
void |
addCssLink(SessionConfig sessionConfig,
String channelId,
String cssId,
int position,
ITransaction transaction)
Add the hyperlink to the channel's CSS file.
|
void |
addOrUpdate(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction)
Add or Update a Channel, depending on its previous existence.
|
String |
adjustFriendlyPathForClash(String originalFriendlyPath,
String clashedFriendlyPath,
String suffix)
Adjusts a friendly path due to clash.
|
String |
adjustResolvedFriendlyPath(WebResource webResource,
String friendlyPath)
Adjusts a friendly path that has been resolved for a web resource.
|
void |
clearCache(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Clear the Channel cache.
|
String |
copy(SessionConfig sessionConfig,
String sourceChannelId,
String destinationParentChannelId,
ITransaction transaction)
Creates a new channel by copying source channel's properties and
structure into destination's parent channel.
|
WebResource |
createWebResourceByDynamicPath(String dynamicPath)
Creates a
WebResource instance based on a dynamic path. |
void |
delete(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Delete the Channel.
|
void |
deleteCssLink(SessionConfig sessionConfig,
String channelId,
String cssId,
ITransaction transaction)
Delete the hyperlink to the channel's CSS file.
|
protected void |
deleteRecursively(SessionConfig sessionConfig,
String channelId,
ITransaction transaction) |
String |
deserialize(SessionConfig sessionConfig,
DeserializationConfig deserializationConfig,
Node channelNode,
ITransaction transaction) |
void |
deserializeCss(SessionConfig sessionConfig,
DeserializationConfig deserializationConfig,
Node cssLinksNodes,
ITransaction transaction) |
void |
deserializeSecondPass(SessionConfig sessionConfig,
DeserializationConfig deserializationConfig,
Node channelNode,
ITransaction transaction)
Perfoms the second pass of the channels deserialization
|
protected void |
disconnectChannelsFromTemplatesRecursively(SessionConfig sessionConfig,
String channelId,
ITransaction transaction) |
ChannelConfig |
get(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Get the Channel's configuration.
|
int |
getCachePages(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction) |
boolean |
getCenterPages(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction)
Get a boolean indicating wheter the page must be centralized.
|
int |
getChannelTreeCount(String rootChannelId,
ITransaction transaction)
Returns the number of channels in the tree for which the root is the given channelId.
|
List<String> |
getChannelTreeIds(String rootChannelId,
boolean includeIgnoredOnImportExportChannels,
ITransaction transaction)
Returns all the ids of channels in the tree for which the root is the given channelId.
|
List<String> |
getChannelTreeIds(String rootChannelId,
ITransaction transaction)
Returns all the ids of channels in the tree for which the root is the given channelId.
|
List<String> |
getCssIds(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Get a list of CSS Ids of the Channel.
|
List<String> |
getCssIdsRecursively(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Get a list of Css Ids of the Channel including inherited Css.
|
String |
getFriendlyPath(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Get the friendly path of a channel.
|
Collection<String> |
getIdsByPageTemplateId(SessionConfig sessionConfig,
String pageTemplateId,
ITransaction transaction)
Retrieves the Ids of all channel that uses the specified page template as default page template
|
List<String> |
getIdsByParentChannelId(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Get a list of sub channel's id given the parent Channel's id.
|
List<String> |
getIdsByParentTemplateId(SessionConfig sessionConfig,
String parentTemplateId,
ITransaction transaction)
Retrieves the Ids of all channel that uses the specified channel template.
|
int |
getLayoutPagesType(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction)
Get a the page layout format.
|
List<String> |
getMetaTagIdsRecursively(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Get a list of meta-tags ids of the Channel including inherit Meta-tag.
|
String |
getPageTemplateIdRecursively(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Returns the PageTemplateId for the specified channel (local or inherited from a parent channel)
|
String |
getPageWebResourceDataProviderClassName(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction)
Returns the default
IPageWebResourceDataProvider
class name for the child pages of a channel. |
String |
getPath(SessionConfig sessionConfig,
String channelId,
boolean localizable,
ITransaction transaction)
Get the full path of the Channel.
|
String |
getPath(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Get the full path of the Channel.
|
List<String> |
getPathIds(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Get Ids of channel and its parents.
|
List<String> |
getPathNames(SessionConfig sessionConfig,
String channelId,
boolean localizable,
ITransaction transaction)
Returns a list of strings each representing the name of the channel between the root portal
channel and the channel solicited.
|
int |
getProtocolType(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction)
Returns the protocolType of the given channel.
|
String |
getRuntimeDataProviderClassName(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction)
Deprecated.
|
boolean |
isCacheEnabled(WebResource webResource)
Returns if the cache is enabled for a web resource.
|
boolean |
isGoogleAnalyticsEnabled(ChannelConfig channelConfig)
Returns whether the Google Analytics is enable in the given channel.
|
Boolean |
isGoogleAnalyticsEnabledLocal(ChannelConfig channelConfig)
Returns whether the Google Analytics is enable in the given channel or
null if this property is inherited. |
IChannelManagerSPI.IgnoreOnExportImportResult |
isIgnoreOnExportImport(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Returns the result of a given channel ignoring.
|
boolean |
isInsideChannelTemplate(SessionConfig sessionConfig,
String channelId,
ITransaction transaction)
Returns whether a channel is inside a channel template or if it is the channel template root itself.
|
boolean |
keyExists(SessionConfig sessionConfig,
Object configKey,
Object config,
ITransaction transaction)
Checks if configId matches an already persisted object
|
boolean |
requiresFriendlyPathUpdate(WebResource webResource)
Returns whether the friendly path for the given web resource
requires updating.
|
void |
serialize(SessionConfig sessionConfig,
String channelId,
OutputStream outputStream,
ITransaction transaction) |
void |
serializeCss(SessionConfig sessionConfig,
String channelId,
OutputStream outputStream,
ITransaction transaction) |
void |
setGoogleAnalyticsEnable(Boolean enabled,
ChannelConfig channelConfig)
Sets whether the Google Analytics is enable in the given channel.
|
void |
setPageCacheFilePath(PageCacheConfig pageCacheConfig)
Sets the file path for a
PageCacheConfig . |
void |
setWebResourcesMissingData(String resourceId,
boolean processChildren)
Sets missing data in the web resources of the specified resource.
|
void |
update(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction)
Update the Channel.
|
void |
updateLocalGroupPrefixFromFriendlyId(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction)
Updates the local group prefix of the given channel with its friendly identifier.
|
void |
validateFriendlyId(SessionConfig sessionConfig,
ChannelConfig channelConfig,
ITransaction transaction)
Validates the channel's friendly identifier.
|
public void addOrUpdate(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
addOrUpdate
in interface IChannelManager
ManagerException
PortalException
public String add(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
add
in interface IChannelManager
ManagerException
PortalException
public void validateFriendlyId(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws PortalException
IChannelManagerSPI
validateFriendlyId
in interface IChannelManagerSPI
sessionConfig
- the user's session information.channelConfig
- the channel to be validated.transaction
- the transaction to use.PortalException
public void update(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws PortalException
IChannelManager
update
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public String copy(SessionConfig sessionConfig, String sourceChannelId, String destinationParentChannelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
copy
in interface IChannelManager
ManagerException
PortalException
public ChannelConfig get(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
get
in interface IChannelManager
sessionConfig
- the user's session information.channelId
- the channelId.transaction
- the transaction for persistence access.PortalObjectNotFoundException
- if the channel was not found.ManagerException
PortalException
public void delete(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
delete
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
protected void disconnectChannelsFromTemplatesRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
ManagerException
PortalException
protected void deleteRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
ManagerException
PortalException
public List<String> getIdsByParentChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws PortalException
IChannelManager
getIdsByParentChannelId
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public String getPath(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getPath
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public String getPath(SessionConfig sessionConfig, String channelId, boolean localizable, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getPath
in interface IChannelManager
sessionConfig
- The session information of the user.localizable
- TODOManagerException
PortalException
public List<String> getPathNames(SessionConfig sessionConfig, String channelId, boolean localizable, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
The first element of the list is the root portal channel followed by its children in hierarchical order.
getPathNames
in interface IChannelManager
sessionConfig
- session config of a userchannelId
- identifier of the channel for which you want the path nameslocalizable
- if true, the channel names are localizedManagerException
PortalException
public String getFriendlyPath(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getFriendlyPath
in interface IChannelManager
sessionConfig
- The session information of the user. the identification of the
user.channelId
- the identification of the channel.transaction
- the transaction for persistence access.ManagerException
PortalException
ChannelConfig.FRIENDLY_PATH_TYPE_CHANNEL_NAME
,
ChannelConfig.FRIENDLY_PATH_TYPE_INHERIT
,
ChannelConfig.FRIENDLY_PATH_TYPE_USER_DEFINED
public List<String> getPathIds(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getPathIds
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public void addCssLink(SessionConfig sessionConfig, String channelId, String cssId, int position, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
addCssLink
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public void deleteCssLink(SessionConfig sessionConfig, String channelId, String cssId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
deleteCssLink
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public List<String> getCssIds(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getCssIds
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public List<String> getCssIdsRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getCssIdsRecursively
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public List<String> getMetaTagIdsRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getMetaTagIdsRecursively
in interface IChannelManager
ManagerException
PortalException
public boolean getCenterPages(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getCenterPages
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public int getLayoutPagesType(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
The return would be one of PageConfig.PAGE_LAYOUT_INHERIT
,
PageConfig.PAGE_LAYOUT_WITH_TABLES
or PageConfig.PAGE_LAYOUT_WITH_TABLELESS
getLayoutPagesType
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public int getCachePages(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws ManagerException, PortalException
getCachePages
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public int getProtocolType(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
This method checks recursively up the channel´s ancestors until it finds a
protocolType that is not PageConfig.PAGE_PROTOCOL_INHERIT
.
Possible protocol types are:
PageConfig.PAGE_PROTOCOL_HTTP
PageConfig.PAGE_PROTOCOL_HTTPS
PageConfig.PAGE_PROTOCOL_ALL
getProtocolType
in interface IChannelManager
ManagerException
PortalException
public void serialize(SessionConfig sessionConfig, String channelId, OutputStream outputStream, ITransaction transaction) throws ManagerException, PortalException
serialize
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public String deserialize(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node channelNode, ITransaction transaction) throws ManagerException, PortalException
deserialize
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public void deserializeSecondPass(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node channelNode, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
deserializeSecondPass
in interface IChannelManager
sessionConfig
- user session information.deserializationConfig
- deserialization configuration.channelNode
- the data for the channel to be imported.transaction
- the transaction for persistence access.ManagerException
PortalException
public void serializeCss(SessionConfig sessionConfig, String channelId, OutputStream outputStream, ITransaction transaction) throws ManagerException, PortalException
serializeCss
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public void deserializeCss(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node cssLinksNodes, ITransaction transaction) throws ManagerException, PortalException
deserializeCss
in interface IChannelManager
sessionConfig
- The session information of the user.ManagerException
PortalException
public List<String> getIdsByParentTemplateId(SessionConfig sessionConfig, String parentTemplateId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getIdsByParentTemplateId
in interface IChannelManager
ManagerException
PortalException
public void clearCache(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
This method clears the following caches
If there are subchannels to which the user does not have access, these channels and their subchannels are skipped.
clearCache
in interface IChannelManager
ManagerException
PortalException
public String getPageTemplateIdRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws PortalException
IChannelManager
getPageTemplateIdRecursively
in interface IChannelManager
PortalException
public int getChannelTreeCount(String rootChannelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getChannelTreeCount
in interface IChannelManager
rootChannelId
- root channel identifierManagerException
PortalException
public List<String> getChannelTreeIds(String rootChannelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getChannelTreeIds
in interface IChannelManager
rootChannelId
- root channel identifierManagerException
PortalException
public List<String> getChannelTreeIds(String rootChannelId, boolean includeIgnoredOnImportExportChannels, ITransaction transaction) throws ManagerException, PortalException
IChannelManagerSPI
getChannelTreeIds
in interface IChannelManagerSPI
rootChannelId
- root channel identifier.includeIgnoredOnImportExportChannels
- indicates whether the ignored channels on export and import should be ignored.transaction
- the transaction.ManagerException
PortalException
public Collection<String> getIdsByPageTemplateId(SessionConfig sessionConfig, String pageTemplateId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
getIdsByPageTemplateId
in interface IChannelManager
ManagerException
PortalException
public boolean keyExists(SessionConfig sessionConfig, Object configKey, Object config, ITransaction transaction)
IConfigKeyChecker
keyExists
in interface IConfigKeyChecker
config
- Optional, allows a checker to read aditional fields to check composed keys@Deprecated public String getRuntimeDataProviderClassName(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws PortalException
IChannelManager
getRuntimeDataProviderClassName
in interface IChannelManager
sessionConfig
- current user sessionchannelConfig
- channel configurationtransaction
- current transactionPortalException
public String getPageWebResourceDataProviderClassName(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws PortalException
IChannelManager
IPageWebResourceDataProvider
class name for the child pages of a channel.
This method recursively traverses up a channel tree starting from the given channel until the first channel that does not inherit the data provider property. Based on the page web resource data provider type, either a standard or customized page web resource data provider class name is returned.
getPageWebResourceDataProviderClassName
in interface IChannelManager
sessionConfig
- user session information.channelConfig
- the channel.transaction
- the transaction for persistence access.PortalException
public WebResource createWebResourceByDynamicPath(String dynamicPath) throws PortalException
IWebResourceFactory
WebResource
instance based on a dynamic path.createWebResourceByDynamicPath
in interface IWebResourceFactory
dynamicPath
- the dynamic path.PortalException
public void setPageCacheFilePath(PageCacheConfig pageCacheConfig) throws PortalException
IWebResourceFactory
PageCacheConfig
.setPageCacheFilePath
in interface IWebResourceFactory
pageCacheConfig
- the page cache.PortalException
public boolean isCacheEnabled(WebResource webResource) throws PortalException
IWebResourceFactory
isCacheEnabled
in interface IWebResourceFactory
webResource
- the web resource.true
if the cache is enabled, false
otherwise.PortalException
public void setWebResourcesMissingData(String resourceId, boolean processChildren) throws PortalException
IWebResourceFactory
setWebResourcesMissingData
in interface IWebResourceFactory
resourceId
- the resource owner of the web resources.processChildren
- indicates if web resources of children resources
should also be processed.PortalException
public String adjustResolvedFriendlyPath(WebResource webResource, String friendlyPath)
IWebResourceFactory
adjustResolvedFriendlyPath
in interface IWebResourceFactory
webResource
- the web resource.friendlyPath
- the resolved friendly path.public String adjustFriendlyPathForClash(String originalFriendlyPath, String clashedFriendlyPath, String suffix)
IWebResourceFactory
adjustFriendlyPathForClash
in interface IWebResourceFactory
originalFriendlyPath
- the original friendly path resolved.clashedFriendlyPath
- the last clashed friendly path value.public boolean requiresFriendlyPathUpdate(WebResource webResource)
IWebResourceFactory
requiresFriendlyPathUpdate
in interface IWebResourceFactory
webResource
- the web resource.true
if update is required, false
otherwise.public IChannelManagerSPI.IgnoreOnExportImportResult isIgnoreOnExportImport(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws PortalException
IChannelManagerSPI
isIgnoreOnExportImport
in interface IChannelManagerSPI
sessionConfig
- the user's session.channelId
- the channel identifier.transaction
- the transaction.PortalException
public Boolean isGoogleAnalyticsEnabledLocal(ChannelConfig channelConfig) throws PortalException
IChannelManagerSPI
null
if this property is inherited.isGoogleAnalyticsEnabledLocal
in interface IChannelManagerSPI
channelConfig
- the channel the information will be read from.null
if this property is inherited.PortalException
public boolean isGoogleAnalyticsEnabled(ChannelConfig channelConfig) throws PortalException
IChannelManagerSPI
isGoogleAnalyticsEnabled
in interface IChannelManagerSPI
channelConfig
- the channel the information will be read from.PortalException
public void setGoogleAnalyticsEnable(Boolean enabled, ChannelConfig channelConfig) throws PortalException
IChannelManagerSPI
setGoogleAnalyticsEnable
in interface IChannelManagerSPI
enabled
- the value or null
to indicate the value should be inherited.channelConfig
- the channel the information will be set to.PortalException
public boolean isInsideChannelTemplate(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
IChannelManager
isInsideChannelTemplate
in interface IChannelManager
sessionConfig
- user session information.channelId
- the identifier of the channel.transaction
- the transaction for persistence access.true
if the channel is inside a channel template, false
otherwise.PortalException
PortalObjectNotFoundException
- if the channel was not found.ManagerException
public void updateLocalGroupPrefixFromFriendlyId(SessionConfig sessionConfig, ChannelConfig channelConfig, ITransaction transaction) throws ManagerException, PortalException
IChannelManagerSPI
updateLocalGroupPrefixFromFriendlyId
in interface IChannelManagerSPI
sessionConfig
- the user's session information.channelConfig
- the channel to be updated.transaction
- the transaction.ManagerException
PortalException
LumisXP 12.0.0.190809 - Copyright © 2006–2019 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.