Skip to content

Commit

Permalink
Merge pull request #983 from SubPointSolutions/dev
Browse files Browse the repository at this point in the history
SPMeta2 1.2.120-beta4, March 2017
  • Loading branch information
SubPointSupport authored Mar 20, 2017
2 parents c68a643 + 7c18ecf commit 4ae8a30
Show file tree
Hide file tree
Showing 36 changed files with 1,431 additions and 1,239 deletions.
56 changes: 28 additions & 28 deletions SPMeta2/Build/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2",
"Id": "SPMeta2.Core",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [ ],
"LicenseUrl": "http://docs.subpointsolutions.com/spmeta2/license",
"ProjectUrl": "https://github.com/SubPointSolutions/spmeta2",
Expand Down Expand Up @@ -266,11 +266,11 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.Standard",
"Id": "SPMeta2.Core.Standard",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.Core",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
}
],
"LicenseUrl": "http://docs.subpointsolutions.com/spmeta2/license",
Expand Down Expand Up @@ -311,11 +311,11 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.CSOM",
"Id": "SPMeta2.CSOM.Foundation",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.Core",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
}
],
"LicenseUrl": "http://docs.subpointsolutions.com/spmeta2/license",
Expand Down Expand Up @@ -348,15 +348,15 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.CSOM.Standard",
"Id": "SPMeta2.CSOM.Standard",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.CSOM.Foundation",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
},
{
"Id": "SPMeta2.Core.Standard",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
}
],
"LicenseUrl": "http://docs.subpointsolutions.com/spmeta2/license",
Expand Down Expand Up @@ -389,11 +389,11 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.SSOM",
"Id": "SPMeta2.SSOM.Foundation",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.Core",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
}
],
"LicenseUrl": "http://docs.subpointsolutions.com/spmeta2/license",
Expand Down Expand Up @@ -426,15 +426,15 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.SSOM.Standard",
"Id": "SPMeta2.SSOM.Standard",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.SSOM.Foundation",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
},
{
"Id": "SPMeta2.Core.Standard",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
}
],
"LicenseUrl": "http://docs.subpointsolutions.com/spmeta2/license",
Expand Down Expand Up @@ -468,11 +468,11 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.CSOM",
"Id": "SPMeta2.CSOM.Foundation-v14",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.Core",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
}
],
"LicenseUrl": "http://docs.subpointsolutions.com/spmeta2/license",
Expand All @@ -498,15 +498,15 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.CSOM.Standard",
"Id": "SPMeta2.CSOM.Standard-v14",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.CSOM.Foundation-v14",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
},
{
"Id": "SPMeta2.Core.Standard",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
}
],
"LicenseUrl": "http://docs.subpointsolutions.com/spmeta2/license",
Expand All @@ -532,11 +532,11 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.SSOM",
"Id": "SPMeta2.SSOM.Foundation-v14",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.Core",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
}
],
"LicenseUrl": "http://docs.subpointsolutions.com/spmeta2/license",
Expand All @@ -562,15 +562,15 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.SSOM.Standard",
"Id": "SPMeta2.SSOM.Standard-v14",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.SSOM.Foundation-v14",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
},
{
"Id": "SPMeta2.Core.Standard",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
}
],
"LicenseUrl": "http://docs.subpointsolutions.com/spmeta2/license",
Expand All @@ -596,11 +596,11 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.CSOM",
"Id": "SPMeta2.CSOM.Foundation-v16",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.Core",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
},
{
"Id": "Microsoft.SharePointOnline.CSOM",
Expand Down Expand Up @@ -637,15 +637,15 @@
{
"CustomProjectFolder" : "SPMeta2/SPMeta2.CSOM.Standard",
"Id": "SPMeta2.CSOM.Standard-v16",
"Version": "1.2.120-beta3",
"Version": "1.2.120-beta4",
"Dependencies": [
{
"Id": "SPMeta2.CSOM.Foundation-v16",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
},
{
"Id": "SPMeta2.Core.Standard",
"Version": "1.2.120-beta3"
"Version": "1.2.120-beta4"
},
{
"Id": "Microsoft.SharePointOnline.CSOM",
Expand Down
70 changes: 35 additions & 35 deletions SPMeta2/SPMeta2.CSOM.Standard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SPMeta2.CSOM.Standard")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SPMeta2.CSOM.Standard")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fe6947ad-76e7-4527-95ec-af15665de77e")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.2.17072.1315")]
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SPMeta2.CSOM.Standard")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SPMeta2.CSOM.Standard")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fe6947ad-76e7-4527-95ec-af15665de77e")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.2.17079.1227")]
32 changes: 18 additions & 14 deletions SPMeta2/SPMeta2.CSOM/ModelHandlers/ContentTypeLinkModelHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
using SPMeta2.ModelHandlers;
using SPMeta2.Services;
using SPMeta2.Utils;
using SPMeta2.CSOM.ModelHosts;
using SPMeta2.CSOM.ModelHosts;
using SPMeta2.ModelHosts;

