ACE-4174: Add concept of hidden channels to ChannelService and mark old core social publishing channels as hidden by default.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@114759 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Webster
2015-10-20 09:11:29 +00:00
parent 90512a33c7
commit dbf5134422
10 changed files with 40 additions and 2 deletions

View File

@@ -46,6 +46,7 @@ public abstract class AbstractChannelType implements ChannelType, ChannelTypePub
private NodeService nodeService;
private ChannelService channelService;
private MetadataEncryptor encryptor;
private boolean hidden = false;
public void setChannelService(ChannelService channelService)
{
@@ -197,4 +198,15 @@ public abstract class AbstractChannelType implements ChannelType, ChannelTypePub
return url;
}
@Override
public boolean isHidden()
{
return hidden;
}
@Override
public void setHidden(boolean hidden)
{
this.hidden = hidden;
}
}

View File

@@ -118,7 +118,15 @@ public class ChannelServiceImpl implements ChannelService
*/
public List<ChannelType> getChannelTypes()
{
return new ArrayList<ChannelType>(channelTypes.values());
List<ChannelType> result = new ArrayList<ChannelType>();
for (ChannelType channelType : channelTypes.values())
{
if (!channelType.isHidden())
{
result.add(channelType);
}
}
return result;
}
/**

View File

@@ -53,7 +53,7 @@ public interface ChannelService
ChannelType getChannelType(String id);
/**
* Retrieve all the registered channel types
* Retrieve all the registered channel types, excluding any that are hidden
* @return A list of ChannelType objects, each representing a channel type registered with this channel service
*/
@NotAuditable

View File

@@ -160,4 +160,16 @@ public interface ChannelType
* @return The resource that represents the requested icon if available. <code>null</code> otherwise.
*/
Resource getIcon(String size);
/**
* If a channel type is hidden then it doesn't appear in the list returned by {@link ChannelService#getChannelTypes()}
* @param hidden
*/
void setHidden(boolean hidden);
/**
* If a channel type is hidden then it doesn't appear in the list returned by {@link ChannelService#getChannelTypes()}
* @param hidden
*/
boolean isHidden();
}