mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
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:
@@ -46,6 +46,7 @@ import org.alfresco.service.cmr.security.PersonService;
|
|||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||||
|
import org.alfresco.util.FileFilterMode.Client;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.json.JSONStringer;
|
import org.json.JSONStringer;
|
||||||
@@ -149,7 +150,7 @@ public class CommentsPost extends DeclarativeWebScript {
|
|||||||
|
|
||||||
String jsonActivityData = jsonWriter.endObject().toString();
|
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)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
@@ -326,7 +326,7 @@ public class ContentStreamer implements ResourceLoaderAware
|
|||||||
final boolean attach,
|
final boolean attach,
|
||||||
final Date modified,
|
final Date modified,
|
||||||
String eTag,
|
String eTag,
|
||||||
String attachFileName,
|
final String attachFileName,
|
||||||
Map<String, Object> model) throws IOException
|
Map<String, Object> model) throws IOException
|
||||||
{
|
{
|
||||||
setAttachment(null, res, attach, attachFileName);
|
setAttachment(null, res, attach, attachFileName);
|
||||||
@@ -364,7 +364,7 @@ public class ContentStreamer implements ResourceLoaderAware
|
|||||||
String siteId = siteService.getSiteShortName(nodeRef);
|
String siteId = siteService.getSiteShortName(nodeRef);
|
||||||
|
|
||||||
return new ContentEventImpl(ContentEvent.DOWNLOAD, user, networkId, transactionId,
|
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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,7 @@ import org.alfresco.repo.tenant.TenantService;
|
|||||||
import org.alfresco.service.cmr.activities.ActivityService;
|
import org.alfresco.service.cmr.activities.ActivityService;
|
||||||
import org.alfresco.service.cmr.model.FileInfo;
|
import org.alfresco.service.cmr.model.FileInfo;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.util.FileFilterMode.Client;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@@ -123,7 +124,9 @@ public class ActivityPosterImpl implements ActivityPoster
|
|||||||
activityType,
|
activityType,
|
||||||
siteId,
|
siteId,
|
||||||
appTool,
|
appTool,
|
||||||
json.toString());
|
json.toString(),
|
||||||
|
Client.webdav,
|
||||||
|
contentNodeInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -309,17 +309,16 @@ public class GetMethod extends WebDAVMethod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void attemptReadContent(FileInfo realNodeInfo, ContentReader reader)
|
protected void attemptReadContent(FileInfo realNodeInfo, ContentReader reader) throws IOException
|
||||||
throws IOException
|
|
||||||
{
|
{
|
||||||
if (byteRanges != null && byteRanges.startsWith(RANGE_HEADER_UNIT_SPECIFIER))
|
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());
|
HttpRangeProcessor rangeProcessor = new HttpRangeProcessor(getContentService());
|
||||||
String userAgent = m_request.getHeader(WebDAV.HEADER_USER_AGENT);
|
String userAgent = m_request.getHeader(WebDAV.HEADER_USER_AGENT);
|
||||||
|
|
||||||
if (m_returnContent)
|
if (m_returnContent)
|
||||||
{
|
{
|
||||||
|
m_davHelper.publishReadEvent(realNodeInfo, reader.getMimetype(), reader.getSize(), byteRanges.substring(6), reader.getEncoding());
|
||||||
rangeProcessor.processRange(
|
rangeProcessor.processRange(
|
||||||
m_response,
|
m_response,
|
||||||
reader,
|
reader,
|
||||||
|
@@ -1100,12 +1100,12 @@ public class WebDAVHelper
|
|||||||
if (StringUtils.hasText(range))
|
if (StringUtils.hasText(range))
|
||||||
{
|
{
|
||||||
return new ContentReadRangeEvent(user, networkId, transactionId, realNodeInfo.getNodeRef().getId(),
|
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
|
else
|
||||||
{
|
{
|
||||||
return new ContentEventImpl(ContentEvent.DOWNLOAD, user, networkId, transactionId, realNodeInfo.getNodeRef().getId(),
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user