Thursday, May 8, 2008

A Lookup to the sub sites

A question:
"I'm creating a WSS 3 site which will have a new subsite each time there is a planning application.
From the parent site I want to be able to enter documents and say which application it belongs to but I don't want the user to have to maintain a list of application names when they could just lookup to a list of all the Application subsites that have been created.
Does anyone know if that's possible?"

My Answer:
This is not possible out of the box (unless you use the SiteDirectory template, and create the application sites' there).

To code it, here are several options:

Either connect a workflow or an event handler to a list of applications, and the workflow\event handler can create the site for you.

Develop a custom field control that will load the list of sub sites for the user.
This should be more robust than option 1, since a workflow\event handler may fail to create the site and you will end up with a mess. however, custom field controls are not supported by office - so you will not be able to set the metadata on documents from within the office applications.

Develop a timer job that synchronizes the list of sites into a choice field as choices.

This will be robust, and will work in office - but will put a load on the server
RECOMMENDED: develop a feature for the application sites that will add the name of the site to a list when the feature is activated.

This will be better than option 1 because you can trigger it again if it fails, without re-creating the site. Also it will have much less load on the server than option 3, and better performance than option 2 since it will not have to check the sites every time someone wants to upload a document. Also - easy development.

Develop a BDC application (using a custom web service) to show the list of applications based on the existing sites.

This may be the second easiest option (after #4) - such a web service is easy to develop. But this will only work if you have MOSS license, as the BDC is not part of WSS.

No comments:




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com