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

system.verbs.apps.Manila.nodeTypes.types.manilaEditorsContainer.expand

<<Expand a Manila Editors container.
	<<10/27/00; 10:43:32 PM by PBS
<<Changes:
	<<12/07/00; 5:40:37 PM by JES
		<<Fixed expansion of editorsContainer node where editors were listed as editor001, editor002, etc.
<<return (playlist.manila.commands.expandManilaEditorsContainer ())

local (oldTarget = target.set (window.frontmost ()));
local (oldDisplay = op.getDisplay ());
op.setDisplay (false);

local (flGoneRight = false);
local (atts);
op.attributes.getAll (@atts);
local (siteUrl = atts.siteUrl);
local (type = string.lower (atts.containerType));

local (username, password);
on createInfoCallback (adrinfo) {
	if manila.windowTypes.getUsernameAndPassword (adrinfo, @username, @password) {
		manila.windowTypes.setUsernameAndPassword (adrinfo, username, password)}
	else {
		bundle { //don't leave stale data lying around
			local (adrtempinfo = @system.temp.manila.data.sites.[nameOf (adrinfo^)]);
			if defined (adrtempinfo^) {delete (adrtempinfo)};
			delete (adrinfo)};
		return (false)}};
local (adrinfo);
if not manila.windowTypes.findSiteInfo (siteUrl, @adrinfo, @createInfoCallback) {
	return (false)};
local (siteinfo = adrinfo^);
manila.windowTypes.getUsernameAndPassword (adrinfo, @username, @password);
siteinfo.username = username;
siteinfo.password = password;

on addContainer (linetext, containerType) {
	local (dir = down);
	if not flGoneRight {
		dir = right;
		flGoneRight = true};
	op.insert (linetext, dir);
	local (atts);
	new (tableType, @atts);
	atts.type = "manilaEditorsContainer";
	atts.containerType = containerType;
	atts.siteUrl = siteUrl;
	op.attributes.addGroup (@atts)};
on addEditor (editorName, editorEmail) {
	local (dir = down);
	if not flGoneRight {
		dir = right;
		flGoneRight = true};
	op.insert (editorName, dir);
	local (atts);
	new (tableType, @atts);
	atts.type = "manilaEditor";
	atts.email = editorEmail;
	atts.name = editorName;
	atts.siteUrl = siteUrl;
	op.attributes.addGroup (@atts)};

op.deleteSubs ();
local (cursor = op.getCursor ());

case type {
	"toplevel" { //it contains ME and CE nodes
		addContainer ("Managing Editors", "managingEditors");
		addContainer ("Contributing Editors", "contributingEditors")};
	"contributingeditors";
	"managingeditors" {
		local (editorsTable = manila.editors.getTable (adrinfo, type));
		local (adrEditor);
		for adrEditor in @editorsTable {
			local (editorName, editorEmail);
			<<12/07/00 JES: returned value is now a table containing name and email, not a table of name/value pairs.
			editorName = adrEditor^.name;
			editorEmail = adrEditor^.email;
			addEditor (editorName, editorEmail)}}};

op.setCursor (cursor);
op.setDisplay (oldDisplay);
try {target.set (oldTarget)};

return (true)



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.