[Engine-devel] UI plugins crash course part two (for plugin developers)

Vojtech Szocs vszocs at redhat.com
Thu Nov 22 16:53:26 UTC 2012


Hi Dave,

this is excellent idea! It's definitely easier (and more fun) for others to follow "crash course" tutorials than just reading wiki docs :)

(I've used the "Level" metaphor to give readers the feeling that they're progressing from beginner to advanced topics, as they make their way through UI plugin development.)

I can certainly dedicate some time to writing such tutorial series. What would be the best way to start?

Regards,
Vojtech


----- Original Message -----
From: "Dave Neary" <dneary at redhat.com>
To: engine-devel at ovirt.org
Sent: Wednesday, November 21, 2012 2:57:20 PM
Subject: Re: [Engine-devel] UI plugins crash course part two (for plugin	developers)

Hi Vojtech,

This is great!

Would you be interested in writing this up as a tutorial series (working 
through a real-life example) for publication on the oVirt website? I 
think it's the kind of article which would be very useful in promoting 
the plug-in API.

Cheers,
Dave.

On 11/19/2012 03:49 PM, Vojtech Szocs wrote:
> Hi guys,
>
> this is a follow-up on the quick "crash course" for writing simple UI plugin.
>
> Before we proceed, please keep in mind that:
> - api.register() must be called exactly once, subsequent calls "overwrite" previous ones
> - api.register() must be called before api.ready(), otherwise your plugin will not work
> - you don't have to define all supported event handler functions in api.register(), just the ones your plugin is interested in (e.g. UiInit)
>
>
> Level 4 - Let's make things configurable
> ========================================
>
> 1. Specify default plugin configuration (optional)
> $ vim /usr/share/ovirt-engine/ui-plugins/hello-ui-world.json
>
> [hello-ui-world.json]
> ...
>    "config": { "testLink": "http://www.example.com/" }
> ...
> [/hello-ui-world.json]
>
> 2. Override default plugin configuration (optional)
> $ mkdir -p /etc/ovirt-engine/ui-plugins
> $ vim /etc/ovirt-engine/ui-plugins/hello-ui-world-config.json
>
> [hello-ui-world-config.json]
> {
>    "config": { "testLink": "http://www.another-example.com/" }
> }
> [/hello-ui-world-config.json]
>
> 3. Use plugin configuration that has been merged together
> $ vim /usr/share/ovirt-engine/ui-plugins/hello-world-files/start.html
>
> [start.html]
> ...
> # Anywhere within event handler function code (e.g. UiInit)
> var conf = api.configObject();
> api.showDialog('Test Dialog', conf.testLink, 600, 400);
> ...
> [/start.html]
>
>
> Regards,
> Vojtech
>
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
>

-- 
Dave Neary - Community Action and Impact
Open Source and Standards, Red Hat - http://community.redhat.com
Ph: +33 9 50 71 55 62 / Cell: +33 6 77 01 92 13
_______________________________________________
Engine-devel mailing list
Engine-devel at ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel



More information about the Engine-devel mailing list