24
EPiServer Charts EPiServer meetup 28-06-2016

EPiServer Charts

Embed Size (px)

Citation preview

Page 1: EPiServer Charts

EPiServer Charts

EPiServer meetup

28-06-2016

Page 2: EPiServer Charts

Patrick van KleefEPiServer Most Valued Professional @Geta

• www.patrickvankleef.com• twitter.com/patkleef• slideshare.com/patkleef• github.com/patkleef• jsfiddle.net/patkleef• www.geta.no

Click icon to add picture

Page 3: EPiServer Charts

Code available!Github | JSFiddle

• www.github.com/patkleef/DojoDragAndDrop

• https://jsfiddle.net/patkleef/Ls3hq01v/1/

• https://github.com/patkleef/DojoCharts• https://jsfiddle.net/patkleef/37yuu79w/

• https://github.com/patkleef/EPiServerStats

Page 4: EPiServer Charts

Contents- Dojo drag and drop- Demo- Dojo charting- Demo- EPiServer Charts- Demo

Page 5: EPiServer Charts

Just to be clear- Widget = Dojo- Gadget = EPiServer

Page 6: EPiServer Charts

Drag and Drop

Dojo

Page 7: EPiServer Charts
Page 8: EPiServer Charts

Drag and Drop

• Types that inherit from IContent can be drag and drop• ContentArea• [AllowedTypes(new[ ] { typeof(ImageData)]

• TinyMCE• Dojo/dnd package• Source • Target• Avatar• Events

Pages | Blocks | Media

Page 9: EPiServer Charts

Dojo/dndHow does it work?

SourceItem 1 - BlockItem 2 - ImageItem 3 - Document

TargetAccept: [ ] { Document }

Avatar

Item 3

EventsDndDrop, DraggingOver, DraggingOut, DropExternal, DropInternal, DndCancel, OverEvent, OutEvent, MouseMove, MouseDown, MouseUp

Page 10: EPiServer Charts

DEMO- Drag and Drop

Page 11: EPiServer Charts

ChartingDojo

Page 12: EPiServer Charts

Charting

• Different chart types• Animation and effects• Customize• Dojox/charting package• Charts• Plot• Axis• Action2d• Themes

Line | Column | Bar | Pie | Bubbles | more

Page 13: EPiServer Charts

DEMO- Charting

Page 14: EPiServer Charts

ChartsEPiServer – custom solution

Page 15: EPiServer Charts

What’s the solution about?

• ChartData : IContent• Chart asset gadget• Chart dashboard - custom view (preview, all-properties, inline-editor)• Chart preview – custom view ‘’• Page source• Modified by• Modified at• Links to page

Display information (charts) of the current page in the CMS

Page 16: EPiServer Charts

ChartData : IContent

• Why IContent? Use the benefits!• Create, update, delete charts• Create gadgets, like the blocks, media assets• Different views: all properties, preview• Find will index it• Trash basket• More ?

All items in EPiServer are IContent: pages, blocks media and charts

Page 17: EPiServer Charts

Architecture

Chart dashboard

Chart gadget• Page modified by• Page modified at

DnD chart

Rest store

Chart drop

Load page

Content repository descriptor

Chart Preview

Create chart

Page 18: EPiServer Charts

Chart dashboard

• Class inherit from ViewConfiguration<T>• Set the view name• Set the controllerType, if you would like to use Dojo• Set the viewType, if you would like to use MVC/Webforms

• Optional – class inherit from UIDescriptor<T>• Default view (view name)• Disable views – for example the OnPageEditView

• Dojo widget – controllerType• UI

What do you need to build a custom view?All types inherit

ViewConfiguration<HomePage>

Check default viewType inherit

UIDescriptor<HomePage>

Render default view

Load HomePage in CMS

Page 19: EPiServer Charts

Chart preview

• Same as previous, but now for ChartData (IContent)

What do you need to build a custom view?

Page 20: EPiServer Charts

Chart gadget

• Class inherit from ComponentDefinitionBase• Set dojo module• Title, description• Plugin area

• ContentRepositoryDescriptorBase• Tell what the gadget should show – ChartData• What the gadget can do – CRUD• What the root is

• Custom content provider ?• Dojo widget• HierarchicalList widget (EPiServer)

What do you need to build a gadget?

Page 21: EPiServer Charts

Dojo widget architecture

Rest store Chart widget

Chart preview widget

Chart dashboard

widget

Module.configChart initializer

Page 22: EPiServer Charts

Code demo- EPiServer Charts

Page 23: EPiServer Charts

Still work in progress

• Implement chart sources for pages• Create Nuget package

What’s next?

Page 24: EPiServer Charts

Thanks!www.patrickvankleef.com