Presentation is loading. Please wait.

Presentation is loading. Please wait.

FF 11 : Hooks A presentation by Robin Upton (2009-05-09) ‏ Latest version at www.altruists.org/ff11 Attribution – NonCommercial - ShareAlike www.altruists.org.

Similar presentations


Presentation on theme: "FF 11 : Hooks A presentation by Robin Upton (2009-05-09) ‏ Latest version at www.altruists.org/ff11 Attribution – NonCommercial - ShareAlike www.altruists.org."— Presentation transcript:

1 FF 11 : Hooks A presentation by Robin Upton (2009-05-09) ‏ Latest version at www.altruists.org/ff11 Attribution – NonCommercial - ShareAlike www.altruists.org V1.0.1 http://www.altruists.org/ff11 Recommended Pre-requisite: FF10: Access Control

2 What is a Hook? This presentation describes Hooks, which are XSLT-based transforms designed for extensibility and the semantic web. Hooks have XML definitions such as the below: Hooks are implemented by a set of handlers: This defines the global handle used to refer to this hook: Handlers link a namespace to a stylesheet. Hook declarations need a ‘wildcard’ handler, with namespace= “*”.

3 Processing Hooks Like services, hooks are explicitly requested by URI: The first step is to retrieve the compiled list of all handlers for this hook. Unlike services, they must contain XML elements....... some XML...

4 Choosing A Handler The child nodes of the hook request are processed by namespace....... some XML... All handlers apply only to data of one particular namespace... except for the wildcard handler, which catches all unspecified namespaces.

5 Applying Handlers Handlers are just XSL Templates, applied to the data item they matched: Handler templates <handler namespace ="*"/> The output of the separate XSL transforms is serialised. hookreq output

6 F2F clients apply this hook to the semantic (XML) data... http://friend2friend.net/hooks/render XML items that users may see should define a handler for this hook. For example, : http://www.altruists.org/ff12 semantic (XML)‏ display (XHTML)‏ hooks/render to produce the display data for showing users. rdf:about=

7 0 We're from the government. We're here to help you. Nope! 0 We're from the government. We're here to help you. Nope! 0 We're from the government. We're here to help you. Nope! 0 We're from the government. We're here to help you. Nope! 0 We're from the government. We're here to help you. Nope! 0 We're from the government. We're here to help you. Nope! 3 0 We're from the government. We're here to help you. Nope! http://friend2friend.net/modules/lib/if /home/home/robin/f2f/modules/lib/if.xslt 1.0 * * 80 /home/home/robin/f2f/modules/lib/compiled/if.input.xsd protected /f2f/lib 0 We're from the government. We're here to help you. Nope! 1 0 We're from the government. We're here to help you. Nope! http://friend2friend.net/modules/lib/if /home/home/robin/f2f/modules/lib/if.xslt 1.0 * * 80 /home/home/robin/f2f/modules/lib/compiled/if.input.xsd protected /f2f/lib 0 We're from the government. We're here to help you. Nope! 0 We're from the government. We're here to help you. Nope! http://friend2friend.net/modules/lib/if /home/home/robin/f2f/modules/lib/if.xslt 1.0 * * 80 /home/home/robin/f2f/modules/lib/compiled/if.input.xsd protected /f2f/lib 0 We're from the government. We're here to help you. Nope! 60 http://friend2friend.net/hooks/render transforms a mass of XML...

8 ...into a more easily understood graphical representation.

9 The icon module makes an for any XML. A hook was the best vehicle for this because it... Icon Module Example Moreover it couldn’t be programmed as a service, because it......applies to XML from many different modules....is a data transform....should apply to data as yet unknown. (i.e. actions & images for yet to be created XML)‏

10 has a simple structure: http://friend2friend.net/modules/icon/hooks/make Conveniently, the F2F core system defines hooks that match the above meanings, so icon/hooks/make can build on them. Icon name Image URI... XML describing what to do... rdf:about=

11 Nesting Hooks This template is applied to the contents of the below... desktop This creates 3 more hook requests which are processed... The wildcard handler script to make icons is as follows: → http://friend2friend.net/images/folder /desktop desktop Processing is complete:

12 Summary Modules may both define their own hooks and contribute handlers to existing hooks. Recommended Follow-up: FF12: Clients http://www.altruists.org/ff12 A hook is a globally referencable data transform. Data is handled by different XSL Transforms, according to namespace. rdf:about= "http://friend2friend.net/hooks/activate" <handler namespace=".. src=”...”/> <ha name src= <h nam src


Download ppt "FF 11 : Hooks A presentation by Robin Upton (2009-05-09) ‏ Latest version at www.altruists.org/ff11 Attribution – NonCommercial - ShareAlike www.altruists.org."

Similar presentations


Ads by Google