diff --git a/documentation/extensions/index.html b/documentation/extensions/index.html index b6a6805d6..e22836b9c 100644 --- a/documentation/extensions/index.html +++ b/documentation/extensions/index.html @@ -1,11 +1,11 @@ - Smack Extensions User Manual + - + diff --git a/documentation/extensions/intro.html b/documentation/extensions/intro.html index 0a8c789d2..afe1929dc 100644 --- a/documentation/extensions/intro.html +++ b/documentation/extensions/intro.html @@ -1,10 +1,11 @@ Smack Extensions User Manual + -

Smack Extensions Manual

+
Smack Extensions Manual

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.

diff --git a/documentation/extensions/messageevents.html b/documentation/extensions/messageevents.html index 5b3851111..23413f98f 100644 --- a/documentation/extensions/messageevents.html +++ b/documentation/extensions/messageevents.html @@ -1,17 +1,18 @@ - - -Message Events + Message Events + -

Message Events Support

+
Message Events

+ 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:

    +
  1. Request for event notifications, +
  2. Receive the event notification requests and send event notifications, and +
  3. Receive the event notifications.

For more information on each stage please follow these links:

JEP related: JEP-22
-

Requesting Event Notifications

-

Description

+
Requesting Event Notifications

+Description

+ 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. -

Usage

+notifications.

+ +Usage

+ The class MessageEventManager 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.

Use the static method MessageEventManager.addNotificationsRequests(Message message, boolean offline, boolean delivered, boolean displayed, boolean composing) for requesting event notifications.

-

Example

+ +Example

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.

@@ -55,12 +60,18 @@ for notifications and sends the message. chat1.sendMessage(msg);
+
-

Reacting to Event Notification Requests

-

Description

+ +
Reacting to Event Notification Requests

+ +Description

+ You can receive notification requests for the following events: delivered, displayed, composing and offline. You -must listen for these requests and react accordingly. -

Usage

+must listen for these requests and react accordingly.

+ +Usage

+ The general idea is to create a new DefaultMessageEventRequestListener that will listen to the event notifications requests and react with custom logic. Then you will have to add the listener to the MessageEventManager that works on @@ -78,8 +89,10 @@ implements the MessageEventRequestListener interface, please remember to

  • To add a listener to the messageEventManager use the MessageEventManager's message addMessageEventRequestListener(MessageEventRequestListener).
  • - -

    Example

    +

    + +Example

    + 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 DefaultMessageEventRequestListener @@ -150,13 +163,19 @@ to a MessageEventManager that will listen and react to the event notifica messageEventManager.sendCancelledNotification(user1, msg.getPacketID()); +


    -

    Reacting to Event Notifications

    -

    Description

    + +
    Reacting to Event Notifications

    + +Description

    + 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. -

    Usage

    +will probably want to react to some or all of these events.

    + +Usage

    + The general idea is to create a new MessageEventNotificationListener that will listen to the event notifications and react with custom logic. Then you will have to add the listener to the MessageEventManager that works on the desired XMPPConnection. @@ -168,8 +187,9 @@ the desired XMPPConnection.

  • To add a listener to the messageEventManager use the MessageEventManager's message addMessageEventNotificationListener(MessageEventNotificationListener).
  • - -

    Example

    +

    + +Example

    Below you can find an example that logs in a user to the server, adds a MessageEventNotificationListener to a MessageEventManager that will listen and react to the event notifications, creates a message, adds the requests for notifications and sends the message. diff --git a/documentation/extensions/privatedata.html b/documentation/extensions/privatedata.html index a00defc81..4d0f65887 100644 --- a/documentation/extensions/privatedata.html +++ b/documentation/extensions/privatedata.html @@ -1,14 +1,29 @@ - - Private Data + -

    Private Data Support

    -Coming soon +
    Private Data

    + +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: + +

    +<color xmlns="http://example.com/xmpp/color">
    +    <favorite>blue</blue>
    +    <leastFavorite>puce</leastFavorite>
    +</color>
    +

    + +JEP related: JEP-49 + +


    + +More coming soon. diff --git a/documentation/extensions/rosterexchange.html b/documentation/extensions/rosterexchange.html index 53d3ac94e..e014da111 100644 --- a/documentation/extensions/rosterexchange.html +++ b/documentation/extensions/rosterexchange.html @@ -1,13 +1,12 @@ - - Roster Item Exchange + -

    Roster Item Exchange Support

    +
    Roster Item Exchange

    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.

  • Receive roster entries
  • JEP related: JEP-93 +
    -

    Send a complete roster

    -

    Description

    + +
    Send a entire roster

    + +Description

    + 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. -

    Usage

    +very easy way to send a complete roster to another XMPP client.

    + +Usage

    + Create an instance of RosterExchangeManager and use the #send(Roster, String) 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. -

    Example

    +the second parameter is the id of the user that will receive the roster entries.

    + +Example

    + In this example we can see how user1 sends his roster to user2.

          // Connect to the server and log in
    @@ -41,16 +48,24 @@ In this example we can see how user1 sends his roster to user2.
           rosterExchangeManager.send(conn1.getRoster(), user2);
     
    +
    -

    Send a roster's group

    -

    Description

    + +
    Send a roster group

    + +Description

    + 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. -

    Usage

    +a set of roster entries under a name.

    + +Usage

    + Create an instance of RosterExchangeManager and use the #send(RosterGroup, String) 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. -

    Example

    +the second parameter is the id of the user that will receive the roster entries.

    + +Example

    + In this example we can see how user1 sends his roster groups to user2.

          // Connect to the server and log in
    @@ -64,16 +79,24 @@ In this example we can see how user1 sends his roster groups to user2.
               rosterExchangeManager.send((RosterGroup)it.next(), user2);
     
    +
    -

    Send a roster's entry

    -

    Description

    + +
    Send a roster entry

    + +Description

    + Sometimes you may need to send a single roster entry to another XMPP client. Smack also lets you send -items at this granularity level. -

    Usage

    +items at this granularity level.

    + +Usage

    + Create an instance of RosterExchangeManager and use the #send(RosterEntry, String) 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. -

    Example

    +the second parameter is the id of the user that will receive the roster entries.

    + +Example

    + In this example we can see how user1 sends a roster entry to user2.

          // Connect to the server and log in
    @@ -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);
      
    -

    Receive roster entries

    -

    Description

    + +
    + +
    Receive roster entries

    + +Description

    + 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. -

    Usage

    +received.

    + +Usage

    +

    1. Create a class that implements the RosterExchangeListener interface.
    2. Implement the method entriesReceived(String, Iterator) that will be called when new entries are received with custom logic.
    3. Add the listener to the RosterExchangeManager that works on the desired XMPPConnection.
    4. -
    -

    Example

    +

    + +Example

    + In this example we can see how user1 sends a roster entry to user2 and user2 adds the received entries to his roster.

    diff --git a/documentation/extensions/style.css b/documentation/extensions/style.css new file mode 100644 index 000000000..5fbf1a70f --- /dev/null +++ b/documentation/extensions/style.css @@ -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; +} \ No newline at end of file diff --git a/documentation/extensions/time.html b/documentation/extensions/time.html index 20bd5c13d..7c00efa77 100644 --- a/documentation/extensions/time.html +++ b/documentation/extensions/time.html @@ -1,14 +1,21 @@ - - - -Time + + Time + -

    Time Exchange Support

    -Coming soon +
    Entity Time Exchange

    + +Supports a protocol that XMPP clients use to exchange their respective local +times and time zones.

    + +JEP related: JEP-90 + +


    + +More coming soon. diff --git a/documentation/extensions/toc.html b/documentation/extensions/toc.html index 5a19e0097..aa23f0a94 100644 --- a/documentation/extensions/toc.html +++ b/documentation/extensions/toc.html @@ -1,15 +1,16 @@ - - Smack Extensions User Manual + -Introduction -

    Smack extensions

    +Introduction

    + +

    Smack Extensions

    + Private Data
    Message Events
    Roster Item Exchange