Publishing:
- Added initial icons to each of the supported channel types along with API (foundation and REST) to access them. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29249 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
@@ -87,6 +87,7 @@
|
||||
<property name="nodeService" ref="NodeService" />
|
||||
<property name="behaviourFilter" ref="policyBehaviourFilter" />
|
||||
<property name="urlShortener" ref="urlShortener" />
|
||||
<property name="dictionaryService" ref="DictionaryService" />
|
||||
</bean>
|
||||
|
||||
<bean id="publishingObjectFactory" class="org.alfresco.repo.publishing.PublishingObjectFactory">
|
||||
|
@@ -38,6 +38,8 @@ import org.alfresco.service.cmr.transfer.NodeFinder;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
/**
|
||||
* @author Nick Smith
|
||||
@@ -175,4 +177,29 @@ public abstract class AbstractChannelType implements ChannelType, InitializingBe
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Resource getIcon16()
|
||||
{
|
||||
return getIcon("16");
|
||||
}
|
||||
|
||||
public Resource getIcon32()
|
||||
{
|
||||
return getIcon("32");
|
||||
}
|
||||
|
||||
protected Resource getIcon(String sizeSuffix)
|
||||
{
|
||||
String className = this.getClass().getCanonicalName();
|
||||
className = className.replaceAll("\\.", "\\/");
|
||||
StringBuilder iconPath = new StringBuilder(className);
|
||||
iconPath.append(sizeSuffix).append('.').append(getIconFileExtension());
|
||||
Resource resource = new ClassPathResource(iconPath.toString());
|
||||
return resource.exists() ? resource : null;
|
||||
}
|
||||
|
||||
public String getIconFileExtension()
|
||||
{
|
||||
return "png";
|
||||
}
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.publishing.NodeSnapshot;
|
||||
import org.alfresco.service.cmr.publishing.PublishingEvent;
|
||||
import org.alfresco.service.cmr.publishing.PublishingPackageEntry;
|
||||
@@ -62,6 +63,7 @@ public class PublishingEventProcessor
|
||||
private NodeService nodeService;
|
||||
private BehaviourFilter behaviourFilter;
|
||||
private UrlShortener urlShortener;
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
public void processEventNode(NodeRef eventNode)
|
||||
{
|
||||
@@ -223,6 +225,13 @@ public class PublishingEventProcessor
|
||||
Map<QName, Serializable> publishProps = nodeService.getProperties(publishedNode);
|
||||
Set<QName> propsToRemove = new HashSet<QName>(publishProps.keySet());
|
||||
propsToRemove.removeAll(snapshotProps.keySet());
|
||||
|
||||
//We want to retain the published asset id and URL in the updated node...
|
||||
snapshotProps.put(PublishingModel.PROP_ASSET_ID, nodeService.getProperty(publishedNode,
|
||||
PublishingModel.PROP_ASSET_ID));
|
||||
snapshotProps.put(PublishingModel.PROP_ASSET_URL, nodeService.getProperty(publishedNode,
|
||||
PublishingModel.PROP_ASSET_URL));
|
||||
|
||||
for (QName propertyToRemove : propsToRemove)
|
||||
{
|
||||
nodeService.removeProperty(publishedNode, propertyToRemove);
|
||||
@@ -238,6 +247,12 @@ public class PublishingEventProcessor
|
||||
Set<QName> aspectsToRemove = nodeService.getAspects(publishedNode);
|
||||
aspectsToRemove.removeAll(newAspects);
|
||||
aspectsToRemove.remove(ASPECT_PUBLISHED);
|
||||
aspectsToRemove.remove(PublishingModel.ASPECT_ASSET);
|
||||
for (QName publishedAssetAspect : dictionaryService.getSubAspects(PublishingModel.ASPECT_ASSET, true))
|
||||
{
|
||||
aspectsToRemove.remove(publishedAssetAspect);
|
||||
}
|
||||
|
||||
for (QName aspectToRemove : aspectsToRemove)
|
||||
{
|
||||
nodeService.removeAspect(publishedNode, aspectToRemove);
|
||||
@@ -327,4 +342,9 @@ public class PublishingEventProcessor
|
||||
{
|
||||
this.urlShortener = urlShortener;
|
||||
}
|
||||
|
||||
public void setDictionaryService(DictionaryService dictionaryService)
|
||||
{
|
||||
this.dictionaryService = dictionaryService;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 270 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 327 B |
After Width: | Height: | Size: 327 B |
After Width: | Height: | Size: 739 B |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 652 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 461 B |
After Width: | Height: | Size: 2.3 KiB |
@@ -27,6 +27,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.transfer.NodeFilter;
|
||||
import org.alfresco.service.cmr.transfer.NodeFinder;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
/**
|
||||
* @author Brian
|
||||
@@ -59,4 +60,8 @@ public interface ChannelType
|
||||
|
||||
String getAuthorisationUrl(Channel channel, String callbackUrl);
|
||||
boolean acceptAuthorisationCallback(Channel channel, Map<String, String[]> callbackHeaders, Map<String, String[]> callbackParams);
|
||||
|
||||
String getIconFileExtension();
|
||||
Resource getIcon16();
|
||||
Resource getIcon32();
|
||||
}
|
||||
|