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

104368: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud)
      104301: Merged DEV to 5.0.N (5.0.2)
         104289: MNT-14052 : CLONE - <filter-activities> config doesn't work in share
                    -added method to set the ignored-types pots


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@104524 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tatyana Valkevych
2015-05-19 15:14:18 +00:00
parent 79e65e0023
commit 7bdcab15bc
3 changed files with 33 additions and 9 deletions

View File

@@ -19,7 +19,10 @@
package org.alfresco.repo.activities;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.events.types.ActivityEvent;
@@ -61,7 +64,17 @@ public class ActivityPostServiceImpl implements ActivityPostService
private int estGridSize = 1;
private boolean userNamesAreCaseSensitive = false;
public void setIgnoredActivityTypes(String ignoredActivityTypes)
{
if (ignoredActivityTypes!= null && ignoredActivityTypes.length() > 0)
{
this.ignoredActivityTypes = Arrays.asList(ignoredActivityTypes.split(","));
}
}
private List<String> ignoredActivityTypes = new ArrayList<>();
public void setUserNamesAreCaseSensitive(boolean userNamesAreCaseSensitive)
{
this.userNamesAreCaseSensitive = userNamesAreCaseSensitive;
@@ -199,6 +212,13 @@ public class ActivityPostServiceImpl implements ActivityPostService
{
throw new IllegalArgumentException("Invalid activity type - exceeds " + ActivityPostDAO.MAX_LEN_ACTIVITY_TYPE + " chars: " + activityType);
}
if (ignoredActivityTypes != null && ignoredActivityTypes.contains(activityType))
{
// do not log the activity for ignored activity types.
logger.debug("Ignoring activity type for posting: " + activityType);
return;
}
// optional - default to empty string
if (activityData == null)
@@ -371,13 +391,13 @@ public class ActivityPostServiceImpl implements ActivityPostService
}
/**
* Validate that the nodeRef property - if present in the activity data - is valid
* on a basic level (it can be used to construct a NodeRef object).
*
* @param jo
* @throws JSONException
*/
private NodeRef checkNodeRef(JSONObject jo) throws JSONException
* Validate that the nodeRef property - if present in the activity data - is valid
* on a basic level (it can be used to construct a NodeRef object).
*
* @param jo
* @throws JSONException
*/
private NodeRef checkNodeRef(JSONObject jo) throws JSONException
{
String nodeRefStr = null;
try