SlideShare una empresa de Scribd logo
1 de 19
Orchard Dynamic Class Extensions
         (A Code Club Presentation)
               May 14, 2012
                       Presenters
                       Mark Dolar
                       Nesim Sisa

    Based on Article: Orchard Extensibility by Bertrand Le Roy

    http://msdn.microsoft.com/en-us/magazine/hh708754.aspx
Orchard Dynamic Class Extensions
                Key Questions -

 Why does Orchard have virtual methods?


 What does it mean to dynamically extend a class at
 runtime?


 Why dynamically extend a class at runtime?


 How do I dynamically extend a class at runtime?
Orchard Dynamic Class Extensions
        A Simple T/F Quiz about Orchard:
        Content Items are the central content entity in Orchard and
T   F   are entities users consider an end- product (like Blog
        Postings or a product page).
        In Orchard, Content Types are classes of Content
T   F   Items.

         In Orchard, Content Items are not instances of classes
T   F   such as BlogPost, Product or Widget.

        In Orchard, Content Items are composed of Content Parts
        where any two Content Items with common sets of
T   F   Content Parts are considered of the same Content Type
        class.
Orchard Dynamic Class Extensions
        A Simple T/F Quiz about Orchard:

T   F   Content Items in Orchard correspond to a URL.


        MPEG-2 Video Stream Closed Captioning Data is a
T   F   Content Part in Orchard.

        New Content Parts can by added to Orchard
T   F   without programming (ie. Visual Studio)
        Development.

T   F   In Orchard, Content Items are instances of Content Types.
Orchard Dynamic Class Extensions
          A Simple T/F Quiz about .NET:

T   F   C# is a statically typed language as opposed to
        a dynamically typed language.

        Static typing in C# means we can only describe
T   F   the fields, properties and methods inherent in all
        dynamic objects, not the objects themselves.
Orchard Dynamic Class Extensions
What important things do we know about Orchard's
dynamic content types?
   This is actually exactly how the blog post content type is defined

 1.ContentDefinitionManager.AlterTypeDefinition
 ("BlogPost",
 2. cfg => cfg
 3. .WithPart("BlogPostPart")
 4. .WithPart("CommonPart", p => p
 5. .WithSetting
 ("CommonTypePartSettings.ShowCreatedUtcEditor",
 "true"))
 6. .WithPart("PublishLaterPart")
 7. .WithPart("RoutePart")
 8. .WithPart("BodyPart")
 9. ); F
Orchard Dynamic Class Extensions
Extending the BlogPost content type dynamically

Two Approaches:
1. Adding an existing Content Part via a Yummy Recipe

       -Comments

        -Tags
2. Building a new Content Part via a Module

       -Brand X GPS

       -Metatag addition to page head example

       -Totally Unique Recording Device (T.U.R.D.)
Orchard Dynamic Class Extensions
Extending the BlogPost content type dynamically

Metatag addition to page head example:

         1.<meta content="Orchard is an open source Web
         CMS built on ASP.NET MVC."

         2. name="description" />

         3.<meta content="Orchard, CMS, Open source"
         name="keywords" />


    Module will add the above properties to the head section of
    the Blog Post Page

    Used to facilitate Search Engine Optimization

    A previously unavailable Content Part
Orchard Dynamic Class Extensions
Extending the BlogPost content type dynamically

Building a new Content Part via a Module

           -The Record

           -The Part Class

           -The Driver


These are basic components to a Content Type Module
Orchard Dynamic Class Extensions
Building a new Content Part via a Module

             -The Record
          0. public class MetaRecord :
          ContentPartRecord {

          0. public virtual string Keywords { get; set;
          }
          1. public virtual string Description { get;
          set; }
          2. }

Deriving from ContentPartRecord not absolutely necessary

A Record provides object persistence in the database

Virtual properties enables dynamic mix-in
Orchard Dynamic Class Extensions
 Building a new Content Part via a Module

                -The Record
            1.public class MetaHandler :
            ContentHandler {
            2. public MetaHandler(
            3. IRepository<MetaRecord> repository)
            {
            4. Filters.Add(
            5. StorageFilter.For(repository));
            6. }
            7.}
The record's only job is persistence.

Via a method, the Record table maps to the record class with calls to
the ContentPartRecord plus Keywords and Description String
Columns.
Orchard Dynamic Class Extensions
  Building a new Content Part via a Module

                 -The Part Class
   The representation of the part itself is another class that
   derives from ContentPart<TRecord>:

1.public class MetaPart : ContentPart<MetaRecord> {
2. public string Keywords {
3. get { return Record.Keywords; }
4. set { Record.Keywords = value; }
5. }
6. public string Description {
7. get { return Record.Description; }
8. set { Record.Description = value; }
9. }
10.}
Orchard Dynamic Class Extensions
Building a new Content Part via a Module

               -The Part Class
 -Part acts as proxy to Keywords and Description properties, but
 can be accessed through base ContentPart class.


 -Strong typing of of Keywords and Descriptions enabled by As
 method (analog to CLR cast operation):

 1.var metaKeywords = item.As<MetaPart>().Keywords;



 -Part class can be a composite; exposing subobject methods or
 composite properties.
Orchard Dynamic Class Extensions
Building a new Content Part via a Module

                 -The Driver

-Class derived from CotentPartDriver

-Scaled-Down Controller

-Methods handling well-defined events

       -Display

       -Editor
Orchard Dynamic Class Extensions
 Building a new Content Part via a Module
              -The Driver
Sample Driver for metadata display method -
       1.protected override DriverResult Display(
       2. MetaPart part, string displayType, dynamic shapeHelper) {
       3. var resourceManager = _wca.GetContext
       ().Resolve<IResourceManager>();
       4. if (!String.IsNullOrWhiteSpace(part.Description)) {
       5. resourceManager.SetMeta(new MetaEntry {
       6. Name = "description",
       7. Content = part.Description
       8. });
       9. }
       10. if (!String.IsNullOrWhiteSpace(part.Keywords)) {
       11. resourceManager.SetMeta(new MetaEntry {
       12. Name = "keywords",
       13. Content = part.Keywords
       14. });
       15. }
       16. return null;
       17.}
Orchard Dynamic Class Extensions
Building a new Content Part via a Module
             -The Driver


     -Most Drivers return a Dynamic Object called a shape

     -Shapes are assembled by Orchard into a composite and
     dynamic view model for the entire request.

     -Default rendering can be overriden by inserting a file into
     the current theme.
Orchard Dynamic Class Extensions
                Key Questions -
 Why does Orchard have virtual methods?


 What does it mean to dynamically extend a class at
 runtime?


 Why dynamically extend a class at runtime?


 How do I dynamically extend a class at runtime?
Orchard Dynamic Class Extensions
                   Thank You!

Mark Dolar Contact Info:

Linkedin:
http://www.linkedin.com/pub/mark-dolar/0/95/344

Follow Mark’s Little Media Blog via Twitter – More
Common Sense than one Blog should enjoy:

Twitter Name: Powerfinger

Current Topic: The Top Ten Reasons We Need Big Data
Orchard Dynamic Class Extensions
                  Thank You!

 Nesim Sisa Contact Info:

 Linkedin:
 http://www.linkedin.com/pub/nesim-sisa/41/911/540

Email:

Nesim.Sisa at gmail.com

Más contenido relacionado

La actualidad más candente

3) web development
3) web development3) web development
3) web development
techbed
 
Lab 5a) create a struts application
Lab 5a) create a struts applicationLab 5a) create a struts application
Lab 5a) create a struts application
techbed
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
DEEPAK KHETAWAT
 

La actualidad más candente (20)

Rest web service
Rest web serviceRest web service
Rest web service
 
