SPSite.LastContentModifiedDate

This can’t be right, it’s insane.  What’s insane ? Well it appears that the LastContentModifiedDate gets updated when the Site Usage is re-calculated.  So my Last Modified webpart is made pretty much useless by having the SiteUsage data enabled.

That blows. Hope its just coincidence.

 

Technorati tags: , ,

That Todd Bleeker

menupart.jpg 

Whilst poking about on sharepoint sites I was looking at Todd’s site again, and stumbled across another of his CEWP again, this one was for a menu part, its great , as they always are leveraging the power of sharepoints built-in functionality but what I never knew before was just how easy it was to generate sharepoint menus.

This is the html for two menu items and its opening link

<menu id=”myLinks” class=”ms-SrvMenuUI”>

<ie:menuitem

iiconSrc=”http://www.highdots.com/website-ranking-checker/images/search_engines/google.gif”

onMenuClick=”window.location.href=’http://google.com’;”

>Google</ie:menuitem>

<ie:menuitem

iiconSrc=”http://www.highdots.com/website-ranking-checker/images/search_engines/msn.gif”

onMenuClick=”window.location.href=’http://msn.com’;”

>MSN</ie:menuitem>

</menu>

<div class=”ms-HoverCellInActive”

onmouseover=”this.className=’ms-HoverCellActive’”

onmouseout=”this.className=’ms-HoverCellInActive’”>

<a id=”menuLink”

style=”CURSOR: hand”

onclick=”JavaScript: if(!myLinks.isOpen())

myLinks.show(this, true, 0, 0, 0);”

tabindex=”0″>

Search Engines

</a>

</div>

 Taken from http://mindsharpblogs.com/todd/archive/2006/08/15/1242.aspx

Now because I spend my time writing dynamic webparts (ie not fixed content) I can name the menu based on the webparts clientId and have these littered all over a page.

Must think up some use for it now.

Technorati tags: , ,

Yet another Ajax Sharepoint Part

Site Map  I got chance to knock up another part, sorry no source code this time, but you might like the idea.

Using the idea from Amazon, ebuyer and MS of the SiteMap at the top of the page I thought I could do the same with my DynamicPanel.  So I created a Webcontrol (not a webpart!) that Spat out a PopperLink (see Ajax and Sharepoint) using the CreateLink method that called yet another httpHandler.

The handler iterates thru the Areas (like this)

Guid homeGUID = AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Home);

Area homeArea = AreaManager.GetArea(PortalContext.Current, homeGUID);

foreach(Area area in homeArea.Areas)
{
if(!area.System)
textWriter.WriteLine (”<TD valign=’top’><TABLE><TR><TD valign=’top’><b><A href=’” + area.WebUrl +”‘>” + area.Title + “</a><b></TD></TR>” + RecurseArea(area) + “</TABLE></TD>”);
}

private string RecurseArea(Area area)
{
string s=”"
foreach(Area areaChild in area.Areas)
{
if(!areaChild.System)
s+= (”<TR><TD valign=’top’><A href=’” + areaChild.WebUrl +”‘>” + areaChild.Title + “</a></TD></TR>”);
}

return s;
}

Simple Stuff (obviously I have surrounding tables too).

This produces a clickable partial page of links.  The HttpHandler is called by the popper and on clicking the Site Map link (see later) it Ajax calls the handler and puts the resultant html in the popup window.

Then using the techniques here Applying a Custom Banner I placed the asp.net control on the page in the new custom banner.

Hey presto Fancy Ajax dynamically populated Sharepoint 2003 Site Map.

Technorati tags: , , , ,

Ajax and Sharepoint 2

Subtitle:Don’t you think the way lists display suck ?

Well I do, no in the web parts themselves, but in the inevitable postback to a crappy looking list item page.

In the previous post you could see the web part I was working on, well its just a demo piece and needs a lot of work, but I figure why should I do all that work I’ll let you do some.  Actually I may not have time to finish this one so I thought I’d put out what I had done.

The web part allows you to select a list that is currently available on this current site. You have to enter the Main field name in the Text box below and its away.  This part will rip through the list contents and spit them out with a link in the web part.  When you click that link the Ajax stuff fetches the list data item and displays it in the box, fast.

Now there is a lot to do here, things like provide html editing for the list display both list and popup designs.  Use the ID instead of the “Title” field (duplicates won’t work in this version)

Also figure out the field type and display appropriately being the main one.

Lots left to do but you can do it.

When you create this you MUST GAC IT.  It was developed with Sharepoint security at FULL, figure it out for yourself if you want a better config.

The web.config needs the HTTP Handler adding (you own key remember)

<httpHandlers>
<add verb=”GET” path=”DynamicCustomListPart.ashx” type=”DynamicCustomListPart.DynamicCustomListWebPart, DynamicCustomListPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=*************” />
</httpHandlers>

Source Code

*NB.  This is a demo and not production software, use at own risk.

 

Technorati tags: , , ,

Ajax and Sharepoint

I noticed Patrick’s post about someone’s demo of ajax webparts.  Well for a while I have been working on this, but not in .NET 2.0 but in 1.1 on the 2003 version of sharepoint.

This has taken quite some time, admittedly as I was fitting it in the spare time I had.  The Http Handler example I talked about earlier was the spark, I had been trialling using this with external web services having trouble with security etc with my client scripts.  Eventually I had a prototype, but this was very messy. 

Now I have a complete example, but I am breaking it down into pieces.  First is the Dynamic Update Panel control.  This is a .NET 1.1 server control that generates all the jscript for a page, allows multiple instances per page of a popup each working independantly of one another.

The picture shown is a crop of a sharepoint portal page.  You can see a webpart with its title and two lines of text.  The Free floating draggable border thing, is the Popup Update panel.  By clicking on a link the AJAX magic makes a request and populates the panel with HTML. 

This is a link to the Source Code for you to try.

There are some things you need to know.

The project uses Build events to copy the latest version of the .js to the aspnet_client folder.

The project should be GAC’d (well yes and no but GAC it anyway).  Check the SNK location in the assembly.cs file.

You will need to make sure the aspnet_client script exists on install.

There is also a test project included that uses the control in an aspx page, configure that, the reference to the Control will be wrong etc.

Your paths are not the same as mine!

Once this is working you can try the next stage of this which is an Ajax Web part that uses this control.  Coming soon. Can you guess what it is yet ?

*Note.  You try this at your own risk, I nor my employer takes any responsibility for this code.  Use your common sense.  If it breaks you have only yourselves to blame.

Thanks to Mark Sheppard, I stole his find the aspnet_client folder code.  Thanks to Dave for letting me post what has been a work/my time project.

This project is still a work in progress. 

Better Firfox and IE handling for dragging and overflow is required.  A choice of GET/POST for the HTTPRequest is required.

Stylesheets

Ability to name parameters passed to the httpRequest (currently fixed to KeyValue1 etc up to 5 max, look at the code you’ll see why, I’m slack).

I’m considering XML/XLST client side rendering instead of HTML output also.

And many more changes besides.

The stuff that arrives here

This is a photo of yet another purchase by mark, it is a diff gearbox for remote control cars. it seems everyday yet another piece of technology in various guises arrives in the office. my favourite has been the laser pens its a pen and a PDA pointer a led torch and a laser pointer in a compact pen all for 5 dollars, thanks to Dan for finding that one.

If you like technology see marks blog http://www.gogadgetgo.com

IMAGE_00025.jpg

Image test this time

Now I thought I’d do an image test with blogmailr. Try tags as well

(tags:blogmailr)

IMAGE_00024.jpg

Published with BlogMailr

Just as I find one

Just as you test one mail to blog another appears. This is a test without an image.=

Published with BlogMailr

Hello, its me.

Flickr and Picasa

Now I love picasa and when picasawebs came out I thought fantastic, auto sync, memberships groovy interface.  Well I got part of one of those a pretty interface that I like, but thats about it.  Membership and sync were out and the limits, I wasn’t sure, thought they were too small.

Flikr on the other hand I hated, I still hate the interface, Im getting used to it but I hate it.  However when you have a large digital photo collection and loads more to scan then you cant fight it anymore, you have to pick flickr.

I wasn’t about to make my picasaweb photos public and maintaining a seperate page for the family changing each time i add a new set was a pain.

Now I’m used to flickr and it has great limits and tags, tags are great but that damn organiser in flickr is rubbish and flaky, it frequently fails on me.  So how to get tags into flickr ?  Picasa.

Picasa or at least the latest one Im using has “Keywords”, these are tags.  Picasa’s interface for adding tags, lots of them across your collection is really quick and really easy.  Now using Flickrs uploading tool with your newly tagged photos auto tags them in flickr as well.  This is really time saving.

So now I have the best of both worlds, a great client side photo organiser and a great web based photo sharing backup site, complete with fully tagged photos.

 

Technorati tags: ,