deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tong Li <liton...@us.ibm.com>
Subject Re: [PATCH core 1/4] CIMI: Initial import of the CIMI client sinatra app
Date Fri, 02 Dec 2011 18:34:05 GMT
ACK, other than a small white space warning. Please fix it and push.

Tong Li
Emerging Technologies & Standards
Building 501/B205
litong01@us.ibm.com



From:	mfojtik@redhat.com
To:	dev@deltacloud.apache.org
Date:	12/02/2011 08:34 AM
Subject:	[PATCH core 1/4] CIMI: Initial import of the CIMI client
            sinatra app



From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 clients/cimi/Gemfile                               |    9 +
 clients/cimi/app.rb                                |   58 ++++
 clients/cimi/bin/start                             |  123 +++++++
 clients/cimi/config.ru                             |   19 +
 clients/cimi/init.rb                               |   29 ++
 clients/cimi/lib/entities.rb                       |   24 ++
 clients/cimi/lib/entities/base_entity.rb           |   23 ++
 clients/cimi/lib/entities/cloud_entry_point.rb     |   26 ++
 clients/cimi/lib/entities/machine_configuration.rb |   30 ++
 clients/cimi/lib/entities/machine_image.rb         |   30 ++
 clients/cimi/lib/lazy_auth.rb                      |   74 ++++
 clients/cimi/public/app.css                        |   57 +++
 clients/cimi/public/bootstrap/LICENSE              |  176 ++++++++++
 clients/cimi/public/bootstrap/bootstrap.min.css    |  356 ++++++++++++++++
++++
 .../cimi/public/bootstrap/js/bootstrap-alerts.js   |  124 +++++++
 .../cimi/public/bootstrap/js/bootstrap-buttons.js  |   64 ++++
 .../cimi/public/bootstrap/js/bootstrap-dropdown.js |   55 +++
 .../cimi/public/bootstrap/js/bootstrap-modal.js    |  260 ++++++++++++++
 .../cimi/public/bootstrap/js/bootstrap-popover.js  |   90 +++++
 .../public/bootstrap/js/bootstrap-scrollspy.js     |  107 ++++++
 clients/cimi/public/bootstrap/js/bootstrap-tabs.js |   80 +++++
 .../cimi/public/bootstrap/js/bootstrap-twipsy.js   |  321 ++++++++++++++++
++
 clients/cimi/public/html5.js                       |    4 +
 clients/cimi/views/cloud_entry_point/index.haml    |   20 ++
 clients/cimi/views/layout.haml                     |   31 ++
 .../cimi/views/machine_configurations/index.haml   |   21 ++
 .../cimi/views/machine_configurations/show.haml    |   33 ++
 clients/cimi/views/machine_images/index.haml       |   21 ++
 clients/cimi/views/machine_images/show.haml        |   31 ++
 29 files changed, 2296 insertions(+), 0 deletions(-)
 create mode 100644 clients/cimi/Gemfile
 create mode 100644 clients/cimi/app.rb
 create mode 100755 clients/cimi/bin/start
 create mode 100644 clients/cimi/config.ru
 create mode 100644 clients/cimi/init.rb
 create mode 100644 clients/cimi/lib/entities.rb
 create mode 100644 clients/cimi/lib/entities/base_entity.rb
 create mode 100644 clients/cimi/lib/entities/cloud_entry_point.rb
 create mode 100644 clients/cimi/lib/entities/machine_configuration.rb
 create mode 100644 clients/cimi/lib/entities/machine_image.rb
 create mode 100644 clients/cimi/lib/lazy_auth.rb
 create mode 100644 clients/cimi/public/app.css
 create mode 100644 clients/cimi/public/bootstrap/LICENSE
 create mode 100644 clients/cimi/public/bootstrap/bootstrap.min.css
 create mode 100644 clients/cimi/public/bootstrap/js/bootstrap-alerts.js
 create mode 100644 clients/cimi/public/bootstrap/js/bootstrap-buttons.js
 create mode 100644 clients/cimi/public/bootstrap/js/bootstrap-dropdown.js
 create mode 100644 clients/cimi/public/bootstrap/js/bootstrap-modal.js
 create mode 100644 clients/cimi/public/bootstrap/js/bootstrap-popover.js
 create mode 100644 clients/cimi/public/bootstrap/js/bootstrap-scrollspy.js
 create mode 100644 clients/cimi/public/bootstrap/js/bootstrap-tabs.js
 create mode 100644 clients/cimi/public/bootstrap/js/bootstrap-twipsy.js
 create mode 100644 clients/cimi/public/html5.js
 create mode 100644 clients/cimi/views/cloud_entry_point/index.haml
 create mode 100644 clients/cimi/views/layout.haml
 create mode 100644 clients/cimi/views/machine_configurations/index.haml
 create mode 100644 clients/cimi/views/machine_configurations/show.haml
 create mode 100644 clients/cimi/views/machine_images/index.haml
 create mode 100644 clients/cimi/views/machine_images/show.haml

