Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

75088: Merged WAT2 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud)
      73976: Improvements to activities post events for ACE-1707


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@75416 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Will Abson
2014-07-01 15:31:54 +00:00
parent 7546d20c6e
commit 24affa291e
5 changed files with 12 additions and 9 deletions

View File

@@ -46,6 +46,7 @@ import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.util.FileFilterMode.Client;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONStringer;
@@ -149,7 +150,7 @@ public class CommentsPost extends DeclarativeWebScript {
String jsonActivityData = jsonWriter.endObject().toString();
activityService.postActivity("org.alfresco.comments.comment-created", siteId, "comments", jsonActivityData);
activityService.postActivity("org.alfresco.comments.comment-created", siteId, "comments", jsonActivityData, Client.webclient);
}
catch(Exception e)
{

View File

@@ -326,7 +326,7 @@ public class ContentStreamer implements ResourceLoaderAware
final boolean attach,
final Date modified,
String eTag,
String attachFileName,
final String attachFileName,
Map<String, Object> model) throws IOException
{
setAttachment(null, res, attach, attachFileName);
@@ -364,7 +364,7 @@ public class ContentStreamer implements ResourceLoaderAware
String siteId = siteService.getSiteShortName(nodeRef);
return new ContentEventImpl(ContentEvent.DOWNLOAD, user, networkId, transactionId,
nodeRef.getId(), siteId, propertyQName.toString(), Client.webclient, finalMimetype, size, encoding);
nodeRef.getId(), siteId, propertyQName.toString(), Client.webclient, attachFileName, finalMimetype, size, encoding);
}
});
}

View File

@@ -25,6 +25,7 @@ import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.cmr.activities.ActivityService;
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.util.FileFilterMode.Client;
import org.json.JSONException;
import org.json.JSONObject;
@@ -123,7 +124,9 @@ public class ActivityPosterImpl implements ActivityPoster
activityType,
siteId,
appTool,
json.toString());
json.toString(),
Client.webdav,
contentNodeInfo);
}
/**

View File

@@ -309,17 +309,16 @@ public class GetMethod extends WebDAVMethod
}
}
protected void attemptReadContent(FileInfo realNodeInfo, ContentReader reader)
throws IOException
protected void attemptReadContent(FileInfo realNodeInfo, ContentReader reader) throws IOException
{
if (byteRanges != null && byteRanges.startsWith(RANGE_HEADER_UNIT_SPECIFIER))
{
m_davHelper.publishReadEvent(realNodeInfo, reader.getMimetype(), reader.getSize(), byteRanges.substring(6), reader.getEncoding());
HttpRangeProcessor rangeProcessor = new HttpRangeProcessor(getContentService());
String userAgent = m_request.getHeader(WebDAV.HEADER_USER_AGENT);
if (m_returnContent)
{
m_davHelper.publishReadEvent(realNodeInfo, reader.getMimetype(), reader.getSize(), byteRanges.substring(6), reader.getEncoding());
rangeProcessor.processRange(
m_response,
reader,

View File

@@ -1100,12 +1100,12 @@ public class WebDAVHelper
if (StringUtils.hasText(range))
{
return new ContentReadRangeEvent(user, networkId, transactionId, realNodeInfo.getNodeRef().getId(),
null, realNodeInfo.getType().toString(), Client.webdav, mimetype, size, contentEncoding, range);
null, realNodeInfo.getType().toString(), Client.webdav, realNodeInfo.getName(), mimetype, size, contentEncoding, range);
}
else
{
return new ContentEventImpl(ContentEvent.DOWNLOAD, user, networkId, transactionId, realNodeInfo.getNodeRef().getId(),
null, realNodeInfo.getType().toString(), Client.webdav, mimetype, size, contentEncoding);
null, realNodeInfo.getType().toString(), Client.webdav, realNodeInfo.getName(), mimetype, size, contentEncoding);
}
}
});