namespace SPMeta2.CSOM.ModelHandlers
{
Expand All @@ -20,8 +21,8 @@ public override Type TargetType
}

public override void WithResolvingModelHost(ModelHostResolveContext modelHostContext)
{
var modelHost = modelHostContext.ModelHost;
{
var modelHost = modelHostContext.ModelHost as CSOMModelHostBase;
var model = modelHostContext.Model;
var childModelType = modelHostContext.ChildModelType;
var action = modelHostContext.Action;
Expand All @@ -33,18 +34,21 @@ public override void WithResolvingModelHost(ModelHostResolveContext modelHostCon
var context = list.Context;

context.Load(list, l => l.ContentTypes);
context.ExecuteQueryWithTrace();

var listContentType = FindListContentType(list, contentTypeLinkModel);

action(new ModelHostContext
{
Site = listModelHost.HostSite,
Web = listModelHost.HostWeb,
ContentType = listContentType
});
context.ExecuteQueryWithTrace();

var contentType = FindListContentType(list, contentTypeLinkModel);

var contentTypeLinkHost = ModelHostBase.Inherit<ContentTypeLinkModelHost>(modelHost, host =>
{
host.HostContentType = contentType;
host.HostList = list;
});

action(contentTypeLinkHost);

if (!contentTypeLinkHost.ShouldUpdateHost)
contentType.Update(false);

listContentType.Update(false);
context.ExecuteQueryWithTrace();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ public override void DeployModel(object modelHost, DefinitionBase model)

DeployContentTypeWorkflowAssociationDefinition(modelHost, contentType, workflowAssociationModel);
}
else if (modelHost is ContentTypeLinkModelHost)
{
var contentTypeLinkModelHost = (modelHost as ContentTypeLinkModelHost);

// don't update content type link within list
if (contentTypeLinkModelHost.HostList != null)
contentTypeLinkModelHost.ShouldUpdateHost = false;

var contentType = contentTypeLinkModelHost.HostContentType;
var web = contentTypeLinkModelHost.HostWeb;

if (contentTypeLinkModelHost.HostList != null)
contentTypeLinkModelHost.ShouldUpdateHost = false;

DeployContentTypeWorkflowAssociationDefinition(modelHost, contentType, workflowAssociationModel);
}
else
{
throw new SPMeta2NotSupportedException("model host should be of type ListModelHost or WebModelHost");
Expand All @@ -77,6 +93,14 @@ private Web GetWebFromModelHost(object modelHost)
return (modelHost as ModelHostContext).Web;
}

if (modelHost is ContentTypeLinkModelHost)
{
var listContentTypeHost = (modelHost as ContentTypeLinkModelHost);


return listContentTypeHost.HostWeb;
}

throw new SPMeta2NotSupportedException("model host should be of type ListModelHost or WebModelHost");
}

Expand Down Expand Up @@ -121,6 +145,19 @@ protected WorkflowAssociation FindExistringWorkflowAssotiation(object modelHost,
return res.FirstOrDefault();
}

if (modelHost is ContentTypeLinkModelHost)
{
var list = (modelHost as ContentTypeLinkModelHost).HostList;
var context = list.Context;

var defName = def.Name;

var res = context.LoadQuery(list.WorkflowAssociations.Where(w => w.Name == defName));
context.ExecuteQueryWithTrace();

return res.FirstOrDefault();
}

throw new SPMeta2NotSupportedException("model host should be of type ListModelHost or WebModelHost");
}

Expand Down
24 changes: 24 additions & 0 deletions SPMeta2/SPMeta2.CSOM/ModelHosts/ContentTypeLinkModelHost.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.SharePoint;
using Microsoft.SharePoint.Client;

namespace SPMeta2.CSOM.ModelHosts
{
public class ContentTypeLinkModelHost : ListModelHost
{
#region constructors


#endregion

#region properties

public ContentType HostContentType { get; set; }

#endregion
}
}
Loading

0 comments on commit 4ae8a30

Please sign in to comment.