Monday, November 08, 2010 at 12:05 AM.

	<<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, which is served by an Apache server at
			<<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:

<<Set default values.
local (usernum =;
local (name =;
local (passwordName = "default");
local (protocol = "xml-rpc");
local (server = "");
local (port = 80);
local (rpcPath = "/RPC2");
local (soapAction = "/xmlStorageSystem");
local (f = +;

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 "/" {
		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 ( {
				adrsub^ =}};
		[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.