Simon Fell > Its just code > RESTLog.NET Installation & Configuration

Sunday, April 6, 2003

Installation
This assumes you're familar with configuring IIS & ASP.NET.

  • Make sure you have ASP.NET installed and running correctly first.
  • unzip the file, preserving directories somewhere convienient ( e.g. c:\inetpub\wwwroot\blog )
  • if you need to, goto IIS admin and create a virtual directory that maps to the directory with the index.config file in. Note that this is entirely optional, but makes things slightly easier.
  • If you didn't create a virtual dir, then move the dll's out of the bin directory to the parent app's bin directory ( e.g. c:\inetpub\wwwroot\bin )
  • Using IIS admin add an application mapping for .html to the ASP.NET Isapi extension. make sure that "check that file exists" is NOT checked. If you choose the limit verbs option, you need to allow GET, POST, PUT, DELETE.
Configuration

Configuration settings for the weblog are stored in the web.config file, open it up in notead, emac, vi, or whatever your particular text editor posion is.

  • <configSections> - this registers the handler for the <restlog.net> section.
  • <httpHandlers> - this maps .html requests onto the weblog engine.
  • <restlog.net> - this houses all the weblog configuration, this is what you'll want to edit.
    • <title> - the title of your weblog, this appears on the web pages, as well as being included in the generated RSS file.
    • <description> - the tagline/description for your weblog, this also appears on the web pages and the RSS file.
    • <author> - enter the name of the weblog's author
    • <indexMaxPosts> - controls the number of entries that appear on the main page, the default is to show the most recent 15 posts, wind this up or down as the mood takes you.
    • <rssMaxPosts> - controls the number of entries that appear in the RSS file, the default is to show the most recent 15 posts, wind this up or down as the mood takes you.
    • <doPingbacks> - If enabled (by setting the value to true), each time you make a new post, it will automatically check the post for links, and send pingbacks to those servers that support it.
    • <rss> - the name of the generated rss file.
    • <basepath> - Important set this to the external path to the root of the blog, i.e., if you installed to c:\inetpub\wwwroot\blog\, then it would be /blog/ if you created a virtual directory call weblog in the root of the web server then it would be /weblog/
    • <templates> - the names of the 3 templates used. by default these are mapped to .config files, as these won't be served to external clients.
      • <main> - this is the main index page, that shows the most recent posts.
      • <monthly> - this is the monthly archive page, by default it uses the same template as the main index, but it doesn't have to, if you want your monthly archive pages to do something different.
      • <item> - this is the template for a single post page.
Templates

The template files index.config and item.config are standard ASPX files, but with a .config file extension. They use ASP.NET's code behind feature so that the weblog engine can provide the relevant information to be rendered. The main and monthly index pages should inherit from the class PocketSoap.RestLog.IndexPage and the item page should inherit from PocketSoap.RestLog.ItemPage.

Both classes expose the information from the web.config file via an instance of the WeblogSettings class available via the Weblog property. The WeblogSettings class has the following properties Title, Description, Author, IndexMaxPosts, RssMaxPosts, DoPingbacks, RssFile, BasePath, MainTemplate, MonthlyTemplate, ItemTemplate.

The Item template exposes the details of the post via an item object, accessed via the Item property, this has the following properties title, description, date, tune, postId, Link, permaLink

The index pages expose a collection (ArrayList) of items to be rendered via the Items property. In addition it has an additional property called ArchiveDate that contains the date of the monthly archived being rendered or the value DateTime.MinValue if its the main index page.