Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.utilities.saveUpstreamSpec
<<Changes
<<11/20/01; 3:46:44 AM by JES
<<Changed the default passwordName from "defaultXssPassword" to "default".
<<10/22/01; 10:57:05 PM by JES
<<Saves the default #upstream.xml to your www/system/upstream folder -- otherwise known as an upstream spec.
<<The default spec upstreams to your folder on radio.xmlstoragesystem.com, which is served by an Apache server at radio.weblogs.com.
<<It uses your usernum to identify your account.
<<Use this script to upgrade your #upstream.xml to the current format, or to create a #upstream.xml for a new installation, if you already have a usernum.
<<See this page for more details:
<<http://smurfturf.manilasites.com/stories/storyReader$335
<<Set default values.
local (usernum = user.radio.prefs.usernum);
local (name = user.prefs.name);
local (passwordName = "default");
local (protocol = "xml-rpc");
local (server = "radio.xmlstoragesystem.com");
local (port = 80);
local (rpcPath = "/RPC2");
local (soapAction = "/xmlStorageSystem");
local (f = user.radio.prefs.upstream.folder + radio.data.filenames.upstreamFileName);
if file.exists (f) { //get values from the upstream spec on disk
local (xmltext = string (file.readwholefile (f)), xstruct);
xml.compile (xmltext, @xstruct);
local (adrupstream = xml.getAddress (@xstruct, "upstream"), adrsub);
local (spectype = xml.getAttribute (adrupstream, "type")^);
for adrsub in adrupstream {
local (name = nameof (adrsub^));
if name beginswith "/" {
continue};
name = xml.convertToDisplayName (name);
if spectype == "xmlStorageSystem" { //8/14/01 JES: account, not email
if (name == "email") or (name == "account") {
name = "usernum"}};
if name == "usernum" {
if defined (user.radio.prefs.usernum) {
adrsub^ = user.radio.prefs.usernum}};
[name] = adrsub^}};
radio.upstream.builtinDrivers.xmlStorageSystem.saveUpstreamSpec (f, usernum, name, passwordName, protocol, server, port, rpcPath, soapAction);
dialog.notify ("Your #upstream.xml has been saved.")
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.