Commit 3c85a9d9 authored by Xavier Guimard's avatar Xavier Guimard

Documentation for notifications system

parent 15e4a17b
......@@ -193,6 +193,10 @@
"4.3-Configure-Liberty-Alliance-fr.html">Utilisation de Liberty Alliance
pour la fédération d'identités (projet
FederID)</a></span> (fr)</li>
<li><span class="wikilink"><a href=
"/xwiki/bin/view/NG/Notifications">Syst&egrave;me de
notifications</a></span> (en)</li>
</ul>
<h3 class="heading-1-1"><span id="HProtectiondesapplications">Protection
......
......@@ -184,6 +184,10 @@
<li><span class="wikilink"><a href=
"4.3-Configure-Liberty-Alliance-fr.html">Liberty Alliance (FederID
project)</a></span> (fr)</li>
<li><span class="wikilink"><a href=
"/xwiki/bin/view/NG/Notifications">Notifications system</a></span>
(en)</li>
</ul>
<h3 class="heading-1-1"><span id="HApplicationprotection">Application
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org" />
<title>Lemonldap::NG documentation:
4.4-Configure-and-use-notification-system.html</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<style type="text/css">
/*<![CDATA[*/
body{
background: #ddd;
font-family: sans-serif;
font-size: 11pt;
padding: 0 50px;
}
div.main-content{
padding: 10px;
background: #fff;
border: 2px #ccc solid;
}
a{
text-decoration: none;
}
p.footer{
text-align: center;
margin: 5px 0 0 0;
}
.heading-1{
text-align: center;
color: orange;
font-variant: small-caps;
font-size: 20pt;
}
.heading-1-1{
color: orange;
font-size: 14pt;
border-bottom: 2px #ccc solid;
}
pre{
background: #eee;
border: 2px #ccc solid;
padding: 5px;
border-left: 10px #ccc solid;
}
ul.star li{
list-style-type: square;
}
/*]]>*/
</style>
</head>
<body>
<div class="main-content">
<h2 class="heading-1"><span id="HNotificationsystem">Notification
system</span></h2>
<p class="paragraph"></p>Since version 0.9.4, Lemonldap::NG can be used to
notify some messages to users: if a user has a message, the message will
be displayed when he will access to the portal. If the message contains
checkboxes, the user has to check all of them else he can not access to
the portal and get his session cookie.
<p class="paragraph"></p>
<ul>
<li>
<a href="#HInstallation">Installation</a>
<ul>
<li><a href="#HActivation">Activation</a></li>
<li><a href="#HStorage">Storage</a></li>
</ul>
</li>
<li>
<a href="#HUsingnotificationsystem">Using notification system</a>
<ul>
<li>
<a href="#HInsertnewnotifications">Insert new notifications</a>
<ul>
<li><a href="#HNotificationformat">Notification format</a></li>
<li><a href="#HInsertionexampleinPerl">Insertion example in
Perl</a></li>
</ul>
</li>
<li><a href="#HTestnotification">Test notification</a></li>
</ul>
</li>
</ul>
<h3 class="heading-1-1"><span id="HInstallation">Installation</span></h3>
<h4 class="heading-1-1-1"><span id="HActivation">Activation</span></h4>
<p class="paragraph"></p>You just have to set "notification =&gt; 1" in
the portal.
<h4 class="heading-1-1-1"><span id="HStorage">Storage</span></h4>
<p class="paragraph"></p>By default, notifications will be stored in the
same database as configuration&nbsp;:
<ul class="star">
<li>if you use "File" system and your "dirName" is set to
/usr/local/lemonldap-ng/conf/, the notifications will be stored in
/usr/local/lemonldap-ng/notifications/</li>
<li>if you use "DBI" system, the notifications will be stored in the
same database as configuration and in a table called "notifications".
You have to create the table by yourself&nbsp;</li>
</ul>
<div class="code">
<pre>
CREATE TABLE 'notifications' (
'date' datetime NOT NULL,
'uid' varchar(255) NOT NULL,
'ref' varchar(255) NOT NULL,
'xml' longblob NOT NULL,
'done' datetime <span class="java-keyword">default</span> NULL,
PRIMARY KEY ('date','uid','ref')
)
</pre>
</div>
<p class="paragraph"></p>You can change default parameters using the
"notificationStorage" parameter with the same syntax as configStorage.
Example&nbsp;:
<div class="code">
<pre>
notificationStorage =&gt; {
type =&gt; 'File',
dirName =&gt; '/<span class=
"java-keyword">var</span>/lib/lemonldap-ng/notifications/',
},
</pre>
</div>
<h3 class="heading-1-1"><span id="HUsingnotificationsystem">Using
notification system</span></h3>
<h4 class="heading-1-1-1"><span id="HInsertnewnotifications">Insert new
notifications</span></h4>
<p class="paragraph"></p>New notifications can be insert using SOAP
request (described in the WSDL file generated by buildPortalWSDL tool).
<h5 class="heading-1-1-1-1"><span id="HNotificationformat">Notification
format</span></h5>
<p class="paragraph"></p>Notifications are XML files containing&nbsp;:
<ul class="star">
<li>"&lt;notification&gt;" element(s) :
<ul class="star">
<li>required attributes :
<ul class="star">
<li>"date" in format YYYY-MM-DD</li>
<li>"ref" : a reference that can be used later to know what has
been notified and when</li>
<li>"uid" : the user (it must correspond to the attibute set in
whatToTrace parameter : uid by default)</li>
</ul>
</li>
<li>sub-elements :
<ul class="star">
<li>&lt;text&gt; : paragraph to display : inserted in HTML page
enclosed in &lt;p class="notifText"&gt;...&lt;/p&gt;)</li>
<li>&lt;check&gt; : paragraph to display with a checkbox :
inserted in HTML page enclosed in &lt;p
class="notifCheck"&gt;&lt;input
type="checkbox/&gt;...&lt;/p&gt;</li>
</ul>
</li>
</ul>
</li>
</ul>All other elements will be removed including HTML elemants like
&lt;b&gt;
<p class="paragraph"></p>Example :
<div class="code">
<pre>
&lt;?xml version=<span class="java-quote">"1.0"</span> encoding=<span class=
"java-quote">"UTF-8"</span> standalone=<span class=
"java-quote">"no"</span>?&gt;
&lt;root&gt;
&lt;notification uid=<span class=
"java-quote">"foo.bar"</span> date=<span class=
"java-quote">"2009-01-27"</span> reference=<span class=
"java-quote">"ABC"</span>&gt;
&lt;text&gt; You've been granted to access to appli-1 &lt;/text&gt;
&lt;text&gt; You've been granted to access to appli-2 &lt;/text&gt;
&lt;check&gt; I know that I can acces to appli-1 &lt;/check&gt;
&lt;check&gt; I know that I can acces to appli-2 &lt;/check&gt;
&lt;/notification&gt;
&lt;/root&gt;
</pre>
</div>
<h5 class="heading-1-1-1-1"><span id="HInsertionexampleinPerl">Insertion
example in Perl</span></h5>
<p class="paragraph"></p>
<div class="code">
<pre>
#!/usr/bin/perl<br /><br />use SOAP::Lite;
use utf8;<br /><br />my $lite = SOAP::Lite
-&gt;uri('urn:Lemonldap::NG::Common::CGI::SOAPService')
-&gt;proxy('http://auth.example.com/index.pl/notification');<br /><br />$r = $lite-&gt;newNotification('&lt;?xml version=<span class="java-quote">"1.0"</span> encoding=<span class="java-quote">"UTF-8"</span> standalone=<span class="java-quote">"no"</span>?&gt;
&lt;root&gt;
&lt;notification uid=<span class=
"java-quote">"foo.bar"</span> date=<span class=
"java-quote">"2009-01-27"</span> reference=<span class=
"java-quote">"ABC"</span>&gt;
&lt;text&gt; You've been granted to access to appli-1 &lt;/text&gt;
&lt;text&gt; You've been granted to access to appli-2 &lt;/text&gt;
&lt;check&gt; I know that I can acces to appli-1 &lt;/check&gt;
&lt;check&gt; I know that I can acces to appli-2 &lt;/check&gt;
&lt;/notification&gt;
&lt;/root&gt;');<br /><br /><span class=
"java-keyword">if</span> ( $r-&gt;fault ) {
print STDERR <span class=
"java-quote">"SOAP Error: "</span> . $r-&gt;fault-&gt;{faultstring};
}
<span class="java-keyword">else</span> {
my $res = $r-&gt;result();
print "$res notification(s) have been inserted";
}
</pre>
</div>
<h4 class="heading-1-1-1"><span id="HTestnotification">Test
notification</span></h4>
<p class="paragraph"></p>You've simply to insert a notification and
connect to the portal using the same UID. You will be prompted.
</div>
<p class="footer"><a href="index.html">Index</a></p>
</body>
</html>
......@@ -108,12 +108,12 @@
<img src="ok.png" alt="ok.png" /> Packages for RedHat/CentOS<br />
<h3 class="heading-1-1"><span id="HVersion1028200929">Version 1.0
(2009)</span></h3><img src="warning_triangle.png" alt=
"warning_triangle.png" /> Date and time parameters in access rules<br />
(2009)</span></h3><img src="ok.png" alt="ok.png" /> Notification
system<br />
<img src="warning_triangle.png" alt="warning_triangle.png" /> Date and
time parameters in access rules<br />
<img src="warning_triangle.png" alt="warning_triangle.png" /> Monitoring
scripts (MRTG, Cacti, Nagios)<br />
<img src="warning_triangle.png" alt="warning_triangle.png" /> Notification
system<br />
<img src="error.png" alt="error.png" /> Handler POST functionnalities, to
fill authentication forms with login/password<br />
<img src="error.png" alt="error.png" /> Portal and Manager trigger system,
......@@ -126,6 +126,9 @@
<img src="error.png" alt="error.png" /> Change configuration storage to
XML<br />
<img src="error.png" alt="error.png" /> Normalize logs messages<br />
<img src="error.png" alt="error.png" /> Multiple cookies (<span class=
"wikilink"><a href="/xwiki/bin/view/NG/MultipleCookies">learn
more</a></span>)<br />
<h3 class="heading-1-1"><span id="HVersion2028201029">Version 2.0
(2010)</span></h3><img src="error.png" alt="error.png" /> Rewrite Manager
......
......@@ -71,6 +71,7 @@
<li><a href="4.2-Configure-password-policy.html">4.2 Configure password policy</a></li>
<li><a href="4.3-Configure-Liberty-Alliance-fr.html">4.3 Configure Liberty Alliance (FR)</a></li>
<li><a href="4.3-Configure-SOAP-fr.html">4.3 Configure SOAP (FR)</a></li>
<li><a href="4.4-Configure-and-use-notification-system.html">4.4 Configure and use notification system</a></li>
<li><a href="5-Appli-Dokuwiki.html">5 Appli Dokuwiki</a></li>
<li><a href="5-Appli-HTTP-Basic-Authentication.html">5 Appli HTTP Basic Authentication</a></li>
<li><a href="5-Appli-Sympa.html">5 Appli Sympa</a></li>
......
......@@ -27,6 +27,7 @@ my $docs = {
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/LDAPSchema' => '4.2-Configure-LDAP-schema.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocSOAP?language=fr' => '4.3-Configure-SOAP-fr.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocLA?language=fr' => '4.3-Configure-Liberty-Alliance-fr.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/Notifications' => '4.4-Configure-and-use-notification-system.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocAppSympa' => '5-Appli-Sympa.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocAppTomcatValve' => '5-Appli-Tomcat-Valve.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocAppDokuwiki' => '5-Appli-Dokuwiki.html',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment