Hippo gettogether april 2012 faceted navigation a tale of daemons

14
1 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012 Faceted Navigation on Related Documents A tale of Daemons Wouter Danes – Hippo Gettogether – 20 april 2012

description

A presentatino by wouter Danes

Transcript of Hippo gettogether april 2012 faceted navigation a tale of daemons

Page 1: Hippo gettogether april 2012 faceted navigation   a tale of daemons

1 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Faceted Navigation on Related Documents

A tale of Daemons

Wouter Danes – Hippo Gettogether – 20 april 2012

Page 2: Hippo gettogether april 2012 faceted navigation   a tale of daemons

2 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Agenda

• About me

• User story: faceted navigation for site wide search

• Problem: practice doesn’t follow theory

• Possible solution: Derived Data Engine

• Better solution: Daemons!

• Some stuff we learned

• How to improve Hippo to make this easier

Page 3: Hippo gettogether april 2012 faceted navigation   a tale of daemons

3 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

About me – Wouter Danes

• Hired via Orange11 @Rijksoverheid.nl

• Java (10yrs experience) & Hippo Developer

• Competence Manager Java & Hippo @ Hinttech

• Merciless refactorer

• Loves Test Driven Development

• Hippo CMS Committer

• Experience as a Software Architect

Page 4: Hippo gettogether april 2012 faceted navigation   a tale of daemons

4 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Faceted Navigation for Site Wide Search

• Rijksoverheid.nl needed a new side wide search

• It had to allow a drill down via four facets:

Responsible Department(s), Document Type

Applicable Theme(s), Document Date

• This is pretty easy with Hippo

• It supports faceted navigation out of the box

• At least, if all facets are properties on the

document…

Page 5: Hippo gettogether april 2012 faceted navigation   a tale of daemons

5 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Problem: Practice doesn’t follow theory

We would like to see:

Page 6: Hippo gettogether april 2012 faceted navigation   a tale of daemons

6 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Problem: Practice doesn’t follow theory

The horrible truth: We would like to see:

Page 7: Hippo gettogether april 2012 faceted navigation   a tale of daemons

7 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Possible solution: Derived Data Engine

• Derived Data Engine allows you to define input

properties and then populate some output

properties

• You can even point to a single property on ONE

related Document (property name is secretly a

relative path… shhh!) f.ex: “common:subject/@title”

• You cannot point to a property on multiple

related Documents

• Crap! Foiled again!

Page 8: Hippo gettogether april 2012 faceted navigation   a tale of daemons

8 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

We Were About to Give Up…

When Jeroen and me came up with this idea…

Page 9: Hippo gettogether april 2012 faceted navigation   a tale of daemons

9 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Daemon Modules

• Hippo CMS supports Daemon Modules

• Daemon modules are services that run in the

Hippo Repository in their own (admin) session

• We could let this daemon module derive stuff for

us, all we have to do is send it the UUID of the

node…

• Let’s see how that works!

!! WARNING: DO NOT TRY THIS AT HOME !!

Page 10: Hippo gettogether april 2012 faceted navigation   a tale of daemons

10 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Sequence Diagram

Now show us some code..!!

Page 11: Hippo gettogether april 2012 faceted navigation   a tale of daemons

11 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Nothing Like the Smell of a Good Hack!

(unless you are Hippo Support and got 50+ clients doing this…)

Page 12: Hippo gettogether april 2012 faceted navigation   a tale of daemons

12 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Stuff We Learned

1. Make Sure Your Daemon Module is Thread Safe

2. When you Refresh a Session, any Nodes it

Supplied Become Useless

3. If a Derived Data Function Throws an Exception,

any Action that Triggered the Node.save() Fails

4. This Will Break (Delayed) Publishing!

1 + 2 + 3 + 4 == Weird Artifacts

….That took us ages to debug

Page 13: Hippo gettogether april 2012 faceted navigation   a tale of daemons

13 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

How to improve Hippo to make this easier

• Improve Derived Data Engine to Supply a

Decorated Read Only Node instead of Input &

Output Properties

• Read Only is Good, Because You Don’t Want the

Derived Data Engine to Modify/Save other Nodes

• Output Concept Can Stay Like it Is

• Or… Wait for SOLR Integration

Page 14: Hippo gettogether april 2012 faceted navigation   a tale of daemons

14 | Copyright ©2012 HintTech B.V. All rights reserved Vrijdag 20 april 2012

Delftechpark 37i

2628 XJ Delft

The Netherlands

Tel:

Mob:

E-mail:

Contact on behalf of HintTech:

+31–(0)88–268 25 00 Address:

Delft San Francisco Novi Sad Nordic United Kingdom

[email protected]

Wouter Danes

@wouterdanes

+31-(0) 6 1158 8264