orchard cms introduction december 15, 2011 copyright 2011 cloud construct, llc

32
Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Upload: abigayle-watson

Post on 11-Jan-2016

216 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Orchard CMSIntroduction

December 15, 2011

Copyright 2011 Cloud Construct, LLC

Page 2: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Orchard CMS Boston User Group

Kickoff!Internet –

User : CambridgePass: BK1215

Microsoft N.E.R.D. Buildinghttp://orchardcmsboston.org

Copyright 2011 Cloud Construct, LLC

• Contribute modules to gallery• Enhance the user group site

•Learn how to use Orchard to build quality sites.

Page 3: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Agenda

• Orchard CMS Overview– Technology– Performance– Project Status– Installation

• Content Types, Content Parts, Fields• Zones, Layers, Widgets• Modules and Themes• Localization• Recipes• Multi-Tenancy• Debugging• Questions?• Tuning Performance

Copyright 2011 Cloud Construct, LLC

Page 4: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Orchard CMS Preview

• Overview• Architecture• Performance• Project Status• Installation

Copyright 2011 Cloud Construct, LLC

Page 5: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Overview

• Latest and Greatest Technology– ASP.NET MVC 3– HTML 5 / CSS 3– .NET 4.0 Entity Framework/Code First– Razor Templates– jQuery– SQL Compact or SQL Server– Windows Azure for scalability– Great for small to medium sized sites

• SEO focused.• Focused on modular extensibility.• Free, open source (new BSD license)• Core MS Team is 7 developers, 2 designers, 2 PMs• Accepts community contributions:

– Patches to core, modules, translations, themes, etc

Copyright 2011 Cloud Construct, LLC

Page 6: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Architecture

• NHibernate – object relational mapping tool. Data persistence.• Autofac – Dependency Injection, separation of implementation

and functionality.• Castle Dynamic Proxy – Dynamic code on the fly to existing

classes.• No knowledge of any of these is needed for module

development.

Copyright 2011 Cloud Construct, LLC

Page 7: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Performance

• Page load time is dependent on modules loaded! < 1sec for a new site. Poorly written modules can change that.

• Memory usage is 120mb for a standard site.• Much of this is attributed to the following:

– It is a CMS and therefore cannot be optimized for a single use case.

– Inversion of control patterns and dynamic code takes longer to execute.

– In memory caching of data.– Template overriding.– Open source modules are not built completely optimized and

can easily cause problems to your site if not tested.

Copyright 2011 Cloud Construct, LLC

Page 8: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Tuning Performance

• Full trust mode from medium. (Security Risk)• Debug flag to false in production.• Orchard.Warmup module for most accessed

page while app domain spins up.• Pinging service so app never recycles in shared

hosting.• SQL server vs. SQL CE.• Multi-tenancy for sharing app domain.• Caching module data such as navigation.

Copyright 2011 Cloud Construct, LLC

Page 9: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Project Status

• Version 1.3.0 released on October 3rd.• Code hosted on Codeplex– Discussions– Releases about every 3 months

• Feature release• Bug fix release

• We have contributed two modules:– Cloud Construct Apple Touch Icon– Cloud Construct Post File

• Planning for Version 2.0 is in the works.

Copyright 2011 Cloud Construct, LLC

Page 10: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Installation

• Web Platform Installer• Download complete source.– Unzip and point at web folder to IIS.– Allows modifications to Orchard.Core and full

build and compilation.• Download only the web application itself.– Unzip and point root at IIS.– Dynamic compilation, edit modules and themes

easily in Visual Studio.– About 50MB footprint for new site.

Copyright 2011 Cloud Construct, LLC

Page 11: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Demo

• Login• Walkthrough content pieces• Editing Content• Save/Publish/Draft• Content Types• Settings

Copyright 2011 Cloud Construct, LLC

Page 12: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Demo

• Show theme folder structure• Enabling a theme

Copyright 2011 Cloud Construct, LLC

Page 13: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Themes

• It is a basic design principle in Orchard that all the HTML that it produces can be replaced from themes, including markup produced by modules.

• Themes can have a parent, which enables child themes to be specializations or adaptations of a parent theme.

• Mobile Theme can be triggered using Theme Selector Feature.

Copyright 2011 Cloud Construct, LLC

Page 14: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Orchard Content

• Content is comprised of the following:– Content Item– Content Types– Content Parts– Content Fields

Copyright 2011 Cloud Construct, LLC

Page 15: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Content Item

• A single piece of content, often associated with a single URL (address) on the site.

• Example,– Content items are pages, blog posts or

products.

