Search This Blog

Wednesday, February 22, 2012

Importing SharePoint 2007 list templates (STP) into SharePoint 2010

if you need to migrate list templates STP's from SharePoint 2007 to 2010, you could try the following:

  1. Rename the original .STP to .CAB

  2. Extract its manifest.xml to a local folder (lets call it {workingfolder})

  3. Search for the ProductVersion element. This should have a value of 3

  4. Change its value to 4

  5. Repackage the manifest.xml into a .CAB. I've done this by using makecab.exe in the C:\Windows\System32 folder
    : makecab.exe {workingfolder}\manifest.xml {workingfolder}\{template-name}.cab

  6. Change the generated cabinet's extension from .CAB back to .STP and upload it into the _catalogs/lt


c:\Windows\System32>makecab.exe C:\Users\Administrator\Desktop\QueriesList\manif
est.xml C:\Users\Administrator\Desktop\QueriesList.stp

Monday, February 13, 2012

SharePoint Application Pages Vs Site Pages

SharePoint Application Pages Vs Site Pages

Application Pages:

  • These are the normal .aspx pages deployed within SharePoint. Most common of them are the admin pages found in _layouts folder.

  • These are deployed either at the farm level or at application level. If they are deployed within _layouts folder or global SharePoint Virtual Directory, then they can be used by any SharePoint application (available at farm level), otherwise they can be deployed at application level only by creating a virtual directory.

  • These are typical ASP.Net aspx pages and can utilize all of the functionalities available within ASP.Net including code-behind, code-beside, inline coding etc.

  • These are compiled by .Net runtime like normal pages.

  • If you deploy your custom ASPX pages within _layouts folder or within SharePoint application using a virtual directory, you will not be able to use SharePoint master pages and have to deploy your master page within the virtual directory or _layouts folder.

  • Application Pages cannot use contents as this concept is associated with SharePoint Page Layouts not with ASP.Net.

  • Since application pages are compiled once, they are much faster

  • Normally application pages are not web part pages, hence can only contain server controls or user controls and cannot be personalized by users.

  • Easiest way to deploy your existing ASP.Net web site within SharePoint is to deploy its pages as Application Pages within SharePoint. In this way you can convert any ASP.Net web solution as SharePoint application with minimal efforts.

  • SharePoint specific features like Information Management Policies, Workflows, auditing, security roles can only be defined against site pages not against application pages.

  • Application pages can be globalized using Resource files only.

  • Site Pages

    1. Site Pages is a concept where complete or partial page is stored within content database and then actual page is parsed at runtime and delivered to end-users.

    2. Pages stored in Pages libraries or document libraries or at root level within SharePoint (Wiki pages) are Site Pages

    3. You must be thinking why we should use such pages? There are many reasons for this. One of the biggest catch of the SharePoint is the page layouts, where you can modify page once for a specific content type and then you can create multiple pages using the same page layout with different contents. In this case, contents are stored within database for better manageability of data with all the advantages of a data driven system like searching, indexing, compression, etc and page layouts are stored on file system and final page is created by merging both of them and then the outcome is pared by SharePoint not compiled.

    4. Site Pages can contain web parts as well as contents placeholders, and all of them are stored per page-instance level within database and then retrieved at run time, parsed and rendered.

    5. Another advantage is they are at user-level not at web-application or farm level and can be customized per site level.

    6. Since their definition is retrieved from database, they can utilize master pages stored within SharePoint masterpages library and merged with them at run time for rendering.

    7. They are slower as compared to Application pages as they are parsed everytime they are accessed.

    8. SharePoint specific features like Information Management Policies, Workflows, auditing, security roles can only be defined against site pages not against application pages.

    9. Since they are rendered not compiled hence it is not easy to add any inline code, code behind or code beside. Best way of adding code to these pages is through web-parts, server controls in master pages, user controls stored in “Control Templates” folder or through smart parts. If you want to add any inline code to master page, first you need to add following configuration within web.config:<PageParserPaths>

      <PageParserPath VirtualPath=”/_catalogs/masterpage/*” CompilationMode=”Always” AllowServerSideScript=”true” IncludeSubFolders=”true” />


    10. To add code behind to SharePoint master pages or page layouts, refer to this MSDN article

    11. Since Site pages are content pages, hence all SharePoint specific features like Information Management Policies, Workflows, auditing, security roles can only be defined against site pages.

    12. Variations can only be applied against Site pages for creating multilingual sites.

    13. “SPVirtualPathProvider” is the virtual path provider responsible for handling all site pages requests. It handles both ghosted and unghosted pages requests as shown below: