org.alfresco.service.cmr.publishing.channels
Interface ChannelType

All Known Implementing Classes:
AbstractChannelType, AbstractOAuth1ChannelType, FacebookChannelType, FlickrChannelType, LinkedInChannelType, MockChannelType, SlideShareChannelType, TestChannelType1, TestChannelType2, TestChannelType3, TwitterChannelType, YouTubeChannelType

public interface ChannelType

Since:
4.0

Nested Class Summary
static class ChannelType.AuthStatus
           
 
Method Summary
 ChannelType.AuthStatus acceptAuthorisationCallback(Channel channel, java.util.Map callbackHeaders, java.util.Map callbackParams)
          This operation is called after the service provider represented by this channel type has redirected the user back to Alfresco.
 boolean canPublish()
          Does this channel type support publishing content?
 boolean canPublishStatusUpdates()
          Does this channel type support status updates?
 boolean canUnpublish()
          Does this channel type support unpublishing content? That is to say, once content has been published to a channel of this type, can it later be removed from that channel?
 java.lang.String getAuthorisationUrl(Channel channel, java.lang.String callbackUrl)
          When creating a new channel of this type, this operation is called to find out where the user should be taken in order to authorise Alfresco to publish content / status updates to that channel.
 org.alfresco.service.namespace.QName getChannelNodeType()
          Each channel is stored in the repository as a node.
 org.springframework.core.io.Resource getIcon(java.lang.String size)
          Obtain the resource that represents an icon for this channel type.
 java.lang.String getId()
          Returns the unique identifier of this channel type
 int getMaximumStatusLength()
          If this channel type supports status updates then this operation returns the maximum permitted length of those status updates.
 java.lang.String getNodeUrl(org.alfresco.service.cmr.repository.NodeRef node)
          Returns the URL for a piece of content represented by the supplied node.
 java.util.Set getSupportedContentTypes()
          Returns the set of content types supported by channels of this type.
 java.util.Set getSupportedMimeTypes()
          Returns the set of MIME types supported by channels of this type.
 void sendStatusUpdate(Channel channel, java.lang.String status)
          Send the specified status update to the specified channel
 

Method Detail

getId

java.lang.String getId()
Returns the unique identifier of this channel type

Returns:

getChannelNodeType

org.alfresco.service.namespace.QName getChannelNodeType()
Each channel is stored in the repository as a node. This operation returns the qualified name of the type of that node.

Returns:

canPublish

boolean canPublish()
Does this channel type support publishing content?

Returns:

canUnpublish

boolean canUnpublish()
Does this channel type support unpublishing content? That is to say, once content has been published to a channel of this type, can it later be removed from that channel?

Returns:

canPublishStatusUpdates

boolean canPublishStatusUpdates()
Does this channel type support status updates?

Returns:

sendStatusUpdate

void sendStatusUpdate(Channel channel,
                      java.lang.String status)
Send the specified status update to the specified channel

Parameters:
channel -
status -

getSupportedMimeTypes

java.util.Set getSupportedMimeTypes()
Returns the set of MIME types supported by channels of this type.

Returns:
The set of MIME types supported by channels of this type or an empty set if content of any MIME type can be published.

getSupportedContentTypes

java.util.Set getSupportedContentTypes()
Returns the set of content types supported by channels of this type.

Returns:
The set of content types supported by channels of this type or an empty set if content of any content type can be published.

getNodeUrl

java.lang.String getNodeUrl(org.alfresco.service.cmr.repository.NodeRef node)
Returns the URL for a piece of content represented by the supplied node.

Parameters:
node - The published content node in the live environment.
Returns:
a URL for the published content.

getMaximumStatusLength

int getMaximumStatusLength()
If this channel type supports status updates then this operation returns the maximum permitted length of those status updates.

Returns:
The maximum length of status updates on channels of this type. A value of zero indicates that there is no maximum.

getAuthorisationUrl

java.lang.String getAuthorisationUrl(Channel channel,
                                     java.lang.String callbackUrl)
When creating a new channel of this type, this operation is called to find out where the user should be taken in order to authorise Alfresco to publish content / status updates to that channel.

Parameters:
channel - The channel that needs to be authorised.
callbackUrl - Where the service provider represented by this channel type should redirect the user to once the authorisation procedure is complete.
Returns:
The URL that the user should be taken to in order to authorise access to Alfresco for the specified channel.

acceptAuthorisationCallback

ChannelType.AuthStatus acceptAuthorisationCallback(Channel channel,
                                                   java.util.Map callbackHeaders,
                                                   java.util.Map callbackParams)
This operation is called after the service provider represented by this channel type has redirected the user back to Alfresco. The HTTP headers and parameters received from the service provider are included, as they are likely to contain essential information such as tokens, error codes, and so on.

Parameters:
channel - The channel related to this authorisation callback.
callbackHeaders - All the HTTP headers received in the callback.
callbackParams - All the HTTP parameters received in the callback.
Returns:
A value indicating whether the authorisation was successful or not. If not, there is an indication as to whether the user may try again or not.

getIcon

org.springframework.core.io.Resource getIcon(java.lang.String size)
Obtain the resource that represents an icon for this channel type.

Parameters:
size - A text representation of the icon size required. "16", "32", etc.
Returns:
The resource that represents the requested icon if available. null otherwise.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.