mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 20:47:57 +01:00
UI updates.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2073 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
b8a72c2f04
commit
de84ef5d36
8 changed files with 201 additions and 68 deletions
|
@ -1,11 +1,11 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<title>Smack Extensions User Manual</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
</head>
|
||||
|
||||
<frameset cols="26%,74%">
|
||||
<frameset cols="200,*">
|
||||
<frame src="toc.html" name="navFrame" target="mainFrame">
|
||||
<frame src="intro.html" name="mainFrame">
|
||||
</frameset>
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Smack Extensions User Manual</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Smack Extensions Manual</h1>
|
||||
<div class="header">Smack Extensions Manual</div>
|
||||
<p>The XMPP protocol includes a base protocol and many optional extensions. Smack provides the
|
||||
org.jivesoftware.smack package for the core XMPP protocol, and the org.jivesoftware.smackx package for
|
||||
many of the protocol extensions.</p>
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<title>Message Events</title>
|
||||
<title>Message Events</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Message Events Support</h1>
|
||||
<div class="header">Message Events</div><p>
|
||||
|
||||
This extension is used to request and respond to events relating to the delivery,
|
||||
display, and composition of messages. There are three stages in this extension: 1) Request for
|
||||
event notifications, 2) Receive the event notification requests and send event notifications, and
|
||||
3) Receive the event notifications.
|
||||
display, and composition of messages. There are three stages in this extension:<ol>
|
||||
<li>Request for event notifications,
|
||||
<li>Receive the event notification requests and send event notifications, and
|
||||
<li>Receive the event notifications.</ol>
|
||||
<p>For more information on each stage please follow these links:</p>
|
||||
<ul>
|
||||
<li><a href="#reqevnot">Requesting Event Notifications</a></li>
|
||||
|
@ -20,19 +21,23 @@ event notifications, 2) Receive the event notification requests and send event n
|
|||
</ul>
|
||||
<b>JEP related:</b> <a href="http://www.jabber.org/jeps/jep-0022.html">JEP-22</a>
|
||||
<hr>
|
||||
<h2><a name="reqevnot">Requesting Event Notifications</a></h2>
|
||||
<h3>Description</h3>
|
||||
<div class="subheader"><a name="reqevnot">Requesting Event Notifications</a></div><p>
|
||||
<b>Description</b><p>
|
||||
|
||||
In order to receive event notifications for a given message you first have to specify
|
||||
which events are you interested in. Each message that you send has to request its own event
|
||||
notifications. Therefore, every message that you send as part of a chat should request its own event
|
||||
notifications.
|
||||
<h3>Usage</h3>
|
||||
notifications.</p>
|
||||
|
||||
<b>Usage</b><p>
|
||||
|
||||
The class <i>MessageEventManager</i> provides an easy way for requesting event notifications. All you have to do is specify
|
||||
the message that requires the event notifications and the events that you are interested in.
|
||||
<p>Use the static method <i><b>MessageEventManager.addNotificationsRequests(Message message, boolean offline, boolean
|
||||
delivered, boolean displayed, boolean composing)</b></i> for requesting event notifications.
|
||||
</p>
|
||||
<h3>Example</h3>
|
||||
|
||||
<b>Example</b><p>
|
||||
Below you can find an example that logs in a user to the server, creates a message, adds the requests
|
||||
for notifications and sends the message.
|
||||
<blockquote>
|
||||
|
@ -55,12 +60,18 @@ for notifications and sends the message.
|
|||
chat1.sendMessage(msg);
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<hr>
|
||||
<h2><a name="lstevnotreq">Reacting to Event Notification Requests</a></h2>
|
||||
<h3>Description</h3>
|
||||
|
||||
<div class="subheader"><a name="lstevnotreq">Reacting to Event Notification Requests</a></div><p>
|
||||
|
||||
<b>Description</b><p>
|
||||
|
||||
You can receive notification requests for the following events: delivered, displayed, composing and offline. You
|
||||
<b>must</b> listen for these requests and react accordingly.
|
||||
<h3>Usage</h3>
|
||||
<b>must</b> listen for these requests and react accordingly.</p>
|
||||
|
||||
<b>Usage</b><p>
|
||||
|
||||
The general idea is to create a new <i>DefaultMessageEventRequestListener</i> that will listen to the event notifications
|
||||
requests and react with custom logic. Then you will have to add the listener to the
|
||||
<i>MessageEventManager</i> that works on
|
||||
|
@ -78,8 +89,10 @@ implements the <i>MessageEventRequestListener</i> interface, please remember to
|
|||
</li>
|
||||
<li>To add a listener to the messageEventManager use the MessageEventManager's message
|
||||
<i><b>addMessageEventRequestListener(MessageEventRequestListener)</b></i>.</li>
|
||||
</ul>
|
||||
<h3>Example</h3>
|
||||
</ul></p>
|
||||
|
||||
<b>Example</b><p>
|
||||
|
||||
Below you can find an example that connects two users to the server. One user will create a message, add the requests
|
||||
for notifications and will send the message to the other user. The other user will add a
|
||||
<i>DefaultMessageEventRequestListener</i>
|
||||
|
@ -150,13 +163,19 @@ to a <i>MessageEventManager</i> that will listen and react to the event notifica
|
|||
messageEventManager.sendCancelledNotification(user1, msg.getPacketID());
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<hr>
|
||||
<h2><a name="lstevnot">Reacting to Event Notifications</a></h2>
|
||||
<h3>Description</h3>
|
||||
|
||||
<div clas="subheader"><a name="lstevnot">Reacting to Event Notifications</a></div><p>
|
||||
|
||||
<b>Description</b><p>
|
||||
|
||||
Once you have requested for event notifications you will start to receive notifications of events. You can
|
||||
receive notifications of the following events: delivered, displayed, composing, offline and cancelled. You
|
||||
will probably want to react to some or all of these events.
|
||||
<h3>Usage</h3>
|
||||
will probably want to react to some or all of these events.</p>
|
||||
|
||||
<b>Usage</b><p>
|
||||
|
||||
The general idea is to create a new <i>MessageEventNotificationListener</i> that will listen to the event notifications
|
||||
and react with custom logic. Then you will have to add the listener to the <i>MessageEventManager</i> that works on
|
||||
the desired <i>XMPPConnection</i>.
|
||||
|
@ -168,8 +187,9 @@ the desired <i>XMPPConnection</i>.
|
|||
</li>
|
||||
<li>To add a listener to the messageEventManager use the MessageEventManager's message
|
||||
<i><b>addMessageEventNotificationListener(MessageEventNotificationListener)</b></i>.</li>
|
||||
</ul>
|
||||
<h3>Example</h3>
|
||||
</ul></p>
|
||||
|
||||
<b>Example</b><p>
|
||||
Below you can find an example that logs in a user to the server, adds a <i>MessageEventNotificationListener</i>
|
||||
to a <i>MessageEventManager</i> that will listen and react to the event notifications, creates a message, adds
|
||||
the requests for notifications and sends the message.
|
||||
|
|
|
@ -1,14 +1,29 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<title>Private Data</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Private Data Support</h1>
|
||||
Coming soon
|
||||
<div class="header">Private Data</div><p>
|
||||
|
||||
Manages private data, which is a mechanism to allow users to store arbitrary XML
|
||||
data on an XMPP server. Each private data chunk is defined by a element name and
|
||||
XML namespace. Example private data:
|
||||
|
||||
<pre>
|
||||
<color xmlns="http://example.com/xmpp/color">
|
||||
<favorite>blue</blue>
|
||||
<leastFavorite>puce</leastFavorite>
|
||||
</color>
|
||||
</pre><p>
|
||||
|
||||
<b>JEP related:</b> <a href="http://www.jabber.org/jeps/jep-0049.html">JEP-49</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<em>More coming soon.</em>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<title>Roster Item Exchange</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Roster Item Exchange Support</h1>
|
||||
<div class="header">Roster Item Exchange</div><p>
|
||||
This extension is used to send rosters, roster groups and roster entries from one XMPP
|
||||
Entity to another. It also provides an easy way to hook up custom logic when entries
|
||||
are received from other XMPP clients.
|
||||
|
@ -19,16 +18,24 @@ are received from other XMPP clients.
|
|||
<li><a href="#riercventry">Receive roster entries</a></li>
|
||||
</ul>
|
||||
<b>JEP related:</b> <a href="http://www.jabber.org/jeps/jep-0093.html">JEP-93</a>
|
||||
|
||||
<hr>
|
||||
<h2><a name="riesendroster">Send a complete roster</a></h2>
|
||||
<h3>Description</h3>
|
||||
|
||||
<div class="subheader"><a name="riesendroster">Send a entire roster</a></div><p>
|
||||
|
||||
<b>Description</b><p>
|
||||
|
||||
Sometimes it is useful to send a whole roster to another user. Smack provides a
|
||||
very easy way to send a complete roster to another XMPP client.
|
||||
<h3>Usage</h3>
|
||||
very easy way to send a complete roster to another XMPP client.</p>
|
||||
|
||||
<b>Usage</b><p>
|
||||
|
||||
Create an instance of <i><b>RosterExchangeManager</b></i> and use the <b>#send(Roster, String)</b>
|
||||
message to send a roster to a given user. The first parameter is the roster to send and
|
||||
the second parameter is the id of the user that will receive the roster entries.
|
||||
<h3>Example</h3>
|
||||
the second parameter is the id of the user that will receive the roster entries.</p>
|
||||
|
||||
<b>Example</b><p>
|
||||
|
||||
In this example we can see how user1 sends his roster to user2.
|
||||
<blockquote>
|
||||
<pre> <font color="#3f7f5f">// Connect to the server and log in</font>
|
||||
|
@ -41,16 +48,24 @@ In this example we can see how user1 sends his roster to user2.
|
|||
rosterExchangeManager.send(conn1.getRoster(), user2);
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<hr>
|
||||
<h2><a name="riesendgroup">Send a roster's group</a></h2>
|
||||
<h3>Description</h3>
|
||||
|
||||
<div class="subheader"><a name="riesendgroup">Send a roster group</a></div><p>
|
||||
|
||||
<b>Description</b><p>
|
||||
|
||||
It is also possible to send a roster group to another XMPP client. A roster group groups
|
||||
a set of roster entries under a name.
|
||||
<h3>Usage</h3>
|
||||
a set of roster entries under a name.</p>
|
||||
|
||||
<b>Usage</b><p>
|
||||
|
||||
Create an instance of <i><b>RosterExchangeManager</b></i> and use the <b>#send(RosterGroup, String)</b>
|
||||
message to send a roster group to a given user. The first parameter is the roster group to send and
|
||||
the second parameter is the id of the user that will receive the roster entries.
|
||||
<h3>Example</h3>
|
||||
the second parameter is the id of the user that will receive the roster entries.</p>
|
||||
|
||||
<b>Example</b><p>
|
||||
|
||||
In this example we can see how user1 sends his roster groups to user2.
|
||||
<blockquote>
|
||||
<pre> <font color="#3f7f5f">// Connect to the server and log in</font>
|
||||
|
@ -64,16 +79,24 @@ In this example we can see how user1 sends his roster groups to user2.
|
|||
rosterExchangeManager.send((RosterGroup)it.next(), user2);
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<hr>
|
||||
<h2><a name="riesendentry">Send a roster's entry</a></h2>
|
||||
<h3>Description</h3>
|
||||
|
||||
<div class="subheader"><a name="riesendentry">Send a roster entry</a></div><p>
|
||||
|
||||
<b>Description</b><p>
|
||||
|
||||
Sometimes you may need to send a single roster entry to another XMPP client. Smack also lets you send
|
||||
items at this granularity level.
|
||||
<h3>Usage</h3>
|
||||
items at this granularity level.</p>
|
||||
|
||||
<b>Usage</b><p>
|
||||
|
||||
Create an instance of <i><b>RosterExchangeManager</b></i> and use the <b>#send(RosterEntry, String)</b>
|
||||
message to send a roster entry to a given user. The first parameter is the roster entry to send and
|
||||
the second parameter is the id of the user that will receive the roster entries.
|
||||
<h3>Example</h3>
|
||||
the second parameter is the id of the user that will receive the roster entries.</p>
|
||||
|
||||
<b>Example</b><p>
|
||||
|
||||
In this example we can see how user1 sends a roster entry to user2.
|
||||
<blockquote>
|
||||
<pre> <font color="#3f7f5f">// Connect to the server and log in</font>
|
||||
|
@ -86,19 +109,28 @@ In this example we can see how user1 sends a roster entry to user2.
|
|||
rosterExchangeManager1.send((RosterEntry)conn1.getRoster().getEntries().next(), user2);
|
||||
</pre>
|
||||
</blockquote>
|
||||
<hr><h2><a name="riercventry">Receive roster entries</a></h2>
|
||||
<h3>Description</h3>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="subheader"><a name="riercventry">Receive roster entries</a></div><p>
|
||||
|
||||
<b>Description</b><p>
|
||||
|
||||
Since roster items are sent between XMPP clients, it is necessary to listen to possible roster entries
|
||||
receptions. Smack provides a mechanism that you can use to execute custom logic when roster entries are
|
||||
received.
|
||||
<h3>Usage</h3>
|
||||
received.</p>
|
||||
|
||||
<b>Usage</b><p>
|
||||
|
||||
<ol>
|
||||
<li>Create a class that implements the <i><b>RosterExchangeListener</b></i> interface.</li>
|
||||
<li>Implement the method <b>entriesReceived(String, Iterator)</b> that will be called when new entries
|
||||
are received with custom logic.</li>
|
||||
<li>Add the listener to the <i>RosterExchangeManager</i> that works on the desired <i>XMPPConnection</i>.</li>
|
||||
</ol>
|
||||
<h3>Example</h3>
|
||||
</ol></p>
|
||||
|
||||
<b>Example</b><p>
|
||||
|
||||
In this example we can see how user1 sends a roster entry to user2 and user2 adds the received
|
||||
entries to his roster.
|
||||
<blockquote>
|
||||
|
|
57
documentation/extensions/style.css
Normal file
57
documentation/extensions/style.css
Normal file
|
@ -0,0 +1,57 @@
|
|||
BODY {
|
||||
font-size : 100%;
|
||||
background-color : #fff;
|
||||
}
|
||||
BODY, TD, TH {
|
||||
font-family : tahoma, arial, helvetica;
|
||||
font-size : 0.8em;
|
||||
}
|
||||
PRE, TT, CODE {
|
||||
font-family : courier new, monospaced;
|
||||
font-size : 1.0em;
|
||||
}
|
||||
A:hover {
|
||||
text-decoration : none;
|
||||
}
|
||||
LI {
|
||||
padding-bottom : 4px;
|
||||
}
|
||||
.header {
|
||||
font-size : 1.4em;
|
||||
font-weight : bold;
|
||||
width : 100%;
|
||||
border-bottom : 1px #ccc solid;
|
||||
padding-bottom : 2px;
|
||||
}
|
||||
.subheader {
|
||||
font-size: 1.1em;
|
||||
font-weight : bold;
|
||||
}
|
||||
.footer {
|
||||
font-size : 0.8em;
|
||||
color : #999;
|
||||
text-align : center;
|
||||
width : 100%;
|
||||
border-top : 1px #ccc solid;
|
||||
padding-top : 2px;
|
||||
}
|
||||
.code {
|
||||
border : 1px #ccc solid;
|
||||
padding : 0em 1.0em 0em 1.0em;
|
||||
margin : 4px 0px 4px 0px;
|
||||
}
|
||||
.nav, .nav A {
|
||||
font-family : verdana;
|
||||
font-size : 0.85em;
|
||||
color : #600;
|
||||
text-decoration : none;
|
||||
font-weight : bold;
|
||||
}
|
||||
.nav {
|
||||
width : 100%;
|
||||
border-bottom : 1px #ccc solid;
|
||||
padding : 3px 3px 5px 1px;
|
||||
}
|
||||
.nav A:hover {
|
||||
text-decoration : underline;
|
||||
}
|
|
@ -1,14 +1,21 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<title>Time</title>
|
||||
<head>
|
||||
<title>Time</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Time Exchange Support</h1>
|
||||
Coming soon
|
||||
<div class="header">Entity Time Exchange</div><p>
|
||||
|
||||
Supports a protocol that XMPP clients use to exchange their respective local
|
||||
times and time zones.<p>
|
||||
|
||||
<b>JEP related:</b> <a href="http://www.jabber.org/jeps/jep-0090.html">JEP-90</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<em>More coming soon.</em>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<title>Smack Extensions User Manual</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
<base target="mainFrame">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<a href="intro.html">Introduction</a>
|
||||
<h3>Smack extensions</h3>
|
||||
<a href="intro.html">Introduction</a><p>
|
||||
|
||||
<div class="subheader">Smack Extensions</div><p>
|
||||
|
||||
<a href="privatedata.html">Private Data</a><br>
|
||||
<a href="messageevents.html">Message Events</a><br>
|
||||
<a href="rosterexchange.html">Roster Item Exchange</a><br>
|
||||
|
|
Loading…
Reference in a new issue