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

scripting2Suite.editor.openOutline

on openOutline (name) {
	<<Changes
		<<7/5/10; 10:04:22 AM by DW
			<<When op.xmltooutline returns, the outline window is open. That's why we weren't getting the buttons the first time you edit the blogroll, we thought the window was already open. Now we close it, and the buttons get a chance to appear.
		<<6/27/10; 9:34:08 AM by DW
			<<See comment at the head of scripting2Suite.server.getOutlineFromUrl.
		<<6/15/10; 8:19:12 AM by DW
			<<Reorg -- now if we already have the outline locally we don't get it from the server. If it's already open in a window we just bring it to the front.
		<<6/12/10; 7:29:51 AM by DW
			<<Change this from "openBlogroll" to "openOutline" -- so it can be used to open other kinds of outlines, for example "stylesheet" and "homeTemplate" etc.
		<<6/8/10; 10:13:39 AM by DW
			<<Created.
	local (adrdata = scripting2Suite.init ());
	local (adrtable = @system.temp.scripting2.editor.[name]);
	local (url = "http://scripting.com/" + name);
	bundle { //6/27/10 by DW
		url = name};
	if not defined (adrtable^) {
		new (tabletype, adrtable)};
	local (adroutline = @adrtable^.outline);
	if not defined (adroutline^) { //need to get it from the server
		local (username = adrdata^.editor.prefs.username);
		<<local (adruser = scripting2Suite.inituser (username))
		local (opmltext = scripting2Suite.editor.getOutline (url));
		op.xmltooutline (opmltext, adroutline);
		if window.isopen (adroutline) { //7/5/10 by DW
			window.close (adroutline)}};
	if not window.isopen (adroutline) {
		local (adrbuttons = @scripting2Suite.editor.buttons.blogroll);
		if string.lower (name) == "instantoutline" {
			adrbuttons = @scripting2Suite.editor.buttons.instantOutline};
		local (title = "scripting2: " + name);
		edit (adroutline, adrButtonTable:adrbuttons, windowtitle:title);
		window.attributes.setone ("outlineUrl", url);
		window.minimumSize (adroutline, 500, 400)}
	else {
		window.bringtofront (adroutline)}};
bundle { //test code
	openOutline ("instantOutline")}



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.