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:
Brian Remmington
2011-07-20 15:54:43 +00:00
parent e5f7b3a6ee
commit 5a303b71ec
6 changed files with 11 additions and 7 deletions

View File

@@ -14,6 +14,7 @@
<dt>channelId</dt><dd>the identifier of the new publishing channel</dd> <dt>channelId</dt><dd>the identifier of the new publishing channel</dd>
<dt>pollUrl</dt> <dd>The URL to poll to discover whether the channel has been authorised</dd> <dt>pollUrl</dt> <dd>The URL to poll to discover whether the channel has been authorised</dd>
<dt>authoriseUrl</dt> <dd>The URL to send the user to in order for them to authorise access to the channel</dd> <dt>authoriseUrl</dt> <dd>The URL to send the user to in order for them to authorise access to the channel</dd>
<dt>authCallbackUrl</dt> <dd>The URL to return the channel authorisation details to</dd>
</dl> </dl>
]]></description> ]]></description>
@@ -48,6 +49,7 @@
"channelId": string, "channelId": string,
"pollUrl": string, "pollUrl": string,
"authoriseUrl": string "authoriseUrl": string
"authCallbackUrl": string
} }
} }
]]> ]]>

View File

@@ -5,7 +5,8 @@
{ {
"channelId" : "${channelId}", "channelId" : "${channelId}",
"pollUrl": "${pollUrl}", "pollUrl": "${pollUrl}",
"authoriseUrl": "${authoriseUrl}" "authoriseUrl": "${authoriseUrl}",
"authCallbackUrl": "${authCallbackUrl}"
} }
} }
</#escape> </#escape>

View File

@@ -1126,8 +1126,8 @@
</bean> </bean>
<!-- Create a new Channel web script --> <!-- Create a new Channel web script -->
<bean id="webscript.org.alfresco.repository.publishing.channel.post" <bean id="webscript.org.alfresco.repository.publishing.channels.post"
class="org.alfresco.repo.web.scripts.publishing.ChannelPostWebScript" class="org.alfresco.repo.web.scripts.publishing.ChannelsPostWebScript"
parent="webscript"> parent="webscript">
<property name="channelService" ref="channelService" /> <property name="channelService" ref="channelService" />
</bean> </bean>

View File

@@ -30,7 +30,7 @@ import org.springframework.extensions.webscripts.DeclarativeWebScript;
import org.springframework.extensions.webscripts.Status; import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.WebScriptRequest; import org.springframework.extensions.webscripts.WebScriptRequest;
public class ChannelPostWebScript extends DeclarativeWebScript public class ChannelsPostWebScript extends DeclarativeWebScript
{ {
private ChannelService channelService; private ChannelService channelService;
@@ -76,6 +76,7 @@ public class ChannelPostWebScript extends DeclarativeWebScript
model.put("pollUrl", pollUrl); model.put("pollUrl", pollUrl);
model.put("authoriseUrl", authoriseUrl); model.put("authoriseUrl", authoriseUrl);
model.put("channelId", channelNodeRef.toString()); model.put("channelId", channelNodeRef.toString());
model.put("authCallbackUrl", callbackUrl);
return model; return model;
} }

View File

@@ -146,7 +146,7 @@ public class PublishingModelBuilder
model.put(CHANNEL_NODE_TYPE, type.getChannelNodeType().toString()); model.put(CHANNEL_NODE_TYPE, type.getChannelNodeType().toString());
model.put(SUPPORTED_CONTENT_TYPES, toListOfStrings(type.getSupportedContentTypes())); model.put(SUPPORTED_CONTENT_TYPES, toListOfStrings(type.getSupportedContentTypes()));
model.put(SUPPORTED_MIME_TYPES, type.getSupportedMimetypes()); model.put(SUPPORTED_MIME_TYPES, type.getSupportedMimeTypes());
model.put(CAN_PUBLISH, toString(type.canPublish())); model.put(CAN_PUBLISH, toString(type.canPublish()));
model.put(CAN_PUBLISH_STATUS_UPDATES, toString(type.canPublishStatusUpdates())); model.put(CAN_PUBLISH_STATUS_UPDATES, toString(type.canPublishStatusUpdates()));

View File

@@ -599,7 +599,7 @@ public class PublishingRestApiTest extends BaseWebScriptTest
List<String> contentTypes = CollectionUtils.toListOfStrings(channelType.getSupportedContentTypes()); List<String> contentTypes = CollectionUtils.toListOfStrings(channelType.getSupportedContentTypes());
checkStrings(jsonType.getJSONArray(SUPPORTED_CONTENT_TYPES), contentTypes); checkStrings(jsonType.getJSONArray(SUPPORTED_CONTENT_TYPES), contentTypes);
checkStrings(jsonType.getJSONArray(SUPPORTED_MIME_TYPES), channelType.getSupportedMimetypes()); checkStrings(jsonType.getJSONArray(SUPPORTED_MIME_TYPES), channelType.getSupportedMimeTypes());
check(CAN_PUBLISH, jsonType, channelType.canPublish()); check(CAN_PUBLISH, jsonType, channelType.canPublish());
check(CAN_PUBLISH_STATUS_UPDATES, jsonType, channelType.canPublishStatusUpdates()); check(CAN_PUBLISH_STATUS_UPDATES, jsonType, channelType.canPublishStatusUpdates());
@@ -731,7 +731,7 @@ public class PublishingRestApiTest extends BaseWebScriptTest
ChannelType publishPdf= mockChannelType(publishPdfType); ChannelType publishPdf= mockChannelType(publishPdfType);
when(publishPdf.canPublish()).thenReturn(true); when(publishPdf.canPublish()).thenReturn(true);
when(publishPdf.getSupportedMimetypes()).thenReturn(Collections.singleton(MimetypeMap.MIMETYPE_PDF)); when(publishPdf.getSupportedMimeTypes()).thenReturn(Collections.singleton(MimetypeMap.MIMETYPE_PDF));
ChannelType statusUpdate= mockChannelType(statusUpdateType); ChannelType statusUpdate= mockChannelType(statusUpdateType);
when(statusUpdate.canPublishStatusUpdates()).thenReturn(true); when(statusUpdate.canPublishStatusUpdates()).thenReturn(true);