Searching for a new employeer

I am currently emploed at Cabana.dk but the time has come for me to explore and search for new challenges to further my development. My servises as a creative web developer are now available for hire.  Although this blog is in English, I am a danish developer resident in the city of Copenhagen, so let me know if you have a good proposition.

If you know someone who would be interested, please forward this URL: https://maanehunden.wordpress.com/2010/06/10/searching-for-a-new-employeer/

Sitecore6 Lucene indexing webconfig setup Tip

As far as I remember all indexes are build onpublish event in Sitecore. But that is not the case with Sitecore6x to my suprise indexes for web database were never built. So i took a look at the webconfic and to my amazment i had to ad the folowing to make it work as intended.

<database id="web" singleInstance="true"  type="Sitecore.Data.Database, Sitecore.Kernel">
...
 <indexes hint="list:AddIndex">
    <index  path="indexes/index[@id='system']" />
 </indexes>
...
<Engines.HistoryEngine.Storage>
   <obj  type="Sitecore.Data.$(database).$(database)HistoryStorage,  Sitecore.Kernel">
          <param connectionStringName="$(id)"  />
          <EntryLifeTime>30.00:00:00</EntryLifeTime>
    </obj>
 </Engines.HistoryEngine.Storage>
<Engines.HistoryEngine.SaveDotNetCallStack>false</Engines.HistoryEngine.SaveDotNetCallStack>

</database>

more info about Sitecore and Lucene indexing here
http://sdn.sitecore.net/upload/sdn/articles/administration/lucene-search-engine/lucene-search-engine.pdf

well there you have it, another successful fix (c:

How to avoid Access Denied error while using AllWebs

Hwile running SPSecurity.RunWithElevatedPrivileges we can brows AllWebs whithout hitting the Access denied wall (c:  Her’s how it gows

StringBuilder sb = new StringBuilder(); 
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite sitecol = new SPSite(sharePointRootSite))
{
sb.AppendFormat("{0}", "<ul>");
foreach (SPWeb web in sitecol.AllWebs)
{
if (web.DoesUserHavePermissions(login, SPBasePermissions.ViewPages))
sb.AppendFormat("<li><a href='{0}'>{1}</a></li>", web.Url, web.Title);
}
sb.AppendFormat("{0}", "</ul>");
}
});

This way you only have to show the user only the sites which he/she have promissions to se.
Another good thing is by wraping our statement in a using statement it handles the disposing of IDisposable objects by it self.
it essentially calls .Dispose() when it is done.

How to make a serverside delayed rederrect

Injecting javascript at runtime, can be a mess but there is a much easeay way just change your meta data like this

HttpContext.Current.Response.AddHeader(“REFRESH”, seconds + “;URL='” +url +”‘”)

where seconds is number of seconds to delay rederect and
url is the url that you want to rederect to.. (c:

eacy ass eating pancakes (c:

How to disable caching of input fields

this is one pesky feature,.. if you ask me. well to the point ,. if u make your ordanary<input> html control the content of it will be cached in browser memory,.  this way if you press F5 it will remember your input,.. and from time to time you want to diable that ,.. and this is how you do it.

add autocomplete=”off” attribute to your her’s an exsample.

<input  type=”text”  id=”myInput runat=”server”   value=”” autocomplete=”off”  />

Geometric shapes using unicode symbols

how about drawing a round corner without using images

or a new kind of bullit for your bullit list

well check out this link for more amazing and wired symbols, that you can use
http://en.wikipedia.org/wiki/Unicode_Geometric_Shapes

VAlidating your HTML

I allways wright good an validt marckup but from time to time you have to finde thouse small inconsitensis that you have mised ,. (c:
here is a couple of sites that i like to use ,.. to validate my stuff ,..

if you ask me ,. this is the best one http://htmlhelp.com/cgi-bin/validate.cgi 
W3C is ok ,.. http://validator.w3.org/