mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +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:
@@ -14,6 +14,7 @@
|
||||
<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>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>
|
||||
|
||||
]]></description>
|
||||
@@ -48,6 +49,7 @@
|
||||
"channelId": string,
|
||||
"pollUrl": string,
|
||||
"authoriseUrl": string
|
||||
"authCallbackUrl": string
|
||||
}
|
||||
}
|
||||
]]>
|
@@ -5,7 +5,8 @@
|
||||
{
|
||||
"channelId" : "${channelId}",
|
||||
"pollUrl": "${pollUrl}",
|
||||
"authoriseUrl": "${authoriseUrl}"
|
||||
"authoriseUrl": "${authoriseUrl}",
|
||||
"authCallbackUrl": "${authCallbackUrl}"
|
||||
}
|
||||
}
|
||||
</#escape>
|
@@ -1126,8 +1126,8 @@
|
||||
</bean>
|
||||
|
||||
<!-- Create a new Channel web script -->
|
||||
<bean id="webscript.org.alfresco.repository.publishing.channel.post"
|
||||
class="org.alfresco.repo.web.scripts.publishing.ChannelPostWebScript"
|
||||
<bean id="webscript.org.alfresco.repository.publishing.channels.post"
|
||||
class="org.alfresco.repo.web.scripts.publishing.ChannelsPostWebScript"
|
||||
parent="webscript">
|
||||
<property name="channelService" ref="channelService" />
|
||||
</bean>
|
||||
|
@@ -30,7 +30,7 @@ import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
|
||||
public class ChannelPostWebScript extends DeclarativeWebScript
|
||||
public class ChannelsPostWebScript extends DeclarativeWebScript
|
||||
{
|
||||
private ChannelService channelService;
|
||||
|
||||
@@ -76,6 +76,7 @@ public class ChannelPostWebScript extends DeclarativeWebScript
|
||||
model.put("pollUrl", pollUrl);
|
||||
model.put("authoriseUrl", authoriseUrl);
|
||||
model.put("channelId", channelNodeRef.toString());
|
||||
model.put("authCallbackUrl", callbackUrl);
|
||||
|
||||
return model;
|
||||
}
|
@@ -146,7 +146,7 @@ public class PublishingModelBuilder
|
||||
|
||||
model.put(CHANNEL_NODE_TYPE, type.getChannelNodeType().toString());
|
||||
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_STATUS_UPDATES, toString(type.canPublishStatusUpdates()));
|
||||
|
@@ -599,7 +599,7 @@ public class PublishingRestApiTest extends BaseWebScriptTest
|
||||
|
||||
List<String> contentTypes = CollectionUtils.toListOfStrings(channelType.getSupportedContentTypes());
|
||||
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_STATUS_UPDATES, jsonType, channelType.canPublishStatusUpdates());
|
||||
@@ -731,7 +731,7 @@ public class PublishingRestApiTest extends BaseWebScriptTest
|
||||
|
||||
ChannelType publishPdf= mockChannelType(publishPdfType);
|
||||
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);
|
||||
when(statusUpdate.canPublishStatusUpdates()).thenReturn(true);
|
||||
|
Reference in New Issue
Block a user