mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Publishing:
- channels.post webscript now returns authCallbackUrl in addition to previous data git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29230 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -200,7 +200,7 @@ public class ChannelHelper
|
||||
|
||||
private boolean isMimetypeSupported(String mimetype, ChannelType type)
|
||||
{
|
||||
Set<String> supportedMimetypes = type.getSupportedMimetypes();
|
||||
Set<String> supportedMimetypes = type.getSupportedMimeTypes();
|
||||
if (supportedMimetypes == null || supportedMimetypes.isEmpty())
|
||||
{
|
||||
return true;
|
||||
|
@@ -119,7 +119,7 @@ public class MockChannelType extends AbstractChannelType
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getSupportedMimetypes()
|
||||
public Set<String> getSupportedMimeTypes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@@ -305,7 +305,7 @@ public class PublishEventActionTest extends AbstractPublishingIntegrationTest
|
||||
|
||||
// Set supported type to XML
|
||||
Set<String> mimeTypes = Collections.singleton(MimetypeMap.MIMETYPE_XML);
|
||||
when(channelType.getSupportedMimetypes()).thenReturn(mimeTypes);
|
||||
when(channelType.getSupportedMimeTypes()).thenReturn(mimeTypes);
|
||||
|
||||
// Publish source node but don't call ChannelType.publish().
|
||||
publishNode(source);
|
||||
@@ -315,7 +315,7 @@ public class PublishEventActionTest extends AbstractPublishingIntegrationTest
|
||||
|
||||
// Change supported type to plain text.
|
||||
mimeTypes = Collections.singleton(MimetypeMap.MIMETYPE_TEXT_PLAIN);
|
||||
when(channelType.getSupportedMimetypes()).thenReturn(mimeTypes);
|
||||
when(channelType.getSupportedMimeTypes()).thenReturn(mimeTypes);
|
||||
|
||||
// Publish source node
|
||||
publishNode(source);
|
||||
|
@@ -92,7 +92,7 @@ public class FacebookChannelType extends AbstractChannelType
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getSupportedMimetypes()
|
||||
public Set<String> getSupportedMimeTypes()
|
||||
{
|
||||
return Collections.emptySet();
|
||||
}
|
||||
@@ -124,7 +124,6 @@ public class FacebookChannelType extends AbstractChannelType
|
||||
public String getAuthorisationUrl(Channel channel, String callbackUrl)
|
||||
{
|
||||
ParameterCheck.mandatory("channel", channel);
|
||||
ParameterCheck.mandatory("callbackUrl", callbackUrl);
|
||||
if (!ID.equals(channel.getChannelType().getId()))
|
||||
{
|
||||
throw new IllegalArgumentException("Invalid channel type: " + channel.getChannelType().getId());
|
||||
|
@@ -23,7 +23,9 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.publishing.AbstractChannelType;
|
||||
import org.alfresco.repo.publishing.PublishingModel;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
@@ -43,9 +45,19 @@ import org.springframework.util.MultiValueMap;
|
||||
public class FlickrChannelType extends AbstractChannelType
|
||||
{
|
||||
public final static String ID = "flickr";
|
||||
private final static Set<String> DEFAULT_SUPPORTED_MIME_TYPES = new TreeSet<String>();
|
||||
|
||||
static
|
||||
{
|
||||
DEFAULT_SUPPORTED_MIME_TYPES.add(MimetypeMap.MIMETYPE_IMAGE_GIF);
|
||||
DEFAULT_SUPPORTED_MIME_TYPES.add(MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
||||
DEFAULT_SUPPORTED_MIME_TYPES.add(MimetypeMap.MIMETYPE_IMAGE_PNG);
|
||||
}
|
||||
|
||||
private NodeService nodeService;
|
||||
private FlickrPublishingHelper publishingHelper;
|
||||
private ActionService actionService;
|
||||
private Set<String> supportedMimeTypes = Collections.unmodifiableSet(DEFAULT_SUPPORTED_MIME_TYPES);
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
@@ -61,6 +73,11 @@ public class FlickrChannelType extends AbstractChannelType
|
||||
{
|
||||
this.actionService = actionService;
|
||||
}
|
||||
|
||||
public void setSupportedMimeTypes(Set<String> mimeTypes)
|
||||
{
|
||||
supportedMimeTypes = Collections.unmodifiableSet(new TreeSet<String>(mimeTypes));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPublish()
|
||||
@@ -99,9 +116,9 @@ public class FlickrChannelType extends AbstractChannelType
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getSupportedMimetypes()
|
||||
public Set<String> getSupportedMimeTypes()
|
||||
{
|
||||
return Collections.emptySet();
|
||||
return supportedMimeTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -92,7 +92,7 @@ public class SlideShareChannelType extends AbstractChannelType
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getSupportedMimetypes()
|
||||
public Set<String> getSupportedMimeTypes()
|
||||
{
|
||||
return publishingHelper.getAllowedMimeTypes().keySet();
|
||||
}
|
||||
|
@@ -95,7 +95,7 @@ public class TestChannelType1 extends AbstractChannelType
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getSupportedMimetypes()
|
||||
public Set<String> getSupportedMimeTypes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@@ -95,7 +95,7 @@ public class TestChannelType2 extends AbstractChannelType
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getSupportedMimetypes()
|
||||
public Set<String> getSupportedMimeTypes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@@ -95,7 +95,7 @@ public class TestChannelType3 extends AbstractChannelType
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getSupportedMimetypes()
|
||||
public Set<String> getSupportedMimeTypes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ public class TwitterChannelType extends AbstractChannelType
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getSupportedMimetypes()
|
||||
public Set<String> getSupportedMimeTypes()
|
||||
{
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ public class YouTubeChannelType extends AbstractChannelType
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getSupportedMimetypes()
|
||||
public Set<String> getSupportedMimeTypes()
|
||||
{
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ public interface ChannelType
|
||||
boolean canUnpublish();
|
||||
boolean canPublishStatusUpdates();
|
||||
|
||||
Set<String> getSupportedMimetypes();
|
||||
Set<String> getSupportedMimeTypes();
|
||||
Set<QName> getSupportedContentTypes();
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user