none
wsp upgrade/update + pagelayout + module + exported webpart and included in the element xml

    Question

  • Hi

    trying to upgrade web part property that is residing in a pagelayout's module element xml file like :

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Module Name="PageLayouts" Url="_catalogs/masterpage">
      <File Path="PageLayouts\XXXXXXXXXXXX.aspx" Url="XXXXXXXXX.aspx" Type="GhostableInLibrary">
          <Property Name="Title" Value="pagelayout_XXXXXXXXXXXX;" />
          <Property Name="ContentType" Value="XXXXXXXX Layouts" />
          <Property Name="PublishingAssociatedContentType" Value="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" />
           <AllUsersWebPart WebPartZoneID="Zone1" WebPartOrder="1">

              <![CDATA[<webParts>    <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
            <metaData> <type name="Project.project.WebParts.webpart,Project.project.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxx" />
                </metaData>       <data>   <properties>

                    <property name="Title" type="string">XXXXXXXXX</property>
                    <property name="ChromeState" type="chromestate">Normal</property>
                    <property name="ChromeType" type="chrometype">None</property>
                    <property name="ResultLimit" type="int">5</property>

                </properties>    </data>    </webPart></webParts>        ]]>      </AllUsersWebPart>    </Module></Elements>

    so lets say I wanted to change the <property name="ResultLimit" type="int">5</property> to <property name="ResultLimit" type="int">25</property>

    and used the update wsp or upgrade , there is no effect seenniether on the exisiting nor on the new created pages that is using this layout, after some searching and reading the ghosting unghosting fenomena in the in :

    http://blog.beckybertram.com/Lists/Posts/Post.aspx?List=5489bebf%2Dbd8d%2D4a6f%2D995b%2D3a0a456796f6&ID=9&Web=316c15c2%2D6bc0%2D464f%2Dbda1%2D7ba96b4ba453

    http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopmentlegacy/thread/83393c7a-4231-42b6-b676-0aa866b900d8

    http://ateraprime.com/community/Blog/Lists/Posts/Post.aspx?ID=24 http://alephnullplex.appspot.com/blog/view/2010/06/17/sharepoint-solution-upgrade-woes

    http://blog.mediawhole.com/2008/07/uncustomising-moss-pages-part-2.html

    and trying to revert the targeted page layout that is needed to get the effect : first it seems to be uncustomized when running the follwing ;

    $webapp = Get-SPWebApplication
    $site = Get-SPSite  http://localhost
    $web = $site.RootWeb
    write-host = $web.Title
    $pweb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
    $layouts = $pweb.GetAvailablePageLayouts()
    foreach ($PageLayout in $layouts)
       {
       if( $PageLayout.ServerRelativeUrl -eq "/_catalogs/masterpage/xxxxxx.aspx")
        {
        [Microsoft.SharePoint.SPFile]$file = $web.GetFile($PageLayout.ServerRelativeUrl);
        
        write-host $PageLayout.ServerRelativeUrl
        write-host $file.Title
        write-host $file.CustomizedPageStatus
       
        }
        
        
        }
    even then trying to
    force that .---->file.RevertContentStream() nothing happens and the page layout wiil always be the old vesrion despite seeing that on the file sysytem under the 14 the information is changed but take no effect, the option of redeploying the wsp is not avalable as the thing in production , and even if its not on the test environemnt deploying the wsp will mess up the layout more and the pagelayout will have duplication  of the webparts , but this is even not an optiion 

    any similar experince 

    thanks



    azoozazooz


    • Edited by azoozazooz Thursday, November 22, 2012 2:50 PM spell
    Thursday, November 22, 2012 2:49 PM

Answers

  • Hello,

    You need to deactivate and activate the feature which deploys your page layouts. Also this change will affect only newly created pages and not for existing pages. 

    For existing pages you need to write power shell script. Please refer my blog http://prashamsabadra.blogspot.in/2011/12/how-to-setupdate-webpart-property-using.html for changing the web part property for the existing pages.

    Please let me know if you face some more issues.


    Thanks! BR, Prasham http://prashamsabadra.blogspot.in/

    Wednesday, November 28, 2012 5:12 AM

All replies

  • Hello,

    You need to deactivate and activate the feature which deploys your page layouts. Also this change will affect only newly created pages and not for existing pages. 

    For existing pages you need to write power shell script. Please refer my blog http://prashamsabadra.blogspot.in/2011/12/how-to-setupdate-webpart-property-using.html for changing the web part property for the existing pages.

    Please let me know if you face some more issues.


    Thanks! BR, Prasham http://prashamsabadra.blogspot.in/

    Wednesday, November 28, 2012 5:12 AM
  • Hello,

    Is your problem resolved by deactivating and activating the feature.


    Thanks! BR, Prasham http://prashamsabadra.blogspot.in/

    Thursday, November 29, 2012 8:02 AM