Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regression tests for XsltListViewWebPart provision on sub-webs #810

Closed
SubPointSupport opened this issue Mar 14, 2016 · 2 comments
Closed

Comments

@SubPointSupport
Copy link
Contributor

Both CSOM/SSOM should pass these tests, we should be able to provision XsltListViewWebPart under subsities resolving rootweb and other web correctly.

The following tests are to be implemented:

  • XsltListViewWebPart provision on sub-web + list at root web
  • XsltListViewWebPart provision on sub-web + list at other sub-web
  • XsltListViewWebPart provision on sub-sub-web + list at other sub-web-web

Base on community feedback:

I'm having some trouble adding an XsltListViewWebPartDefinition that shows a list on a different site.

I have on my rootweb a list with the name 'Projects' (also created via SPMeta2). On a subsite of a subsite, I try to add a web part that shows this list (later I'll try to filter this). The definition of my web part is included as an attachment.

Whenever I try to provision, I get an error saying the list does not exist. Any idea what I'm doing wrong?

https://www.yammer.com/spmeta2feedback/#/Threads/show?threadId=672833789

@Spongeroberto
Copy link

I had the issue with a list on the rootweb and a web part on a page in a subweb of a subweb. It may be interesting to note that the site collection is not the root site collection, but under /sites/somesite:

RootWeb

var projectsList = new ListDefinition
        {
            Title = "Projects",
            Description = "Projects",
            TemplateType = BuiltInListTemplateTypeId.GenericList,
            Url = "Projects",
            ContentTypesEnabled = true,
       }; 

var projectsWeb= Template = new WebDefinition
        {
            Title = "Project sites",
            Url = "projects",
            WebTemplate = "STS#0",
            UseUniquePermission = false
        };

Subweb (projects)

var projectWeb = Template = new WebDefinition
        {
            Title = "Project template site",
            Url = "projecttemplate",
            WebTemplate = "STS#0",
            UseUniquePermission = false
        };


Subweb 2 (projects/projecttemplate)

site.AddHostList(BuiltInListDefinitions.SitePages, list =>
{
    list.AddWebPartPage(new WebPartPageDefinition
    {
        FileName = "Home.aspx",
        NeedOverride = true,
        Title = "Home",
        PageLayoutTemplate = BuiltInWebPartPageTemplates.spstd2
    }, page =>
    {
        page.AddWebPart(new XsltListViewWebPartDefinition
        {
            Title = "Projects",
            ZoneId = "CenterColumn",
            Toolbar = BuiltInToolbarType.None,
            ViewName = "All Items",
            ZoneIndex = 0,
            WebId = null,            
            WebUrl = "~sitecollection/",            
            ListTitle = projectsList.Title
        });
    });
});

@SubPointSupport
Copy link
Contributor Author

The following tests were added:

  • CanDeploy_XsltListViewWebPart_At_RootWeb_FromRootWeb
  • CanDeploy_XsltListViewWebPart_At_RootWeb_FromSubWeb
  • CanDeploy_XsltListViewWebPart_At_SubWeb_FromSubWeb
  • CanDeploy_XsltListViewWebPart_At_SubWeb_FromRootWeb

https://github.com/SubPointSolutions/spmeta2/blob/dev/SPMeta2/SPMeta2.Regression.Tests/Impl/Scenarios/Webparts/XsltListViewWebPartScenariosTest.cs

Confirming that SSOM does not allow to deploy XsltListViewWebPart at sub-web with list being at other web or root web, CSOM gives same errors.

Only CanDeploy_XsltListViewWebPart_At_RootWeb_FromRootWeb test is passed.

Fixing up, ETA would be about March 25th or early.

SubPointSupport added a commit that referenced this issue Mar 14, 2016
… sub-webs #810

+Passed alll CanDeploy_XsltListViewWebPartXXX tests for SSOM for both root /sites/m2 site collections
SubPointSupport added a commit that referenced this issue Mar 14, 2016
… on sub-webs #810

+ all CanDeploy_XsltListViewWebPart_XXX tests are passed
@SubPointSupport SubPointSupport changed the title Add regression tests for XsltListViewWebPart provision on sub-webs Add regression tests for XsltListViewWebPart provision on sub-webs Mar 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants