NSilverBullet

Complex solutions for simple problems.

  • Posts in category: dasBlog
Your Ad Here

New Theme for dasBlog - now with Google Search


Wednesday 14 May, 2008 (Blogging | dasBlog | Web)

I have created a new theme for my blog, I feel that this theme is more modern and has a lighter feel to it. I based the theme on an open source / free web template named Multiflex. It is available from www.1234.info this theme is based on Multiflex version 5.4. It took a lot more time to convert the web template into a dasBlog theme than I had figured on - partly because i also changed the page width of Multiflex which meant that I had to redo all the border images and partly due to Multiflex being gray only and I had to go through all the CSS to restyle the entire template! I am pretty pleased with the end result at the moment, although I am sure there are a couple of glitches that will need to be ironed out. One thing that irritated me with dasBlog and theme modifications is that it doesn't seem to be possible to change how certain parts are rendered for example post comments and related links. A lot of the content gets put in tables and modern design doesn't use tables but advanced CSS for positioning and flow control.

I can whole-heartedly recommend Multiflex to anyone who wants to create web pages but, like me, is not super gifted in the arts department! The template is well documented, there is a content toolkit for building your page structure and the CSS was easy to understand and modify. I found it at www.openwebdesign.org there is also a Color Contest there which I will check in on in the future to see how my color scheme compares to others. I used a flash-based tool from www.colorsontheweb.com to create a pleasant color scheme, it was a great help since I am not that good at picking out matching colors.

One major addition in this theme for my site is the Google search box in the top right-hand corner. Originally I tried to just add the Google search code in my old theme but since the Google code contains a <form> element it conflicts with the predefined form in dasBlog/ASP.Net. I solved it by placing the Google form in a separate html file and just including that file as an iframe.

Comments [1]

Your Ad Here


Messing about with dasBlog templates


Wednesday 30 April, 2008 (Blogging | dasBlog)

I am thinking about doing a complete graphic do-over of this blog due to the home and item templates being pretty messed up after all my editing and experimenting with them over the last couple of years. While I was going over some of the macros that you can use I found a nice little page with most (if not all) of the dasBlog macros described including syntax, screenshots and which version they are available from. It takes a lot of the guessing out of using the built in functionality.
http://www.jforsythe.com/jforsythe/projects/dasBlogMacros.html

I also found a customisation category at dasblog.info where you can find information about how customisation of the templates and themes works: http://dasblog.info/CategoryView,category,Customization.aspx

I have also switched the rss feed over to feedburner so that I can get some proper rss statistics.

Comments [0]


Finished update to 2.0


Tuesday 15 April, 2008 (.Net | Blogging | dasBlog)

It turns out that it really was very simple to upgrade to dasBlog 2.0 and ASP.Net 2.0. I did the ASP.Net upgrade first simply by changing which version of .Net to use. dasBlog 1.9 seemed to keep on working without a hitch which meant I could proceed with the upgrade process locally. I followed the instructions and uploaded all the files to my server...

Unfortunately I had missed a section that I had changed in my web.config which of course meant an ugly error page was the first thing that came up. In the upgrade instructions they point out that the most common cause of errors during an upgrade is problems merging changes in web.config so I could easily fix it guided by the detailed error message that I received.

Now it seems that most of the problems that I had with previous versions of dasBlog running under medium trust are gone. The only problem that remains is that the default configuration of medium trust won't allow dasBlog to ping or trackback to other sites, I can live with that!

Comments [0]


Moving dasBlog to 2.0


Tuesday 15 April, 2008 (.Net | Blogging | dasBlog)

I am preparing to upgrade my blog to 2.0. Thats both dasBlog 2.0 and .Net 2.0.

It looks like this version should fix all of my previous issues with my setup, unless my host has done some weird .Net 2.0 medium trust setup, you never know... There is a guide on doing the upgrade install here. As far as I can see the process seems to be:

  • Download & place all the files for you new version of dasBlog locally
  • Download the content folder from your public site and place it in the local version of dasBlog
  • Run the upgrader tool locally
  • Merge changes in your current web.config and the new versions web.config
  • Merge changes in your current site.config and the new versions site.config
  • Upload all the local files overwriting existing files

Seems pretty simple. I also have to change the config of my host to use ASP.NET 2.0.

What could possibly go wrong... ;-)

Comments [0]


Messing with dasBlog content folder


Tuesday 28 November, 2006 (.Net | Bugs | dasBlog)

