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

system.verbs.apps.Manila.windowTypes.init

<<7/5/01; 2:36:18 PM by JES
	<<Initialize Manila site editing windowTypes, copying info from user.playlist.manila if it exists.
	<<All Manila site editing functionality is now implemented in nodeTypes and windowTypes.
bundle { //init user.manila
	if not defined (user.manila) {
		new (tableType, @user.manila)};
	if not defined (user.manila.prefs) {
		new (tableType, @user.manila.prefs)};
	if not defined (user.manila.prefs.lastSiteUrl) {
		if defined (user.playlist.manila.prefs.lastSiteUrl) {
			user.manila.prefs.lastSiteUrl = user.playlist.manila.prefs.lastSiteUrl}
		else {
			user.manila.prefs.lastSiteUrl = "http://"}};
	if not defined (user.manila.data) {
		new (tableType, @user.manila.data)};
	if not defined (user.manila.data.sites) {
		new (tableType, @user.manila.data.sites);
		if defined (user.playlist.manila.sites) {
			local (adrinfo);
			for adrinfo in @user.playlist.manila.sites {
				local (name = nameOf (adrinfo^));
				bundle { //make sure that the table name includes the port
					local (parts = string.urlSplit (name));
					if not (parts[2] contains ":") {
						parts[2] = parts[2] + ":80"};
					name = parts[1] + parts[2] + "/" + parts[3]};
				local (adrdest = @user.manila.data.sites.[name]);
				adrdest^ = adrinfo^;
				try {table.rename (@adrdest^.rpcServer, "host")};
				try {table.rename (@adrdest^.rpcPort, "port")};
				try {table.rename (@adrdest^.canonicalSiteName, "siteName")}}}}};
bundle { //install windowTypes
	local (adrcode = @system.verbs.apps.manila.windowTypes.types);
	local (adrtable = @Frontier.tools.data.windowTypes);
	local (adrtype);
	for adrtype in adrcode {
		local (name = nameOf (adrtype^));
		adrtable^.[name] = adrtype}}



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.