Tumbleweed intro
Tumbleweed introTumbleweed intro
Tumbleweed intro
 
Struts N E W
Struts N E WStruts N E W
Struts N E W
 
Exploring Maven SVN GIT
Exploring Maven SVN GITExploring Maven SVN GIT
Exploring Maven SVN GIT
 
Spring & hibernate
Spring & hibernateSpring & hibernate
Spring & hibernate
 
Leverage Hibernate and Spring Features Together
Leverage Hibernate and Spring Features TogetherLeverage Hibernate and Spring Features Together
Leverage Hibernate and Spring Features Together
 
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsSpring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
 
Reactjs Basics
Reactjs BasicsReactjs Basics
Reactjs Basics
 
3) web development
3) web development3) web development
3) web development
 
Ee java lab assignment 4
Ee java lab assignment 4Ee java lab assignment 4
Ee java lab assignment 4
 
JSP Technology II
JSP Technology IIJSP Technology II
JSP Technology II
 
Lec6 ecom fall16
Lec6 ecom fall16Lec6 ecom fall16
Lec6 ecom fall16
 
Share point review qustions
Share point review qustionsShare point review qustions
Share point review qustions
 
Lab 5a) create a struts application
Lab 5a) create a struts applicationLab 5a) create a struts application
Lab 5a) create a struts application
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
 
Lab4 - android
Lab4 - androidLab4 - android
Lab4 - android
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
 
Struts notes
Struts notesStruts notes
Struts notes
 
Java serverpages
Java serverpagesJava serverpages
Java serverpages
 
Basics of Spring - KNOWARTH
Basics of Spring - KNOWARTHBasics of Spring - KNOWARTH
Basics of Spring - KNOWARTH
 

Destacado

AutCo 2011 First Mailing
AutCo 2011 First Mailing AutCo 2011 First Mailing
AutCo 2011 First Mailing
Dawid Bombera
 
AutCo 2011 Second Mailing
AutCo 2011 Second Mailing AutCo 2011 Second Mailing
AutCo 2011 Second Mailing
Dawid Bombera
 
ORGANISATION STRUCTURE
ORGANISATION STRUCTUREORGANISATION STRUCTURE
ORGANISATION STRUCTURE
Snehanka Kadge
 
India public expenditure recent
India public expenditure recentIndia public expenditure recent
India public expenditure recent
Snehanka Kadge
 

Destacado (19)

AutCo 2011 First Mailing
AutCo 2011 First Mailing AutCo 2011 First Mailing
AutCo 2011 First Mailing
 
What will be YOUR Moonwalk?
What will be YOUR Moonwalk?What will be YOUR Moonwalk?
What will be YOUR Moonwalk?
 
2010 Alberta Chamber Agm pp
2010 Alberta Chamber Agm pp2010 Alberta Chamber Agm pp
2010 Alberta Chamber Agm pp
 
02 блаженны плачущие
02 блаженны плачущие 02 блаженны плачущие
02 блаженны плачущие
 
PARIS COMO "LA CIUDAD DEL AMOR"
PARIS COMO "LA CIUDAD DEL AMOR"PARIS COMO "LA CIUDAD DEL AMOR"
PARIS COMO "LA CIUDAD DEL AMOR"
 
AutCo 2011 Second Mailing
AutCo 2011 Second Mailing AutCo 2011 Second Mailing
AutCo 2011 Second Mailing
 
НАГОРНАЯ ПРОПОВЕДЬ общее введение
НАГОРНАЯ ПРОПОВЕДЬ  общее введениеНАГОРНАЯ ПРОПОВЕДЬ  общее введение
НАГОРНАЯ ПРОПОВЕДЬ общее введение
 
What's your Moonwalk?
What's your Moonwalk?What's your Moonwalk?
What's your Moonwalk?
 
Earthquake ppt
Earthquake pptEarthquake ppt
Earthquake ppt
 
Drømmeløftet Moonwalk + Innovation Norway: Norway beyond Oil & Gas
Drømmeløftet Moonwalk + Innovation Norway: Norway beyond Oil & GasDrømmeløftet Moonwalk + Innovation Norway: Norway beyond Oil & Gas
Drømmeløftet Moonwalk + Innovation Norway: Norway beyond Oil & Gas
 
Disaster events p.p
Disaster events  p.pDisaster events  p.p
Disaster events p.p
 
17-03 блаженны кроткие
17-03 блаженны кроткие17-03 блаженны кроткие
17-03 блаженны кроткие
 
那個藏在你屁股後面的小玩意兒
那個藏在你屁股後面的小玩意兒那個藏在你屁股後面的小玩意兒
那個藏在你屁股後面的小玩意兒
 
Toll ppt
Toll pptToll ppt
Toll ppt
 
ORGANISATION STRUCTURE
ORGANISATION STRUCTUREORGANISATION STRUCTURE
ORGANISATION STRUCTURE
 
India public expenditure recent
India public expenditure recentIndia public expenditure recent
India public expenditure recent
 
STAFFING
STAFFINGSTAFFING
STAFFING
 
Earthquake ppt
Earthquake pptEarthquake ppt
Earthquake ppt
 
CHSurvey introduce
CHSurvey introduceCHSurvey introduce
CHSurvey introduce
 

Similar a Orchard Dynamic Class Extensions

Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Ranel Padon
 
Xv ocd2010-jsharp
Xv ocd2010-jsharpXv ocd2010-jsharp
Xv ocd2010-jsharp
Jason Sharp
 
Workshop: Creating your first WordPress plugin
Workshop: Creating your first WordPress pluginWorkshop: Creating your first WordPress plugin
Workshop: Creating your first WordPress plugin
ylefebvre
 
CustomizingStyleSheetsForHTMLOutputs
CustomizingStyleSheetsForHTMLOutputsCustomizingStyleSheetsForHTMLOutputs
CustomizingStyleSheetsForHTMLOutputs
Suite Solutions
 
Best Practices for Migrating a Legacy-Based CMS to Drupal
Best Practices for Migrating a Legacy-Based CMS to DrupalBest Practices for Migrating a Legacy-Based CMS to Drupal
Best Practices for Migrating a Legacy-Based CMS to Drupal
Acquia
 

Similar a Orchard Dynamic Class Extensions (20)

Copy is a 4 letter word
Copy  is a 4 letter wordCopy  is a 4 letter word
Copy is a 4 letter word
 
Oleksandr Krakovetskyi - Orchard CMS
Oleksandr Krakovetskyi - Orchard CMSOleksandr Krakovetskyi - Orchard CMS
Oleksandr Krakovetskyi - Orchard CMS
 
Orchard
OrchardOrchard
Orchard
 
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
 
CUST-3 Document Management with Share
CUST-3 Document Management with ShareCUST-3 Document Management with Share
CUST-3 Document Management with Share
 
Objectifying drupal
Objectifying drupalObjectifying drupal
Objectifying drupal
 
People aggregator
People aggregatorPeople aggregator
People aggregator
 
Xv ocd2010-jsharp
Xv ocd2010-jsharpXv ocd2010-jsharp
Xv ocd2010-jsharp
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Workshop: Creating your first WordPress plugin
Workshop: Creating your first WordPress pluginWorkshop: Creating your first WordPress plugin
Workshop: Creating your first WordPress plugin
 
PRG 421 Education Specialist / snaptutorial.com
PRG 421 Education Specialist / snaptutorial.comPRG 421 Education Specialist / snaptutorial.com
PRG 421 Education Specialist / snaptutorial.com
 
Django 1.10.3 Getting started
Django 1.10.3 Getting startedDjango 1.10.3 Getting started
Django 1.10.3 Getting started
 
In-Fisherman.com - Building an Enterprise Level Drupal Site
In-Fisherman.com - Building an Enterprise Level Drupal SiteIn-Fisherman.com - Building an Enterprise Level Drupal Site
In-Fisherman.com - Building an Enterprise Level Drupal Site
 
Word press interview question and answer tops technologies
Word press interview question and answer   tops technologiesWord press interview question and answer   tops technologies
Word press interview question and answer tops technologies
 
Cognos Software Development Kit
Cognos Software Development KitCognos Software Development Kit
Cognos Software Development Kit
 
20100707 e z_rmll_gig_v1
20100707 e z_rmll_gig_v120100707 e z_rmll_gig_v1
20100707 e z_rmll_gig_v1
 
The smartpath information systems c plus plus
The smartpath information systems  c plus plusThe smartpath information systems  c plus plus
The smartpath information systems c plus plus
 
Prg421
Prg421Prg421
Prg421
 
CustomizingStyleSheetsForHTMLOutputs
CustomizingStyleSheetsForHTMLOutputsCustomizingStyleSheetsForHTMLOutputs
CustomizingStyleSheetsForHTMLOutputs
 
Best Practices for Migrating a Legacy-Based CMS to Drupal
Best Practices for Migrating a Legacy-Based CMS to DrupalBest Practices for Migrating a Legacy-Based CMS to Drupal
Best Practices for Migrating a Legacy-Based CMS to Drupal
 

Orchard Dynamic Class Extensions

  • 1. Orchard Dynamic Class Extensions (A Code Club Presentation) May 14, 2012 Presenters Mark Dolar Nesim Sisa Based on Article: Orchard Extensibility by Bertrand Le Roy http://msdn.microsoft.com/en-us/magazine/hh708754.aspx
  • 2. Orchard Dynamic Class Extensions Key Questions - Why does Orchard have virtual methods? What does it mean to dynamically extend a class at runtime? Why dynamically extend a class at runtime? How do I dynamically extend a class at runtime?
  • 3. Orchard Dynamic Class Extensions A Simple T/F Quiz about Orchard: Content Items are the central content entity in Orchard and T F are entities users consider an end- product (like Blog Postings or a product page). In Orchard, Content Types are classes of Content T F Items. In Orchard, Content Items are not instances of classes T F such as BlogPost, Product or Widget. In Orchard, Content Items are composed of Content Parts where any two Content Items with common sets of T F Content Parts are considered of the same Content Type class.
  • 4. Orchard Dynamic Class Extensions A Simple T/F Quiz about Orchard: T F Content Items in Orchard correspond to a URL. MPEG-2 Video Stream Closed Captioning Data is a T F Content Part in Orchard. New Content Parts can by added to Orchard T F without programming (ie. Visual Studio) Development. T F In Orchard, Content Items are instances of Content Types.
  • 5. Orchard Dynamic Class Extensions A Simple T/F Quiz about .NET: T F C# is a statically typed language as opposed to a dynamically typed language. Static typing in C# means we can only describe T F the fields, properties and methods inherent in all dynamic objects, not the objects themselves.
  • 6. Orchard Dynamic Class Extensions What important things do we know about Orchard's dynamic content types? This is actually exactly how the blog post content type is defined 1.ContentDefinitionManager.AlterTypeDefinition ("BlogPost", 2. cfg => cfg 3. .WithPart("BlogPostPart") 4. .WithPart("CommonPart", p => p 5. .WithSetting ("CommonTypePartSettings.ShowCreatedUtcEditor", "true")) 6. .WithPart("PublishLaterPart") 7. .WithPart("RoutePart") 8. .WithPart("BodyPart") 9. ); F
  • 7. Orchard Dynamic Class Extensions Extending the BlogPost content type dynamically Two Approaches: 1. Adding an existing Content Part via a Yummy Recipe -Comments -Tags 2. Building a new Content Part via a Module -Brand X GPS -Metatag addition to page head example -Totally Unique Recording Device (T.U.R.D.)
  • 8. Orchard Dynamic Class Extensions Extending the BlogPost content type dynamically Metatag addition to page head example: 1.<meta content="Orchard is an open source Web CMS built on ASP.NET MVC." 2. name="description" /> 3.<meta content="Orchard, CMS, Open source" name="keywords" /> Module will add the above properties to the head section of the Blog Post Page Used to facilitate Search Engine Optimization A previously unavailable Content Part
  • 9. Orchard Dynamic Class Extensions Extending the BlogPost content type dynamically Building a new Content Part via a Module -The Record -The Part Class -The Driver These are basic components to a Content Type Module
  • 10. Orchard Dynamic Class Extensions Building a new Content Part via a Module -The Record 0. public class MetaRecord : ContentPartRecord { 0. public virtual string Keywords { get; set; } 1. public virtual string Description { get; set; } 2. } Deriving from ContentPartRecord not absolutely necessary A Record provides object persistence in the database Virtual properties enables dynamic mix-in
  • 11. Orchard Dynamic Class Extensions Building a new Content Part via a Module -The Record 1.public class MetaHandler : ContentHandler { 2. public MetaHandler( 3. IRepository<MetaRecord> repository) { 4. Filters.Add( 5. StorageFilter.For(repository)); 6. } 7.} The record's only job is persistence. Via a method, the Record table maps to the record class with calls to the ContentPartRecord plus Keywords and Description String Columns.
  • 12. Orchard Dynamic Class Extensions Building a new Content Part via a Module -The Part Class The representation of the part itself is another class that derives from ContentPart<TRecord>: 1.public class MetaPart : ContentPart<MetaRecord> { 2. public string Keywords { 3. get { return Record.Keywords; } 4. set { Record.Keywords = value; } 5. } 6. public string Description { 7. get { return Record.Description; } 8. set { Record.Description = value; } 9. } 10.}
  • 13. Orchard Dynamic Class Extensions Building a new Content Part via a Module -The Part Class -Part acts as proxy to Keywords and Description properties, but can be accessed through base ContentPart class. -Strong typing of of Keywords and Descriptions enabled by As method (analog to CLR cast operation): 1.var metaKeywords = item.As<MetaPart>().Keywords; -Part class can be a composite; exposing subobject methods or composite properties.
  • 14. Orchard Dynamic Class Extensions Building a new Content Part via a Module -The Driver -Class derived from CotentPartDriver -Scaled-Down Controller -Methods handling well-defined events -Display -Editor
  • 15. Orchard Dynamic Class Extensions Building a new Content Part via a Module -The Driver Sample Driver for metadata display method - 1.protected override DriverResult Display( 2. MetaPart part, string displayType, dynamic shapeHelper) { 3. var resourceManager = _wca.GetContext ().Resolve<IResourceManager>(); 4. if (!String.IsNullOrWhiteSpace(part.Description)) { 5. resourceManager.SetMeta(new MetaEntry { 6. Name = "description", 7. Content = part.Description 8. }); 9. } 10. if (!String.IsNullOrWhiteSpace(part.Keywords)) { 11. resourceManager.SetMeta(new MetaEntry { 12. Name = "keywords", 13. Content = part.Keywords 14. }); 15. } 16. return null; 17.}
  • 16. Orchard Dynamic Class Extensions Building a new Content Part via a Module -The Driver -Most Drivers return a Dynamic Object called a shape -Shapes are assembled by Orchard into a composite and dynamic view model for the entire request. -Default rendering can be overriden by inserting a file into the current theme.
  • 17. Orchard Dynamic Class Extensions Key Questions - Why does Orchard have virtual methods? What does it mean to dynamically extend a class at runtime? Why dynamically extend a class at runtime? How do I dynamically extend a class at runtime?
  • 18. Orchard Dynamic Class Extensions Thank You! Mark Dolar Contact Info: Linkedin: http://www.linkedin.com/pub/mark-dolar/0/95/344 Follow Mark’s Little Media Blog via Twitter – More Common Sense than one Blog should enjoy: Twitter Name: Powerfinger Current Topic: The Top Ten Reasons We Need Big Data
  • 19. Orchard Dynamic Class Extensions Thank You! Nesim Sisa Contact Info: Linkedin: http://www.linkedin.com/pub/nesim-sisa/41/911/540 Email: Nesim.Sisa at gmail.com

