summaryrefslogtreecommitdiffstats
path: root/README.txt
blob: 61e9d3a5fd3b526a40ffffee46732b78c3785c7c (plain)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
Drupal Hub

Created by Aaron Winborn
winborn@advomatic.com
Begun 16 January 2006

Drupal Hub is an api to allow a server to act as a portal to other web servers.
It associates a specific CCK content type with web listings, and optionally
allows the client servers to create and update their own listings, using xml.

------------
Installation
------------

1) Copy the drupal_hub folder into the modules directory of your Drupal 5.0 installation.
2) Go to the modules administration page and activate the desired modules. drupal_hub.module
   is required at a minimum.

Hub Server
----------

If you wish to act as a Drupal Hub server

3) Create a CCK type with the fields you wish to collect from other servers.
   At a minimum, you will need fields for the title (corresponds to site name),
   url, and description/mission.
4) Go to the Drupal Hub administration page and link the new type to your hub.
5) Link specific fields with the fields to collect information about.
6) Set the other configuration options as appropriate.

Hub Client
----------

If you wish your site to register with & update another specific Hub server

7) Fill in the information for each server you wish to notify.

-----
Usage
-----

Because this module is tied to CCK functionality, administrators of a Hub server may
use other modules to control listing functionality. For instance, they may use the
Views module to display listings as they wish, or they may create an event node type
with nodereference to allow clients to create events tied to their client servers.

As the module provides an API, other modules may extend the Hub module functionality.
For instance, RPG Hub will allow Hub servers to collect game statistics and information.

-----------------
Technical Details
-----------------

When the administrator of a client server enters the information of the hub server they
wish to register with, the client will request an xml document from the hub server. This
document will contain the information the hub server requires, plus a unique code.

After the administrator submits the required information, the information is stored in
the client server (and may be modified at any time). After any submission or modification,
the client again pings the hub server with the unique code.

After confirmation, the hub server will periodically check client servers, using the cron (and
a configurable time duration). It will request an xml document from the client, which must
contain both the unique identifier code and the other required information.

------------------------
Hub Server Configuration
------------------------

A Hub server will associate individual clients with nodes of a specific content type.
So first, an administrator must create and assign a node type to hub clients. They will
need, at a minimum, fields for the client site's title, url, and description. They may
assign any other fields as desired. From the Hub server administration page, the
administrator will then assign the node type for clients.

After this, when Hub clients have registered with the site, they will be available as a
paginated listing from the administration page, with various options available for mass
edits, such as ping, publish/unpublish, promote, or block.

Using the Views module, various listing pages and blocks can be created to harness the
power of the Hub module. If the Views module is enabled, some basic views will be made
available to the Views administration page.

------------------------
Hub Client Configuration
------------------------

After initially registering with a Hub server, a hub client will respond to periodic pings,
giving the status of that server, plus any special messages. An administrator may update
their information at any time from their admin screens, and the client will notify the Hub
server at the next ping that the info needs to be updated.

A Hub client may optionally display a block/page of information of the Hub servers they
are linked to. The Hub servers will send an html block to be displayed with a link. This
may, for instance, have a small image or brief description. This information will be
configurable by the client administrator.

-------------
Specification
-------------

All communication between the Hub server and client will use XML scripting. $clienthash and
$serverhash will be unique random variables created by each specific server. All communication will
be verified on both ends by checking these values.

Registration:
The Hub client (www.example.com) will access a page from the hub server (www.examplehub.com)
as follows:

http://www.examplehub.com/hub/xml/register?url=http://www.example.com&clienthash=xe3Fi8cPq914sQ5cORv3

In response, the Hub server will send an XML document similar to the following:

<xml>
  <clienthash>xe3Fi8cPq914sQ5cORv3</clienthash>
  <serverhash>ichEH83Cde492Ipz4H1d</serverhash>
  <huburl>http://www.examplehub.com</huburl>
  <hubversion>hub.module#1.0.72</hubversion>
  <fields>
    <title>
      <type>textfield</type>
      <title>Site Name</title>
      <default>site_name</default>
      <required>1</required>
    </title>
    <description>
      <type>textarea</type>
      <title>Site Description</title>
      <default>site_mission</default>
      <required>1</required>
    </description>
    <logo>
      <type>textfield</type>
      <title>Logo</title>
      <description>You may add a link to a logo for your site, which must be an image no larger
        than 80x120 pixels.</description>
      <required>0</required>
    </logo>
  </fields>
  <hubblock>
    <title>Example Hub</title>
    <logo>http://www.examplehub.com/files/hublogo.png</logo>
    <description>We're listed at the best Example hub ever!</description>
  </hubblock>
