Thursday, April 07, 2011 at 1:07 AM.

river2Suite.utilities.setupAdminUser

on setupAdminUser () {
	<<Changes
		<<4/6/11; 12:25:04 PM by DW
			<<Initial feeds setup for Admin user.
	local (adrdata = river2suite.init (), adruser = @adrdata^.users.admin);
	river2suite.inituser (adruser);
	
	if sizeof (adruser^.feeds) == 0 {
		on notFeedInList (url) {
			local (adrlist);
			for adrlist in @adrdata^.lists {
				if defined (adrlist^.feeds.[url]) {
					return (false)}};
			return (true)};
		bundle { //loop over lists
			local (adrlist);
			for adrlist in @adrdata^.lists {
				local (urllist = nameof (adrlist^), adrfeed = @adruser^.feeds.[urllist]);
				if not defined (adrfeed^) {
					new (tabletype, adrfeed)}};
			river2suite.inituser (adruser)};
		bundle { //add all the feeds that are not in the list
			local (adr, url);
			for adr in @adrdata^.feeds {
				url = nameof (adr^);
				if not defined (adrdata^.lists.[url]) { //not a list
					if notFeedInList (url) {
						local (adrfeed = @adruser^.feeds.[url]);
						if not defined (adrfeed^) {
							new (tabletype, adrfeed)}}}};
			river2suite.inituser (adruser)}};
	
	opmlEditor.member.initMember ("admin", flcreate:true)};
bundle { //test code
	setupAdminUser ()}



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.