mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +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:
@@ -1107,6 +1107,7 @@
|
|||||||
class="org.alfresco.repo.web.scripts.publishing.ChannelsGet"
|
class="org.alfresco.repo.web.scripts.publishing.ChannelsGet"
|
||||||
parent="webscript">
|
parent="webscript">
|
||||||
<property name="channelService" ref="channelService" />
|
<property name="channelService" ref="channelService" />
|
||||||
|
<property name="urlShortener" ref="urlShortener" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- Get Channel Types web script -->
|
<!-- Get Channel Types web script -->
|
||||||
|
@@ -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.Channel;
|
||||||
import org.alfresco.service.cmr.publishing.channels.ChannelService;
|
import org.alfresco.service.cmr.publishing.channels.ChannelService;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
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.Cache;
|
||||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||||
import org.springframework.extensions.webscripts.Status;
|
import org.springframework.extensions.webscripts.Status;
|
||||||
@@ -49,6 +50,7 @@ public class ChannelsGet extends DeclarativeWebScript
|
|||||||
{
|
{
|
||||||
private final PublishingModelBuilder builder = new PublishingModelBuilder();
|
private final PublishingModelBuilder builder = new PublishingModelBuilder();
|
||||||
private ChannelService channelService;
|
private ChannelService channelService;
|
||||||
|
private UrlShortener urlShortener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
@@ -81,7 +83,7 @@ public class ChannelsGet extends DeclarativeWebScript
|
|||||||
Map<String, Object> model = new HashMap<String, Object>();
|
Map<String, Object> model = new HashMap<String, Object>();
|
||||||
|
|
||||||
//TODO Implement URL shortening.
|
//TODO Implement URL shortening.
|
||||||
model.put(URL_LENGTH, 20);
|
model.put(URL_LENGTH, urlShortener.getUrlLength());
|
||||||
|
|
||||||
model.put(PUBLISHING_CHANNELS, builder.buildChannels(publishingChannels));
|
model.put(PUBLISHING_CHANNELS, builder.buildChannels(publishingChannels));
|
||||||
model.put(STATUS_UPDATE_CHANNELS, builder.buildChannels(statusUpdateChannels));
|
model.put(STATUS_UPDATE_CHANNELS, builder.buildChannels(statusUpdateChannels));
|
||||||
@@ -95,4 +97,12 @@ public class ChannelsGet extends DeclarativeWebScript
|
|||||||
{
|
{
|
||||||
this.channelService = channelService;
|
this.channelService = channelService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param urlShortener the urlShortener to set
|
||||||
|
*/
|
||||||
|
public void setUrlShortener(UrlShortener urlShortener)
|
||||||
|
{
|
||||||
|
this.urlShortener = urlShortener;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user