Sign In
zevenseas logo
What we offer
Work
Community
Who and where
Communities
Consultancy
Products
With us
Industries
Through us
Get on board
Jobs in the US
Blogs
Stuff
Codeplex
News
Who are we
Where are we
 
Navigation
  • Community Home
  • Blogs Home
  • This Blog's Home
Archives
  • February 2008 (4)
  • March 2008 (22)
  • April 2008 (5)
  • May 2008 (4)
  • June 2008 (3)
  • July 2008 (7)
  • August 2008 (1)
Categories
  • Support
  • Code
  • How-to
  • Governance
  • MOSS Search
  • LoveLinks
  • Workflow
RSS Feed Feed your read!

Site Life Cycle Management V2 .. Why V2?

February 29, 2008 - 17:14, by Robin Meure

I've been busy this week with a new project called LCMv2. If you remember, Joel Oleson and Bill Bear posted a governance solution called Site Life Cycle Management a while ago on CodePlex. MS IT use this solution to do the following:

Microsoft IT Team Site Life Cycle Management is a custom Microsoft solution that provides lifecycle management for Windows SharePoint Services site collections through write locking, back up to disk.
The MSIT SLCM tool helps you by "arching" (backup/delete) unused sites and automating the notification process of pinging owners on sites that are not in use. A site collection is used to administer the settings and configuration for the Site Life Cycle Management process.

Now the customer where I'm currently working requested such a feature. So I downloaded and installed it on our development environment to see if it worked and more importantly how it worked since the customer also had some extra requirements like : give us a report that tells us how many sites are using the Enterprise features, how many sitecollections are in each webapplication, how many MySites are there and more analytical stuff like that.

So I downloaded the source code and the first thing I was particularly interested in was the EventReceiver. So I went in the folder and opened up the DeleteEventReceiver.cs file and while browsing the code the following caught my attention :

v2deprecatedclasses

Then I scrolled up again and noticed that the source code was dated in November 2006 .. just shortly after the launch of our beloved 2007 version. So that's probably the reason why the new classes like SPFarm and SPWebApplication weren't used. After seeing this and other things like the custom Windows Service (why not use a custom TimerJob) and the separate creation of a sitecollection to configure the LCM (why not use a propertybag to store data and use a custom .aspx page in the Central Admin to configure) I decided to recreate and extend this solution!

So things to do are :

  1. Create an application page to configure LCM settings
  2. Modify the EventReceiver to make use of the new OM
    • While deleting, store information about the site (date of deletion, name of backup file, size of site)
  3. Create a custom timer job to gather all the information of all the webapplications and it's sitecollections
  4. Create an application page to get an overview of all the gathered information
    • Get an overview of unused sites
    • Get an overview of sites / webs with enterprise features enabled
    • Get an overview of how many sites per webapplications are in the farm
    • Get an overview of all the mysites
    • Get an overview of all unique active users on the farm
  5. Create a subweb to store rich information about all the gathered information within the CA

And while we are at it.. store the custom webparts (already built) that displays the following information in there as well :

  1. For a given user, show what his or her rights are on each sitecollection and webs
  2. For a given site/web, show what all the rights are per user per list/document library

Think it makes sense to redevelop the whole tool to be a. supported when we upgrade to the next version and b. make it more fancy by using 2007 techniques. I got 75% covered already this week.. so expect to see the final version and the post on 'How we dit it' very soon (prolly within a week after the SharePoint conference)

0 Comments


Seattle!

February 26, 2008 - 20:19, by Robin Meure

Well.. maybe a bit late to announce but together with Daniel, Hans and Mark I'm going to be in Seattle next week to attend the SharePoint Conference! So if you want to meet me (or the rest of the crew) just ping me and we will arrange something! ;) If you are unfortunate enough to join us in Seattle.. don't worry! We have a separate Seattle Blog that can be found here. The purpose of this blog is to inform you about all the news and interesting sessions so it would almost feel like you are actually there with us!

Couple of todo's for me personally :

  • Visit Microsoft HQ
  • Buy clothes in a A&F (outlet) store
  • See an Ice Hockey game
  • Go up the 'needle'
  • And of course.. drink lot's of beer! *cough* with all the SharePoint minded people (and 'normal' people as well ;))

See you there!

2 Comments


InfoPath attachment workflow activity

February 26, 2008 - 19:58, by Robin Meure

If all went right you are reading this through my new weblog that is located at : http://community.zevenseas.com/blogs/robin. Hopefully for you, the rss-reader, you won't notice the change of the transition ;)

A few posts ago I wrote about a console application which extracted attachments from a published infopath document. In that post I described that it was pretty cool that by using some fancy techniques you could access all of your infopath fields through an object model by creating XSD classes. Sure this is really good technique, it is not very generic. If you have multiple infopath documents, you will need to create a schema for each of your infopath forms. That's why I decided to discard the technique and went for a more simple solution which is generic.

XmlTextReader reader = null;

System.IO.StreamReader str = new System.IO.StreamReader(file.OpenBinaryStream());
reader = new XmlTextReader(str);

while (reader.Read())
{
    if (reader.Value.Length > 255)
    {
        UploadIntoSharePoint(reader.Value);

    }
}

So.. If the length of the value within a field is larger than 255 characters I assume that it is an attachment. I know.. it's tricky because you can have a multineline field which can hold more than 255 characters. I have to figure out what the best magical value could be to distinctively identify what could be an attachment and what not.

But it does the trick right now ;) Next thing is to embed the code in a custom workflow activity! My activity accepts the following parameters :

  • Url (url of the SharePoint web)
  • Form Library (name of the form library where the forms get published to)
  • FormItemID (ID of the form item)
  • Target Document Library (target document library to store the attachments in)

Next to do that I use two functions :

  • GetDocumentsFromForm
  • private void GetDocumentsFromForm() 
    { 
        Uri uri = new Uri(Url); 
    
        SPWeb web = new SPSite(Url).OpenWeb(); 
        SPList formlist = web.Lists[ListName]; 
        SPListItem formitem = formlist.GetItemById(Convert.ToInt32(ListItemID)); 
    
        SPFile file = formitem.File; 
        XmlTextReader reader = null; 
    
        System.IO.StreamReader str = new System.IO.StreamReader(file.OpenBinaryStream()); 
        reader = new XmlTextReader(str); 
    
        while (reader.Read()) 
        { 
            if (reader.Value.Length > 255) 
            { 
                UploadIntoSharePoint(reader.Value); 
    
            } 
        } 
    } 
  • UploadIntoSharePoint
  • private void UploadIntoSharePoint(string attachment) 
    { 
            Uri uri = new Uri(Url); 
    
            SPWeb web = new SPSite(Url).OpenWeb(); 
            SPFolder AttachmentStore = web.GetFolder(DocumentLibrary); 
            SPList formlist = web.Lists[ListName]; 
            SPListItem formitem = formlist.GetItemById(Convert.ToInt32(ListItemID)); 
    
            try 
            { 
                InfoPathAttachmentDecoder Attachment = new InfoPathAttachmentDecoder(attachment); 
                SPFile newfile = AttachmentStore.Files.Add(Attachment.Filename, Attachment.DecodedAttachment); 
                SPListItem item = newfile.Item; 
                item["RelatedForm"] = formitem.ID + ";#" + formitem.Title.ToString(); 
                //item["DocumentationType"] = type.ToString(); 
                item.Update(); 
            } 
            catch (Exception error) 
            { 
                Console.WriteLine(error.Message.ToString()); 
            } 
    
            web.Close(); 
            web.Dispose(); 
    
    } 

So that's pretty much it.. let me know what you think!

7 Comments


Time for a change!

February 22, 2008 - 13:12, by Robin Meure

It's been 3,5yrs ago since I joined Atos Origin after graduating in july 2004. A lot has happened since that time, not only professionally but also personally. During my carreer at Atos, I've met a lot of good colleagues/friends like (my fantastic people manager): Gijs, Coen, Joost, Paul, Stan, Steve, Suus, Jacques, Karlijn, Hendrik, etc.. And gained a lot of experience and knowledge and my particular interest in the product SharePoint.

So why the change? Well I was asked by Daniel McPherson to join a new company called zevenseas (yes.. no capital in the name) which is founded by Daniel himself and Hans Blaauw (point2share.com and points2share.com.. you do the math how they found each other ;). So what makes zevenseas so special? I'll tell you!

  1. Being a member of elite team of SharePoint experts
  2. Being a part of something new that has the potential to become something very big in the (near) future and having the influence of creating it
  3. 4days @ the customer and 1 day 'creative learning' work ethic
  4. Having two new fantastic friends/colleagues/bosses and one more in the near future!

Pretty good points eh? ;)

So to conclude this post. I just wanted to share that this is my first official day working at zevenseas and so far I like it !

1 Comments


 

© 2007 Community Kit For SharePoint