Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

InfoPath with Microsoft Content Management Server Web Services : Creating the Business Layer (part 2) - Creating the Lightweight Template Class

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
7/12/2012 5:46:09 PM

Creating the Lightweight Template Class

The template’s path and GUID will be included in the InfoPath form so users know what template a posting is using. To do this we will create the LightweightTemplate class, which is a serializable cut-down representation of the Microsoft.ContentManagement.Publishing.Template class.

1.
In Visual Studio .NET, right-click on the McmsAuthoringWebService project and create a new class called LightweightTemplate.

2.
Add the Microsoft.ContentManagement.Publishing namespace.

using System;
using Microsoft.ContentManagement.Publishing;
namespace McmsAuthoringWebService
{
  /// <summary>
  /// Summary description for LightweightTemplate.
  /// </summary>
  public class LightweightTemplate
  {
    . . . code continues . . .
  }
}

3.
Define the following public variables in the class:

/// <summary>
/// The name of the template in MCMS
/// </summary>
public string Name;

/// <summary>
/// The path of the template in MCMS
/// </summary>
public string Path;

/// <summary>
/// The Guid of the template in MCMS
/// </summary>
public Guid ID;

4.
As the template object will be loaded from an instance of the Microsoft.ContentManagement.Publishing.Template class, we will now define the Load() method:

/// <summary>
/// Load the lightweight object from the MCMS Template
/// </summary>
/// <param name="_Template">The MCMS template to load from</param>
public void Load(Template _Template)
{
  this.Name = _Template.Name;
  this.Path = _Template.Path;

  // Create a new guid object because MCMS stores Guids in string format.
  this.ID = new Guid(_Template.Guid);
}
Other -----------------
- InfoPath with Microsoft Content Management Server Web Services : Creating the MCMS Web Service Project
- Microsoft SharePoint 2010 : Social Architecture - Viewing an Activity feed, Setting up and compiling an audience
- Microsoft SharePoint 2010 : Creating an Alternate Access Mapping & Patching
- Microsoft Systems Management Server 2003 : Communicating Through Senders (part 2) - Courier Sender
- Microsoft Systems Management Server 2003 : Communicating Through Senders (part 1) - Sender Process Flow & Defining a Sender
- Windows Server 2008 Server Core : Working with iSCSI Using the iSCSICli Utility (part 2) - iSCSICli Mappings and Flags
- Windows Server 2008 Server Core : Working with iSCSI Using the iSCSICli Utility (part 1) - Working with the iSCSI Client (iSCSICli) Utility
- Active Directory Domain Services 2008 : Modify an Organizational Unit's General Properties, Modify an Organizational Unit's Managed By Properties
- Active Directory Domain Services 2008 : Move an Organizational Unit
- Windows Server 2008 R2 : Troubleshoot IPV4 - Verify Responsiveness
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server