Notas del editor

  1. No matter what CMS you use to build your site, there will be a central content entity that goes by different names. In Drupal, it’s called a node, and in Orchard, it’s a content item. Content items are atoms of content such as blog posts, pages, products, widgets or status updates. Some of them correspond to a URL, and some don’t. Their schemas vary greatly, but what they have in common is they’re the smallest content units on the site. Or are they?As developers, our first reaction is to identify content items as instances of classes (post, page, product or widget), which is correct to an extent
  2. Question 1 certainly falseSome of them correspond to a URL, and some don’t. Question 2 may be true or false, depending on whether the Closed Captioning is being processed by a video player run by a driver. If the Closed Captioning is processed independent of the video, it could be it’s own content part (ie. A search algorithm).Question 3 probably false (requires a module). Content Types can be added without developmentQuestion 4 I think is true
  3. Question 1 is obviousQuestion 2 is probably true, but should initiate discussion. In other words, I can’t describe a Blog Posting because the definition is not universal. It turns out there are only two fields: Keywords and Descriptions and two methods: Display and Editor.
  4. There&apos;s not much Here...by designNo Comments or Tags
  5. The objective is to extend the capabilities of the Blog Post Content Type – is a new Content Type created?Figure 2 The SEO Meta Data EditorThese properties will be rendered into the head section of the page as standard metatags that search engines understand:&lt;meta content=&quot;Orchard is an open source Web CMS built on ASP.NET MVC.&quot;name=&quot;description&quot; /&gt;&lt;meta content=&quot;Orchard, CMS, Open source&quot; name=&quot;keywords&quot; /&gt;
  6. If you want to build a module, you will likely need each one these. One of them is optional – which one?
  7. That is basics of the Record
  8. The Part Class basically contains two properties – Keywords and Description
  9. Now we get to some interesting stuff –The part acts as a proxy to the record’s Keywords and Description properties as a convenience, but if it didn’t, the record and its properties would still be available through the public Record property of the base ContentPart class.Any code that has a reference to a content item that has the MetaPart part will be able to gain strongly typed access to the Keywords and Description properties by calling the As method, which is the analog in the Orchard type system of a CLR cast operation:varmetaKeywords = item.As&lt;MetaPart&gt;().Keywords;The part class is also where you’d implement any specific behavior of the part’s data. For example, a composite product could expose methods or properties to access its subproducts or compute a total price.Behavior that pertains to user interaction (the orchestration code that would in a regular ASP.NET MVC application be found in the controller) is another matter. This is where drivers come in.
  10. Each part in a content item has to get an opportunity to participate in the request lifecycle and effectively do the work of an ASP.NET MVC controller, but it needs to do it at the scale of the part instead of doing it at the scale of the full request. A content part driver plays the role of a scaled-down controller. It doesn’t have the full richness of a controller in that there’s no mapping to its methods from routes. Instead, it’s made of methods handling well-defined events, such as Display or Editor. A driver is just a class that derives from ContentPartDriver.
  11. Prepares the Rendering of the Part (extra precaution due to shared header region)
  12. By calling in to all the drivers for all the parts, Orchard is able to build a tree of shapes—a large composite and dynamic view model for the whole request. Its next task is to figure out how to resolve each of the shapes into templates that will be able to render them. It does so by looking at the name of each shape (Parts_Meta_Edit in the case of the Editor method) and attempting to map that to files in well-defined places of the system, such as the current theme’s and the module’s Views folders. This is an important extensibility point because it enables you to override the default rendering of anything in the system by just dropping a file with the right name into your local theme.