SlideShare a Scribd company logo
1 of 15
Using the Kentico CMS API
Thom Robbins (thomasr@kentico.com
Bryan Soltis (bryan@bitwizards.com)
Agenda
• Overview (Architecture/Objects) (Thom)
• CMS Context (Bryan)
• Document Management (Thom)
• Global Events (Thom)
• Modules (Bryan)
Looking at Kentico CMS
Logical three tier architecture…
Architecture breakdown
Data layer
(+metadata)
Business layer
Controls libraries
UI components
Web project pages Live site pages +
admin UI pages
Web parts + User
controls
CMSControls
Helpers
SettingsProvider
Enumerations Infos & Providers
Data engine
GeneralConnection
Abstract info
Metadata infos
(Class, Query,
SettingsKey)
Interfaces
Third party code
Module web parts
+ Module user
controls
Module controls
Module Infos &
Providers
Module definitions
Presentationlayer
Best Practice Tip
• Kentico CMS web site project provides examples of all sorts of code!
OO Basics - Object Creation Examples
// Create UserInfo
CMS.SiteProvider.UserInfo user = new CMS.SiteProvider.UserInfo();
// Set properties
user.UserName = "Alice";
user.FirstName = "Alice";
user.LastName = "Cooper";
user.FullName = "Alice Cooper";
user.Email = "alice.cooper@domain.com";
user.IsEditor = true;
user.IsGlobalAdministrator = true;
user.PreferredCultureCode = "en-us";
user.Enabled = true;
// Create new user
CMS.SiteProvider.UserInfoProvider.SetUserInfo(user);
// Prepare the TreeProvider (it must be initialized with user information when editing
document structure)
UserInfo ui = UserInfoProvider.GetUserInfo("administrator");
CMS.TreeEngine.TreeProvider tree = new CMS.TreeEngine.TreeProvider(ui);
// Get the document (current culture)
CMS.TreeEngine.TreeNode node =
tree.SelectSingleNode(CMS.CMSHelper.CMSContext.CurrentSiteName,
"/News/TestingWorkflow",
CMS.CMSHelper.CMSContext.CurrentUser.PreferredCultureCode, false, null, false);
if (node != null)
{
// Always delete the document with DocumentHelper, it handles all the
dependencies
CMS.WorkflowEngine.DocumentHelper.DeleteDocument(node, tree, true,
true,true);
}
Example - Creating
new user
Example – Delete
Document
API Everywhere!
• Class View is your Friend
CMS.SettingsProvider
.SettingsHelper
.SQLHelperClass
.TranslationHelp
er
CMS.GlobalHelper
.DataHelper
.ContextHelper
.AJAXHelper
Library Specific
CMS.Controls.CM
SControlsHelper
CMS.WorkflowEn
gine.DocumentHe
lper
CMS.Blogs.BlogHe
lper
Some Examples…
Best practice Tip:
Class view is customizable to allow
personalized organization and viewing
Helpers and general libraries
SettingsProvider
(metadata helpers)
SettingsHelper
(web.config)
SettingsKeyHelper
(web site settings)
SqlHelperClass
(low level DB connection, used
only from SettingsProvider)
DataHelper
(basic data manipulation)
TranslationHelper
(conversion of IDs based on
code names or GUIDs)
GlobalHelper
(general helpers)
/Context
(HTTP context related data)
/Data
(advanced data manipulation and
validation)
/Globalization
(resource strings and cultures)
/Markup
(macros, HTML, XML, text, script)
/Media
(images and media manipulation
and information)
Library specific
(module helpers)
ControlsHelper
CMSControlsHelper
DocumentHelper
WebFarmSyncHelperClass
Etc.
App_Code
(helper functions)
Functions.cs
InstallerFunctions.cs
BlogFunctions.cs
EcommerceFunctions.cs
Etc.
Best Practice Tip
• For general code locate the appropriate helper and use it
• If the helper contains similar methods override and extend
• Implement new behavior in helpers
CMS Context
• CMS.CMSHelper.CMSContext class provides static
methods to access common information
Method
CurrentAliasPath
CurrentDocument
CurrentPageInfo
CurrentSite
CurrentSiteName
CurrentUser
ViewMode
ResolveCurrentPath
Need a code snippet?
Document Management – How documents are stored
• Documents stored in SQL joined tables
– CMS_Tree – Table with basic document data shared between different
language versions. Contains one record for all culture version of the
document
– CMS_Document – Table with document data of specified language
version of the document. Contains one record representing one
language version of the document
– Coupled table – table that contains custom document type fields
CMS_Tree
CMS_Document Coupled table
CMS_Document Coupled table
CMS_Document Coupled table
Best Practice Tip:
Every document is stored in up to three (3) tables. Use the
API to access documents
Document Management – Versioning Internals
• Document versions and its history are stored in separate
tables
– CMS_VersionHistory – Table containing the document versions. Each
version of the document is represented by one record that contains
the complete document data in XML.
– CMS_AttachmentHistory – Table containing the attachment version
records. Each attachment version is bound to one or more document
versions. Every record contains binary data of the attachment.
– CMS_VersionAttachment – Table containing the bindings of the
attachment versions to the document versions.
CMS_VersionHistory
CMS_VersionAttachment
CMS_AttachmentHistory
Version of attachments
CMS_VersionAttachment
CMS_AttachmentHistory
Version of attachments
Document Management Techniques
CMS.TreeEngine.TreeNode
• Not aware of
versioning/workflow/attachments
• Only works with published records
CMS.WorkflowEngine.DocumentHelper
• Versioning/workflow/attachment aware
• Use for all document deletes
Best Practice Tip:
CMS.WorkflowEngine.DocumentHelper is recommended to access
document information
CMS.CMSHelper.TreeHelper allows
access to documents directly
Best Practice Tip:
TreeHelper.GetDocuments checks the view mode and then
calls either TreeProvider or DocumentHelper
Global Events
• Provide a way to execute custom events within the CMS
system
• Managed as a separate projects
• Web Config Key
Best Practice Tip:
Developer documentation contains step by step instructions for
implementing Global Events
Global Event Classes
• The events are applied to all data items that are stored to the database. It
includes documents, user information or any other settings
• Receives DataClass
CustomDataHandler.cs
• Event applied to all exceptions that occur
• Receives System.exception
CustomExceptionHandler.cs
• Allows the integration of external databases and modify the authentication
and authorization processCustomSecurityHandler.cs
• Execute custom actions when a document is created, updated or deletedCustomTreeNodeHandler.cs
• Event applied to workflow documents (same as CustomTreeNodeHandler)
• Same as CustomtreeNodeHandler
CustomWorkflowHandler.cs
Best Practice Tip:
For Document events always use either the CustomTreeNodeHandler (no workflow) or
CustomWorkFlowHandler (workflow) not the CustomDataHandler
Modules
• Extend the CMS system to include your custom code
Additional Information
• Best samples are in your project!
• Get your poster
• Documentation -
http://devnet.kentico.com/Documentation.aspx
• Code Snippet Library -
http://devnet.kentico.com/Blogs/Thomas-Robbins.aspx
• Marketplace -
http://devnet.kentico.com/Marketplace.aspx

More Related Content

What's hot

Information storage and management
Information storage and managementInformation storage and management
Information storage and managementAkash Badone
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
Chapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlChapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlAbDul ThaYyal
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administratorAisha Talat
 
Distributed Shared Memory Systems
Distributed Shared Memory SystemsDistributed Shared Memory Systems
Distributed Shared Memory SystemsArush Nagpal
 
AWS Cloud Experience CA: Almacenamiento Inteligente con AWS
AWS Cloud Experience CA: Almacenamiento Inteligente con AWSAWS Cloud Experience CA: Almacenamiento Inteligente con AWS
AWS Cloud Experience CA: Almacenamiento Inteligente con AWSAmazon Web Services LATAM
 
Social Network Analysis power point presentation
Social Network Analysis power point presentation Social Network Analysis power point presentation
Social Network Analysis power point presentation Ratnesh Shah
 
MDaemon Messaging Server Version 16 Feature Overview
MDaemon Messaging Server Version 16 Feature OverviewMDaemon Messaging Server Version 16 Feature Overview
MDaemon Messaging Server Version 16 Feature OverviewAlt-N Technologies
 
Computer Network Notes UNIT II
Computer Network Notes UNIT IIComputer Network Notes UNIT II
Computer Network Notes UNIT IINANDINI SHARMA
 
Introduction To Tiny Os And Contiki Os
Introduction To Tiny Os And Contiki OsIntroduction To Tiny Os And Contiki Os
Introduction To Tiny Os And Contiki OsSudharsan S
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactionsNilu Desai
 
Service level agreement in cloud computing an overview
Service level agreement in cloud computing  an overviewService level agreement in cloud computing  an overview
Service level agreement in cloud computing an overviewDr Neelesh Jain
 
Transport control protocols for Wireless sensor networks
Transport control protocols for Wireless sensor networksTransport control protocols for Wireless sensor networks
Transport control protocols for Wireless sensor networksRushin Shah
 
Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 ReliabilityAli Usman
 
Google File Systems
Google File SystemsGoogle File Systems
Google File SystemsAzeem Mumtaz
 
Intro to Amazon S3
Intro to Amazon S3Intro to Amazon S3
Intro to Amazon S3Yu Lun Teo
 

What's hot (20)

Information storage and management
Information storage and managementInformation storage and management
Information storage and management
 
Composer
ComposerComposer
Composer
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Chapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlChapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency control
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
 
Distributed Shared Memory Systems
Distributed Shared Memory SystemsDistributed Shared Memory Systems
Distributed Shared Memory Systems
 
AWS Cloud Experience CA: Almacenamiento Inteligente con AWS
AWS Cloud Experience CA: Almacenamiento Inteligente con AWSAWS Cloud Experience CA: Almacenamiento Inteligente con AWS
AWS Cloud Experience CA: Almacenamiento Inteligente con AWS
 
Social Network Analysis power point presentation
Social Network Analysis power point presentation Social Network Analysis power point presentation
Social Network Analysis power point presentation
 
MDaemon Messaging Server Version 16 Feature Overview
MDaemon Messaging Server Version 16 Feature OverviewMDaemon Messaging Server Version 16 Feature Overview
MDaemon Messaging Server Version 16 Feature Overview
 
Computer Network Notes UNIT II
Computer Network Notes UNIT IIComputer Network Notes UNIT II
Computer Network Notes UNIT II
 
Introduction To Tiny Os And Contiki Os
Introduction To Tiny Os And Contiki OsIntroduction To Tiny Os And Contiki Os
Introduction To Tiny Os And Contiki Os
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
 
Service level agreement in cloud computing an overview
Service level agreement in cloud computing  an overviewService level agreement in cloud computing  an overview
Service level agreement in cloud computing an overview
 
Transport control protocols for Wireless sensor networks
Transport control protocols for Wireless sensor networksTransport control protocols for Wireless sensor networks
Transport control protocols for Wireless sensor networks
 
Distributed Operating System_4
Distributed Operating System_4Distributed Operating System_4
Distributed Operating System_4
 
Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 Reliability
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
 
Google File Systems
Google File SystemsGoogle File Systems
Google File Systems
 
Nfs
NfsNfs
Nfs
 
Intro to Amazon S3
Intro to Amazon S3Intro to Amazon S3
Intro to Amazon S3
 

Similar to Using the Kentico CMS API

Patterns For Parallel Computing
Patterns For Parallel ComputingPatterns For Parallel Computing
Patterns For Parallel ComputingDavid Chou
 
How To Implement a CMS
How To Implement a CMSHow To Implement a CMS
How To Implement a CMSJonathan Smith
 
ASMUG February 2015 Knowledge Event
ASMUG February 2015 Knowledge EventASMUG February 2015 Knowledge Event
ASMUG February 2015 Knowledge Eventjmustac
 
SharePoint 2007 and SharePoint 2010 for Web Content Management (WCM)
SharePoint 2007 and SharePoint 2010 for Web Content Management (WCM)SharePoint 2007 and SharePoint 2010 for Web Content Management (WCM)
SharePoint 2007 and SharePoint 2010 for Web Content Management (WCM)Richard Harbridge
 
FME World Tour 2015 - FME & Data Migration Simon McCabe
FME World Tour 2015 -  FME & Data Migration Simon McCabeFME World Tour 2015 -  FME & Data Migration Simon McCabe
FME World Tour 2015 - FME & Data Migration Simon McCabeIMGS
 
Cdocumentsandsettingsuser1desktop2 dbmsexamples-091012013049-phpapp01
Cdocumentsandsettingsuser1desktop2 dbmsexamples-091012013049-phpapp01Cdocumentsandsettingsuser1desktop2 dbmsexamples-091012013049-phpapp01
Cdocumentsandsettingsuser1desktop2 dbmsexamples-091012013049-phpapp01Raza Baloch
 
Choosing a CMS: One Management System to Rule Them All?
Choosing a CMS: One Management System to Rule Them All?Choosing a CMS: One Management System to Rule Them All?
Choosing a CMS: One Management System to Rule Them All?Noz Urbina
 
CMS by Thai Son
CMS by Thai SonCMS by Thai Son
CMS by Thai Sondoba2007
 
CUST-3 Document Management with Share
CUST-3 Document Management with ShareCUST-3 Document Management with Share
CUST-3 Document Management with ShareAlfresco Software
 
WPF Windows Presentation Foundation A detailed overview Version1.2
WPF Windows Presentation Foundation A detailed overview Version1.2WPF Windows Presentation Foundation A detailed overview Version1.2
WPF Windows Presentation Foundation A detailed overview Version1.2Shahzad
 
3-Tier Architecture Step By Step Exercises
3-Tier Architecture Step By Step Exercises3-Tier Architecture Step By Step Exercises
3-Tier Architecture Step By Step ExercisesMiranda Anderson
 
I p-o in different data processing systems
I p-o in different data processing systemsI p-o in different data processing systems
I p-o in different data processing systemsKinshook Chaturvedi
 
Configuration Management
Configuration ManagementConfiguration Management
Configuration Managementelliando dias
 
Content Typing, Flows, Models by Rahel Anne Bailie
Content Typing, Flows, Models by Rahel Anne BailieContent Typing, Flows, Models by Rahel Anne Bailie
Content Typing, Flows, Models by Rahel Anne BailieContent Strategy Workshops
 

Similar to Using the Kentico CMS API (20)

Patterns For Parallel Computing
Patterns For Parallel ComputingPatterns For Parallel Computing
Patterns For Parallel Computing
 
Ikenstudiolive
IkenstudioliveIkenstudiolive
Ikenstudiolive
 
How To Implement a CMS
How To Implement a CMSHow To Implement a CMS
How To Implement a CMS
 
ASMUG February 2015 Knowledge Event
ASMUG February 2015 Knowledge EventASMUG February 2015 Knowledge Event
ASMUG February 2015 Knowledge Event
 
SharePoint 2007 and SharePoint 2010 for Web Content Management (WCM)
SharePoint 2007 and SharePoint 2010 for Web Content Management (WCM)SharePoint 2007 and SharePoint 2010 for Web Content Management (WCM)
SharePoint 2007 and SharePoint 2010 for Web Content Management (WCM)
 
FME World Tour 2015 - FME & Data Migration Simon McCabe
FME World Tour 2015 -  FME & Data Migration Simon McCabeFME World Tour 2015 -  FME & Data Migration Simon McCabe
FME World Tour 2015 - FME & Data Migration Simon McCabe
 
DBMS an Example
DBMS an ExampleDBMS an Example
DBMS an Example
 
Cdocumentsandsettingsuser1desktop2 dbmsexamples-091012013049-phpapp01
Cdocumentsandsettingsuser1desktop2 dbmsexamples-091012013049-phpapp01Cdocumentsandsettingsuser1desktop2 dbmsexamples-091012013049-phpapp01
Cdocumentsandsettingsuser1desktop2 dbmsexamples-091012013049-phpapp01
 
Choosing a CMS: One Management System to Rule Them All?
Choosing a CMS: One Management System to Rule Them All?Choosing a CMS: One Management System to Rule Them All?
Choosing a CMS: One Management System to Rule Them All?
 
CMS by Thai Son
CMS by Thai SonCMS by Thai Son
CMS by Thai Son
 
Sad52 requirement
Sad52 requirementSad52 requirement
Sad52 requirement
 
CUST-3 Document Management with Share
CUST-3 Document Management with ShareCUST-3 Document Management with Share
CUST-3 Document Management with Share
 
Ch13
Ch13Ch13
Ch13
 
Content mgmtsys
Content mgmtsysContent mgmtsys
Content mgmtsys
 
Moss Governance Guidelines
Moss Governance GuidelinesMoss Governance Guidelines
Moss Governance Guidelines
 
WPF Windows Presentation Foundation A detailed overview Version1.2
WPF Windows Presentation Foundation A detailed overview Version1.2WPF Windows Presentation Foundation A detailed overview Version1.2
WPF Windows Presentation Foundation A detailed overview Version1.2
 
3-Tier Architecture Step By Step Exercises
3-Tier Architecture Step By Step Exercises3-Tier Architecture Step By Step Exercises
3-Tier Architecture Step By Step Exercises
 
I p-o in different data processing systems
I p-o in different data processing systemsI p-o in different data processing systems
I p-o in different data processing systems
 
Configuration Management
Configuration ManagementConfiguration Management
Configuration Management
 
Content Typing, Flows, Models by Rahel Anne Bailie
Content Typing, Flows, Models by Rahel Anne BailieContent Typing, Flows, Models by Rahel Anne Bailie
Content Typing, Flows, Models by Rahel Anne Bailie
 

More from Thomas Robbins

PlayFab Advanced Cloud Script
PlayFab Advanced Cloud ScriptPlayFab Advanced Cloud Script
PlayFab Advanced Cloud ScriptThomas Robbins
 
What’s in the box? Creating chance mechanics and rewards
What’s in the box? Creating chance mechanics and rewardsWhat’s in the box? Creating chance mechanics and rewards
What’s in the box? Creating chance mechanics and rewardsThomas Robbins
 
Getting started with Cloud Script
Getting started with Cloud ScriptGetting started with Cloud Script
Getting started with Cloud ScriptThomas Robbins
 
Say hello to the new PlayFab!
Say hello to the new PlayFab!Say hello to the new PlayFab!
Say hello to the new PlayFab!Thomas Robbins
 
Data-Driven Government: Explore the Four Pillars of Value
Data-Driven Government: Explore the Four Pillars of ValueData-Driven Government: Explore the Four Pillars of Value
Data-Driven Government: Explore the Four Pillars of ValueThomas Robbins
 
Financial Transparency Trailblazers
Financial Transparency TrailblazersFinancial Transparency Trailblazers
Financial Transparency TrailblazersThomas Robbins
 
Telling Stories with Open Data
Telling Stories with Open DataTelling Stories with Open Data
Telling Stories with Open DataThomas Robbins
 
Socrata Financial Transparency Suite
Socrata Financial Transparency Suite Socrata Financial Transparency Suite
Socrata Financial Transparency Suite Thomas Robbins
 
Socrata Service Connect
Socrata Service ConnectSocrata Service Connect
Socrata Service ConnectThomas Robbins
 
Leveraging Data to Engage Citizens and Drive Innovation
Leveraging Data to Engage Citizens and Drive InnovationLeveraging Data to Engage Citizens and Drive Innovation
Leveraging Data to Engage Citizens and Drive InnovationThomas Robbins
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8Thomas Robbins
 
Say hello to Kentico 8! Your integrated marketing solution has arrived
Say hello to Kentico 8! Your integrated marketing solution has arrivedSay hello to Kentico 8! Your integrated marketing solution has arrived
Say hello to Kentico 8! Your integrated marketing solution has arrivedThomas Robbins
 
One Size does Not Fit All: Selecting the Right Mobile StrategyKentico mobil...
One Size does Not Fit All: Selecting the Right Mobile StrategyKentico   mobil...One Size does Not Fit All: Selecting the Right Mobile StrategyKentico   mobil...
One Size does Not Fit All: Selecting the Right Mobile StrategyKentico mobil...Thomas Robbins
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Thomas Robbins
 
Digital marketing best practices
Digital marketing best practices Digital marketing best practices
Digital marketing best practices Thomas Robbins
 
Do you speak digital marketing with Kentico CMS?
Do you speak digital marketing with Kentico CMS?Do you speak digital marketing with Kentico CMS?
Do you speak digital marketing with Kentico CMS?Thomas Robbins
 
Common questions for Windows Azure and Kentico CMS
Common questions for Windows Azure and Kentico CMSCommon questions for Windows Azure and Kentico CMS
Common questions for Windows Azure and Kentico CMSThomas Robbins
 
Advanced development with Windows Azure
Advanced development with Windows AzureAdvanced development with Windows Azure
Advanced development with Windows AzureThomas Robbins
 
Best Practices for Kentico CMS and Windows Azure
Best Practices for Kentico CMS and Windows AzureBest Practices for Kentico CMS and Windows Azure
Best Practices for Kentico CMS and Windows AzureThomas Robbins
 

More from Thomas Robbins (20)

PlayFab Advanced Cloud Script
PlayFab Advanced Cloud ScriptPlayFab Advanced Cloud Script
PlayFab Advanced Cloud Script
 
What’s in the box? Creating chance mechanics and rewards
What’s in the box? Creating chance mechanics and rewardsWhat’s in the box? Creating chance mechanics and rewards
What’s in the box? Creating chance mechanics and rewards
 
Getting started with Cloud Script
Getting started with Cloud ScriptGetting started with Cloud Script
Getting started with Cloud Script
 
Say hello to the new PlayFab!
Say hello to the new PlayFab!Say hello to the new PlayFab!
Say hello to the new PlayFab!
 
Data-Driven Government: Explore the Four Pillars of Value
Data-Driven Government: Explore the Four Pillars of ValueData-Driven Government: Explore the Four Pillars of Value
Data-Driven Government: Explore the Four Pillars of Value
 
Financial Transparency Trailblazers
Financial Transparency TrailblazersFinancial Transparency Trailblazers
Financial Transparency Trailblazers
 
Telling Stories with Open Data
Telling Stories with Open DataTelling Stories with Open Data
Telling Stories with Open Data
 
Socrata Financial Transparency Suite
Socrata Financial Transparency Suite Socrata Financial Transparency Suite
Socrata Financial Transparency Suite
 
Socrata Service Connect
Socrata Service ConnectSocrata Service Connect
Socrata Service Connect
 
Leveraging Data to Engage Citizens and Drive Innovation
Leveraging Data to Engage Citizens and Drive InnovationLeveraging Data to Engage Citizens and Drive Innovation
Leveraging Data to Engage Citizens and Drive Innovation
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
 
Here Comes Kentico 8
Here Comes Kentico 8Here Comes Kentico 8
Here Comes Kentico 8
 
Say hello to Kentico 8! Your integrated marketing solution has arrived
Say hello to Kentico 8! Your integrated marketing solution has arrivedSay hello to Kentico 8! Your integrated marketing solution has arrived
Say hello to Kentico 8! Your integrated marketing solution has arrived
 
One Size does Not Fit All: Selecting the Right Mobile StrategyKentico mobil...
One Size does Not Fit All: Selecting the Right Mobile StrategyKentico   mobil...One Size does Not Fit All: Selecting the Right Mobile StrategyKentico   mobil...
One Size does Not Fit All: Selecting the Right Mobile StrategyKentico mobil...
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
Digital marketing best practices
Digital marketing best practices Digital marketing best practices
Digital marketing best practices
 
Do you speak digital marketing with Kentico CMS?
Do you speak digital marketing with Kentico CMS?Do you speak digital marketing with Kentico CMS?
Do you speak digital marketing with Kentico CMS?
 
Common questions for Windows Azure and Kentico CMS
Common questions for Windows Azure and Kentico CMSCommon questions for Windows Azure and Kentico CMS
Common questions for Windows Azure and Kentico CMS
 
Advanced development with Windows Azure
Advanced development with Windows AzureAdvanced development with Windows Azure
Advanced development with Windows Azure
 
Best Practices for Kentico CMS and Windows Azure
Best Practices for Kentico CMS and Windows AzureBest Practices for Kentico CMS and Windows Azure
Best Practices for Kentico CMS and Windows Azure
 

Recently uploaded

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Using the Kentico CMS API

  • 1. Using the Kentico CMS API Thom Robbins (thomasr@kentico.com Bryan Soltis (bryan@bitwizards.com)
  • 2. Agenda • Overview (Architecture/Objects) (Thom) • CMS Context (Bryan) • Document Management (Thom) • Global Events (Thom) • Modules (Bryan)
  • 3. Looking at Kentico CMS Logical three tier architecture…
  • 4. Architecture breakdown Data layer (+metadata) Business layer Controls libraries UI components Web project pages Live site pages + admin UI pages Web parts + User controls CMSControls Helpers SettingsProvider Enumerations Infos & Providers Data engine GeneralConnection Abstract info Metadata infos (Class, Query, SettingsKey) Interfaces Third party code Module web parts + Module user controls Module controls Module Infos & Providers Module definitions Presentationlayer Best Practice Tip • Kentico CMS web site project provides examples of all sorts of code!
  • 5. OO Basics - Object Creation Examples // Create UserInfo CMS.SiteProvider.UserInfo user = new CMS.SiteProvider.UserInfo(); // Set properties user.UserName = "Alice"; user.FirstName = "Alice"; user.LastName = "Cooper"; user.FullName = "Alice Cooper"; user.Email = "alice.cooper@domain.com"; user.IsEditor = true; user.IsGlobalAdministrator = true; user.PreferredCultureCode = "en-us"; user.Enabled = true; // Create new user CMS.SiteProvider.UserInfoProvider.SetUserInfo(user); // Prepare the TreeProvider (it must be initialized with user information when editing document structure) UserInfo ui = UserInfoProvider.GetUserInfo("administrator"); CMS.TreeEngine.TreeProvider tree = new CMS.TreeEngine.TreeProvider(ui); // Get the document (current culture) CMS.TreeEngine.TreeNode node = tree.SelectSingleNode(CMS.CMSHelper.CMSContext.CurrentSiteName, "/News/TestingWorkflow", CMS.CMSHelper.CMSContext.CurrentUser.PreferredCultureCode, false, null, false); if (node != null) { // Always delete the document with DocumentHelper, it handles all the dependencies CMS.WorkflowEngine.DocumentHelper.DeleteDocument(node, tree, true, true,true); } Example - Creating new user Example – Delete Document
  • 6. API Everywhere! • Class View is your Friend CMS.SettingsProvider .SettingsHelper .SQLHelperClass .TranslationHelp er CMS.GlobalHelper .DataHelper .ContextHelper .AJAXHelper Library Specific CMS.Controls.CM SControlsHelper CMS.WorkflowEn gine.DocumentHe lper CMS.Blogs.BlogHe lper Some Examples… Best practice Tip: Class view is customizable to allow personalized organization and viewing
  • 7. Helpers and general libraries SettingsProvider (metadata helpers) SettingsHelper (web.config) SettingsKeyHelper (web site settings) SqlHelperClass (low level DB connection, used only from SettingsProvider) DataHelper (basic data manipulation) TranslationHelper (conversion of IDs based on code names or GUIDs) GlobalHelper (general helpers) /Context (HTTP context related data) /Data (advanced data manipulation and validation) /Globalization (resource strings and cultures) /Markup (macros, HTML, XML, text, script) /Media (images and media manipulation and information) Library specific (module helpers) ControlsHelper CMSControlsHelper DocumentHelper WebFarmSyncHelperClass Etc. App_Code (helper functions) Functions.cs InstallerFunctions.cs BlogFunctions.cs EcommerceFunctions.cs Etc. Best Practice Tip • For general code locate the appropriate helper and use it • If the helper contains similar methods override and extend • Implement new behavior in helpers
  • 8. CMS Context • CMS.CMSHelper.CMSContext class provides static methods to access common information Method CurrentAliasPath CurrentDocument CurrentPageInfo CurrentSite CurrentSiteName CurrentUser ViewMode ResolveCurrentPath Need a code snippet?
  • 9. Document Management – How documents are stored • Documents stored in SQL joined tables – CMS_Tree – Table with basic document data shared between different language versions. Contains one record for all culture version of the document – CMS_Document – Table with document data of specified language version of the document. Contains one record representing one language version of the document – Coupled table – table that contains custom document type fields CMS_Tree CMS_Document Coupled table CMS_Document Coupled table CMS_Document Coupled table Best Practice Tip: Every document is stored in up to three (3) tables. Use the API to access documents
  • 10. Document Management – Versioning Internals • Document versions and its history are stored in separate tables – CMS_VersionHistory – Table containing the document versions. Each version of the document is represented by one record that contains the complete document data in XML. – CMS_AttachmentHistory – Table containing the attachment version records. Each attachment version is bound to one or more document versions. Every record contains binary data of the attachment. – CMS_VersionAttachment – Table containing the bindings of the attachment versions to the document versions. CMS_VersionHistory CMS_VersionAttachment CMS_AttachmentHistory Version of attachments CMS_VersionAttachment CMS_AttachmentHistory Version of attachments
  • 11. Document Management Techniques CMS.TreeEngine.TreeNode • Not aware of versioning/workflow/attachments • Only works with published records CMS.WorkflowEngine.DocumentHelper • Versioning/workflow/attachment aware • Use for all document deletes Best Practice Tip: CMS.WorkflowEngine.DocumentHelper is recommended to access document information CMS.CMSHelper.TreeHelper allows access to documents directly Best Practice Tip: TreeHelper.GetDocuments checks the view mode and then calls either TreeProvider or DocumentHelper
  • 12. Global Events • Provide a way to execute custom events within the CMS system • Managed as a separate projects • Web Config Key Best Practice Tip: Developer documentation contains step by step instructions for implementing Global Events
  • 13. Global Event Classes • The events are applied to all data items that are stored to the database. It includes documents, user information or any other settings • Receives DataClass CustomDataHandler.cs • Event applied to all exceptions that occur • Receives System.exception CustomExceptionHandler.cs • Allows the integration of external databases and modify the authentication and authorization processCustomSecurityHandler.cs • Execute custom actions when a document is created, updated or deletedCustomTreeNodeHandler.cs • Event applied to workflow documents (same as CustomTreeNodeHandler) • Same as CustomtreeNodeHandler CustomWorkflowHandler.cs Best Practice Tip: For Document events always use either the CustomTreeNodeHandler (no workflow) or CustomWorkFlowHandler (workflow) not the CustomDataHandler
  • 14. Modules • Extend the CMS system to include your custom code
  • 15. Additional Information • Best samples are in your project! • Get your poster • Documentation - http://devnet.kentico.com/Documentation.aspx • Code Snippet Library - http://devnet.kentico.com/Blogs/Thomas-Robbins.aspx • Marketplace - http://devnet.kentico.com/Marketplace.aspx

Editor's Notes

  1. Standard 3-tier architecture Data driven object model (bussiness layer objects content based on metadata) UI consists of server controls, user controls and pages Modules are logically separated
  2. We have helpers for almost everything If you plan to write any general code that can be used later by someone else: Locate the helper If the helper contains the method, use it If the helper contains similar method, enhance it by overriding it and provide original method so that the behavior of existing calls stays the same If the helper doesn’t contain the method, implement it in the helper