Towards a GUI for CDB-CLI
Outline > Overview of CDB-CLI Why a GUI? Investigations Results & Future Work Conclusion
Overview of CDB-CLI Command Line Interface for the Configuration DataBase of Quattor $ cdbop Allows remote manipulation, validation and compilation of the content of a CDB Server from a client. Communication between CDB Server and cdbop by a SOAP interface. Written in Perl Interactive and batch mode Not really robust and flexible......but it does the job!
Outline Overview of CDB-CLI > Why a GUI? Investigations Results & Future Work Conclusion
Why a GUI? Since a GUI is : more user (? or admin) friendly than the command line interface more flexible? more aesthetic? Moreover, a GUI may brings us the benefit of dynamically modifiable abstract information. Panguin (an old gui for cdb) was not maintained (maintainable?) written in Java directly performs cdb operations (soap interface)
How? (1) A new GUI : on top of cdb-cli (cdbop) well designed flexible and robust maintainable really useful (of course)
How? (2) Using a development platform : a plug-in Using a standard approach : a language with a widgets library
My job («the attack plan») Find possible solutions Analyze them according to our needs Test them (prototypes) Evaluate them Synthesize the information Make a conclusion If required, fully develop the solution!
Outline Overview of CDB-CLI Why a GUI? > Investigations Results & Future Work Conclusion
Investigations a plug-in for a development platform : eclipse plug-in emacs plug-in a complete application : with a gui builder or not
eclipse Eclipse : is more than a Java IDE has an open, extensible architecture is built out of layers of plug-ins
eclipse Menu bar Tool bar Text editor Perspective and Fast View bar Resource Navigator view Outline view Properties view Bookmarks view Message area Stacked views Tasks view Editor Status area
Platform vs. Extensible Application Eclipse is a platform with a small runtime kernel : Plug-ins Plug-ins Application Run-time Platform Extensible Application
eclipse platform Platform implications : everybody can contribute plug-ins every programmer can be a tool smith creating opportunities for further extension makes it possible for the tool smith to benefit from the work of others easy to install and manage plug-ins In many ways eclipse is the emacs for the 21st century
eclipse plug-in architecture (1) Plug-in (set of contributions) Smallest unit of Eclipse functionality Big example: HTML editor Small example: Action to create zip files Extension point (named entity for collecting contributions) Example : extension point for workbench preference UI Extension (a contribution) Example: specific HTML editor preferences
eclipse plug-in architecture (2) Allows loading on demand by separating : declaration implementation Tip of the iceberg : Startup time: O(#used plug-ins) not O(# installed plug-ins)
plugin.xml plug-in manifest Plug-in identification <plugin id = com.example.tool" name = Example Plug-in Tool" class = "com.example.tool.toolplugin"> <requires> <import plugin = "org.eclipse.core.resources"/> <import plugin = "org.eclipse.ui"/> </requires> <runtime> <library name = tool.jar"/> </runtime> <extension point = "org.eclipse.ui.preferencepages"> <page id = "com.example.tool.preferences" icon = "icons/knob.gif" title = Tool Knobs" class = "com.example.tool.toolpreferencewizard /> </extension> <extension-point name = Frob Providers id = "com.example.tool.frobprovider"/> </plugin> Other plug-ins needed Location of plug-in s code Declare contribution this plug-in makes Declare new extension point open to contributions from other plug-ins
eclipse plug-in development Eclipse Plug-in Development Environment (PDE) Java programming language JFace UI framework : built on top of SWT (a portable widget set) provides trees, tables, lists, styled text, dialogs, wizards, etc.
emacs plug-in (overview) no specific development environment (like PDE) (ok, you have emacs :) elisp programming language no widgets
gui builders java based gui builder : netbeans, borland jbuilder, etc. alternatives : c++/gtk+ (with glade?) python/gtk+ (with glade/tepache?)
Outline Overview of CDB-CLI Why a GUI? Investigations > Results & Future Work Conclusion
Results (1) cdbop needed adaptations (and bug corrections) : possibility to «fork» it (how to integrate it outside a terminal) «--opensession» and «--closesession <SESSIONID>» non-interactive mode «--command» behavior adapted (uses CDB_SESSIONID environment variable) Example : $ export CDB_USER=npinto && export CDB_PASSWORD=CERN $ export CDB_SESSIONID=`cdbop opensession` $ cdbop --command list $ cdbop --command ''put my_template; commit'' $ cdbop --closesession `echo $CDB_SESSIONID`
Results (2) eclipse plug-in : eclipse is extremely powerful strong background in eclipse development is required too much «usine à gaz» for our simple application emacs plug-in : very powerful too (e)lisp is a very powerful language but who knows it? gui builder : perhaps python/gtk+ with glade/tepache is THE solution do you remember panguin?
Results (3) Building a powerful GUI takes time we don't want a new panguin cdbop adaptations takes time time is money GUI development vs GNU/Linux tool combination Admins are not lambda users! Do they really need a GUI? Are unix tools not sufficient? What do we need exactly?
Results (4) Merits of the command line : command line interface still has much to offer us many of its benefits simply cannot physically be emulated or even replaced by graphical ones... (ex: get quattor_*) Maintenance of a new GUI based on top of cdbop : cdbop only provides the presentation layer (end user layer) additions/modifications on cdbop = adaptations on the GUI = time
Future Work (1) a solution? First, build a specific library (Python?) for the CDB SOAP interface used by the cli and the gui Second, completely re-engineer CDB-CLI (cdbop) in Python? good OO design make it extensible, flexible and well documented Then, build the GUI (if we really need one) in Python?/GTK+ same as above use the glade/tepache combo to build it Finally, enjoy ;)
Future Work (2) CDB Server SOAP Interface CLI GUI
Outline Overview of CDB-CLI Why a GUI? Investigations Results & Future Work > Conclusion
Final Conclusion Learning, learning... It was a great experience! Thank you ;-)
Thank you for your attention! Questions? Comments? Criticisms?
Resources www.eclipse.org www.planeteclipse.org «Contributing to Eclipse: Principles, Patterns, and Plug-Ins» by Erich Gamma and Kent Beck http://www.omg.org/news/meetings/workshops/mda_ 2004_Manual/0-6_Tutorial4_Griffin.pdf www.google.com