How do you switch to a different site template in SharePoint 2010? - sharepoint-2010

If you used a site template (such as the Document Center template) and wish to use a different template (such as a Team Site), how can you accomplish this? More importantly, how do you do this without losing permissions that have been setup on the document libraries, lists, etc?

This functionality is not available in SP2010. Once a site is setup with a template that is how it is created. That being said, you can simply add the functionality you require to make the site appear to be of another template. By selecting a template, you are simply setting a starting point and not restricted future usage.

Related

custom page in sharepoint 2010

We are currently working on small SharePoint project.
As per our requirement, we need to implement custom check in page with additional drop down list to select File status.
Would like to know whether we can customize default check in page? If yes, How? How to redirect to custom page?
I would argue that what is the purpose of applying the metadata at the check-in status? Can this be a metadata property of the document? And if so it can easily be set in most office clients inside the document bar. Allowing them to retain their built in office client functionality. If this isn't the case. I would suggest using the Client Side Object Model to build a custom action that sets this value and then checks the file in. It would be much easier than creating custom action pages

Programmatically accessing a Sharepoint list at runtime (without creating a service reference at design time)

I'm creating an app that will be configurable by the end-user to access SharePoint lists, on various different SharePoint sites, that are entered by the user.
All of the examples for reading SharePoint lists I've come across online are of the form:
Open or create a Visual Studio
project.
In Solution Explorer,
right-click the References node, and
then click Add Service Reference.
In the Address box, type the URL to
the target site and append
/_vti_bin/ListData.svc. For example,
the address for the site
intranet.wingtip.com would be
http://intranet.wingtip.com/_vti_bin/ListData.svc.
Change the default name in the
Namespace box from ServiceReference1
to something more appropriate, such
as WingtipSite.
etc, etc, etc
This method creates proxy classes within your project based on the specified server reference. However, in my case, the server/site is not known at design time, only runtime by reading the sites/lists specified by the user. How would one go about doing that (reading the list via http://intranet.wingtip.com/_vti_bin/ListData.svc, but at runtime only)?
Note: I am making this call from a different machine than the one running Sharepoint.
There are a couple answers.
If the lists schemas will be consistent across all the sites you are querying, you can still use the generated proxy. When you create the DataContext, you just need to pass in the URI to the ListData.svc for the site chosen by the user.
If not, then you can use an ASP.NET WebRequest with an appropriately formatted URI and parse out the ATOM or JSON response that comes back.
For more information on using the REST APIs, check out this talk from the 2009 SharePoint Conference
http://msdn.microsoft.com/en-us/sharepoint/ff462048
You can set the URL in your proxy class at runtime with the Url property.
SharePoint does not provide a proxy class for their web services. Therefore it's not possible to set the url at runtime. WHat I have had to do is add 2 service references and then paramaterize which one I will access. I use a config setting to determine which one to access. If the site name changes or list changes, then I need to remove the references, re-add them, recompile and redeploy. There is no way to change the SharePoint site/list at runtime. Have been searching for 3 days for an answer. Microsoft does not know how to accomplish this.

prevent duplicate site / page / layouts / templates / webparts, possible

We have a sharepoint environment with many sites (and sometimes many site collections). Each site (or site collection) has the same default page with some custom webparts that use sitecolumn values (for example a projectcode or clientcode) to show information from external systems. (for each project we have to create a separate site (or site collection) because of other reasons)
What is the best approach to minimize duplication? The dynamic parts of the page are stored in site columns. When we add a new webpart, ideally the default page every site/page should show the new webpart without spreading the update to the individual pages
Thanks
One approach you may want to take is to use the web part as a wrapper for a user control. The user control does the heavy lifting on the site. Once the web part is included on your pages, the user control should be able to tell which site it is being executed on and pull the necessary dynamic data from your site columns.
When you need to make updates, you update the user control and then redeploy the solution package to the farm. Each site will pick up the change as soon as the solution is deployed.
Here is a little information about this approach:
http://msdn.microsoft.com/en-us/library/ff649867.aspx.
The above article relates to WSS 3.0, but that should give you a starting point.
An approach you may want to look at for SharePoint 2010 is a visual web part. More info can be found here: http://msdn.microsoft.com/en-us/library/ff597539.aspx.

SharePoint 2010: Point a PortalSiteMapProvider to a specific site collection

Is it possible to get an OOTB PortalSiteMapProvider to provide a site heirarchy from a specified site collection or URL (i.e. not the current site collection) in SharePoint 2010? In MOSS this was only possible by creating a custom SiteMapProvider, traversing the site collections and manually building the navigation tree.
NB: I am not prepared to write a
custom SiteMapProvider that reads from
a static XML (.sitemap) file as the regular site contributors may not have access to files on the file system.
A little bit of background... I have a single web application with 2x site collections:
1 for my intranet portal at http://intranet/ (publishing enabled)
1 for the My Sites at http://intranet/my (publishing not enabled)
We have no plans to facilitate multiple portals, therefore, I would like a consistant global navigation bar across both site collections. Ideally, I'd like the My Sites to show the site heirarchy from the main portal site. So is it possible to set the PortalSiteMapProvider.CurrentSite property to "http://intranet/" instead of "http://intranet/my"?
To achieve this behaviour I wrote my own web service which goes off and traverses another site collection's hierarchy (using it's own PortalSiteMapProvider), and returns that structure as an XML document. I obviously then bound my global navigation navigation menu to that.
I got the concept from here: PortalSiteMapProvider
There is a similar approach describes here which uses HttpHandlers instead: http://blog.symprogress.com/2011/03/sharepoint2010-custom-navigation-provider-cross-sitecollection/

How is the Trac Project List page customised?

We've been using Trac for a while now for our developers only. However we are now opening it up for our (internal) clients. We have a project listing page (based on the default one that comes with Trac). What we'd like to do, is display more information about the project than what is currently available.
I have searched google and here, to see if I can find how to get more information. There seems to be a variable called $project which has .name, .description and .href as attributes.
Is there somewhere, a list of the attributes available? Or perhaps a different solution altogether that will allow us to display more information on the project list page. Such as the number of open tickets etc.
As far as I known, you can use $project.env as well. It is an object, which provides a number of attributes:
$project.env.base_url
$project.env.base_url_for_redirect
$project.env.secure_cookies
$project.env.project_name
$project.env.project_description
$project.env.project_url
$project.env.project_admin
$project.env.project_admin_trac_url
$project.env.project_footer
$project.env.project_icon
$project.env.log_type
$project.env.log_file
$project.env.log_level
$project.env.log_format
More detail is available at env.py
On the project page customization page there is not much variables, indeed. Looking at the source code there is also trac.version, trac.time, but that's all. There is also project.env that may hold more information. I do not have a multiproject setup at hand, so you might be interested to see for yourself what variables are available with TracDeveloper plugin. It dumps variables if enabled and you add debug=true in the URL.