public interface Channel
Modifier and Type | Method and Description |
---|---|
void |
activate()
Does processing when the channel is installed.
|
void |
deActivate()
Does processing when the channel is uninstalled.
|
void |
deleteData(ChannelInstance channelInstance)
Removes any additional data added by this channel when the channel
instance is removed.
|
void |
exportData(com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext,
com.liferay.portal.kernel.xml.Element tacticElement,
Tactic tactic,
com.liferay.portal.kernel.xml.Element channelInstanceElement,
ChannelInstance channelInstance)
Exports any additional data added by this channel when the channel
instance is exported.
|
java.lang.String |
getChannelKey()
Returns the key that identifies the channel.
|
java.lang.String |
getDescription(java.util.Locale locale)
Returns the channel's localized description.
|
java.lang.String |
getFormHTML(ChannelInstance channelInstance,
java.util.Map<java.lang.String,java.lang.Object> context,
java.util.Map<java.lang.String,java.lang.String> values)
Returns the HTML code containing the form fields required to edit the
channel instance configuration, based on the context.
|
java.lang.String |
getIcon()
Returns the Font Awesome CSS class for the channel icon.
|
java.lang.String |
getName(java.util.Locale locale)
Returns the channel's localized name.
|
java.lang.String |
getShortDescription(java.util.Locale locale)
Returns the channel's localized short description.
|
java.lang.String |
getSummary(ChannelInstance channelInstance,
java.util.Locale locale)
Returns the channel's instance localized summary.
|
void |
importData(com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext,
Tactic tactic,
ChannelInstance channelInstance)
Imports any additional data added by this channel when the channel
instance is imported.
|
boolean |
isInstantiable()
Returns
true if the channel can be used more than once with
different values for a campaign. |
boolean |
isVisible()
Returns
true if the channel is visible. |
java.lang.String |
processChannel(javax.portlet.PortletRequest portletRequest,
javax.portlet.PortletResponse portletResponse,
java.lang.String id,
java.util.Map<java.lang.String,java.lang.String> values)
Returns the result of evaluating the channel form fields in the context
of the request and response.
|
void |
updateChannel(java.lang.String typeSettings,
long channelInstanceId)
Associates the current channel with the channel instance matching the ID.
|
void activate()
void deActivate()
void deleteData(ChannelInstance channelInstance) throws com.liferay.portal.kernel.exception.PortalException
channelInstance
- the channel instance with the stored
configurationcom.liferay.portal.kernel.exception.PortalException
- if a portal exception occurredvoid exportData(com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext, com.liferay.portal.kernel.xml.Element tacticElement, Tactic tactic, com.liferay.portal.kernel.xml.Element channelInstanceElement, ChannelInstance channelInstance) throws java.lang.Exception
portletDataContext
- the context of the data exporttacticElement
- the element with the tactic export datatactic
- the tactic containing the channel instancechannelInstanceElement
- the element with the channel instance
export datachannelInstance
- the channel instance with stored configurationjava.lang.Exception
- if an exception occurredjava.lang.String getChannelKey()
java.lang.String getDescription(java.util.Locale locale)
locale
- the language localejava.lang.String getFormHTML(ChannelInstance channelInstance, java.util.Map<java.lang.String,java.lang.Object> context, java.util.Map<java.lang.String,java.lang.String> values)
channelInstance
- the channel instance with stored configurationcontext
- the map defining the form evaluation contextvalues
- the values configured by users for the current channel
instance based on the form controls from the HTML. This will be
used when there is an error and the form is reloaded.java.lang.String getIcon()
java.lang.String getName(java.util.Locale locale)
locale
- the language localejava.lang.String getShortDescription(java.util.Locale locale)
locale
- the language localejava.lang.String getSummary(ChannelInstance channelInstance, java.util.Locale locale)
channelInstance
- the channel instance with stored configurationlocale
- the language localevoid importData(com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext, Tactic tactic, ChannelInstance channelInstance) throws java.lang.Exception
portletDataContext
- the context of the data importtactic
- the tactic containing the channel instancechannelInstance
- the channel instance with stored configurationjava.lang.Exception
- if an exception occurredboolean isInstantiable()
true
if the channel can be used more than once with
different values for a campaign.true
if the channel can be used more than once;
false
otherwiseboolean isVisible()
true
if the channel is visible.true
if the channel is visible; false
otherwisejava.lang.String processChannel(javax.portlet.PortletRequest portletRequest, javax.portlet.PortletResponse portletResponse, java.lang.String id, java.util.Map<java.lang.String,java.lang.String> values) throws InvalidChannelException
portletRequest
- the request from which to get the request
parametersportletResponse
- the response to receive the render parametersid
- the identifier that differentiates between channel instances
of the same type of an instantiable channelvalues
- the values configured by users for the current channel
instance based on the form controls from the HTMLInvalidChannelException
- if an invalid channel exception occurredvoid updateChannel(java.lang.String typeSettings, long channelInstanceId)
typeSettings
- the processed settings for the channelchannelInstanceId
- the ID of the channel instance to associate