Building websites with the KB-Suite Carl Alex Friis Nielsen The - - PowerPoint PPT Presentation

building websites with the
SMART_READER_LITE
LIVE PREVIEW

Building websites with the KB-Suite Carl Alex Friis Nielsen The - - PowerPoint PPT Presentation

Building websites with the KB-Suite Carl Alex Friis Nielsen The Royal Library Presentation Overview What is the KB-Suite ? The Component Concept Using Components Other KB suite stuff Questions 2/30 What is the KB-Suite ?


slide-1
SLIDE 1

Building websites with the KB-Suite

Carl Alex Friis Nielsen The Royal Library

slide-2
SLIDE 2

2/30

Presentation Overview

  • What is the KB-Suite ?
  • The Component Concept
  • Using Components
  • Other KB suite stuff
  • Questions
slide-3
SLIDE 3

3/30

What is the KB-Suite ?

  • Add-on modules for OpenCms
  • Made for the Danish Royal Library
  • KB = Kongelige Bibliotek
  • Some available for free download

(LGPL)

  • The rest and source available on

request

slide-4
SLIDE 4

4/30

The Component Concept

  • Components are building blocks from which

pages are built.

  • Any resource can be a component.
  • If the system knows how to handle a resource

it is a component.

  • Rendering method
  • Different rendering methods in different

contexts

  • Different rendering methods for different

resource types

slide-5
SLIDE 5

5/30

The Component Concept

  • The “traditional” way:

– resource->template

  • The “new” way:

– resource->component layer->template

  • What we want to achieve:

– Versatility – Simplicity

slide-6
SLIDE 6

6/30

The Users Perspective

  • How a cms user builds a page from

components.

slide-7
SLIDE 7

7/30

slide-8
SLIDE 8

8/30

slide-9
SLIDE 9

9/30

slide-10
SLIDE 10

10/30

slide-11
SLIDE 11

11/30

slide-12
SLIDE 12

12/30

slide-13
SLIDE 13

13/30

The System Design Perspective

  • Components in a given context are

handled by a set of handlers.

  • A component is associated with the

proper handler by a mapping from the components type to the handler.

slide-14
SLIDE 14

14/30

Handler

public interface I_KBResourceHandler { public void handleResource( String path, Map< String , String > param, CmsResourceUtil resu, JspWriter out, CmsJspXmlContentBean cms, CmsMessages messages ) throws JspException , IOException; }

slide-15
SLIDE 15

15/30

Handlermap

public interface I_KBResourceHandlerMap { public Map< String , I_KBResourceHandler > getMap(); public void addHandler( String resTypeName , I_KBResourceHandler handler ) throws KBTypeAllreadyHandledException; public void removeHandler( String resTypeName , I_KBResourceHandler handler ) throws KBTypeNotHandledException; public void replaceHandler( String resTypeName , I_KBResourceHandler handler ) throws KBTypeNotHandledException; public boolean handles( String resTypeName ); public boolean handles( String resTypeName , boolean includeDefault ); public boolean hasDefaultHandler();} public void handleResource( String path, Map< String , String > param, JspWriter out, CmsJspXmlContentBean cms, CmsMessages messages ) throws CmsException , JspException , IOException , KBTypeNotHandledException;

slide-16
SLIDE 16

16/30

Component Types in the KB suite

  • “Default”
  • Jsp/plain text
  • Collector configuration
  • (link) list
  • Agent
  • Slideshow
slide-17
SLIDE 17

17/30

Local Component Types of the Royal Library

  • Content pages

– Standard – Arrangement – News – Course

  • Front Pages
  • ”Pure” components

– Spot – Fact Box.

slide-18
SLIDE 18

18/30

The Default Handler

public class DefaultResourceHandler implements I_KBResourceHandler { public void handleResource( String path, Map<String,String> param, CmsResourceUtil resu, JspWriter out, CmsJspXmlContentBean cms, CmsMessages messages ) throws JspException, IOException {

  • ut.write( "<a href=\"" + cms.link( path ) + "\">" +

resu.getTitle() + "</a>\n" ); } }

slide-19
SLIDE 19

19/30

JSP/Plain Text

public class JspResourceHandler implements I_KBResourceHandler { public void handleResource( String path, Map< String , String > param, CmsResourceUtil resu, JspWriter out, CmsJspXmlContentBean cms, CmsMessages messages ) throws JspException , IOException { cms.include( path , null , param ); } }

slide-20
SLIDE 20

20/30

Collector Configuration

  • Will work recursively
  • Circles NOT handled
  • Needs to know map
  • Map provides handlers from the

collected resources

slide-21
SLIDE 21

21/30

List

slide-22
SLIDE 22

22/30

List

slide-23
SLIDE 23

23/30

Agent

  • Very complex
  • Used to handle sets of components
  • Driven by a collector configured by a

structured content

  • Lucene based search

– Keywords – Categories – Multiple folders

  • Sorting
  • More……
  • Handled like collector configs
  • Developed by Codedroids
slide-24
SLIDE 24

24/30

Creating a HandlerMap

  • Extend A_KBResourceHandlerMap
  • ”only” the constructor needed
  • Handlers can be specified as local

classes

  • Handlers can be included
  • Handlers can be loaded

dynamically

  • The map can be manipulated
slide-25
SLIDE 25

25/30

Restrictions of the Component Concept

  • Direct edit probably hard to

implement with components

  • User wishes for embedding

components in content in WYSIWYG editor cannot be met

slide-26
SLIDE 26

26/30

Inherited Content

  • A mechanism for sharing content

between pages

  • Sets of Components are shared
  • Configured in structured content
  • Components can be added at any

node.

  • Can be overridden (mostly)
slide-27
SLIDE 27

27/30

Inherited Content

slide-28
SLIDE 28

28/30

Other KB suite stuff

  • Menus configured in structured

content

  • Documentation and demo module
slide-29
SLIDE 29

29/30

Availabilty

  • The KB suite – free download from

http://www.kb.dk/en/kb/it/dup/KBSuite.html

  • Questions or comments – Carl Alex

Friis Nielsen (cfn@kb.dk)

  • Local KB modules – available on

demand

  • Source code – available on

demand

slide-30
SLIDE 30

30/30

Questions ?