8. 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
15. 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
16. 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
17. 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
18. 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 view
Type inherit
UIDescriptor<HomePage>
Render default view
Load HomePage in CMS
19. Chart preview
• Same as previous, but now for ChartData (IContent)
What do you need to build a custom view?
20. 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?