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:
N Smith
2011-07-14 09:11:04 +00:00
parent b2459e54cf
commit 68956f2c48
6 changed files with 164 additions and 5 deletions

View File

@@ -43,6 +43,7 @@ import org.alfresco.service.cmr.publishing.channels.ChannelService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.urlshortening.UrlShortener;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.util.GUID;
@@ -60,6 +61,7 @@ public class PublishingEventProcessor
private ChannelService channelService;
private NodeService nodeService;
private BehaviourFilter behaviourFilter;
private UrlShortener urlShortener;
public void processEventNode(NodeRef eventNode)
{
@@ -100,7 +102,7 @@ public class PublishingEventProcessor
String nodeUrl = publishChannel.getChannelType().getNodeUrl(node);
if(nodeUrl != null)
{
message += nodeUrl;
message += urlShortener.shortenUrl(nodeUrl);
}
}
Set<String> channels = update.getChannelNames();
@@ -234,7 +236,6 @@ public class PublishingEventProcessor
}
}
private void addAspects(NodeRef publishedNode, Collection<QName> aspects)
{
Set<QName> currentAspects = nodeService.getAspects(publishedNode);
@@ -310,4 +311,12 @@ public class PublishingEventProcessor
{
this.behaviourFilter = behaviourFilter;
}
}
/**
* @param urlShortener the urlShortener to set
*/
public void setUrlShortener(UrlShortener urlShortener)
{
this.urlShortener = urlShortener;
}
}