</xml>

After this, the Hub client administrator will now see a form (in a fieldset under the new Hub server)
on the administration page at /admin/hub/client. The form will look something like the following:

Hub Server: http://www.examplehub.com
Hub Server Version: hub.module#1.0.72

Site Name: *
  +-----------------------------+
  | Example dot com             |
  +-----------------------------+

Site Description: *
  +---------------------------------------+
  | This is the site mission for Example  |
  | dot com, the most used site for       |
  | example tutorials on the Internet!    |
  +---------------------------------------+

Logo:
  +---------------------------------------+
  | http://www.example.com/files/logo.jpg |
  +---------------------------------------+

Status:
  (Dropdown w/ following:
    Active
    Offline
  )

Hub Server Block:

  A new block will be created for you to optionally display. As currently configured, it will
  appear as follows:

  {=================}  Example Hub
  { H U B - L O G O }  We're listed at the best Example hub ever!
  {=================}

  Hub Title:
    +---------------------+
    | Example Hub         |
    +---------------------+

  Hub Logo:
    +---------------------------------------------+
    | http://www.examplehub.com/files/hublogo.png |
    +---------------------------------------------+

  Hub Description: *
    +---------------------------------------+
    | We're listed at the best Example hub  |
    | ever!                                 |
    |                                       |
    |                                       |
    +---------------------------------------+

+------+    +--------+
| Ping |    | Delete |  (NOTE: these buttons only appear after initially submitted.)
+------+    +--------+

This form will also have a #value of hub_client_hash_c_123 = xe3Fi8cPq914sQ5cORv3,
and #value of hub_client_hash_s_123 = ichEH83Cde492Ipz4H1d. (The _123 is a unique value chosen
by the client to correspond to this hub server, and is used only internally.)

After this, the Hub server will ping the Hub client for the new information, either when the Hub
client administrator hits the Ping button, or on a cron from either server. Note that the client
will not respond until the information has been reviewed and submitted by the administrator,
which it checks for with variable_get('hub_client_active_123', false).

Once the information has been submitted, the Hub server asks for the following document:
http://www.example.com/hub/xml/client/ping?hub=http://www.examplehub.com&serverhash=ichEH83Cde492Ipz4H1d

The Hub client responds with the following information:
<xml>
  <clienthash>xe3Fi8cPq914sQ5cORv3</clienthash>
  <hubversion>hub.module#1.0.58</hubversion>
  <status>1</status>
</xml>

Status may be:
0 = Offline or Not configured (this will be returned until the initial registration form has been submitted).
1 = Active

Once the status is 1, the Hub server will the request the client's registration information. (This may be
asked on other occassions, such as when the client pings with new information, or on a regular cron run.)

http://www.example.com/hub/xml/client/info?hub=http://www.examplehub.com&serverhash=ichEH83Cde492Ipz4H1d

The Hub client responds as follows:
<xml>
  <clienthash>xe3Fi8cPq914sQ5cORv3</clienthash>
  <hubversion>hub.module#1.0.58</hubversion>
  <status>1</status>
  <fields>
    <title>Example dot com</title>
    <description>This is the site mission for Example dot com, the most used site for example tutorials on the
      Internet!</description>
    <logo>http://www.example.com/files/logo.jpg</logo>
  </fields>
</xml>

At this point, the Hub server will create a node with the required information. The Hub server may then display
that information in various ways as configured by its adminstrator, most likely using Views and blocks, or
even simply promoting it to the front page.

-------------
Extensibility
-------------

The Drupal Hub module includes certain hooks, allowing for an API to be extended by other modules. For
instance, the RPG Hub module allows for game statistics to be automatically passed between the
Hub servers.