org.alfresco.repo.publishing
Class ChannelImpl

java.lang.Object
  extended by org.alfresco.repo.publishing.ChannelImpl
All Implemented Interfaces:
Channel

public class ChannelImpl
extends java.lang.Object
implements Channel

Since:
4.0

Constructor Summary
ChannelImpl(ServiceRegistry serviceRegistry, AbstractChannelType channelType, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String name, ChannelHelper channelHelper, PublishingEventHelper eventHelper)
           
 
Method Summary
 boolean canPublish()
          Returns true only if the currently authenticated user can publish content to this Channel.
 boolean canPublishStatusUpdates()
          Returns true only if the currently authenticated user can unpublish status updates to this Channel.
 boolean canUnpublish()
          Returns true only if the currently authenticated user can unpublish content from this Channel.
 ChannelType getChannelType()
          
 java.lang.String getId()
          
 java.lang.String getName()
          Retrieve the name of this channel
 org.alfresco.service.cmr.repository.NodeRef getNodeRef()
          Retrieve the node ref of the node that represents this channel object in the repository
 java.util.Map getProperties()
          Retrieve the properties defined on this channel.
 java.lang.String getUrl(org.alfresco.service.cmr.repository.NodeRef publishedNode)
          Returns the URL for the specified node on this channel.
 boolean isAuthorised()
          Has this channel been authorised yet? Typically, when a channel is created in Alfresco the user is sent to the service provider to authorise Alfresco to access their account on their behalf.
 org.alfresco.service.cmr.repository.NodeRef publishEntry(PublishingPackageEntry entry, org.alfresco.service.cmr.repository.NodeRef eventNode)
           
 void publishEvent(PublishingEvent event)
           
 void sendStatusUpdate(java.lang.String status, java.lang.String nodeUrl)
          Post the specified text onto this channel as a status update.
 void unpublishEntry(PublishingPackageEntry entry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelImpl

public ChannelImpl(ServiceRegistry serviceRegistry,
                   AbstractChannelType channelType,
                   org.alfresco.service.cmr.repository.NodeRef nodeRef,
                   java.lang.String name,
                   ChannelHelper channelHelper,
                   PublishingEventHelper eventHelper)
Method Detail

getId

public java.lang.String getId()

Specified by:
getId in interface Channel
Returns:
a unique identifier for this Channel.

getChannelType

public ChannelType getChannelType()

Specified by:
getChannelType in interface Channel
Returns:
the ChannelType for this Channel.

getName

public java.lang.String getName()
Retrieve the name of this channel

Specified by:
getName in interface Channel
Returns:

getNodeRef

public org.alfresco.service.cmr.repository.NodeRef getNodeRef()
Retrieve the node ref of the node that represents this channel object in the repository

Specified by:
getNodeRef in interface Channel
Returns:

getProperties

public java.util.Map getProperties()
Retrieve the properties defined on this channel.

Specified by:
getProperties in interface Channel
Returns:

publishEvent

public void publishEvent(PublishingEvent event)

unpublishEntry

public void unpublishEntry(PublishingPackageEntry entry)

publishEntry

public org.alfresco.service.cmr.repository.NodeRef publishEntry(PublishingPackageEntry entry,
                                                                org.alfresco.service.cmr.repository.NodeRef eventNode)

sendStatusUpdate

public void sendStatusUpdate(java.lang.String status,
                             java.lang.String nodeUrl)
Post the specified text onto this channel as a status update.

Specified by:
sendStatusUpdate in interface Channel
Parameters:
status - The text of the status update. Note that if the length of this text plus the length of the urlToAppend text is greater than the maximum length permitted as a status update on this channel then this text will be truncated to fit.
nodeUrl - Text that is to be appended to the status update - often a URL to a relevant piece of content. If this channel can't accept both the status text and the URL then the status text will be truncated in preference to the URL. This argument may be null.

getUrl

public java.lang.String getUrl(org.alfresco.service.cmr.repository.NodeRef publishedNode)
Returns the URL for the specified node on this channel.

Specified by:
getUrl in interface Channel
Returns:
a URL for the published content. May return null if the specified node has not been published to this channel.

isAuthorised

public boolean isAuthorised()
Has this channel been authorised yet? Typically, when a channel is created in Alfresco the user is sent to the service provider to authorise Alfresco to access their account on their behalf. Once Alfresco has been told that the user has done that then this operation will return true. Until then, this operation will return false. A channel that is not authorised cannot be used to publish content or status updates to.

Specified by:
isAuthorised in interface Channel
Returns:
true if this channel has been authorised and is ready for use.

canPublish

public boolean canPublish()
Returns true only if the currently authenticated user can publish content to this Channel. If the ChannelType does not support publishing, if the Channel is not authorised or if the currently authenticated user does not have permission to publish to this Channel then this method will return false.

Specified by:
canPublish in interface Channel
Returns:

canUnpublish

public boolean canUnpublish()
Returns true only if the currently authenticated user can unpublish content from this Channel. If the ChannelType does not support unpublishing, if the Channel is not authorised or if the currently authenticated user does not have permission to publish to this Channel then this method will return false.

Specified by:
canUnpublish in interface Channel
Returns:

canPublishStatusUpdates

public boolean canPublishStatusUpdates()
Returns true only if the currently authenticated user can unpublish status updates to this Channel. If the ChannelType does not support publishing of status updates, if the Channel is not authorised or if the currently authenticated user does not have permission to publish to this Channel then this method will return false.

Specified by:
canPublishStatusUpdates in interface Channel
Returns:


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