Web CMS, object database, scripting, tools, HTTP server, Windows & Mac.

Home

UserLand Manila

Open Source Site

Discussion Forum

User's Guide

Support

Directory

Search


Members
Join Now
Login

Subscriptions

Overview

You can publish a guest database and allow other people to subscribe to changes made to the guest database. It uses the same mechanism as updates to Frontier.root.

To synch a guest database with the version on the server, the user only has to bring the database to front, and choose the Update command, the first item in the Main menu. You can automate updates via scheduled scripts.

Changes to the guest database are made through WebEdit. Since WebEdit is team software, multiple people may work on the same database.

Server

To make a guest database on your server subscribable:

  1. Create a top-level table in the database called #changes.

  2. Set supportsSubscribe to true in the database's table in user.databases.

  3. Set config.mainResponder.prefs.flSubscriptions to true.

When changes are made via WebEdit, a record of these changes in stored in the #changes table. This is implemented by mainResponder.subscriptions.checkInCallback, which gets called whenever an object is checked in via WebEdit.

The XML-RPC handler for the updates server is at mainResponder.rpcHandlers.subscriptions.update. It calls mainResponder.subscriptions.server, which does the work of gathering the new and changed parts from the #changes table.

Client

On the client side, you need to create a new sub-table in user.rootUpdates.servers that's named the same as the guest database.

This table should contain the following preferences:

  • autoBackup -- a boolean, if true then backup the database before updating it.

  • dbName -- a string, the name of the guest database.

  • dialogs -- a boolean, usually true, that specifies whether or not to display dialogs when updating.

  • lastUpdate -- a string expressing the last update time, usually as formatted by date.netStandardString.

  • method -- a string, the name of the XML-RPC handler to call. It should be mainResponder.subscriptions.update.

  • port -- the port number of the server's HTTP server, usually 80.

  • serialNum -- a number, this can be initialized to 0, it's the number of the last downloaded change.

  • server -- the host name or IP address of the server.

  • URL -- the optional URL of a page explaining what this guest database is, perhaps providing more details about the changes.

To update the client's database, just bring the database to the front, then choose the top command in the Main menu. That command will read something like Update MyGDB.root... -- in other words, it will contain the name of the database that's in front.

See also the DocServer documentation for rootUpdates.update.

© Copyright 1992-2026 UserLand Software, Inc..
Last update: Tuesday, September 7, 1999 at 3:31:42 PM Pacific.
Email: webmaster@userland.com

This is a Manila site.