org.alfresco.repo.publishing
Class MockChannelType

java.lang.Object
  extended by org.alfresco.repo.publishing.AbstractChannelType
      extended by org.alfresco.repo.publishing.MockChannelType
All Implemented Interfaces:
ChannelTypePublishingOperations, ChannelType

public class MockChannelType
extends AbstractChannelType

For test purposes only.

Since:
4.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.publishing.channels.ChannelType
ChannelType.AuthStatus
 
Field Summary
static java.lang.String ID
           
 
Constructor Summary
MockChannelType()
           
 
Method Summary
 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.
 java.util.Map getCapabilities()
          
 org.alfresco.service.namespace.QName getChannelNodeType()
          Each channel is stored in the repository as a node.
 org.alfresco.service.namespace.QName getContentRootNodeType()
          
 java.lang.String getId()
          Returns the unique identifier of this channel type
 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 publish(org.alfresco.service.cmr.repository.NodeRef nodeToPublish, java.util.Map properties)
          
 void sendStatusUpdate(Channel channel, java.lang.String status)
          Send the specified status update to the specified channel
 void unpublish(org.alfresco.service.cmr.repository.NodeRef nodeToUnpublish, java.util.Map properties)
          
 
Methods inherited from class org.alfresco.repo.publishing.AbstractChannelType
acceptAuthorisationCallback, getChannelService, getEncryptor, getIcon, getIconFileExtension, getMaximumStatusLength, getNodeService, internalAcceptAuthorisation, setChannelService, setEncryptor, setNodeService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values
Constructor Detail

MockChannelType

public MockChannelType()
Method Detail

getId

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

Returns:

getCapabilities

public java.util.Map getCapabilities()


getChannelNodeType

public 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:

getContentRootNodeType

public org.alfresco.service.namespace.QName getContentRootNodeType()


publish

public void publish(org.alfresco.service.cmr.repository.NodeRef nodeToPublish,
                    java.util.Map properties)

Specified by:
publish in interface ChannelTypePublishingOperations
Overrides:
publish in class AbstractChannelType

unpublish

public void unpublish(org.alfresco.service.cmr.repository.NodeRef nodeToUnpublish,
                      java.util.Map properties)

Specified by:
unpublish in interface ChannelTypePublishingOperations
Overrides:
unpublish in class AbstractChannelType

sendStatusUpdate

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

Specified by:
sendStatusUpdate in interface ChannelType
Overrides:
sendStatusUpdate in class AbstractChannelType

canPublish

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

Returns:

canUnpublish

public 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:

getSupportedMimeTypes

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

Specified by:
getSupportedMimeTypes in interface ChannelType
Overrides:
getSupportedMimeTypes in class AbstractChannelType
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

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

Specified by:
getSupportedContentTypes in interface ChannelType
Overrides:
getSupportedContentTypes in class AbstractChannelType
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.

canPublishStatusUpdates

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

Returns:

getNodeUrl

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

Specified by:
getNodeUrl in interface ChannelType
Overrides:
getNodeUrl in class AbstractChannelType
Parameters:
node - The published content node in the live environment.
Returns:
a URL for the published content.

getAuthorisationUrl

public java.lang.String getAuthorisationUrl(Channel channel,
                                            java.lang.String callbackUrl)
Description copied from interface: ChannelType
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.

Specified by:
getAuthorisationUrl in interface ChannelType
Overrides:
getAuthorisationUrl in class AbstractChannelType
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.


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