bug fix: remove decode for resouce ident when use cherrypy's default dispatcher

Now there are two kinds of sub-collection/resource dispatchers.
1. Use cherrypy's default dispatcher
Cherrypy will decode the ident automatically
But now in kimchi we decode the ident manually.
This is a bug.
Kimchi can not list the resources with unicode name.

For examle:
create a pool with kīмсhī-pool name
list this pool
$ curl -u shhfeng -H 'Accept: application/json' \
-H 'Content-type: application/json' \
http://localhost:8000/storagepools/kīмсhī-pool

kimchi will throw an UnicodeEncodeError.

This patch fixes this bug.

2. customized dispatcher by overriding the cherrypy dispatcher
We need to decode the ident explicitly.
Now kimchi handles it correctly.

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
bug fix: Expose /storageservers

Now to expose a new uri for kimchi server we need to use the UrlSubNode
decorator, otherwise the uri will not be available.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Remove the unnecessary 'exposed'

'exposed' is only need to be set when a leaf hander is exposed,
so this patch removes the usages on resources.

Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Make guests template handling more robust like host template handling

Change guest tab loading from an ajax request to an inline element
processed by Cheetah at guests.html.tmpl load time. This will eliminate
the potential for error when fetching the guest template, as well as improve
the performance of the flow. Also updated kimchi-ui.html to eliminate
potential race condition as I integrated the new guests load into the main
flow.

Signed-off-by: Adam King <rak@linux.vnet.ibm.com>
get vms list by listAllDomains

we can get all domains by listAllDomains

Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
GET /plugins failed, fix it

commit 478d01d add a more parameter "filter_params" for get method of collection.

But it does not add this new parameter to derived class.

$ curl -H "Content-Type: application/json" -H "Accept: application/json" \
http://localhost:8000/plugins

Error as follow:

[27/Jan/2014:23:01:50] HTTP Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line
656, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line
188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line
34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/home/shhfeng/work/workdir/kimchi/src/kimchi/control/base.py",
line 266, in index
    return self.get(filter_params)
TypeError: get() takes exactly 1 argument (2 given)

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Use Autoconf macros AC_PROG_MKDIR_P and MKDIR_P

configure complains AM_PROG_MKDIR_P and MKDIR_P are obsolete.
configure.ac:44: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and
its use is discouraged.
configure.ac:44: You should use the Autoconf-provided 'AC_PROG_MKDIR_P'
macro instead,
configure.ac:44: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your
Makefile.am files.

Automake manual says:
From Automake 1.8 to 1.9.6 AM_PROG_MKDIR_P used to define the output variable
mkdir_p to one of mkdir -p, install-sh -d, or mkinstalldirs

Nowadays Autoconf provides a similar functionality with AC_PROG_MKDIR_P.
Automake manual advises to switch ASAP to the more modern Autoconf-provided
interface instead; both the macro and the variable might be removed in a
future major Automake release.

AC_PROG_MKDIR_P will set output variable MKDIR_P.

And kimchi already contains install-sh under build-aux.

REF:
http://www.gnu.org/software/automake/manual/automake.html#Obsolete-Macros
http://www.gnu.org/software/autoconf/manual/autoconf.html#index-AC_005fPROG_005fMKDIR_005fP-277

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Update README to direct users to the oVirt mailing list

Update README to direct users to the oVirt mailing list
rather than the old google group.

Signed-off-by: Adam King <rak@linux.vnet.ibm.com>
HTML: Make the form element's labels clickable

A good usability feature of an HTML form is to click on an element's
label to activate the element itself. For example, when clicking on a
checkbox's label, the checkbox itself is checked, instead of requiring
the user to click on the small corresponding element.

Assign every checkbox's and radio's labels to their corresponding
form elements.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
CSS: Do not allow lines longer than 79 characters

In order to make the code more consistent, set a maximum of 79
characters per line in CSS files. If the CSS properties line is longer
than 79, break it and align the second line to the beginning of the
properties of the first line. If the CSS filter line is longer than 79,
break it and do not indent the second line (so it also keeps aligned to
the first line as well).

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
CSS: Change all CSS files indentation to 4 spaces

In order to make the code more consistent, all CSS files should use the
same indentation level.

Use 4 spaces to indent the CSS properties.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
Move resource config's info fetching to model level

We should not put the resource specefic information in controller
level. Controller is just used to dispatch request and act a glue
of view and model.  We can dynamcially generate the controller code
in future.

Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reorganize the kimchi's paths gereneration code

This patch reorganizes kimchi's paths generation code to make the user
of path vars can work with both kimchi root app and plugin app.

Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Add test cases for paths generation code

This patch adds test cases for paths generation code.

Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Allow plugin use kimchi's ui handler

To make kimchi's error handler and tabs handler resued for plugin,
this patch moves the resource related code into a subclass. With this
change, the plugin can have error handler and tabs handler by
inheriting from this class.

Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
refactor model: Separate libvirtconnection from model.py

Libvirt connection is a base facility for kimchi model, so each
resource model should be able to access it directly. It can remove
the denpendency on class Model for resource models which need connect
libvirt. With this change, we can separate different resource model
classes from class Model.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
refactor model: Move StoragePooldef from model to libvirtstoragepools.py

Separate StoragePoolDef (and its sub-classes) from model as it handles the xml
generation for libvirt storage pools.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
refactor model: Create a common model builder

It will be useful while splitting model and mockmodel into smaller
modules.
It will automatically map all sub-model instance methods to a BaseModel
instance.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Signed-off-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
Create a model to join all model resources implementation

That way we don't need to change tests and controller in order to use
the separated model implementations
All models will be automatically loaded into Model() which will contain
all methods needed by controller.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
refactor model: Create a separated  model for task resource

The model implementation for config and its sub-resources were added to
model_/tasks.py

Signed-off-by: Aline Manera <alinefm@br.ibm.com>