0% found this document useful (0 votes)
69 views43 pages

Building Web Services Based Placeholders For Content Management Server 2002

The document discusses building web service based placeholders for CMS 2002. It covers content syndication and aggregation architectures, CMS 2002 placeholders, XML web services, and how to build placeholders that retrieve and save content from web services to the CMS repository.

Uploaded by

Viktor Justin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views43 pages

Building Web Services Based Placeholders For Content Management Server 2002

The document discusses building web service based placeholders for CMS 2002. It covers content syndication and aggregation architectures, CMS 2002 placeholders, XML web services, and how to build placeholders that retrieve and save content from web services to the CMS repository.

Uploaded by

Viktor Justin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 43

Building

Web Services Based Placeholders


for Content Management Server 2002

Tal Shahar
Microsoft Regional Director
Development Division Manager
Matrix
[email protected]
Session Outline
1. Content Syndication and Aggregation
2. CMS2002 Placeholder
3. XML Web Services
4. Web Service based Placeholders

 Lots of References
Prerequisite Knowledge
1. Web Services
2. CMS 2002 Basic Terms
1. Template
2. Posting
3. Placeholder
3. CMS2002 Basic Architecture
Part I
Content Syndication and Aggregation

Architecture
Syndication and Aggregation

Syndication
Aggregation
Architecture Considerations
 Horizonatl vs. Vertical
 Divide structure from unstructured Data
 Commerce Server Content Connector (MSIB)
“Credit Products”
Vertical Publishing a Simple WS
Part II
CMS 2002 Placeholders
Placeholder - What is it?

 Web UI component…
 Exposes properties, methods, events
 Renders as HTML, XML, script, etc.

 Processes posted data and user actions

 Can represent HTML elements or higher-level

abstractions
 Most
Important -> Encapsulates the action
needed to store data in CMS repository
Placeholder - What is it?

 Technically speaking…
 Implemented as a .NET class
 Derives from System.Web.UI.Control or

System.Web.UI.WebControls.WebControl
Conceptual Model
CMS
CMSTemplate
Template(aspx
(aspxfile)
file) Contents
Contents Definitions
Definitions
HTML Objects
Objects Definitions
Definitions
Placeholder
Control
HTML HTML
Placeholder Placeholder
Custom Object Definition
Placeholder XML XML
Control Placeholder Placeholder
Object Definition

File System CMS Repository


Placeholder Types
 User Controls
 Easy to author – just like a page
 Scoped to a single application
 Poor design time support in VS.NET
 Custom Controls
 Support multiple applications
 Install to Global Assembly Cache
 Great design time support in VS.NET
“Aggregation Combo” Placeholder
Placeholder Control
Base Class
[
SupportedPlaceholderDefinitionType(
Typeof(XmlPlaceholderDefinition) )
]
public class MyCustomPlaceholderControl :
BasePlaceholderControl
{
}
Placeholder Control
Framework
 Dual run-time functionality:
 Presentation mode: Display the contents of a
placeholder.
 Published
 Unpublished
 Authoring mode: Author the contents of a
placeholder.
Creation of Child Controls
 For Authoring

protected override void CreateAuthoringChildControls(


BaseModeContainer authoringContainer)
{
this.MyDropDownList = new DropDownList();

authoringContainer.Controls.Add(this.
DropDownList);
}
Creation of Child Controls
 For Presentation

protected override void


CreatePresentationChildControls(
BaseModeContainer presentationContainer)
{ this.MyLiteral = new Literal();

presentationContainer.Controls.Add(
this.MyLiteral);
}
Loading Content From CMS

protected override void


LoadPlaceholderContentForAuthoring
(PlaceholderControlEventArgs e)
{ EnsureChildControls();
this.MyDropDownList.SelectedText =
((XmlPlaceholder)this.BoundPlaceholder).XmlAsStri
ng;
}
Loading Content From CMS

protected override void


LoadPlaceholderContentForPresentation
(PlaceholderControlEventArgs e)
{ EnsureChildControls();
Posting posting = e.Posting;

this.presControl.DocumentContent =
((XmlPlaceholder)this.BoundPlaceholder).XmlAsString
;
}
Saving Content Back to CMS

protected override void SavePlaceholderContent


(PlaceholderControlSaveEventArgs e)
{ EnsureChildControls();
if (!e.IsTemporarySaveForPreview)
{ …
}
((XmlPlaceholder)this.BoundPlaceholder).XmlAsString
= this.MyDropDownList.SelectedText;
}
References
 Introduction to the PlaceHolder Web Server Control
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon
/html/vbconplaceholderwebservercontrol.asp
 PlaceHolder Web Server Control
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgen
ref/html/gnconplaceholderwebservercontrol.asp
 Adding PlaceHolder Web Server Controls to a Web Forms Page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon
/html/vbtskaddingplaceholdercontrolstowebformspage.asp
Part III
XML Web Services
XML Web Services - How
to?
 The easy way –
Use Visual Studio .NET
 Another easy way –
Use SQL XML Web Services Toolkit
“Get Placeholder Title”
Horizontal Publishing XML Web Service
References
 Web Services Overview
http://msdn.microsoft.com/webservices/.
 Web Services Security
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnws
secur/html/xmlwssec.asp
.
 Web Service Authentication and Authorization
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dn_voices_webservice/html/service02282001.asp.
 Web Service Caching Strategies
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dn_voices_webservice/html/service04172002.asp.
 Communicating with Web Services Asynchronously
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/cpguide/html/cpconinvokingwebservicesasynchronously.asp
Part IV
Web Service based
Placeholder
What is it?
A CMS2002 placeholder
 Which is an ASP.NET server control
 Which content is

 Derived from an XML Web Service


 Published to an XML Web Service
Placeholder
PlaceholderControl
Control
)authoring
)authoring((
We
b Se
rvi
ce
Workflow

CMS 2002 Back-end


Repository Repository
Design Considerations 1/4

 Itis possible to consume a Web service in a


template using the same methodology as any
other ASP.NET page.
Design Considerations 1/4

 Pro
 Guarantees that the latest data from the Web service is being
shown to the browsers.
 Cons
 May cause performance problems if the page sees heavy
traffic.
 May be unnecessary if the data retrieved from the Web
service does not change frequently.
 Knowledge workers cannot control if the “foreign” content is
shown on the site.
Design Considerations 2/4

 Make a copy of the data into a MCMS


placeholder.
Design Considerations 2/4

 Pro
 Eliminating the need to invoke a Web service upon every
page request.
 Cons
 A strategy must be devised to synchronize the data between
MCMS and the Web service.
 Depending on the application requirements, the
synchronization may use a regular process that regularly
updates the data automatically, or it may be tied to a manual
content update process through the MCMS Web Author.
Design Considerations 3/4

 How to Synchronize?
 An automated process must be able to
determine what queries to make to the Web
service and use business logic to translate the
returned data into updates that must be made
on the MCMS site.
 The synchronization can be carried out by a
console application (EXE) which accesses the
Web service and uses the MCMS Publishing
API to update the Web site.
Design Considerations 3/4

 How to Synchronize?
 The synchronization application could also
approve any new or modified objects as
necessary.
 The application can then be executed on a

timed interval using the Windows Task


Scheduler.
Design Considerations 4/4

 Proxy
 In order for the application to interact with the remote application
seamlessly, a local proxy must be created. However, when using
Visual Studio .NET, using the “Add Web Reference” command
will automatically parse the Web service’s WSDL and create a
functional proxy class.
Design Considerations 4/4

 Error Handling
 Since the consumer cannot guarantee the availability of the
remote Web service, it must be prepared for scenarios where the
data cannot successfully be retrieved. By using the “Timeout”
property on the proxy class and the .NET platform’s inherent
exception handling, it is possible to gracefully detect and react to
these error conditions.
Automatic Update of CMS2002
Repository with XML Web Service
Content
Manually Consuming and
Replicating Web Service Data
References
 Extending the Functionality of MCMS
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/sitedevl/htm/cms_sd_ext_intro_egts.asp
 MCMS Projects in Visual Studio .NET
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/sitedevl/htm/cms_sd_dev_vsnetintegration_lfbj.asp
 Using Microsoft Content Management Server 2002 and
Web Services
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/dnmscms02/html/cms_2002webservices.asp
Content Integration
 Authoring Connector – MS-Word Editor
 “Spark” – CMS Connector for Sharepoint
 MSIB – CS & CMS Integration
Summary
 Web services are location and platform
agnostic
 Server controls are great reusable
components

 Integration is the name of the game

See You in TechEd


© 2003-2004 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
© 2003-2004 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

You might also like