Notification activator Portlet

From Sense/Net Wiki
Jump to: navigation, search
  •  
  •  
  •  
  •  
  • 100%
  • 6.0.4
  • Enterprise
  • Community
  • Planned

Overview

Notification activator Portlet is responsible for activating or deactivating a Notifications subscribed by the user. It has no visual appearance; it just calles the appropriate methods and redirects to the caller page.

Details

Basically, you can modify your own Notifications only, but there are an apportunity to activate/inactivate another user's.

The portlet needs at least two parameters to receive from URL:

  • ContentPath: the path of the content whose changes are watched
  • IsActive: the current state of the notification. Its value selects the used mode of the portlet: activation or deactivation

You can give an additional parameter to the portlet:

  • UserPath: if you set this as well, you can activate/deativate the given user's notification.

for Portal builders

In fact you have nothing to do with the portlet after you added it to your application page. It will never be shown for the user, so any UI is not needed. If you would like to display a link for each element of a notification list, you can do it easily with an ActionLinkButton:

<sn:ActionLinkButton runat="server" ID="BtnSetActivation" ActionName="SetActivation" ContextInfoID="ContextInfoUser" 
  ParameterString='<%# "ContentPath=" + Eval("ContentPath") + ";IsActive=" + Eval("IsActive") %>>
    <%# (bool)((SenseNet.ContentRepository.Content)Container.DataItem)["IsActive"]
      ? "Deactivate"
      : "Activate"
</sn:ActionLinkButton>

The above code supposes a ContextInfo control with ID="ContextInfoUser" on your view which selects the current user.

Related links

References