SharePoint Developer Center > SharePoint Products and Technologies Forums > SharePoint - Development and Programming > Create wsp template that will relink lookups, web parts, and SPD workflows
Ask a questionAsk a question
 

QuestionCreate wsp template that will relink lookups, web parts, and SPD workflows

  • Wednesday, November 04, 2009 10:35 PMEric Sammann Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    I have done a lot of customizations on a SharePoint site using SharePoint Designer and I now want to package it up into a template that can be reused in other farms.  I have several lists that contain lookups to other lists, custom data views, and workflows that do lookups to other lists.  I  have tried creating a project using the SharePoint Solution Generator and then publishing the results to a test system.  I have also tried using the wsp builder to build the solution.  Either option seems to create a new site using new GUID's, which makes sense, but this process breaks lookups, custom web parts, and workflows.

    - Do any of you know how to relink these types of fields?
    - I have noticed that the Solution Generator comments out lookup fields.  Any idea why? (uncommenting them made it so that the site creation failed.  My first three lists were created but when it tried to create the list where I removed comments on then it failed.  default.aspx was never created so I had to go directly to the settings to delete it.)
    - Will newer versions of the SharePoint Solution generator work better?  If so, then will any extensions versions past 1.1 work with VS 2005?

    Thanks,

All Replies

  • Friday, November 06, 2009 10:07 AMAaron Han - MSFTModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi, Eric

           As your SharePoint site has been deeply customized, perhaps it is a little difficult to reuse and package all customized element and features, especially for SPD  customizations parts,

           since most of deification schemas are XML rather than class library.

           As your description, you have pointed out some keys: lookup list/customized webpart/workflow, here are some ideas:

          

    ·         For SPD workflow reusing, you can migrate the SPD workflow to Visual Studio workflow by saving XOML locally for reusing, this is not supported but it is a possible solution.

                     Please refer the following articles:

                     http://blogs.msdn.com/sharepointdesigner/archive/2007/07/06/porting-sharepoint-designer-workflows-to-visual-studio.aspx

                     http://agiledirect.wordpress.com/2008/07/04/packaging-and-re-using-sharepoint-designer-workflows-part-1/

                     Also to similar requirement for SPD WF reusing(With WSPBuilder):

                     http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/fb923a07-502c-4b08-807a-26f219744581

     

    ·         For lookup list and customized webpart, if there are some limitation with packaging the totally with tools(WSP Builder/ Solution Generator…),SharePoint also provided API / event to modify creating site with specify site template.

                     You can to see feature stapling solution (http://blogs.msdn.com/cjohnson/archive/2006/11/01/feature-stapling-in-wss-v3.aspx )

                     Feature stapling is a way to tell SharePoint when a site is created with a particular site definition activate this feature,

                     so you can add some logic(such as reset lookup list value, set property for created webpart) for new site medication as an extension of site template, site feature.

     

            Hope this can help.

     

    o    Best Regards
    Aaron

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com

     

  • Monday, November 09, 2009 8:34 PMEric Sammann Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello Aaron,

    Thing is that I am still kind of new to visual studio, so it is going to take some time to learn how to do the feature stapling.   It seems like this should be possible without feature stapling tho.  Although it has been customized with SPD I don't think that it has really been customized to the extent that I would need to use feature stapling.

    Here is the odd thing that makes me think that.  If I create a stp template then lookups work fine, and workflows work fine, but the dataview web parts and some customized pages lose their links because the GUID's have changed.  If I create a .wsp template then lookups are broken, but dataview web parts were re-linked.  Workflows are also there, but broken because the lookup colums were not recreated and relinked.  It seems like the process of recreating and relinking lookup columns should be a basic function of the .wsp template create since it is a part of the .stp template creator.

    I probably would spend 4 times as much time trying to develop a all-in-one step template as I would just deploying the site to the 4 locatoins that I need to deploy it to and then fixing the created sites (using .stp template).  Still, I would like to learn the feature stapling so I do really appreciate the links.  I was just hoping that I was missing something simple.

    Thanks,
    Eric