mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Added UrlShortener interface/implementation. Included support for shortening of Urls generated through publishing of content.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29014 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -34,6 +34,7 @@ import org.alfresco.repo.web.scripts.WebScriptUtil;
|
||||
import org.alfresco.service.cmr.publishing.channels.Channel;
|
||||
import org.alfresco.service.cmr.publishing.channels.ChannelService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.urlshortening.UrlShortener;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
@@ -49,7 +50,8 @@ public class ChannelsGet extends DeclarativeWebScript
|
||||
{
|
||||
private final PublishingModelBuilder builder = new PublishingModelBuilder();
|
||||
private ChannelService channelService;
|
||||
|
||||
private UrlShortener urlShortener;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@@ -81,7 +83,7 @@ public class ChannelsGet extends DeclarativeWebScript
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
|
||||
//TODO Implement URL shortening.
|
||||
model.put(URL_LENGTH, 20);
|
||||
model.put(URL_LENGTH, urlShortener.getUrlLength());
|
||||
|
||||
model.put(PUBLISHING_CHANNELS, builder.buildChannels(publishingChannels));
|
||||
model.put(STATUS_UPDATE_CHANNELS, builder.buildChannels(statusUpdateChannels));
|
||||
@@ -95,4 +97,12 @@ public class ChannelsGet extends DeclarativeWebScript
|
||||
{
|
||||
this.channelService = channelService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param urlShortener the urlShortener to set
|
||||
*/
|
||||
public void setUrlShortener(UrlShortener urlShortener)
|
||||
{
|
||||
this.urlShortener = urlShortener;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user