tag:blogger.com,1999:blog-8257012011174718720.post1764515993035952618..comments2024-03-28T22:48:01.249-07:00Comments on Stefan Stanev's SharePoint blog: Provision publishing pages in a sandbox solutionStefan Stanevhttp://www.blogger.com/profile/08627530356349625319noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-8257012011174718720.post-13513684591887094612015-05-08T10:14:29.473-07:002015-05-08T10:14:29.473-07:00Hi,
Apparently it is not possible to do:
<Prop...Hi,<br /><br />Apparently it is not possible to do:<br /><Property Name="PublishingPageLayout" Value="~Site/_catalogs/masterpage/<br /><br />i.e. to reference a Page Layout which is deployed into the current SPWeb, rather than the SPSite. Not sure why...<br /><br />Pozdrawi ;)HYhttps://www.blogger.com/profile/07286081906176391131noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-29381800561915297652013-07-29T13:38:31.013-07:002013-07-29T13:38:31.013-07:00Hi Justin,
well spotted, thanks for the correctio...Hi Justin,<br /><br />well spotted, thanks for the correction<br /><br />Greets<br />StefanStefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-22470538496646137722013-07-29T12:16:00.858-07:002013-07-29T12:16:00.858-07:00Excellent article. One other thing I came across f...Excellent article. One other thing I came across from another blog is the token for the Pages library created by the publishing feature. I have not tested, but presumably the pages library would not be called 'pages' in site collections from different language packs. Using the token will be safer.<br /><br />In the Url attribute of the Module element, use Url="$Resources:osrvcore,List_Pages_UrlName;"Anonymoushttps://www.blogger.com/profile/06473331301173266847noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-51558094176149232252013-07-29T12:13:53.510-07:002013-07-29T12:13:53.510-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/06473331301173266847noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-43962458831237420892013-03-15T07:20:11.925-07:002013-03-15T07:20:11.925-07:00You saved my life! Thanks a lot! This is sooo good...You saved my life! Thanks a lot! This is sooo good , that ppl like you share this with othersAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-78198825625765387672012-12-07T12:13:49.112-08:002012-12-07T12:13:49.112-08:00Hi Srinu,
you can reference any file (any aspx pa...Hi Srinu,<br /><br />you can reference any file (any aspx page) under the standard SharePoint TEMPLATE folder. So, if you want to provision a page as the one used in the standard team template for instance you can use these values of the SetupPath attribute (of the Module element) and the Path attribute (of the File element): "SiteTemplates\STS" and "default.aspx" (note the different subfolder here STS and not SPS as it was in the posting). Note that the concatenated values of these two attributes give you the relative path of the referenced file in the TEMPLATE folder, so you can choose any of the existing files there.<br />The web part pages templates available in the standard team site template are available in this subfolder under the TEMPLATE folder: 1033\STS\DOCTEMP\SMARTPGS - the file names go from spstd1.aspx to spstd8.aspx<br /><br />Greetings<br />StefanStefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-58226864140440845912012-12-06T08:24:04.874-08:002012-12-06T08:24:04.874-08:00Hi,
For Provisioning Publishing page you are usin...Hi,<br /><br />For Provisioning Publishing page you are using<br /><br /><br /><br /><%@ Page="" Inherits="Microsoft.SharePoint.Publishing.TemplateRedirectionPage,Microsoft.SharePoint.Publishing,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %><%@ Reference="" VirtualPath="~TemplatePageUrl" %><%@ Reference="" VirtualPath="~masterurl/custom.master" %><br /><br />Can you tell me for provisioning webpart page what we have to use?<br /><br />Regards,<br />SrinuAnonymoushttps://www.blogger.com/profile/03341812199941357666noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-71229471865817241562012-09-22T01:03:02.927-07:002012-09-22T01:03:02.927-07:00Hi Tal,
you mean whether it is possible to provis...Hi Tal,<br /><br />you mean whether it is possible to provision a page containing an inline block of code containing a Response.Redirect method call? If this is the case - the answer is yes - you can provision almost any type of file to a SharePoint library regardless of the contents of the file. The important question after that is whether the page containing inline code will work - and the answer here is no - inline code is by default not allowed in pages in the content database. This can be enabled though in the web.config file using the "PageParserPaths" element - check this posting of mine which contains more details about this: http://stefan-stanev-sharepoint-blog.blogspot.nl/2011/10/normally-user-controls.html<br />But if you are using a sandbox solution in the first place you will most probably be not allowed to do web.config changes. If this is the case the last option that you can consider is to use the standard publishing redirection page layout which comes OOB with SharePoint.<br />Let me know if this was of help for you<br /><br />Greets<br />StefanStefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-29700253934916767532012-09-13T07:13:37.463-07:002012-09-13T07:13:37.463-07:00Stefan, Can I to use Response Redirect to redirec...Stefan, Can I to use Response Redirect to redirect the page using feature ?? Talhttps://www.blogger.com/profile/08962385008258680130noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-32224681842784261982012-09-05T04:19:36.512-07:002012-09-05T04:19:36.512-07:00Hi,
it looks like the problem is caused by a web ...Hi,<br /><br />it looks like the problem is caused by a web part schema that you have in your Module element. Did you try to provision your page file without any web parts in it? If the issue still persists you can paste the whole Module element snippet in a new comment so that I can check it.<br /><br />Greets<br />StefanStefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-22667300364579672112012-08-27T15:33:05.444-07:002012-08-27T15:33:05.444-07:00Hi Stefan,
I tried to create a module just like y...Hi Stefan,<br /><br />I tried to create a module just like your example to deploy to a subweb. But I get the following errors from the ULS logs...<br /><br />Failed to find a suitable list id for doc 'SitePages/MyHome.aspx' given List template attribute 'Lists/Tasks'<br /><br />Failed with 0x80004005 to create the view query or web parts for web /01, site collection (unspecified), URL SitePages/MyHome.aspx<br /><br />any help is much appreciatedAnonymoushttps://www.blogger.com/profile/14411078756020760911noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-15338699618045332912012-07-28T09:46:39.904-07:002012-07-28T09:46:39.904-07:00Hi Sangram,
I couldn't quite understand your i...Hi Sangram,<br />I couldn't quite understand your issue - the corev4.css link gets rendered by the CssLink control in the master page. You can either remove it or use its Alternate property to specify whether the default stylesheet should be rendered.<br /><br />Greets<br />StefanStefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-55917976156075652752012-07-25T03:36:28.352-07:002012-07-25T03:36:28.352-07:00Thanks Stefen for your valuable reply.. I get the ...Thanks Stefen for your valuable reply.. I get the master page from Sharepoint RPC call like fiddler do that. I just stuck when I'm trying to migrate master page from source to target I have ghosted master page migrate with unghosted on target and unghosted css file which i have modified to corev4.css and its saved at _styles folder automatically. I did not find any reference link in master pages for customized css so I can not migrate them as it is on targetSangram Gawadehttps://www.blogger.com/profile/07583744018176465435noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-72936660099478297832012-07-13T01:05:24.923-07:002012-07-13T01:05:24.923-07:00Hi Sangram,
I saw this - the File.OpenBinaryDirect...Hi Sangram,<br />I saw this - the File.OpenBinaryDirect method uses a WebDav call (simple HTTP POST request with the "Translate: f" HTTP header) to get the contents of the file. I think that there is a built-in security protection for ".master" files (and probably some other file types) and this is why the server returns a 404 error. I tried to find something on Google but without success.<br />I would suggest that you try using the old style SOAP web service: _vti_bin/WebPartPages.asmx (SPD 2010 itself uses it to fetch file contents). The SOAP method that does the job is this: WebPartPagesWebService.GetWebPartPage (you can check it in MSDN: http://msdn.microsoft.com/en-us/library/ms772651%28v=office.12%29).<br />Let me know if this works for you<br /><br />Greets<br />StefanStefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-21361140988379772502012-07-10T06:23:18.940-07:002012-07-10T06:23:18.940-07:00Hi Stefen,
I am trying to open master pages from ...Hi Stefen,<br /><br />I am trying to open master pages from File.OpenDirect() I can open file if it is not master page but If I tried to open master page its through exception as "File Not Found" could you help me in that?Sangram Gawadehttps://www.blogger.com/profile/07583744018176465435noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-19143663660956427472012-06-20T09:50:06.529-07:002012-06-20T09:50:06.529-07:00Hi Stefen,
I'm trying to move sitepages from ...Hi Stefen,<br /><br />I'm trying to move sitepages from one site to another site with contained all the web parts in aspx pages. I am using FileInformation fi=File.openBinaryDirect(serverRelativeURL); I am using stream in that but I could not get <br /> <br /> content in my final string.. Could you please help me in that.<br /><br />Thanks in AdvanceSangram Gawadehttps://www.blogger.com/profile/07583744018176465435noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-17110065894739401082012-06-04T11:03:20.973-07:002012-06-04T11:03:20.973-07:00thank you!!!!thank you!!!!p3040084_p3040121https://www.blogger.com/profile/02481592331528104876noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-44329557704385698922011-08-15T10:35:20.633-07:002011-08-15T10:35:20.633-07:00Hi,
check this simple example - a file element wit...Hi,<br />check this simple example - a file element with three view elements from a sample "Module" element:<br /><br /> <File Path="ModuleTasks\test.aspx" Url="test.aspx" Type="Ghostable" ><br /> <View List="Lists/Tasks" BaseViewID="1" Type="HTML" WebPartZoneID="Left" WebPartOrder="1" ></View><br /> <View List="Lists/Tasks" BaseViewID="2" Type="HTML" WebPartZoneID="Left" WebPartOrder="2" ></View><br /> <View List="Lists/Tasks" BaseViewID="3" Type="HTML" WebPartZoneID="Left" WebPartOrder="3" ></View><br /> </File><br /><br />This provisions a simple web part page to a team site with three XLV web parts displaying the data from the Lists/Tasks list. Each XLV web part displays a different view definition from the standard Tasks list. If you check the schema.xml of the Tasks list definition (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\TasksList\Tasks\schema.xml) you will see that the view definitions with BaseViewID-s 1, 2 and 3 correspond to the "All tasks", "My tasks" and "Due today tasks" standard tasks views. The XLV web parts in the provisioned page will display the view fields that are defined in these view definitions (and the specific filtering and sorting as well).<br />The bottom line is that you can indeed use the <webParts> element in the CDATA below the <View> element but apart from the "Title" and "Description" properties of the web part it cannot set any other of its properties (including the XmlDefinition one).<br />I see one other thing from your sample CAML - you also set the "ID" attribute of the "View" element - I have had problems with it especially when I apply the same feature many times in one and the same content DB (in one and the same site). If you don't reference this exact GUID somewhere else (e.g. in some view manipulation or web part connecting), you can safely remove it from the CAML.Stefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-26447901018621175852011-08-10T23:12:08.142-07:002011-08-10T23:12:08.142-07:00Hi Stefan,
Can you post a sample of how to pass th...Hi Stefan,<br />Can you post a sample of how to pass that xml definition. My List definition has the views configured and they do show up when the list is created. But once i deploy the page with that xslt webpart, it shows default or no view inside it.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-33901163384642214232011-08-10T12:59:55.698-07:002011-08-10T12:59:55.698-07:00Hi Praveen,
Unfortunately the options that you hav...Hi Praveen,<br />Unfortunately the options that you have with the declarative approach using the "View" element are quite limited. Actually, you can use only the "BaseViewID" attribute if you want to have a different set of view fields. And the value of the "BaseViewID" attribute should correspond to the "ID" of one of the already existing view definitions in the list definition on which your list is based. This means that you will need to have a custom list definition (or at least a list instance feature that uses the CustomSchema attribute with a separate custom schema.xml file) if you don't have a predefined view definition in it with the desired set of view fields. Another possibility, which would do the job but which defeats the whole idea of the declarative approach is to consider using the BinarySerializedWebPart feature element - you can check my posting with the same name and this blog too - http://pholpar.wordpress.com/2010/10/17/decoding-the-content-of-the-binaryserializedwebpart-the-code/<br /><br />Greets<br />StefanStefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-8635288749052081622011-08-10T02:35:39.275-07:002011-08-10T02:35:39.275-07:00Hi there,
I have added the ListView web part succe...Hi there,<br />I have added the ListView web part successfully but how to control what fields to show up on the list view??<br />I have used below code but still no luck. Could you help?<br /><br /><View List="0GeneralInformationandReports" DisplayName="0GeneralInformationandReports" DefaultView="FALSE" BaseViewID="0" Type="HTML" WebPartOrder="0" <br /> WebPartZoneID="bottomLeft_LeftZone" ContentTypeID="0x" ID="g_6A655C23_9AED_481A_A8CC_415DA52124AF" Hidden="FALSE"><br /> <![CDATA[<webParts><br /> <webPart xmlns="http://schemas.microsoft.com/WebPart/v3"><br /> <metaData><br /> <type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" /><br /> <importErrorMessage>Cannot import this Web Part.</importErrorMessage><br /> </metaData><br /> <data><br /> <properties><br /> <property name="Title" type="string" /><br /> <property name="Height" type="string" >215px</property><br /> <property name="ListName" type="string">{$ListId:0GeneralInformationandReports;}</property><br /> <property name="WebId" type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">00000000-0000-0000-0000-000000000000</property><br /> <property name="ListUrl" type="string" null="true" /><br /> <property name="ListId" type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">$ListId:0GeneralInformationandReports;</property><br /> <property name="TitleUrl" type="string">../0GeneralInformationandReports</property><br /> <property name="CatalogIconImageUrl" type="string">/_layouts/images/itdl.png</property><br /> <property name="XmlDefinition" type="string">&lt;View Name="{6A655C23-9AED-481A-A8CC-415DA52124AF}" MobileView="TRUE" Type="HTML" Hidden="TRUE" DisplayName="" Url="default.aspx" Level="2" BaseViewID="0" ContentTypeID="0x" ImageUrl="/_layouts/images/dlicon.png"&gt;&lt;Query/&gt;&lt;ViewFields&gt;&lt;FieldRef Name="LinkFilenameNoMenu"/&gt;&lt;/ViewFields&gt;&lt;/View&gt;</property><br /> <property name="MissingAssembly" type="string">Cannot import this Web Part.</property><br /> <property name="SelectParameters" type="string" /><br /> </properties><br /> </data><br /> </webPart><br /> </webParts>]]><br /> </View> <br /><br />The <XmlDefinition> has the <ViewFields> section which controls what columns needs to display. But it is not working.Anonymoushttps://www.blogger.com/profile/11277148819153438060noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-84920156638891487572011-01-05T12:36:19.916-08:002011-01-05T12:36:19.916-08:00Good ole SandboxesGood ole SandboxesTerm Life Insurance Rockstarhttp://www.wholesaleinsurance.net/noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-10214902722738858752010-08-09T00:49:39.310-07:002010-08-09T00:49:39.310-07:00Thanks for sharing it.Thanks for sharing it.Anonymousnoreply@blogger.com