Basically avoid changing the xml files under content for dasBlog, you will mess up your blog. I did this in an attempt to make a post that I started on the 7th but posted on the 8th go back to being on the 7th... First I just changed the CreatedDate in the content xml and this almost worked, the post would intermittently disappear from the site (and the file). Luckily I had made a backup of the content files before I did this so I could just put the post back up when it disappeared. I quickly realised that this was a suboptimal solution! So I moved the post over to a new file with the correct date in the name. This file was eaten up by dasBlog and mysteriously disappeared, although I didn't notice it for about a week. What had happened was that I had got the date for the outer element set to another day in conflict with another file. So dasBlog just kicked it. Once I had got the date right it still took several updates for the change to propagate. Now I hope I have saved all my posts!

Comments [0]


Free off-line blogging tool reviews


Thursday 23 November, 2006 (Blogging | dasBlog | Reviews)

I listed a set of features that I think I require for using off-line or desktop blogging tools. Here is my first round-up of test results, if nothing else is noted then these tools are Windows based. This first round will be focusing on free tools and if I can't find what I am looking for then I will start checking the commercial tools.

I'll summarise at the top so you don't have to read the entire post if you don't want to. The only two tools of the 9 that I have tested (10 with w.bloggar) that nearly meet my requirements are Zoundry and Lycos-Qumana both of these tools have the following problems for me: no support for <H4> tags which I use as subheadings and it doesn't seem possible to create new categories from within the tools. These are minor problems to say the least, at the moment I am using Zoundry for posting but I think I am going to have to try out Lycos-Qumana some more.

Lycos-Qumana

A free Java based editor with big name backing (Lycos) this is easily the tool that I have the highest expectations for, download here. Auto configuration of blog settings means it is super easy to get started. Pinging, tagging and trackback support built in. Spell checker with instant underlining of misspelled words of you want that. It is easy to manage existing posts and drafts but I couldn't find how to add new categories and there is no built in support for rmy <H4> headings. There is no custom preview with the sites style sheet but image uploading is supported. The user interface is not as intuitive as it could have been. Tested version 3.0

Zoundry

Zoundry is a free editor with an intuitive interface and easy access to draft and existing posts. Spell checking support, image upload, tagging, pinging, trackback style sheet preview, XHTML support and source view. Zoundry pretty much has it all although I have had difficulties getting trackbacks to work since you don't get notified if they were accepted or not. My only problem with Zoundry is that I have to add my sub-heading formatting manually since I want to use <h4> and there is no support for that. There is also no support for creating new categories.

Bleezer

Bleezer is a free Java based so is available for multiple platforms. It's a bit rough around the edges but was simple to configure for my dasBlog. It adds "Powered by Bleezer" to the end of posts. I don't like being forced to support Bleezer with a link every time I post, it should be an option as it is in some other tools. There is basic text formatting support but the interaction between the editing pane, which is a plain multi-line textbox, and the preview was difficult to master. The spell checker doesn't understand HTML formatting so has all sorts of ideas about what I am trying to spell with my <h4> and <p>. Also the HTML editor has no contextual help or tag completion. There is basic category support but no support for creating new categories. There is support for pinging, tagging, uploading over ftp and previewing with a custom style sheet, but no trackback management. Downloading existing posts for editing should work but I couldn't get it to play nicely with dasBlog. There is no list of unpublished local posts, you save them as files to disk and have to manage them manually so I feel that it will require quite a bit of manual work to use Bleezer for managing ongoing writing. All in all this looks like a promising tool but it has nowhere near the feature-set that I require for blogging. Tested version 0.9.5.6

blogBuddy

The first thing that strikes me with blogBuddy is the clean and simple interface. Unfortunately it just makes me feel like all of the features that I am looking for are missing... Connecting to dasBlog was no problem, neither was getting existing posts and editing them. Again there is no list of ongoing work and I couldn't find a way to save unfinished posts without posting them to my blog as unpublished work. Text editing and formatting is very basic through a textbox with HTML code support either from the tool (<B>, <I>, <U> and <A>). The spell checker and some other parts of the GUI returned developer errors. No preview, upload function, pinging, tagging, categories or trackback but it is free. Tested version 0.5

BlogDesk

Initially this looks promising, while downloading BlogDesk I read through the feature set and it seemed to cover most of my requirements. Connecting to a blog is a breeze with the help of a wizard, there is even an option for dasBlog as the blog type which makes it easy. The connection wizard tests all the functionality too if you want: uploading, getting categories and so on. After the wizard has run you can go into a tabbed dialogue and change all the details. Editing is done in a WYSIWYG pane but can also be done in HTML so you can make sure that the tool hasn't messed up your formatting. Unfortunately switching between normal (editing) mode, preview and source (HTML) is done through a menu so multiple clicks are required although there is a keyboard shortcut the interface doesn't feel intuitive. Spell checking seems to work and there are options for additional languages and custom dictionaries. It appears that there is some kind of trackback support but I couldn't figure it out and there is no mention of it in the included help file. Managing draft posts and existing posts was relatively simple although it required multiple clicks through a menu so switching between posts is not something that you do with a single click. New categories could be added through the blog configuration interface and using them was as simple as checking them in a list. Contextual menus everywhere made it simple to find the more advanced setup issues. Technorati tags are supported but no automatic pinging. This free tool contains many of the features that I am looking for but in the end it is not intuitive enough for me to use regularly and some of my main features are missing. Tested version 2.6

BlogEd

Another free Java based blog editor touted as a very simple Blog editor. It has the typical Java application feel which I personally don't like at all. Unfortunately I couldn't get it to connect to dasBlog at all. Tested version 0.7

JBlogEditor

Free Java based blog editor, JBlogEditor is a giant download (15,4 MB) which either means that it is really good or that it has loads of pointless features. The first thing that happens when I connect to my dasBlog is that the application crashes, a Java error log has been created so I can see that it is a real crash whether it is a fault in my configuration or caused by my previous Java editor test I don't know (and don't care). Simple switching between different drafts and published posts but that crash really puts me off the tool. There is no formatted editing mode, its just HTML editing with tool support and a preview pane. No tagging, pinging, trackback or uploading really means this is useless for me. Tested version 0.6

IMHO

IMHO Instant Blogger is a sourceforge project so it is free and open source, there is also a plug-in architecture and a couple of formatting plug-ins available for download. Setting up my connection to dasBlog returned a developer exception caused by a missing http:// Once connected there are many features missing: creating categories, tagging, pinging, trackback management, editing existing posts. In addition I hate the user interface, there are no menus and you don't know where to go to find functions that there are no buttons for. Tested version 1.3.2106

PowerBlog

I couldn't get this to work at all for dasBlog, the blog setup was so difficult to understand that I don't know if it just doesn't support dasBlog or if I didn't get the configuration right. Tested version 2.4.3

Comments [0]


First shot at fixing dasBlog medium trust issues


Tuesday 14 November, 2006 (.Net | AJAX | Blogging | Bugs | dasBlog | Fixes)

So far I have managed to get my dasBlog up and running. But in doing so I have disabled and broken several features:

  • No HttpCompression
  • No date picker while editing
  • No Pingback/trackback support

It seems that I have also broken my FreeTextBox editing control. I believe that this may be an unrelated issue to the medium trust fixes and wont get into that in this post.

How could I get the broken features back up again? The strong naming issues that affect SharpZipLib and BasicDatePicker are easy to fix since there is a new free version of BasicDatePicker available BasicDatePicker Lite, the new version is not strong named and may require you to recompile dasBlog. SharpZipLib is open source so you can download it and add:

using System.Security;
[assembly:AllowPartiallyTrustedCallers]

to assemblyinfo.cs then just recompile and these functions should be up and running again, you may have to install SharpDevelop to compile the code for SharpZipLib. Any changes that were made to web.config or aspx pages to disable the functions need to be reverted and recompiled. Your web.config will need to be updated with a new version for SharpZipLib:

<dependentAssembly>
<assemblyI entity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral"/>
<bindingReirect oldVersion="0.5.0.0-0.84.0.0" newVersion="0.85.0.0"/>
</dependentAssembly>

After doing this I received an "Invalid use of response filter" exception (more info at dasBlog.us) which turns out to be because my host already implements httpCompression, but disabling the blowery handler sorted it out.

TrackBack support

The main problems that remain are getting TrackBack and PingBack support. I will start by looking at getting TrackBacks working. The problem with TrackBacks is that they require dasBlog to call a web page on another site and network access to other servers is not allowed by default under medium trust so this jut won't work. I checked the TrackBack protocol to see if I could find any workarounds that could be applied. Reading the spec I realised that TrackBacks do not require the call to originate from the server that hosts the blog, if we could implement this as a client call then we could theoretically allow TrackBacks under medium trust.

I started by implementing a very simple html page to post a trackback call to localhost.

<html><body>
  <
form method=post action=http://localhost/Trackback.aspx?guid=3d9f45e4... enctype="application/x-www-form-urlencoded;charset=utf-8">
    <
input type="hidden" name="title" value="SuperTrackback 1" />
    <
input type="hidden" name="excerpt" value="This is a vlient trackback call." />
    <
input type="hidden" name="url" value=http://localhost/Trackback.aspx?guid=dc205699... />
    <
input type="hidden" name="blog_name" value="TestBlogger" />
    <
input type=submit name="doit" value=1>
  </
form>
</
body></html>

I have hardcoded the trackback urls just for testing. Of course it was not as easy as just posting the call since dasBlog includes spammer protection by checking the url in the trackback call. We have to disable spammer protection by checking if we can call the url at runtime in TrackBackHandler.cs (added lines are bold) .

