?? x780.htm
字號:
<HTML
><HEAD
><TITLE
>Browsing</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
"><LINK
REL="HOME"
TITLE="Programming Jabber"
HREF="book1.htm"><LINK
REL="UP"
TITLE="Inside Jabber"
HREF="c445.htm"><LINK
REL="PREVIOUS"
TITLE="XML-RPC and SOAP"
HREF="x775.htm"><LINK
REL="NEXT"
TITLE="Installing the Jabber Server"
HREF="c813.htm"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Programming Jabber</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x775.htm"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. Inside Jabber</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="c813.htm"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="JABTDG-CH-2-SECT-2.9"
>Browsing</A
></H1
><P
><I
CLASS="EMPHASIS"
>"All sorts of entities and services."</I
> The more pervasive
Jabber becomes, and the more uses to which it is put, the larger the
world of entities grows. And therein lies the challenge. How can we
identify, organize and navigate these entities in any useful way? Within
the relatively narrow world of IM, the entities that exist (the IM users)
and the hierarchies and relationships that are formed between them
(where the only hierarchies are in the form of user
rosters) don't really present much of a problem; as all the entities are
users, there's no classification problem, and there's no hierarchical
navigation problem. But within a system that regards users, applications,
and services as equals (the unifying concept of a JID is an especially
powerful device here), we need to have some way of searching, traversing,
discovering, and querying these entities that is consistent regardless
of what those entities are. Enter <I
CLASS="EMPHASIS"
>Jabber Browsing</I
>.</P
><P
>Browsing was introduced with the 1.4
Jabber server to solve some specific problems with service discovery: how
clients found out about what services (say, what IM transports) were
available on the Jabber server that they were connected to. The namespace
mechanism that supported this discovery (<TT
CLASS="LITERAL"
>jabber:iq:agents</TT
>)
was found to be too restrictive, and more importantly, too specific.
What was needed was a more generic way of describing entities in the Jabber
world. </P
><P
>Browsing has since grown from that single problem space and can now be found
in Jabber software everywhere. Want to find out what a user's client is
capable of (so you can interact with it) or what it otherwise offers? Just
browse to it. Want to find out what conference rooms currently exist on a
particular conference service? Browse that service. Want to take a peek
to see who's in one of the rooms? Navigate down one level to browse to
the room.
<A
NAME="AEN788"
HREF="#FTN.AEN788"
>[1]</A
> </P
><P
>There are three key elements that make browsing so flexible and so
powerful:</P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>Categorization</DT
><DD
><P
>Browsing follows the MIME model in defining categories and subcategories,
but rather than <I
CLASS="EMPHASIS"
>content</I
> being categorized
(<TT
CLASS="LITERAL"
>text/plain</TT
>, <TT
CLASS="LITERAL"
>image/png</TT
>, and so on),
the categorization in browsing is of
of entities that can be browsed to. Categories are used to
describe users, services, agents, conferencing mechanism, applications,
and so on. Within these categories, the subcategories are used to make
finer distinctions. </P
></DD
><DT
>Identification</DT
><DD
><P
>Every entity described in browsing is identifiable by a JID; the world
is homogenized, so to speak. The JID is the key to browsing navigation as,
when listed in a browse result as identifiation for an entity, that JID
can be used as the target of the <I
CLASS="EMPHASIS"
>next</I
> browse request.</P
></DD
><DT
>Hierarchy</DT
><DD
><P
>Browsing describes entities in the Jabber world. But the world isn't
<I
CLASS="EMPHASIS"
>flat</I
> ... it's hierarchical! Relationships between
entities are easily established and described by placing browse information
in hierarchies. These hierarchies represented in XML.
A typical browse response might contain descriptions of entities on
one or two levels. These levels can be navigated simply by choosing the
JID of the desired node and making a further browse request, creating
an instant "drill-down" method of accessing information.
'drill-down'.</P
></DD
></DL
></DIV
><P
>So, Jabber entities can be classified, given identities, organized into
hierarchies, and navigated. What takes place from there is really down
to the imagination. But what <I
CLASS="EMPHASIS"
>is</I
> a Jabber entity?
For the sake of argument, let's say it's anything that has a JID.
Does having a JID presume having an IM user account with a Jabber
server? Not necessarily, as we'll see. So as long as we assign a JID to
something we wish to include in the Jabber world, most anything goes.
In <A
HREF="x10201.htm"
>the section called <I
>Browsing LDAP</I
> in Chapter 9</A
> we build an LDAP
'reflector' service that enables us to browse LDAP information from within
our Jabber clients.</P
><P
>Browsing is a
combination—a culmination even—of many of the Jabber
features. Browsing is carried out in the context of the
IQ request/response mechanism, and uses a namespace-qualified payload
to carry the data whose
hierarchy is naturally expressed in XML. And it bridges, philosophically
and technically, the distances between the Jabber and non-Jabber spaces.</P
></DIV
><H3
CLASS="FOOTNOTES"
>Notes</H3
><TABLE
BORDER="0"
CLASS="FOOTNOTES"
WIDTH="100%"
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN788"
HREF="x780.htm#AEN788"
>[1]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>If this is permitted by the room.</P
></TD
></TR
></TABLE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x775.htm"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.htm"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="c813.htm"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>XML-RPC and SOAP</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c445.htm"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Installing the Jabber Server</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -