This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
/
manifest.xml
146 lines (146 loc) · 10.9 KB
/
manifest.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?xml version="1.0" encoding="UTF-8"?>
<ajxp_plugin label="CONF_MESSAGE[Notification Center]" description="CONF_MESSAGE[Handle users watches and notifications]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
<class_definition classname="AJXP_NotificationCenter" filename="plugins/core.notifications/class.AJXP_NotificationCenter.php"/>
<client_settings>
<resources>
<i18n namespace="notification.tpl.short" path="plugins/core.notifications/templates/short"/>
<i18n namespace="notification.tpl.long" path="plugins/core.notifications/templates/long"/>
<i18n namespace="notification.tpl.group" path="plugins/core.notifications/templates/group"/>
<i18n namespace="notification.tpl.block" path="plugins/core.notifications/templates/block"/>
<i18n namespace="notification_center" path="plugins/core.notifications/res/i18n"/>
<css file="plugins/core.notifications/res/css/notification_center.css" autoload="true"/>
<img_library alias="notification_center" path="plugins/core.notifications/res/img"/>
</resources>
</client_settings>
<server_settings>
<param name="activate_notifications" scope="user" description="CONF_MESSAGE[Activate desktop notifications]" label="CONF_MESSAGE[Desktop Notifications]" type="button" choices="run_client_action:activateDesktopNotifications" expose="true" editable="true"/>
<global_param description="CONF_MESSAGE[Display a new entry with all events happening on a user workspaces, and alerts. An SQL database must be setup for the FEED_DRIVER configuration.]" label="CONF_MESSAGE[User events and alerts]" name="USER_EVENTS" type="boolean" default="false"/>
<global_param type="plugin_instance:feed" name="UNIQUE_FEED_INSTANCE" group="CONF_MESSAGE[Instance Params]" label="CONF_MESSAGE[Feed Instance]" description="CONF_MESSAGE[Choose the plugin]" mandatory="true" default="feed.sql"/>
</server_settings>
<registry_contributions>
<actions>
<action name="get_my_feed">
<gui text="notification_center.1" title="notification_center.2" iconClass="icon-rss" src="notification_center/ICON_SIZE/feed.png" accessKey="" hasAccessKey="false">
<context selection="false" dir="" recycle="true" actionBar="true" actionBarGroup="user" contextMenu="false" infoPanel="false"/>
</gui>
<rightsContext adminOnly="false" noUser="false" read="false" userLogged="only" write="false"/>
<subMenu>
<dynamicBuilder><![CDATA[
var context = window.builderContext;
var protoMenu = window.builderProtoMenu;
ResourcesManager.prototype.loadJSResource('plugins/core.notifications/class.NotificationLoader.js', 'NotificationLoader', function(){
NotificationLoader.getInstance().dynamicBuilderLoader(context, protoMenu);
});
]]></dynamicBuilder>
</subMenu>
<processing>
<clientCallback><![CDATA[
]]></clientCallback>
<clientForm id="user_feed"><![CDATA[
<div id="user_feed" box_padding="0" class="dialogBox css_boxshadow">
</div>
]]></clientForm>
<clientListener name="contextChange"><![CDATA[
if(!window.NotificationLoader && ajaxplorer.user){
ResourcesManager.prototype.loadJSResource('plugins/core.notifications/class.NotificationLoader.js', 'NotificationLoader');
}
]]></clientListener>
<serverCallback methodName="loadUserFeed"/>
</processing>
</action>
<action name="feed">
<rightsContext adminOnly="false" noUser="false" read="false" userLogged="only" write="false"/>
<processing>
<serverCallback methodName="loadUserFeed" restParams="/feed_type/path+" developerComment="Load an activity feed for the given node. Filtered by what the current user is authorized to see">
<input_param name="path" type="path" description="Optional filter to get activity on a file or a folder"/>
<input_param name="format" type="string" description="html, json, xml, array (internal value)"/>
<input_param name="feed_type" type="string" description="notif, alert or all"/>
<input_param name="offset" type="integer" description="Offset for pagination"/>
<input_param name="limit" type="integer" description="Limit for pagination"/>
<input_param name="merge_description" type="boolean" description="Wether to merge notification title and description in text"/>
<input_param name="merge_description_as_label" type="boolean" description="Wether to merge notification title and description in title"/>
<input_param name="current_repository" type="boolean"
description="Wether to get activity from current repository (true), or compute all from authorized repositories for user (false)"/>
</serverCallback>
</processing>
</action>
<action name="dismiss_user_alert">
<gui text="notification_center.7" title="notification_center.7" iconClass="icon-remove-sign" src="notification_center/ICON_SIZE/feed.png" accessKey="" hasAccessKey="false">
<context selection="false" dir="" recycle="true" actionBar="true" actionBarGroup="inline-notifications" contextMenu="false" infoPanel="false"/>
</gui>
<processing>
<clientCallback><![CDATA[
var selection = window.actionArguments[0];
if(selection && selection.getMetadata && selection.getMetadata().get("alert_id")){
var elMeta = selection.getMetadata();
var conn = new Connexion();
conn.onComplete = function(){
ajaxplorer.notify("server_message:tree/reload_user_feed");
};
var params = {
get_action:'dismiss_user_alert',
alert_id:elMeta.get('alert_id')
};
if(elMeta.get("event_occurence")){
params.occurrences = elMeta.get("event_occurence");
}
conn.setParameters(params);
conn.sendAsync();
}
]]></clientCallback>
<serverCallback methodName="dismissUserAlert" restParams="/alert_id/occurences" developerComment="Dismiss one or more occurences of alerts">
<input_param name="alert_id" type="integer" description="Id passed in /feed action list"/>
<input_param name="occurences" type="integer" description="1 or more"/>
</serverCallback>
</processing>
</action>
<action name="activateDesktopNotifications">
<gui src="" iconClass="icon-rss" text="notification_center.1" title="notification_title.2">
<context dir="true" recycle="true" selection="false"/>
</gui>
<processing>
<clientCallback><![CDATA[
if(window.Notification){
alert('Depending on your browser, this will ask for a specific permission. To disable, go through your browser preferences and exceptions. If you have already enabled this feature, probably nothing will hapen.');
window.Notification.requestPermission(function(grant) {
['default', 'granted', 'denied'].indexOf(grant) === true
});
}else{
alert('Your browser does not seem to support Desktop Notifications yet.');
}
]]></clientCallback>
</processing>
</action>
</actions>
<hooks>
<serverCallback methodName="persistChangeHookToFeed" hookName="node.change" defer="true"/>
<serverCallback methodName="persistNotificationToAlerts" hookName="msg.notification"/>
<serverCallback methodName="loadRepositoryInfo" hookName="repository.load_info"/>
</hooks>
<client_configs>
<component_config className="InfoPanel">
<infoPanelExtension mime="ajxp_root_node,generic_dir,generic_file" attributes="" modifier="NotificationLoader.prototype.loadInfoPanel">
<messages>
<message key="type_string" id="share_center.50"/>
</messages>
<html><![CDATA[
<div id="ajxp_activity_panel" data-infoPanelPosition="last">
</div>
]]></html>
</infoPanelExtension>
</component_config>
<component_config className="AjxpPane::navigation_scroller">
<additional_content id="navigation_alerts"><![CDATA[
<div id="navigation_alerts" ajxp_position="0">
<h3 class="colorcode-alert" ajxp_message_id="notification_center.3">AJXP_MESSAGE[notification_center.3] <span class="alerts_number_badge" id="alerts_number" ajxpClass="DataModelProperty" ajxpOptions='{"dmID":"notif_pane","property":"metadata","metadata_sum":"event_occurence"}'></span><small id="alerts_toggler" class="simple-toggler-hide" ajxpClass="VisibilityToggler" ajxpOptions='{"widget_id":"notif_pane"}'>AJXP_MESSAGE[514]</small></h3>
<div id="notif_pane" ajxpClass="FetchedResultPane" ajxpOptions='{"forceClearOnRepoSwitch":true, "inlineToolbarOptions":{"toolbarsList":["inline-notifications"]}, "fit":"content", "columnsDef":[{"attributeName":"ajxp_label", "messageId":1, "sortType":"String"},{"attributeName":"event_description", "messageString":"Description", "sortType":"String"}], "reloadOnServerMessage":"tree/reload_user_feed", "silentLoading":true, "fixedSortColumn":"event_time", "fixedSortDirection":"desc","nodeProviderProperties":{"get_action":"get_my_feed", "connexion_discrete":true, "format":"xml", "current_repository":"true", "feed_type":"alert", "merge_description":"true"}, "emptyChildrenMessage":"notification_center.8"}'></div>
</div>
]]></additional_content>
</component_config>
</client_configs>
</registry_contributions>
<dependencies>
<activePlugin pluginName="core.conf"/>
</dependencies>
</ajxp_plugin>