use of org.alfresco.service.cmr.activities.ActivityInfo in project records-management by Alfresco.
the class FilePlanComponentsApiUtils method postActivity.
/**
* Posts activities for given fileInfo
*
* @param fileInfo
* @param parentNodeRef
* @param activityType
*/
public void postActivity(FileInfo fileInfo, NodeRef parentNodeRef, String activityType) {
ActivityInfo activityInfo = null;
RMSite rmSite = sites.getRMSite(RM_SITE_ID);
if (rmSite != null && !rmSite.getId().equals("")) {
if (fileInfo != null) {
boolean isContent = dictionaryService.isSubClass(fileInfo.getType(), ContentModel.TYPE_CONTENT);
if (isContent) {
activityInfo = new ActivityInfo(null, parentNodeRef, RM_SITE_ID, fileInfo);
}
}
} else {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Non-site activity, so ignored " + fileInfo.getNodeRef());
}
}
if (activityInfo == null)
// Nothing to do.
return;
if (activityType != null) {
activityPoster.postFileFolderActivity(activityType, null, TenantUtil.getCurrentDomain(), activityInfo.getSiteId(), activityInfo.getParentNodeRef(), activityInfo.getNodeRef(), activityInfo.getFileName(), Activities.APP_TOOL, Activities.RESTAPI_CLIENT, activityInfo.getFileInfo());
}
}
Aggregations