Entry entry = dataService.GetEntry( entryId );
if ( entry != null )
{
System.Net.WebPermission urlPermission =
new WebPermission(System.Net.NetworkAccess.Connect,url);
if
(System.Security.SecurityManager.IsGranted(urlPermission))
{
try
{
string requestBody = null;
// see if this is a spammer
HttpWebRequest webRequest = WebRequest.Create(url) as HttpWebRequest;
webRequest.Method="GET";
webRequest.UserAgent = Utils.GetUserAgent();
...
...
}
catch
{
// trackback url is not even alive
logService.AddEvent(new EventDataItem(
EventCodes.TrackbackBlocked,
context.Request.UserHostAddress + " because the server did not return a valid response",
Utils.GetPermaLinkUrl(entryId),
url,
entry.Title
));
context.Response.StatusCode = 404;
context.Response.End();
return;
}
}
// if we've gotten this far, the trackback is real and valid
Tracking t = new Tracking();
t.PermaLink = url;
t.RefererBlogName = blog_name;
t.RefererExcerpt = excerpt;

This allows an anonymous caller to add a TrackBack to our blog but it also enables incoming TrackBacks under medium trust. This is only half of the solution for TrackBacks; we have opened up dasBlog för incoming calls to our TrackBackHandler but we still have to make calls to remote trackback urls. The next step would be to implement initiate a client-side trackback call to a remote server from inside dasBlog, this can be done in an AJAX (or is it Ajaxian) manner using XMLHttpRequest in JavaScript http://developer.mozilla.org/en/docs/AJAX:Getting_Started. I will cover this and tackling the spammer threat in future posts, since I haven't implemented a solution yet.

Comments [2]


Running dasBlog as a partially trusted application


Tuesday 07 November, 2006 (.Net | Bugs | dasBlog | Fixes)

Since changeing web hosts I have not been able to get dasBlog running in the new environment. The host server is setup so that .Net code runs at medium trust level and won't allow me to override the trust settings. As anyone who has tried to get dasBlog to run at medium trust knows, it just isn't possible out of the box. To make life even more difficult Asp.Net returns an incomplete and ambiguous SecurityException:

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Security error.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

The stack trace that is included provides no help in solving the problem and actually sent me on a wild goose chase trying to solve completely unrelated issues.

I have started to dig into this to try and see if I could find a quick fix for it with googles help. So far I haven't found a quick fix but I have found a few other things that may lead me to a solution... First of all I have seen a few forum posts and blogs referring to reflection used by serialization as part of the problem. But I have managed to get XmlSerialization to work without chainging the serializer or trust level of the application so it doesn't seem to be the XmlSerializer that is causing the exception. I changed the virtual directory settings on my local machine so that dasBlog runs under .Net 2, this provided me with a much clearer exception. dasBlog has a custom XmlTextReader called XmlNamespaceUpgradeReader which inherits fom XmlTextReader. The only problem is that XmlTextReader has a security demand for exicit inheritance permissions [PermissionSet(SecurityAction.InheritanceDemand, Unrestricted=true)]. Running under medium trust you don't have the required permissions. Changing all XmlNamespaceUpgradeReader  references to XmlTextReader allowed the deserialization of SiteConfig (and all other serialized data) to run.

The next problem was that even though the site serialization was working dasBlog stilled just returned a big fat exception. Another wild goose chase followed trying to solve new unrelated issues, but working on them gave me a flashback to a problem I solved a year or so ago while setting up NGallery on the same host. Calling strong named assemblies from partially trusted code can also be a show stopper if the signed assemblies don't allow partially trusted callers. Two assemblies in dasBlog cause this problem SharpZipLib which is used for HttpCompression and BasicFrame BasicDatePicker, neither are compiled with the AllowPartiallyTrutedCallers setting. Removing references to these solves the rest of the problems that I was experiencing. Unfortunately the fixes disable some functionality in dasBlog and may have unexpected effects on configurations other than mine.

I am planning on following up on this post with detailed instructions on implementing the fixes and maybe som attempts to restore full functionality.

References on the web that sort of showed me in the right direction:
http://choirulamri.or.id/archives/94
http://www.hanselman.com/blog/CommentView.aspx?guid=a7e58fa0-9390-4270-bab3-83ea2e969352
http://www.hanselman.com/blog/CommentView.aspx?guid=4dd4573a-1fee-4680-b28e-983271bd3ae8
http://www.jwerx.com/blog/CommentView,guid,31c5f741-3d52-46a3-beb5-b934dea73423.aspx
http://dasblog.us/viewtopic.php?p=761&sid=b87a704cc1fffacabcb0bfff2660aac9


Comments [0]


Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Sign In