mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Implemented truncation of status update messages if they exceed the max status length for that channel.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29681 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -113,9 +113,20 @@ public class ChannelImpl implements Channel
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void updateStatus(String status)
|
||||
public void updateStatus(String status, String nodeUrl)
|
||||
{
|
||||
channelType.updateStatus(this, status, getProperties());
|
||||
if(channelType.canPublishStatusUpdates())
|
||||
{
|
||||
int urlLength = nodeUrl == null ? 0 : nodeUrl.length();
|
||||
int maxLength = channelType.getMaximumStatusLength() - urlLength;
|
||||
if (maxLength > 0)
|
||||
{
|
||||
int endpoint = Math.min(maxLength, status.length());
|
||||
status = status.substring(0, endpoint );
|
||||
}
|
||||
String msg = nodeUrl==null ? status : status + nodeUrl;
|
||||
channelType.updateStatus(this, msg, getProperties());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user