Saturday, April 02, 2011 at 9:21 PM.

rssToBlogSuite.initBlog

on initBlog (adrblog) {
	<<Changes
		<<12/23/10; 11:01:43 PM by DW
			<<Created. 
	if not defined (adrblog^) {
		new (tabletype, adrblog)};
	bundle { //prefs
		if not defined (adrblog^.prefs) {
			new (tabletype, @adrblog^.prefs)};
		if not defined (adrblog^.prefs.enabled) {
			adrblog^.prefs.enabled = false};
		if not defined (adrblog^.prefs.urlFeed) {
			adrblog^.prefs.urlFeed = ""};
		if not defined (adrblog^.prefs.urlBlogHome) { //3/10/11 by DW
			adrblog^.prefs.urlBlogHome = ""};
		if not defined (adrblog^.prefs.postTemplate) { //3/18/11 by DW
			adrblog^.prefs.postTemplate = "<a href=\"<%link%>\">From <%domain%></a>. <%title%> <%description%>"};
		bundle { //params
			if not defined (adrblog^.prefs.params) {
				new (tabletype, @adrblog^.prefs.params)};
			if not defined (adrblog^.prefs.params.blogID) {
				adrblog^.prefs.params.blogID = 1};
			if not defined (adrblog^.prefs.params.url) {
				adrblog^.prefs.params.url = ""};
			if not defined (adrblog^.prefs.params.username) {
				adrblog^.prefs.params.username = ""};
			if not defined (adrblog^.prefs.params.password) {
				adrblog^.prefs.params.password = ""};
			if not defined (adrblog^.prefs.params.blogType) { //2/27/11 by DW
				adrblog^.prefs.params.blogType = "wordpress"}}};
	bundle { //stats
		if not defined (adrblog^.stats) {
			new (tabletype, @adrblog^.stats)};
		if not defined (adrblog^.stats.ctReads) {
			adrblog^.stats.ctReads = 0};
		if not defined (adrblog^.stats.ctSaves) {
			adrblog^.stats.ctSaves = 0};
		if not defined (adrblog^.stats.ctErrors) {
			adrblog^.stats.ctErrors = 0};
		if not defined (adrblog^.stats.ctPosts) {
			adrblog^.stats.ctPosts = 0};
		if not defined (adrblog^.stats.whenNextRead) {
			adrblog^.stats.whenNextRead = clock.now ()}};
	if not defined (adrblog^.history) {
		new (tabletype, @adrblog^.history)};
	if not defined (adrblog^.calendar) {
		new (tabletype, @adrblog^.calendar)}};
bundle { //test code
	local (adrdata = rssToBlogSuite.init ());
	initBlog (@adrdata^.blogs.["linkblog.xml"])}



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.