diff --git a/clients/cimi/Gemfile b/clients/cimi/Gemfile
new file mode 100644
index 0000000..d3b3f63
--- /dev/null
+++ b/clients/cimi/Gemfile
@@ -0,0 +1,9 @@
+source "http://rubygems.org"
+
+gem 'sinatra'
+gem 'sinatra-content-for'
+gem 'rack-accept'
+gem 'haml'
+gem 'rest-client'
+gem 'json'
+gem 'xmlsimple'
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
new file mode 100644
index 0000000..3be0af9
--- /dev/null
+++ b/clients/cimi/app.rb
@@ -0,0 +1,58 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See
the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+module CIMI::Frontend
+
+  class Application < Sinatra::Base
+    use CIMI::Frontend::CloudEntryPoint
+    use CIMI::Frontend::MachineConfiguration
+    use CIMI::Frontend::MachineImage
+
+    configure do
+      enable :logging
+      enable :show_exceptions
+      enable :dump_errors
+      enable :raise_exceptions
+    end
+
+    get '/' do
+      redirect '/cimi/cloudEntryPoint'
+    end
+
+    get '/cimi' do
+      redirect '/cimi/cloudEntryPoint'
+    end
+  end
+
+  private
+
+  def self.client
+    RestClient::Resource.new(ENV['CIMI_API_URL'])
+  end
+
+  def self.get_entity(entity_type, id, credentials)
+    client['%s/%s' % [entity_type, id]].get(auth_header(credentials))
+  end
+
+  def self.get_entity_collection(entity_type, credentials)
+    client[entity_type].get(auth_header(credentials))
+  end
+
+  def self.auth_header(credentials)
+    encoded_credentials =
["#{credentials.user}:#{credentials.password}"].pack("m0").gsub(/\n/,'')
+    { :authorization => "Basic " + encoded_credentials }
+  end
+
+end
diff --git a/clients/cimi/bin/start b/clients/cimi/bin/start
new file mode 100755
index 0000000..94d6fc9
--- /dev/null
+++ b/clients/cimi/bin/start
@@ -0,0 +1,123 @@
+#!/usr/bin/env ruby
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See
the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+$:.unshift File.join(File.dirname(__FILE__), '..')
+
+require 'rubygems'
+require 'optparse'
+
+#rackup -p 4567
+
+#API_URL=$1 shotgun config.ru -p 4567 -E development
+#
+
+def library_present?(name)
+  begin
+    require name
+    true
+  rescue LoadError
+    false
+  end
+end
+
+options = {}
+
+optparse = OptionParser.new do |opts|
+
+opts.banner = <<BANNER
+Usage:
+start -u <URL> [options]
+
+Options:
+BANNER
+
+  opts.on( '-u', '--url URL', 'CIMI REST API entry point URL') do |url|
+    ENV["CIMI_API_URL"] ||= url
+  end
+
+  opts.on( '-r', '--hostname HOSTNAME',
+           'Bind to HOST address (default: localhost)') do |host|
+    ENV["CIMI_API_HOST"] = host
+  end
+
+  opts.on( '-p', '--port PORT', 'Use PORT (default: 4001)') do |port|
+    ENV["CIMI_API_PORT"] = port
+  end
+
+  opts.on( '-e', '--env ENV', 'Environment (default: "development")') { |
env| options[:env] = env }
+end
+
+optparse.parse!
+
+options[:env] ||= 'development'
+
+dirname="#{File.dirname(__FILE__)}/.."
+
+have_thin = library_present?('thin')
+have_rerun = library_present?('rerun')
+
+unless have_thin
+  require 'rack'
+
+  # Read in config.ru and convert it to an instance of Rack::Builder
+  cfgfile = File.read(File.join(dirname, 'config.ru'))
+  inner_app = eval("Rack::Builder.new {(" + cfgfile + "\n )}.to_app",
+                   nil, 'config.ru')
+
+  app = Rack::Builder.new {
+    use Rack::CommonLogger # apache-like logging
+    use Rack::Reloader if options[:env] == "development"
+    set :root, dirname # Set Sinatra root since we can't chdir to ../
+    run inner_app
+  }.to_app
+
+  # There's a bug with string ports on JRuby so convert to int
+  # http://jira.codehaus.org/browse/JRUBY-4868
+  port = ENV["CIMI_API_PORT"].to_i
+
+  puts "=> Ctrl-C to shutdown server"
+  Rack::Handler::WEBrick.run(app,
+                             :Host => ENV["CIMI_API_HOST"],
+                             :Port => port,
+                             :AccessLog => [])
+else
+  argv_opts = ARGV.clone
+  argv_opts << ['start']
+  argv_opts << ['--address', ENV["CIMI_API_HOST"] ] if ENV
['CIMI_API_HOST']
+  argv_opts << ['--port', ENV["CIMI_API_PORT"] || '4001' ]
+  argv_opts << ['--rackup', File.join(dirname, 'config.ru') ]
+  argv_opts << ['--timeout', ENV["API_TIMEOUT"] || '60']
+  argv_opts << ['--threaded', '-D' ]
+
+  argv_opts.flatten!
+
+  puts argv_opts.inspect
+
+  if have_rerun && options[:env] == "development"
+    argv_opts.unshift "thin"
+    command = argv_opts.join(" ")
+    topdir = File::expand_path(File::join(File::dirname(__FILE__), ".."))
+    rerun = Rerun::Runner.new(command, :dir => topdir)
+    rerun.start
+    rerun.join
+  else
+    $:.unshift File.join(dirname)
+    thin = Thin::Runner.new(argv_opts)
+    thin.run!
+  end
+end
diff --git a/clients/cimi/config.ru b/clients/cimi/config.ru
new file mode 100644
index 0000000..0ce0647
--- /dev/null
+++ b/clients/cimi/config.ru
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See
the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+require './init.rb'
+require './app.rb'
+
+run CIMI::Frontend::Application
diff --git a/clients/cimi/init.rb b/clients/cimi/init.rb
new file mode 100644
index 0000000..9979668
--- /dev/null
+++ b/clients/cimi/init.rb
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See
the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+require 'rubygems'
+require 'sinatra/base'
+require 'sinatra/content_for'
+require 'rack/accept'
+require 'haml'
+require 'rest-client'
+
+$:.unshift File.join('lib')
+require 'lazy_auth'
+require 'entities'
+
+$:.unshift File.join('..', '..','server', 'lib')
+require 'deltacloud/core_ext'
+require 'cimi/model'
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
new file mode 100644
index 0000000..0fd1535
--- /dev/null
+++ b/clients/cimi/lib/entities.rb
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See
the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+module CIMI
+  module Frontend
+  end
+end
+
+require 'entities/base_entity'
+require 'entities/cloud_entry_point'
+require 'entities/machine_configuration'
+require 'entities/machine_image'
diff --git a/clients/cimi/lib/entities/base_entity.rb
b/clients/cimi/lib/entities/base_entity.rb
new file mode 100644
index 0000000..254f67b
--- /dev/null
+++ b/clients/cimi/lib/entities/base_entity.rb
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See
the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Frontend::Entity < Sinatra::Base
+
+  helpers Sinatra::LazyAuth
+  helpers Sinatra::ContentFor
+
+  set :views, Proc.new { File.join(File::dirname(__FILE__), "..", "..",
"views") }
+
+end
diff --git a/clients/cimi/lib/entities/cloud_entry_point.rb
b/clients/cimi/lib/entities/cloud_entry_point.rb
new file mode 100644
index 0000000..1429a85
--- /dev/null
+++ b/clients/cimi/lib/entities/cloud_entry_point.rb
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See
the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+
+class CIMI::Frontend::CloudEntryPoint < CIMI::Frontend::Entity
+
+  get '/cimi/cloudEntryPoint' do
+    entry_point_xml = CIMI::Frontend::get_entity_collection
('cloudEntryPoint', credentials)
+    @entry_point = CIMI::Model::CloudEntryPoint.from_xml(entry_point_xml)
+    @entities = CIMI::Model::root_entities.map { |e|
e.underscore.downcase }
+    haml :'cloud_entry_point/index'
+  end
+
+end
diff --git a/clients/cimi/lib/entities/machine_configuration.rb
b/clients/cimi/lib/entities/machine_configuration.rb
new file mode 100644
index 0000000..02f55c7
--- /dev/null
+++ b/clients/cimi/lib/entities/machine_configuration.rb
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See
the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Frontend::MachineConfiguration < CIMI::Frontend::Entity
+
+  get '/cimi/machine_configurations/:id' do
+    machine_confs_xml = CIMI::Frontend.get_entity
('machine_configurations', params[:id], credentials)
+    @machine_configuration = CIMI::Model::MachineConfiguration.from_xml
(machine_confs_xml)
+    haml :'machine_configurations/show'
+  end
+
+  get '/cimi/machine_configurations' do
+    machine_conf_xml = CIMI::Frontend.get_entity_collection
('machine_configurations', credentials)
+    @machine_configurations =
CIMI::Model::MachineConfigurationCollection.from_xml(machine_conf_xml)
+    haml :'machine_configurations/index'
+  end
+
+end
diff --git a/clients/cimi/lib/entities/machine_image.rb
b/clients/cimi/lib/entities/machine_image.rb
new file mode 100644
index 0000000..4565c7f
--- /dev/null
+++ b/clients/cimi/lib/entities/machine_image.rb
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See
the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Frontend::MachineImage < CIMI::Frontend::Entity
+
+  get '/cimi/machine_images/:id' do
+    machine_image_xml = CIMI::Frontend.get_entity('machine_images', params
[:id], credentials)
+    @machine_image= CIMI::Model::MachineImage.from_xml(machine_image_xml)
+    haml :'machine_images/show'
+  end
+
+  get '/cimi/machine_images' do
+    machine_image_xml = CIMI::Frontend.get_entity_collection
('machine_images', credentials)
+    @machine_images = CIMI::Model::MachineImageCollection.from_xml
(machine_image_xml)
+    haml :'machine_images/index'
+  end
+
+end
diff --git a/clients/cimi/lib/lazy_auth.rb b/clients/cimi/lib/lazy_auth.rb
new file mode 100644
index 0000000..528f95c
--- /dev/null
+++ b/clients/cimi/lib/lazy_auth.rb
@@ -0,0 +1,74 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See
the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+require 'sinatra/base'
+
+# Lazy Basic HTTP authentication. Authentication is only forced when the
+# credentials are actually needed.
+module Sinatra
+  module LazyAuth
+    class LazyCredentials
+      def initialize(app)
+        @app = app
+        @provided = false
+      end
+
+      def user
+        credentials!
+        @user
+      end
+
+      def password
+        credentials!
+        @password
+      end
+
+      def provided?
+        @provided
+      end
+
+      def credentials!
+        if ENV["API_USER"] && ENV["API_PASSWORD"]
+          @user = ENV["API_USER"]
+          @password = ENV["API_PASSWORD"]
+          @provided = true
+        end
+        unless provided?
+          auth = Rack::Auth::Basic::Request.new(@app.request.env)
+          unless auth.provided? && auth.basic? && auth.credentials
+            @app.authorize!
+          end
+          @user = auth.credentials[0]
+          @password = auth.credentials[1]
+          @provided = true
+        end
+      end
+
+    end
+
+    def authorize!
+      r = "cimi@localhost"
+      response['WWW-Authenticate'] = %(Basic realm="#{r}")
+      throw(:halt, [401, "Not authorized\n"])
+    end
+
+    # Request the current user's credentials. Actual credentials are only
+    # requested when an attempt is made to get the user name or password
+    def credentials
+      LazyCredentials.new(self)
+    end
+  end
+end
diff --git a/clients/cimi/public/app.css b/clients/cimi/public/app.css
new file mode 100644
index 0000000..15a6aa0
--- /dev/null
+++ b/clients/cimi/public/app.css
@@ -0,0 +1,57 @@
+/* Override some defaults */
+html, body {
+  background-color: #eee;
+}
+body {
+  padding-top: 40px; /* 40px to make the container go all the way to the
bottom of the topbar */
+}
+.container > footer p {
+  text-align: center; /* center align it with the container */
+}
+.container {
+  width: 820px; /* downsize our container to make the content feel a bit
tighter and more cohesive. NOTE: this removes two full columns from the
grid, meaning you only go to 14 columns and not 16. */
+}
+
+/* The white background content wrapper */
+.container > .content {
+  background-color: #fff;
+  padding: 20px;
+  margin: 0 -20px; /* negative indent the amount of the padding to
maintain the grid system */
+  -webkit-border-radius: 0 0 6px 6px;
+  -moz-border-radius: 0 0 6px 6px;
+  border-radius: 0 0 6px 6px;
+  -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
+  -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
+  box-shadow: 0 1px 2px rgba(0,0,0,.15);
+}
+
+/* Page header tweaks */
+.page-header {
+  background-color: #f5f5f5;
+  margin: -20px -20px 10px;
+}
+
+.page-header h1 {
+  padding : 10px 20px;
+}
+
+.page-header .breadcrumb {
+  margin : 5px -1px 0px -1px;
+}
+
+/* Styles you shouldn't keep as they are for displaying this base example
only */
+.content .span10,
+.content .span4 {
+  min-height: 500px;
+}
+/* Give a quick and non-cross-browser friendly divider */
+.content .span4 {
+  margin-left: 0;
+  padding-left: 19px;
+  border-left: 1px solid #eee;
+}
+
+.topbar .btn {
+  border: 0;
+}
+
diff --git a/clients/cimi/public/bootstrap/LICENSE
b/clients/cimi/public/bootstrap/LICENSE
new file mode 100644
index 0000000..2bb9ad2
--- /dev/null
+++ b/clients/cimi/public/bootstrap/LICENSE
@@ -0,0 +1,176 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
http://twitter.github.com/bootstrap/javascript.html#alerts
+ * ==========================================================
+ * Copyright 2011 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function( $ ){
+
+  "use strict"
+
+  /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
+   * ======================================================= */
+
+   var transitionEnd
+
+   $(document).ready(function () {
+
+     $.support.transition = (function () {
+       var thisBody = document.body || document.documentElement
+         , thisStyle = thisBody.style
+         , support = thisStyle.transition !== undefined ||
thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !==
undefined || thisStyle.MsTransition !== undefined ||
thisStyle.OTransition !== undefined
+       return support
+     })()
+
+     // set CSS transition event type
+     if ( $.support.transition ) {
+       transitionEnd = "TransitionEnd"
+       if ( $.browser.webkit ) {
+        transitionEnd = "webkitTransitionEnd"
+       } else if ( $.browser.mozilla ) {
+        transitionEnd = "transitionend"
+       } else if ( $.browser.opera ) {
+        transitionEnd = "oTransitionEnd"
+       }
+     }
+
+   })
+
+ /* ALERT CLASS DEFINITION
+  * ====================== */
+
+  var Alert = function ( content, options ) {
+    if (options == 'close') return this.close.call(content)
+    this.settings = $.extend({}, $.fn.alert.defaults, options)
+    this.$element = $(content)
+      .delegate(this.settings.selector, 'click', this.close)
+  }
+
+  Alert.prototype = {
+
+    close: function (e) {
+      var $element = $(this)
+        , className = 'alert-message'
+
+      $element = $element.hasClass(className) ? $element : $element.parent
()
+
+      e && e.preventDefault()
+      $element.removeClass('in')
+
+      function removeElement () {
+        $element.remove()
+      }
+
+      $.support.transition && $element.hasClass('fade') ?
+        $element.bind(transitionEnd, removeElement) :
+        removeElement()
+    }
+
+  }
+
+
+ /* ALERT PLUGIN DEFINITION
+  * ======================= */
+
+  $.fn.alert = function ( options ) {
+
+    if ( options === true ) {
+      return this.data('alert')
+    }
+
+    return this.each(function () {
+      var $this = $(this)
+        , data
+
+      if ( typeof options == 'string' ) {
+
+        data = $this.data('alert')
+
+        if (typeof data == 'object') {
+          return data[options].call( $this )
+        }
+
+      }
+
+      $(this).data('alert', new Alert( this, options ))
+
+    })
+  }
+
+  $.fn.alert.defaults = {
+    selector: '.close'
+  }
+
+  $(document).ready(function () {
+    new Alert($('body'), {
+      selector: '.alert-message[data-alert] .close'
+    })
+  })
+
+}( window.jQuery || window.ender );
\ No newline at end of file
diff --git a/clients/cimi/public/bootstrap/js/bootstrap-buttons.js
b/clients/cimi/public/bootstrap/js/bootstrap-buttons.js
new file mode 100644
index 0000000..ba52f1c
--- /dev/null
+++ b/clients/cimi/public/bootstrap/js/bootstrap-buttons.js
@@ -0,0 +1,64 @@
+/* ============================================================
+ * bootstrap-buttons.js v1.4.0
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
+ * ============================================================
+ * Copyright 2011 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+!function( $ ){
+
+  "use strict"
+
+  function setState(el, state) {
+    var d = 'disabled'
+      , $el = $(el)
+      , data = $el.data()
+
+    state = state + 'Text'
+    data.resetText || $el.data('resetText', $el.html())
+
+    $el.html( data[state] || $.fn.button.defaults[state] )
+
+    setTimeout(function () {
+      state == 'loadingText' ?
+        $el.addClass(d).attr(d, d) :
+        $el.removeClass(d).removeAttr(d)
+    }, 0)
+  }
+
+  function toggle(el) {
+    $(el).toggleClass('active')
+  }
+
+  $.fn.button = function(options) {
+    return this.each(function () {
+      if (options == 'toggle') {
+        return toggle(this)
+      }
+      options && setState(this, options)
+    })
+  }
+
+  $.fn.button.defaults = {
+    loadingText: 'loading...'
+  }
+
+  $(function () {
+    $('body').delegate('.btn[data-toggle]', 'click', function () {
+      $(this).button('toggle')
+    })
+  })
+
+}( window.jQuery || window.ender );
\ No newline at end of file
diff --git a/clients/cimi/public/bootstrap/js/bootstrap-dropdown.js
b/clients/cimi/public/bootstrap/js/bootstrap-dropdown.js
new file mode 100644
index 0000000..fda6da5
--- /dev/null
+++ b/clients/cimi/public/bootstrap/js/bootstrap-dropdown.js
@@ -0,0 +1,55 @@
+/* ============================================================
+ * bootstrap-dropdown.js v1.4.0
+ * http://twitter.github.com/bootstrap/javascript.html#dropdown
+ * ============================================================
+ * Copyright 2011 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function( $ ){
+
+  "use strict"
+
+  /* DROPDOWN PLUGIN DEFINITION
+   * ========================== */
+
+  $.fn.dropdown = function ( selector ) {
+    return this.each(function () {
+      $(this).delegate(selector || d, 'click', function (e) {
+        var li = $(this).parent('li')
+          , isActive = li.hasClass('open')
+
+        clearMenus()
+        !isActive && li.toggleClass('open')
+        return false
+      })
+    })
+  }
+
+  /* APPLY TO STANDARD DROPDOWN ELEMENTS
+   * =================================== */
+
+  var d = 'a.menu, .dropdown-toggle'
+
+  function clearMenus() {
+    $(d).parent('li').removeClass('open')
+  }
+
+  $(function () {
+    $('html').bind("click", clearMenus)
+    $('body').dropdown( '[data-dropdown] a.menu,
[data-dropdown] .dropdown-toggle' )
+  })
+
+}( window.jQuery || window.ender );
diff --git a/clients/cimi/public/bootstrap/js/bootstrap-modal.js
b/clients/cimi/public/bootstrap/js/bootstrap-modal.js
new file mode 100644
index 0000000..b328217
--- /dev/null
+++ b/clients/cimi/public/bootstrap/js/bootstrap-modal.js
@@ -0,0 +1,260 @@
+/* =========================================================
+ * bootstrap-modal.js v1.4.0
+ * http://twitter.github.com/bootstrap/javascript.html#modal
+ * =========================================================
+ * Copyright 2011 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================= */
+
+
+!function( $ ){
+
+  "use strict"
+
+ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
+  * ======================================================= */
+
+  var transitionEnd
+
+  $(document).ready(function () {
+
+    $.support.transition = (function () {
+      var thisBody = document.body || document.documentElement
+        , thisStyle = thisBody.style
+        , support = thisStyle.transition !== undefined ||
thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !==
undefined || thisStyle.MsTransition !== undefined ||
thisStyle.OTransition !== undefined
+      return support
+    })()
+
+    // set CSS transition event type
+    if ( $.support.transition ) {
+      transitionEnd = "TransitionEnd"
+      if ( $.browser.webkit ) {
+      		 transitionEnd = "webkitTransitionEnd"
+      } else if ( $.browser.mozilla ) {
+      		 transitionEnd = "transitionend"
+      } else if ( $.browser.opera ) {
+      		 transitionEnd = "oTransitionEnd"
+      }
+    }
+
+  })
+
+
+ /* MODAL PUBLIC CLASS DEFINITION
+  * ============================= */
+
+  var Modal = function ( content, options ) {
+    this.settings = $.extend({}, $.fn.modal.defaults, options)
+    this.$element = $(content)
+      .delegate('.close', 'click.modal', $.proxy(this.hide, this))
+
+    if ( this.settings.show ) {
+      this.show()
+    }
+
+    return this
+  }
+
+  Modal.prototype = {
+
+      toggle: function () {
+        return this[!this.isShown ? 'show' : 'hide']()
+      }
+
+    , show: function () {
+        var that = this
+        this.isShown = true
+        this.$element.trigger('show')
+
+        escape.call(this)
+        backdrop.call(this, function () {
+          var transition = $.support.transition && that.$element.hasClass
('fade')
+
+          that.$element
+            .appendTo(document.body)
+            .show()
+
+          if (transition) {
+            that.$element[0].offsetWidth // force reflow
+          }
+
+          that.$element.addClass('in')
+
+          transition ?
+            that.$element.one(transitionEnd, function ()
{ that.$element.trigger('shown') }) :
+            that.$element.trigger('shown')
+
+        })
+
+        return this
+      }
+
+    , hide: function (e) {
+        e && e.preventDefault()
+
+        if ( !this.isShown ) {
+          return this
+        }
+
+        var that = this
+        this.isShown = false
+
+        escape.call(this)
+
+        this.$element
+          .trigger('hide')
+          .removeClass('in')
+
+        $.support.transition && this.$element.hasClass('fade') ?
+          hideWithTransition.call(this) :
+          hideModal.call(this)
+
+        return this
+      }
+
+  }
+
+
+ /* MODAL PRIVATE METHODS
+  * ===================== */
+
+  function hideWithTransition() {
+    // firefox drops transitionEnd events :{o
+    var that = this
+      , timeout = setTimeout(function () {
+          that.$element.unbind(transitionEnd)
+          hideModal.call(that)
+        }, 500)
+
+    this.$element.one(transitionEnd, function () {
+      clearTimeout(timeout)
+      hideModal.call(that)
+    })
+  }
+
+  function hideModal (that) {
+    this.$element
+      .hide()
+      .trigger('hidden')
+
+    backdrop.call(this)
+  }
+
+  function backdrop ( callback ) {
+    var that = this
+      , animate = this.$element.hasClass('fade') ? 'fade' : ''
+    if ( this.isShown && this.settings.backdrop ) {
+      var doAnimate = $.support.transition && animate
+
+      this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
+        .appendTo(document.body)
+
+      if ( this.settings.backdrop != 'static' ) {
+        this.$backdrop.click($.proxy(this.hide, this))
+      }
+
+      if ( doAnimate ) {
+        this.$backdrop[0].offsetWidth // force reflow
+      }
+
+      this.$backdrop.addClass('in')
+
+      doAnimate ?
+        this.$backdrop.one(transitionEnd, callback) :
+        callback()
+
+    } else if ( !this.isShown && this.$backdrop ) {
+      this.$backdrop.removeClass('in')
+
+      $.support.transition && this.$element.hasClass('fade')?
+        this.$backdrop.one(transitionEnd, $.proxy(removeBackdrop, this)) :
+        removeBackdrop.call(this)
+
+    } else if ( callback ) {
+       callback()
+    }
+  }
+
+  function removeBackdrop() {
+    this.$backdrop.remove()
+    this.$backdrop = null
+  }
+
+  function escape() {
+    var that = this
+    if ( this.isShown && this.settings.keyboard ) {
+      $(document).bind('keyup.modal', function ( e ) {
+        if ( e.which == 27 ) {
+          that.hide()
+        }
+      })
+    } else if ( !this.isShown ) {
+      $(document).unbind('keyup.modal')
+    }
+  }
+
+
+ /* MODAL PLUGIN DEFINITION
+  * ======================= */
+
+  $.fn.modal = function ( options ) {
+    var modal = this.data('modal')
+
+    if (!modal) {
+
+      if (typeof options == 'string') {
+        options = {
+          show: /show|toggle/.test(options)
+        }
+      }
+
+      return this.each(function () {
+        $(this).data('modal', new Modal(this, options))
+      })
+    }
+
+    if ( options === true ) {
+      return modal
+    }
+
+    if ( typeof options == 'string' ) {
+      modal[options]()
+    } else if ( modal ) {
+      modal.toggle()
+    }
+
+    return this
+  }
+
+  $.fn.modal.Modal = Modal
+
+  $.fn.modal.defaults = {
+    backdrop: false
+  , keyboard: false
+  , show: false
+  }
+
+
+ /* MODAL DATA- IMPLEMENTATION
+  * ========================== */
+
+  $(document).ready(function () {
+    $('body').delegate('[data-controls-modal]', 'click', function (e) {
+      e.preventDefault()
+      var $this = $(this).data('show', true)
+      $('#' + $this.attr('data-controls-modal')).modal( $this.data() )
+    })
+  })
+
+}( window.jQuery || window.ender );
diff --git a/clients/cimi/public/bootstrap/js/bootstrap-popover.js
b/clients/cimi/public/bootstrap/js/bootstrap-popover.js
new file mode 100644
index 0000000..39fb575
--- /dev/null
+++ b/clients/cimi/public/bootstrap/js/bootstrap-popover.js
@@ -0,0 +1,90 @@
+/* ===========================================================
+ * bootstrap-popover.js v1.4.0
+ * http://twitter.github.com/bootstrap/javascript.html#popover
+ * ===========================================================
+ * Copyright 2011 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =========================================================== */
+
+
+!function( $ ) {
+
+ "use strict"
+
+  var Popover = function ( element, options ) {
+    this.$element = $(element)
+    this.options = options
+    this.enabled = true
+    this.fixTitle()
+  }
+
+  /* NOTE: POPOVER EXTENDS BOOTSTRAP-TWIPSY.js
+     ========================================= */
+
+  Popover.prototype = $.extend({}, $.fn.twipsy.Twipsy.prototype, {
+
+    setContent: function () {
+      var $tip = this.tip()
+      $tip.find('.title')[this.options.html ? 'html' :
'text'](this.getTitle())
+      $tip.find('.content > *')[this.options.html ? 'html' :
'text'](this.getContent())
+      $tip[0].className = 'popover'
+    }
+
+  , hasContent: function () {
+      return this.getTitle() || this.getContent()
+    }
+
+  , getContent: function () {
+      var content
+       , $e = this.$element
+       , o = this.options
+
+      if (typeof this.options.content == 'string') {
+        content = $e.attr(this.options.content)
+      } else if (typeof this.options.content == 'function') {
+        content = this.options.content.call(this.$element[0])
+      }
+
+      return content
+    }
+
+  , tip: function() {
+      if (!this.$tip) {
+        this.$tip = $('<div class="popover" />')
+          .html(this.options.template)
+      }
+      return this.$tip
+    }
+
+  })
+
+
+ /* POPOVER PLUGIN DEFINITION
+  * ======================= */
+
+  $.fn.popover = function (options) {
+    if (typeof options == 'object') options = $.extend({},
$.fn.popover.defaults, options)
+    $.fn.twipsy.initWith.call(this, options, Popover, 'popover')
+    return this
+  }
+
+  $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
+    placement: 'right'
+  , content: 'data-content'
+  , template: '<div class="arrow"></div><div class="inner"><h3
class="title"></h3><div class="content"><p></p></div></div>'
+  })
+
+  $.fn.twipsy.rejectAttrOptions.push( 'content' )
+
+}( window.jQuery || window.ender );
diff --git a/clients/cimi/public/bootstrap/js/bootstrap-scrollspy.js
b/clients/cimi/public/bootstrap/js/bootstrap-scrollspy.js
new file mode 100644
index 0000000..efbc432
--- /dev/null
+++ b/clients/cimi/public/bootstrap/js/bootstrap-scrollspy.js
@@ -0,0 +1,107 @@
+/* =============================================================
+ * bootstrap-scrollspy.js v1.4.0
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
+ * =============================================================
+ * Copyright 2011 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================== */
+
+
+!function ( $ ) {
+
+  "use strict"
+
+  var $window = $(window)
+
+  function ScrollSpy( topbar, selector ) {
+    var processScroll = $.proxy(this.processScroll, this)
+    this.$topbar = $(topbar)
+    this.selector = selector || 'li > a'
+    this.refresh()
+    this.$topbar.delegate(this.selector, 'click', processScroll)
+    $window.scroll(processScroll)
+    this.processScroll()
+  }
+
+  ScrollSpy.prototype = {
+
+      refresh: function () {
+        this.targets = this.$topbar.find(this.selector).map(function () {
+          var href = $(this).attr('href')
+          return /^#\w/.test(href) && $(href).length ? href : null
+        })
+
+        this.offsets = $.map(this.targets, function (id) {
+          return $(id).offset().top
+        })
+      }
+
+    , processScroll: function () {
+        var scrollTop = $window.scrollTop() + 10
+          , offsets = this.offsets
+          , targets = this.targets
+          , activeTarget = this.activeTarget
+          , i
+
+        for (i = offsets.length; i--;) {
+          activeTarget != targets[i]
+            && scrollTop >= offsets[i]
+            && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
+            && this.activateButton( targets[i] )
+        }
+      }
+
+    , activateButton: function (target) {
+        this.activeTarget = target
+
+        this.$topbar
+          .find(this.selector).parent('.active')
+          .removeClass('active')
+
+        this.$topbar
+          .find(this.selector + '[href="' + target + '"]')
+          .parent('li')
+          .addClass('active')
+      }
+
+  }
+
+  /* SCROLLSPY PLUGIN DEFINITION
+   * =========================== */
+
+  $.fn.scrollSpy = function( options ) {
+    var scrollspy = this.data('scrollspy')
+
+    if (!scrollspy) {
+      return this.each(function () {
+        $(this).data('scrollspy', new ScrollSpy( this, options ))
+      })
+    }
+
+    if ( options === true ) {
+      return scrollspy
+    }
+
+    if ( typeof options == 'string' ) {
+      scrollspy[options]()
+    }
+
+    return this
+  }
+
+  $(document).ready(function () {
+    $('body').scrollSpy('[data-scrollspy] li > a')
+  })
+
+}( window.jQuery || window.ender );
\ No newline at end of file
diff --git a/clients/cimi/public/bootstrap/js/bootstrap-tabs.js
b/clients/cimi/public/bootstrap/js/bootstrap-tabs.js
new file mode 100644
index 0000000..a3c7ee1
--- /dev/null
+++ b/clients/cimi/public/bootstrap/js/bootstrap-tabs.js
@@ -0,0 +1,80 @@
+/* ========================================================
+ * bootstrap-tabs.js v1.4.0
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
+ * ========================================================
+ * Copyright 2011 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ======================================================== */
+
+
+!function( $ ){
+
+  "use strict"
+
+  function activate ( element, container ) {
+    container
+      .find('> .active')
+      .removeClass('active')
+      .find('> .dropdown-menu > .active')
+      .removeClass('active')
+
+    element.addClass('active')
+
+    if ( element.parent('.dropdown-menu') ) {
+      element.closest('li.dropdown').addClass('active')
+    }
+  }
+
+  function tab( e ) {
+    var $this = $(this)
+      , $ul = $this.closest('ul:not(.dropdown-menu)')
+      , href = $this.attr('href')
+      , previous
+      , $href
+
+    if ( /^#\w+/.test(href) ) {
+      e.preventDefault()
+
+      if ( $this.parent('li').hasClass('active') ) {
+        return
+      }
+
+      previous = $ul.find('.active a').last()[0]
+      $href = $(href)
+
+      activate($this.parent('li'), $ul)
+      activate($href, $href.parent())
+
+      $this.trigger({
+        type: 'change'
+      , relatedTarget: previous
+      })
+    }
+  }
+
+
+ /* TABS/PILLS PLUGIN DEFINITION
+  * ============================ */
+
+  $.fn.tabs = $.fn.pills = function ( selector ) {
+    return this.each(function () {
+      $(this).delegate(selector || '.tabs li > a, .pills > li > a',
'click', tab)
+    })
+  }
+
+  $(document).ready(function () {
+    $('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
+  })
+
+}( window.jQuery || window.ender );
diff --git a/clients/cimi/public/bootstrap/js/bootstrap-twipsy.js
b/clients/cimi/public/bootstrap/js/bootstrap-twipsy.js
new file mode 100644
index 0000000..5ebbddd
--- /dev/null
+++ b/clients/cimi/public/bootstrap/js/bootstrap-twipsy.js
@@ -0,0 +1,321 @@
+/* ==========================================================
+ * bootstrap-twipsy.js v1.4.0
+ * http://twitter.github.com/bootstrap/javascript.html#twipsy
+ * Adapted from the original jQuery.tipsy by Jason Frame
+ * ==========================================================
+ * Copyright 2011 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function( $ ) {
+
+  "use strict"
+
+ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
+  * ======================================================= */
+
+  var transitionEnd
+
+  $(document).ready(function () {
+
+    $.support.transition = (function () {
+      var thisBody = document.body || document.documentElement
+        , thisStyle = thisBody.style
+        , support = thisStyle.transition !== undefined ||
thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !==
undefined || thisStyle.MsTransition !== undefined ||
thisStyle.OTransition !== undefined
+      return support
+    })()
+
+    // set CSS transition event type
+    if ( $.support.transition ) {
+      transitionEnd = "TransitionEnd"
+      if ( $.browser.webkit ) {
+      		 transitionEnd = "webkitTransitionEnd"
+      } else if ( $.browser.mozilla ) {
+      		 transitionEnd = "transitionend"
+      } else if ( $.browser.opera ) {
+      		 transitionEnd = "oTransitionEnd"
+      }
+    }
+
+  })
+
+
+ /* TWIPSY PUBLIC CLASS DEFINITION
+  * ============================== */
+
+  var Twipsy = function ( element, options ) {
+    this.$element = $(element)
+    this.options = options
+    this.enabled = true
+    this.fixTitle()
+  }
+
+  Twipsy.prototype = {
+
+    show: function() {
+      var pos
+        , actualWidth
+        , actualHeight
+        , placement
+        , $tip
+        , tp
+
+      if (this.hasContent() && this.enabled) {
+        $tip = this.tip()
+        this.setContent()
+
+        if (this.options.animate) {
+          $tip.addClass('fade')
+        }
+
+        $tip
+          .remove()
+          .css({ top: 0, left: 0, display: 'block' })
+          .prependTo(document.body)
+
+        pos = $.extend({}, this.$element.offset(), {
+          width: this.$element[0].offsetWidth
+        , height: this.$element[0].offsetHeight
+        })
+
+        actualWidth = $tip[0].offsetWidth
+        actualHeight = $tip[0].offsetHeight
+
+        placement = maybeCall(this.options.placement, this, [ $tip[0],
this.$element[0] ])
+
+        switch (placement) {
+          case 'below':
+            tp = {top: pos.top + pos.height + this.options.offset, left:
pos.left + pos.width / 2 - actualWidth / 2}
+            break
+          case 'above':
+            tp = {top: pos.top - actualHeight - this.options.offset, left:
pos.left + pos.width / 2 - actualWidth / 2}
+            break
+          case 'left':
+            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left:
pos.left - actualWidth - this.options.offset}
+            break
+          case 'right':
+            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left:
pos.left + pos.width + this.options.offset}
+            break
+        }
+
+        $tip
+          .css(tp)
+          .addClass(placement)
+          .addClass('in')
+      }
+    }
+
+  , setContent: function () {
+      var $tip = this.tip()
+      $tip.find('.twipsy-inner')[this.options.html ? 'html' :
'text'](this.getTitle())
+      $tip[0].className = 'twipsy'
+    }
+
+  , hide: function() {
+      var that = this
+        , $tip = this.tip()
+
+      $tip.removeClass('in')
+
+      function removeElement () {
+        $tip.remove()
+      }
+
+      $.support.transition && this.$tip.hasClass('fade') ?
+        $tip.bind(transitionEnd, removeElement) :
+        removeElement()
+    }
+
+  , fixTitle: function() {
+      var $e = this.$element
+      if ($e.attr('title') || typeof($e.attr('data-original-title')) !=
'string') {
+        $e.attr('data-original-title', $e.attr('title') || '').removeAttr
('title')
+      }
+    }
+
+  , hasContent: function () {
+      return this.getTitle()
+    }
+
+  , getTitle: function() {
+      var title
+        , $e = this.$element
+        , o = this.options
+
+        this.fixTitle()
+
+        if (typeof o.title == 'string') {
+          title = $e.attr(o.title == 'title' ? 'data-original-title' :
o.title)
+        } else if (typeof o.title == 'function') {
+          title = o.title.call($e[0])
+        }
+
+        title = ('' + title).replace(/(^\s*|\s*$)/, "")
+
+        return title || o.fallback
+    }
+
+  , tip: function() {
+      return this.$tip = this.$tip || $('<div class="twipsy" />').html
(this.options.template)
+    }
+
+  , validate: function() {
+      if (!this.$element[0].parentNode) {
+        this.hide()
+        this.$element = null
+        this.options = null
+      }
+    }
+
+  , enable: function() {
+      this.enabled = true
+    }
+
+  , disable: function() {
+      this.enabled = false
+    }
+
+  , toggleEnabled: function() {
+      this.enabled = !this.enabled
+    }
+
+  , toggle: function () {
+      this[this.tip().hasClass('in') ? 'hide' : 'show']()
+    }
+
+  }
+
+
+ /* TWIPSY PRIVATE METHODS
+  * ====================== */
+
+   function maybeCall ( thing, ctx, args ) {
+     return typeof thing == 'function' ? thing.apply(ctx, args) : thing
+   }
+
+ /* TWIPSY PLUGIN DEFINITION
+  * ======================== */
+
+  $.fn.twipsy = function (options) {
+    $.fn.twipsy.initWith.call(this, options, Twipsy, 'twipsy')
+    return this
+  }
+
+  $.fn.twipsy.initWith = function (options, Constructor, name) {
+    var twipsy
+      , binder
+      , eventIn
+      , eventOut
+
+    if (options === true) {
+      return this.data(name)
+    } else if (typeof options == 'string') {
+      twipsy = this.data(name)
+      if (twipsy) {
+        twipsy[options]()
+      }
+      return this
+    }
+
+    options = $.extend({}, $.fn[name].defaults, options)
+
+    function get(ele) {
+      var twipsy = $.data(ele, name)
+
+      if (!twipsy) {
+        twipsy = new Constructor(ele, $.fn.twipsy.elementOptions(ele,
options))
+        $.data(ele, name, twipsy)
+      }
+
+      return twipsy
+    }
+
+    function enter() {
+      var twipsy = get(this)
+      twipsy.hoverState = 'in'
+
+      if (options.delayIn == 0) {
+        twipsy.show()
+      } else {
+        twipsy.fixTitle()
+        setTimeout(function() {
+          if (twipsy.hoverState == 'in') {
+            twipsy.show()
+          }
+        }, options.delayIn)
+      }
+    }
+
+    function leave() {
+      var twipsy = get(this)
+      twipsy.hoverState = 'out'
+      if (options.delayOut == 0) {
+        twipsy.hide()
+      } else {
+        setTimeout(function() {
+          if (twipsy.hoverState == 'out') {
+            twipsy.hide()
+          }
+        }, options.delayOut)
+      }
+    }
+
+    if (!options.live) {
+      this.each(function() {
+        get(this)
+      })
+    }
+
+    if (options.trigger != 'manual') {
+      binder   = options.live ? 'live' : 'bind'
+      eventIn  = options.trigger == 'hover' ? 'mouseenter' : 'focus'
+      eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'
+      this[binder](eventIn, enter)[binder](eventOut, leave)
+    }
+
+    return this
+  }
+
+  $.fn.twipsy.Twipsy = Twipsy
+
+  $.fn.twipsy.defaults = {
+    animate: true
+  , delayIn: 0
+  , delayOut: 0
+  , fallback: ''
+  , placement: 'above'
+  , html: false
+  , live: false
+  , offset: 0
+  , title: 'title'
+  , trigger: 'hover'
+  , template: '<div class="twipsy-arrow"></div><div
class="twipsy-inner"></div>'
+  }
+
+  $.fn.twipsy.rejectAttrOptions = [ 'title' ]
+
+  $.fn.twipsy.elementOptions = function(ele, options) {
+    var data = $(ele).data()
+      , rejects = $.fn.twipsy.rejectAttrOptions
+      , i = rejects.length
+
+    while (i--) {
+      delete data[rejects[i]]
+    }
+
+    return $.extend({}, options, data)
+  }
+
+}( window.jQuery || window.ender );
\ No newline at end of file
diff --git a/clients/cimi/public/html5.js b/clients/cimi/public/html5.js
new file mode 100644
index 0000000..cbb52a0
--- /dev/null
+++ b/clients/cimi/public/html5.js
@@ -0,0 +1,4 @@
+// iepp v2.1pre @jon_neal & @aFarkas github.com/aFarkas/iepp
+// html5shiv @rem remysharp.com/html5-enabling-script
+// Dual licensed under the MIT or GPL Version 2 licenses
+/*@cc_on(function(a,b){function r(a){var b=-1;while(++b<f)a.createElement
(e[b])}if(!window.attachEvent||!b.createStyleSheet||!function(){var
a=document.createElement("div");return
a.innerHTML="<elem></elem>",a.childNodes.length!==1}())return;a.iepp=a.iepp||
{};var c=a.iepp,d=c.html5elements||"abbr|article|aside|audio|bdi|canvas|
data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|
nav|output|progress|section|subline|summary|time|video",e=d.split
("|"),f=e.length,g=new RegExp("(^|\\s)("+d+")","gi"),h=new RegExp("<
(/*)("+d+")","gi"),i=/^\s*[\{\}]\s*$/,j=new RegExp("(^|[^\\n]*?\\s)("+d
+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),k=b.createDocumentFragment
(),l=b.documentElement,m=b.getElementsByTagName
("script")[0].parentNode,n=b.createElement("body"),o=b.createElement
("style"),p=/print|all/,q;c.getCSS=function(a,b){try{if(a
+""===undefined)return""}catch(d){return""}var e=-1,f=a.length,g,h=[];while
(++e<f){g=a[e];if(g.disabled)continue;b=g.media||b,p.test(b)&&h.push(c.ge!
 tCSS(g.imports,b),g.cssText),b="all"}return h.join
("")},c.parseCSS=function(a){var b=[],c;while((c=j.exec(a))!=null)b.push
(((i.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(g,"$1.iepp-$2")+c[4]);return
b.join("\n")},c.writeHTML=function(){var a=-1;q=q||b.body;while(++a<f){var
c=b.getElementsByTagName(e[a]),d=c.length,g=-1;while(++g<d)c
[g].className.indexOf("iepp-")<0&&(c[g].className+=" iepp-"+e
[a])}k.appendChild(q),l.appendChild
(n),n.className=q.className,n.id=q.id,n.innerHTML=q.innerHTML.replace(h,"<
$1font")},c._beforePrint=function(){if
(c.disablePP)return;o.styleSheet.cssText=c.parseCSS(c.getCSS
(b.styleSheets,"all")),c.writeHTML()},c.restoreHTML=function(){if
(c.disablePP)return;n.swapNode(q)},c._afterPrint=function(){c.restoreHTML
(),o.styleSheet.cssText=""},r(b),r(k);if(c.disablePP)return;m.insertBefore
(o,m.firstChild),o.media="print",o.className="iepp-printshim",a.attachEvent
("onbeforeprint",c._beforePrint),a.attachEvent
("onafterprint",c._afterPrint)})(this,document)@*/
\ No newline at end of file
diff --git a/clients/cimi/views/cloud_entry_point/index.haml
b/clients/cimi/views/cloud_entry_point/index.haml
new file mode 100644
index 0000000..0867d31
--- /dev/null
+++ b/clients/cimi/views/cloud_entry_point/index.haml
@@ -0,0 +1,20 @@
+- @title=@entry_point.description
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li.active
+      CloudEntryPoint
+
+%blockquote
+  %p
+    The Cloud Entry Point represents the entry point into the cloud
defined by
+    the CIMI Model. The Cloud Entry Point implements a catalog of entities
such
+    as Systems, System Templates, Machines, Machine Templates, etc. that
can be
+    queried and browsed by the Consumer
+
+%ul
+  - @entities.each do |entity|
+    %li
+      - if @entry_point.respond_to? entity
+        %a{ :href => "/cimi/#{entity}"}=@entry_point.send
(entity.intern).class.name.split('_').last
+
diff --git a/clients/cimi/views/layout.haml
b/clients/cimi/views/layout.haml
new file mode 100644
index 0000000..cf53ef4
--- /dev/null
+++ b/clients/cimi/views/layout.haml
@@ -0,0 +1,31 @@
+!!! 5
+%html{ :lang => :en }
+  %head
+    %meta{ :charset => 'utf-8' }
+    %title CIMI Client
+    /[if lt IE 9]
+      %script{ :src => '/html5.js' }
+    %link{ :href => '/bootstrap/bootstrap.min.css', :rel => :stylesheet }
+    %link{ :href => '/app.css', :rel => :stylesheet }
+    %body
+      .topbar
+        .fill
+          .container
+            %a.brand{ :href => '/' } CIMI frontend
+      .container
+        .content
+          .page-header
+            %h1=@title || 'no-title-fix-me'
+            = yield_content :breadcrumb
+          .row
+            .span10
+              =yield
+            .span4
+              %h3 Actions
+              =yield_content :actions
+              %span.label.warning
+                TODO: Implement me!
+        %footer
+          %p
+            &copy; 2009-2011 The Apache Software Foundation and individual
contributors.
+
diff --git a/clients/cimi/views/machine_configurations/index.haml
b/clients/cimi/views/machine_configurations/index.haml
new file mode 100644
index 0000000..6b3452e
--- /dev/null
+++ b/clients/cimi/views/machine_configurations/index.haml
@@ -0,0 +1,21 @@
+- @title=@machine_configurations.description
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li.active
+      MachineConfigurationCollection
+
+
+%blockquote
+  %p
+    A Machine Configuration Collection entity represents the collection of
+    Machine Configuration entities within a Provider. This entity can be
used to
+    locate and create Machine Configurations.
+
+%ul
+  - @machine_configurations.machine_configurations.each do |conf|
+    %li
+      %a{ :href => "/cimi/machine_configurations/#{conf.href.split
('/').last}"}=conf.href.split('/').last
diff --git a/clients/cimi/views/machine_configurations/show.haml
b/clients/cimi/views/machine_configurations/show.haml
new file mode 100644
index 0000000..06663cf
--- /dev/null
+++ b/clients/cimi/views/machine_configurations/show.haml
@@ -0,0 +1,33 @@
+- @title="#{@machine_configuration.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/machine_configurations"}
MachineConfigurationCollection
+      %span.divider="/"
+    %li.active
+      = @machine_configuration.name
+
+%blockquote
+  %p
+    The Machine Configuration entity represents the set of configuration
values
+    that define the (virtual) hardware resources of a to-be-realized
Machine
+    Instance. Machine Configurations are created by Providers and MAY, at
the
+    Providers discretion, be created by Consumers.
+
+%dl
+  %dt URI
+  %dd
+    %a{ :href => @machine_configuration.uri }=@machine_configuration.uri
+  %dt Description
+  %dd=@machine_configuration.description
+  %dt CPU
+  %dd=@machine_configuration.cpu
+  %dt Memory
+  %dd=[@machine_configuration.memory[:quantity],
@machine_configuration.memory[:units]].join('&nbsp;')
+  %dt Disks
+  - @machine_configuration.disks.each do |disk|
+    %dd=[disk.capacity.quantity, disk.capacity.units].join('&nbsp;')
diff --git a/clients/cimi/views/machine_images/index.haml
b/clients/cimi/views/machine_images/index.haml
new file mode 100644
index 0000000..6bfb7fa
--- /dev/null
+++ b/clients/cimi/views/machine_images/index.haml
@@ -0,0 +1,21 @@
+- @title=@machine_images.description
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li.active
+      MachineImageCollection
+
+
+%blockquote
+  %p
+    A Machine Image Collection entity represents the collection of Machine
Image
+    entities within a Provider. This entity can be used to locate and
create
+    Machine Images.
+
+%ul
+  - @machine_images.machine_images.each do |image|
+    %li
+      %a{ :href => "/cimi/machine_images/#{image.href.split
('/').last}"}=image.href.split('/').last
diff --git a/clients/cimi/views/machine_images/show.haml
b/clients/cimi/views/machine_images/show.haml
new file mode 100644
index 0000000..3a6a75d
--- /dev/null
+++ b/clients/cimi/views/machine_images/show.haml
@@ -0,0 +1,31 @@
+- @title="#{@machine_image.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/machine_images"} MachineImageCollection
+      %span.divider="/"
+    %li.active
+      = @machine_image.name
+
+%blockquote
+  %p
+    This entity represents the information (e.g. an Open Virtualization
Format
+    (OVF) package) necessary for hardware virtualized resources to create
a
+    Machine Instance
+
+%dl
+  %dt URI
+  %dd
+    %a{ :href => @machine_image.uri }=@machine_image.uri
+  %dt Description
+  %dd=@machine_image.description
+  %dt Created
+  %dd=@machine_image.created
+  %dt Image Location
+  %dd=@machine_image.image_location.href
+  %dt Image Data
+  %dd=@machine_image.image_data
--
1.7.4.4




Mime
View raw message