Im having a problem placing the XsltListViewWebPart on my Default.aspx template (relevant code bellow)
<WebPartPages:WebPartZone runat="server" ID="NewsItemsList">
<ZoneTemplate>
<WebPartPages:XsltListViewWebPart AllowPartiallyTrustedCallers="TRUE" runat="server" ListUrl="Lists/NewsItemsListInstance" ID="NewsItems" DisplayName="" ChromeType="None" ViewGuid="{00000000-0000-0000-0000-000000000000}">
<XmlDefinition>
<View Name="MyView" Default="True" Type="HTML" Hidden="TRUE" TabularView="FALSE" DisplayName=" " Url="View.aspx" Level="255" BaseViewID="2" ContentTypeID="0x01000627D3E6EEDA4DCD9F403FE5F9A66E45" ImageUrl="/_layouts/images/generic.png">
<Query>
<OrderBy>
<FieldRef Ascending="FALSE" Name="ID"/>
<FieldRef Ascending="FALSE" Name="Callout"/>
</OrderBy>
</Query>
<ViewFields>
<FieldRef Name="Attachments"></FieldRef>
<FieldRef Name="LinkTitle"></FieldRef>
<FieldRef Name="Callout"></FieldRef>
<FieldRef Name="Icon"></FieldRef>
</ViewFields>
<RowLimit Paged="TRUE">6</RowLimit>
<Aggregations Value="Off"/>
<Toolbar Type="Standard"/>
</View>
</XmlDefinition>
<XslLink>/Style Library/insight/xsl/NewsPortal.xslt</XslLink>
</WebPartPages:XsltListViewWebPart>
</ZoneTemplate>
</WebPartPages:WebPartZone>
when I browse to the template I receive the following error
Access denied. You do not have permission to perform this action or access this resource.
This only appears when i try to use the
<XslLink>/Style Library/insight/xsl/NewsPortal.xslt</XslLink>
element if I remove this then the error goes away. This has put me in a catch 22 situation because I can style the default view of the list through the schema.xml used to provision the list, however this styles all views of the list.
Is there even a way to specify this webpart to use a specific BaseViewID? if so what is it?
happy to provide more information if needed
Thanks in advance
Nicholas
UPDATE:
This is the ULS log error
Error while executing web part: System.UnauthorizedAccessException: <nativehr>0x80070005</nativehr><nativestack></nativestack>
at Microsoft.SharePoint.Library.SPRequest.UpdateWebPartCache(String bstrWebUrl, Boolean bAllUsers, String bstrID, Byte[]& ppsaData, Boolean fOMCall)
at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CacheWriteInternal(Guid storageKey, Byte[] cacheData, Storage storage, Boolean omCall)
at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.get_CustomizedXsl()
at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.LoadXslCompiledTransform(WSSXmlUrlResolver someXmlResolver)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform()
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)
UPDATE 2
I have checked the style library to see if the xsl is provisioned and i have discovered somthing that may be of use in solving this. In the GUI view the file does not exist to my user
However if I type in the URL the file can be found.
Could this be what the webpart is complaining about? and if so how can i give the webpart access to the xslt?
Thanks
Nicholas
Update 3
I have tried using mapped folders to provision my XSL
and I can view the XSL through the browser ie browsing to the mapped folder.
<XslLink>/_layouts/xsl/newsportal.xsl</XslLink>
but the webpart generates this error in the browser
I have done a bit of reading around and found that webpart security has been enhanced in sharepoint 2010 and have found the following link which are suggesting that the way forward is to edit the web.config.
http://msdn.microsoft.com/en-us/library/cc768613.aspx
however I struggle to believe this is the truly the case that I need to lower the security levels to just set a predefined property of the webpart (XslLink) can someone please confirm or deny that this is the case.
Thanks
Nicholas
Update 4
A bit more googling has yeilded the fact that there is indeed a "feature" in sharepoint 2010 xslt list view webpart in that an anon user cannot set the xsl or xsllink property.
This has now brought me back full circle in that I need to provide a styled list view to users and also a traditional allItems.aspx view to editors where they can update the content of their list any suggestions greatly welcome as I am running out of ideas on this one :-S
Thanks
Nicholas
Update 5
Right I have carried on googling and cannot find a solution to this, I am however pretty confident that the collective mind of SO can. I am also convinced seeing the number of posts on various forums around the web that I am not the only person that has this issue.
So I am going to put this up for bounty as soon as I am aloud as I feel that the solution to this can benefit the sharepoint community.