Copyright 2011 Cloud Construct, LLC

Page 16: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Content Types

• Content items are instances of content types.

• Consist of Content Parts and Fields• Example, – A page, blog post and product. In other words

what we call a blog post is just an item of type blog post.

Copyright 2011 Cloud Construct, LLC

Page 17: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Content Parts

• Content parts are atoms of content that are enough to build a specific coherent behavior and that can be reused across content types.

• There can be only one of each part on any given content type.

• Example,– Comments, tags, or ratings are content parts

because they define a specific behavior and can be reused by any content type.

Copyright 2011 Cloud Construct, LLC

Page 18: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Content Fields

• Much more granular than a part.• Content fields are pieces of information

that can be added to a content type.• Example,– A part is used in a “has a” relationship and can

be applied multiple times.• There can be several of each field type on

any given content type.

Copyright 2011 Cloud Construct, LLC

Page 19: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Demo

• Module folder structure• Install of Module• Enabling features

Copyright 2011 Cloud Construct, LLC

Page 20: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Modules

• Extension point for functionality. – Content Parts– Content Fields– Content Types

• ASP.NET MVC area. Grouping of controllers, drivers, handlers, and view templates.

• Use the RAZOR templates or ASPX.• A module typically contains event handlers,

content types and their default rendering templates as well as some admin UI.

Copyright 2011 Cloud Construct, LLC

Page 21: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Demo

• Show Layout.cshtml• Document.cshtml• Zones page, layers, widgets• Show rules

Copyright 2011 Cloud Construct, LLC

Page 22: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Orchard Layout

• Widgets• Layers• Zones

Copyright 2011 Cloud Construct, LLC

Page 23: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Widgets

• Piece of HTML content (with code and logic) which can be mapped / assigned to pages within a website.

• They have the widget content part.• Widgets are added to pages through

widget layers.

Copyright 2011 Cloud Construct, LLC

Page 24: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Layers

• Defines a set of rules for rendering the widgets.• They have a name, a rule that determines what pages of

the site they should appear on, and a list of widgets and associated zone placement and ordering, and settings.

• The rules attached to each of the layers are expressed with IronRuby expressions.

Copyright 2011 Cloud Construct, LLC

Page 25: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Zones

• Defines the position of the widget within a page (available zones depends on selected Theme).

Copyright 2011 Cloud Construct, LLC

Page 26: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Localization

• Application Localization– Administration screens.– Community translations submitted.

• Content Localization– Content items in the db.– PO files are included in module and have

translations. Resolved using T<> Localizer.– Localization module adds multiple content items

for each language. Resolves proper content based on culture picker and URLs. (es-es, fr-fr, en-us)

Copyright 2011 Cloud Construct, LLC

Page 27: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Recipes

• Recipes are used to create Orchard instances based on canned settings and features.– For example, you work in an environment

where you create multiple sites that need similar settings, modules, and features. You can create a custom recipe for your site.

– Runs when new site is created. “Cooks” the site with all the ingredients.

– XML file that can be exported from a previously configured CMS.

Copyright 2011 Cloud Construct, LLC

Page 28: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Multi-Tenancy

• Host multiple sites in one Orchard instance.

• Same app domain, different content and configuration.

• Multi-tenancy is particularly nice in a Windows Azure environment, because one deployment to Azure can easily support multiple websites.

Copyright 2011 Cloud Construct, LLC

Page 29: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Debugging

• Shape Tracing– Demo enabling shape tracing and showing

alternates.• Logging with log4net• Profiling• Developer Modules• Step through with debugger. (Very slow)

Copyright 2011 Cloud Construct, LLC

Page 30: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

New In Orchard 1.3.9

• Content item preview• Markdown support• Delete content types and parts• Title part enables non-routable types to have a title• Common added by default to content types• Rules: trigger custom actions triggered by events• Forms API: create forms from code• Tokens: system-wide variables• New content manager methods: part eager loading, get multiple items

by ids in one query• Task Lease API: creates server affinities for background tasks on web

farms and cloud platforms• Localization: data annotations, widgets, alternates• Lists have RSS feeds

Copyright 2011 Cloud Construct, LLC

Page 31: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

What have we built?

– Localization– Contact Form– Resume Upload– Google Custom Search– Volunteer Signup– Blog with multiple contributors.– Email List Alerts– Apple Touch Icon– Rotating Banners

Copyright 2011 Cloud Construct, LLC

Page 32: Orchard CMS Introduction December 15, 2011 Copyright 2011 Cloud Construct, LLC

Questions

• Questions anyone?

Copyright 2011 Cloud Construct, LLC