cancel
Showing results for 
Search instead for 
Did you mean: 

notification on recent share activities

bisana
Champ on-the-rise
Champ on-the-rise
Hi
I am using CE 4.2.c, my users gets email notification on recent share activities.
I have few doubts to clear:-

Does a user in a system, but not a member of SITE "ABC", will he be getting notification of what is happening at site "ABC"
Does the admin has the right to decide who should not get  and the time interval of the notification
Is there any GUI for managing the same
How does the admin decide who all should get the notification, and who all should not get the notification



Guidance and Advice requested
Thanks
11 REPLIES 11

muralidharand
Star Contributor
Star Contributor
<Strong> 1. Does a user in a system, but not a member of SITE "ABC", will he be getting notification of what is happening at site "ABC"  </Strong>

I don't have any idea for this.


<Strong> 2.Does the admin has the right to decide who should not get  and the time interval of the notification </Strong>

Yes, you can change. Generally notification sends  for every 24 hrs.
Open  
 "C:\Alfresco42d\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\subsystems\ActivitiesFeed\default\activities-jobs.properties" 
and look at the
"activities.feed.notifier.repeatIntervalMins" property value.

# Feed notification period (eg. 1440 mins => every 24 hours)
activities.feed.notifier.repeatIntervalMins=1440


<Strong> 3. Is there any GUI for managing the same  </Strong>

Yes. Login as Admin–> Go to Admin tools–> Under Repository click "Activities Feed" option. Here also you can change the interval.
GUI for Activities Feed:
  http://localhost:8081/share/page/console/admin-console/activities 



<Strong> 4.How does the admin decide who all should get the notification, and who all should not get the notification. </Strong>

I'm not sure for this. But the admin can change it each for users individually.  Try the below url  and uncheck the "Email Notification Feed:" option.

 http://localhost:8081/share/page/user/<userId>/user-notifications 



Hope this helps you !

Hi Murali
Thanks, your advice is appreciated

mpeters
Champ in-the-making
Champ in-the-making
Hello,

if I follow the recommendation described in 4. of post #2 (https://forums.alfresco.com/comment/130728#comment-130728) and try to change a users email notification status as an admin I always end with changing my own (=admin) email notification status rather than the choosen users one. In fact I do not even see the actual email notification status of the choosen user, it's always shown my (=admin) email notification status. I found, that I even can use a non valid rubbish userId (like "asdfg") in http://localhost:8081/share/page/user/<userId>/user-notifications and I constantly end up with my (=admin) email notification status.

Any hints or suggestion for that?

We use Alfresco 4.1.2 EE.

Kind regards
Markus

Hi Markus,
Yes, you're correct, it is not getting the actual user's notification check bok and it is just displaying the admin user's notification check box.
Sorry for that and thanks for sharing it.
Let me check other possibilities to fix this.

Hi Markus,



Please refer the below url and i tried this in 4.2d Community Edition.

http://www.mediafire.com/view/?sldz2l6nv52coga

user-notifications.get.js


Remove the user.id and use userId.

var userId = page.url.templateArgs["userid"]

var result = remote.call("/api/people/" + encodeURIComponent(userId));



You need to change user-notification.post.js also to save the data.

Hi Murali,

thanks for your reply.

I could not find the mentioned <em>user-notification.post.js</em>. Did you probably mean <em>user-notifications.post.json.js</em> instead? Within this file I could change the value of the username field in the JSON object.


      jsonUtils.toJSONString(
         {
            "username": user.id,     // => change user.id to page.url.templateArgs["userid"]?
            "properties":
            {
               "cm:emailFeedDisabled": emailFeedDisabled
            }
         }),


Do I have to restart the server in order to apply the changes? Refreshing the web scripts via Web Scripts Home didn't work.

Regards
Markus

Hi Markus,

Yes, you're correct. I wanted to mention user-notifications.post.json.js file only.
Chaing this  "page.url.templateArgs["userid"] " may not work for the post methods, anyway just give a try.

If you're changing something in webscripts, then no need to restart the server. Refreshing the webscript (http://localhost:8080/share/service/index) should be fine.

Hi Murali,

you are right, <em>page.url.templateArgs["userid"]</em> does not work in the post script (error <em>"01280001 Failed to execute script 'classpath*:alfresco/site-webscripts/org/alfresco/components/profile/user-notifications.post.json.js': 01280000 ReferenceError: "page" is not defined. (file:/C:/Alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/profile/user-notifications.post.json.js#15)"</em>).

So how would I gather the right user id from within <em>user-notifications.post.json.js</em>?

Btw. server restart was necessary to make the script changes work.

Kind regards
Markus

Hi Markus,

Post methods do not have "page" option only get methods will have it.


You need to make changes in three files.

<strong>user-notifications.get.js</strong>

Add the user.Id in the model.

model.userId = page.url.templateArgs["userid"];


<strong>user-notifications.get.html.ftl</strong>

Add a hidden field to keep the user.Id

<span><input type="hidden" id="user-id" value="${userId}"></span>


<strong>User-notifications.post.js</strong>

Create a variable called userid.
Read the json to get the user.Id
Use the userId variable in the post request.


var userId = "";
   if (json.has("user-id"))
   {
      userId= json.get("user-id");
   }  
   else
   userId = user.Id;
…………….
…………….
   jsonUtils.toJSONString(
         {
            "username": userId,
            "properties":
            {
               "cm:emailFeedDisabled": emailFeedDisabled
            }
         }),
      "application/json");
…………………
…………………
   

For your reference : http://www.mediafire.com/view/?v19auac45fg2351