You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2011/10/17 19:04:48 UTC
svn commit: r1185284 [3/3] - in /incubator/deltacloud/trunk: ./ server/
server/bin/ server/lib/cimi/ server/lib/cimi/data/
server/lib/cimi/data/collections/ server/lib/cimi/data/default_res/
server/lib/cimi/helpers/ server/lib/deltacloud/ server/lib/de...
Added: incubator/deltacloud/trunk/server/views/cimi/errors/404.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/errors/404.html.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/errors/404.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/errors/404.html.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,29 @@
+%div{ :'data-role' => :content, :'data-theme' => 'b'}
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ %li{ :'data-role' => 'list-divider'} Server message
+ %li
+ %h3 Not Found
+ %li{ :'data-role' => 'list-divider'} Original request URI
+ %li
+ %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
+ %span=request.env['REQUEST_URI']
+ %span{ :class => 'ui-li-count'} Retry
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Parameters
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ - if params.keys.empty?
+ %li{ :'data-role' => 'list-divider'} No parameters
+ - params.each do |key, value|
+ %li{ :'data-role' => 'list-divider'}=key
+ %li
+ %span{:style => 'font-weight:normal;'}=value.inspect
+
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Request details
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ - request.env.each do |key, value|
+ %li{ :'data-role' => 'list-divider'}=key
+ %li
+ %span{:style => 'font-weight:normal;'}=value.inspect
Added: incubator/deltacloud/trunk/server/views/cimi/errors/404.xml.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/errors/404.xml.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/errors/404.xml.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/errors/404.xml.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,2 @@
+%error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
+ %message Resource not found
Added: incubator/deltacloud/trunk/server/views/cimi/errors/405.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/errors/405.html.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/errors/405.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/errors/405.html.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,29 @@
+%div{ :'data-role' => :content, :'data-theme' => 'b'}
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ %li{ :'data-role' => 'list-divider'} Server message
+ %li
+ %h3 Method not allowed on given resource
+ %li{ :'data-role' => 'list-divider'} Original request URI
+ %li
+ %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
+ %span=request.env['REQUEST_URI']
+ %span{ :class => 'ui-li-count'} Retry
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Parameters
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ - if params.keys.empty?
+ %li{ :'data-role' => 'list-divider'} No parameters
+ - params.each do |key, value|
+ %li{ :'data-role' => 'list-divider'}=key
+ %li
+ %span{:style => 'font-weight:normal;'}=value.inspect
+
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Request details
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ - request.env.each do |key, value|
+ %li{ :'data-role' => 'list-divider'}=key
+ %li
+ %span{:style => 'font-weight:normal;'}=value.inspect
Added: incubator/deltacloud/trunk/server/views/cimi/errors/405.xml.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/errors/405.xml.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/errors/405.xml.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/errors/405.xml.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,5 @@
+%error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
+ %message
+ Requested method not allowed
+ %method
+ =request.env['REQUEST_METHOD']
Added: incubator/deltacloud/trunk/server/views/cimi/errors/500.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/errors/500.html.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/errors/500.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/errors/500.html.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,43 @@
+%div{ :'data-role' => :content, :'data-theme' => 'b'}
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ %li{ :'data-role' => 'list-divider'} Server message
+ %li
+ %h3=[@error.class.name, @error.message].join(' - ')
+ %li{ :'data-role' => 'list-divider'} Original request URI
+ %li
+ %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
+ %span=request.env['REQUEST_URI']
+ %span{ :class => 'ui-li-count'} Retry
+ %li{ :'data-role' => 'list-divider'} Error details
+ %li
+ - if @error.class.method_defined? :details
+ %p= @error.details
+ - else
+ %em No details
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Backtrace
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ %li
+ %pre=@error.backtrace.join("\n")
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Parameters
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ - if params.keys.empty?
+ %li{ :'data-role' => 'list-divider'} No parameters
+ - params.each do |key, value|
+ - next if value.inspect.to_s == '#'
+ %li{ :'data-role' => 'list-divider'}=key
+ %li
+ %span{:style => 'font-weight:normal;'}=value.inspect
+
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Request details
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ - request.env.each do |key, value|
+ - next if value.inspect.to_s == '#'
+ %li{ :'data-role' => 'list-divider'}=key
+ %li
+ %span{:style => 'font-weight:normal;'}=value.inspect
Added: incubator/deltacloud/trunk/server/views/cimi/errors/500.xml.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/errors/500.xml.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/errors/500.xml.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/errors/500.xml.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,5 @@
+%error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
+ %kind backend_error
+ %backend{ :driver => driver_symbol }
+ %code=response.status
+ %message< #{cdata @error.message}
Added: incubator/deltacloud/trunk/server/views/cimi/errors/502.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/errors/502.html.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/errors/502.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/errors/502.html.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,43 @@
+%div{ :'data-role' => :content, :'data-theme' => 'b'}
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ %li{ :'data-role' => 'list-divider'} Server message
+ %li
+ %h3=[@error.class.name, @error.message].join(' - ')
+ %li{ :'data-role' => 'list-divider'} Original request URI
+ %li
+ %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
+ %span=request.env['REQUEST_URI']
+ %span{ :class => 'ui-li-count'} Retry
+ %li{ :'data-role' => 'list-divider'} Error details
+ %li
+ - if @error.class.method_defined? :details
+ %p= @error.details
+ - else
+ %em No details
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Backtrace
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ %li
+ %pre=@error.backtrace.join("\n")
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Parameters
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ - if params.keys.empty?
+ %li{ :'data-role' => 'list-divider'} No parameters
+ - params.each do |key, value|
+ - next if value.inspect.to_s == '#'
+ %li{ :'data-role' => 'list-divider'}=key
+ %li
+ %span{:style => 'font-weight:normal;'}=value.inspect
+
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Request details
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ - request.env.each do |key, value|
+ - next if value.inspect.to_s == '#'
+ %li{ :'data-role' => 'list-divider'}=key
+ %li
+ %span{:style => 'font-weight:normal;'}=value.inspect
Added: incubator/deltacloud/trunk/server/views/cimi/errors/502.xml.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/errors/502.xml.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/errors/502.xml.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/errors/502.xml.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,7 @@
+%error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
+ %kind backend_error
+ %backend{ :driver => driver_symbol }
+ %code= @error.code
+ - if @error.respond_to?(:details) && @error.details
+ %details< #{cdata @error.details.join("\n")}
+ %message< #{cdata @error.message}
Added: incubator/deltacloud/trunk/server/views/cimi/errors/backend_capability_failure.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/errors/backend_capability_failure.html.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/errors/backend_capability_failure.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/errors/backend_capability_failure.html.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,29 @@
+%div{ :'data-role' => :content, :'data-theme' => 'b'}
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ %li{ :'data-role' => 'list-divider'} Server message
+ %li
+ %h3 Backend capability failure
+ %li{ :'data-role' => 'list-divider'} Original request URI
+ %li
+ %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
+ %span=request.env['REQUEST_URI']
+ %span{ :class => 'ui-li-count'} Retry
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Parameters
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ - if params.keys.empty?
+ %li{ :'data-role' => 'list-divider'} No parameters
+ - params.each do |key, value|
+ %li{ :'data-role' => 'list-divider'}=key
+ %li
+ %span{:style => 'font-weight:normal;'}=value.inspect
+
+
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
+ %h3 Request details
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
+ - request.env.each do |key, value|
+ %li{ :'data-role' => 'list-divider'}=key
+ %li
+ %span{:style => 'font-weight:normal;'}=value.inspect
Added: incubator/deltacloud/trunk/server/views/cimi/layout.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/layout.html.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/layout.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/layout.html.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,32 @@
+!!!
+!!! XML
+
+%html
+ %head
+ = stylesheet_link_tag '/stylesheets/compiled/screen.css', :media => 'screen, projection'
+ = stylesheet_link_tag '/stylesheets/compiled/print.css', :media => 'print'
+ /[if lt IE 8]
+ = stylesheet_link_tag '/stylesheets/compiled/ie.css', :media => 'screen, projection'
+ = stylesheet_link_tag '/stylesheets/compiled/application.css', :media => 'screen, projection'
+ %script{:type => "text/javascript", :src => "/javascripts/jquery-1.4.2.min.js" }
+ %script{:type => "text/javascript", :src => "/javascripts/application.js" }
+ %script{:type => "text/javascript", :src => "/javascripts/cmwgapp.js" }
+ %body
+ #wrapper
+ #header
+ = link_to image_tag( "/images/logo-wide.png" ), settings.root_url
+ = bread_crumb_ext
+ #content
+ = yield
+ #footer
+ #formats
+ Format:
+ =link_to_format(:xml)
+ |
+ =link_to_format(:json)
+ #driver_info
+ Driver: #{driver_symbol} | API version: #{settings.version}
+ #copyright
+ Copyright 2009-2011
+ %a{:href => 'http://incubator.apache.org/deltacloud/'} The Apache Software Foundation
+ and individual contributors.
\ No newline at end of file
Added: incubator/deltacloud/trunk/server/views/cimi/machine_configurations/show.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/machine_configurations/show.html.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/machine_configurations/show.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/machine_configurations/show.html.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,159 @@
+%h1 View/Edit machine configuration
+
+%form{ :action => machine_configurations_url }
+ %input{ :name => :id, :type => :hidden, :value => @dmtfitem["uri"] }/
+ %input{ :name => :xmlRootNode, :type => :hidden, :value => @xml_root_node }/
+ %input{ :name => :refreshURI, :type => :hidden, :value => machine_configurations_url }/
+ %p
+ %label
+ Name:
+ %p
+ %input{ :name => :name, :size => 50, :value => @dmtfitem["name"], :style => "width:50%;" }
+ %input{ :name => :created, :type => :hidden, :size => 50, :value => @dmtfitem["created"] }
+ %p
+ %br
+ %label
+ Description:
+ %p
+ %textarea{ :name => :description, :cols => 50, :rows => 4, :style => "width:50%;" } #{@dmtfitem['description']}
+ %p
+ %br
+ %label
+ Properties:
+ %p
+ %table{ :style => "width:50%;", :id => "propertyTable"}
+ - if @dmtfitem["property"]
+ - if @dmtfitem["property"]["name"] && @dmtfitem["property"]["content"]
+ - property_object = {"#{@dmtfitem['property']['name']}" => {"content" => @dmtfitem["property"]["content"]}}
+ - else
+ - property_object = @dmtfitem["property"]
+
+ - iter = -1
+ - property_object.each_pair do |key, value|
+ - iter += 1
+ %tr
+ %td
+ %input{ :name => "param_name_" + iter.to_s, :size => 30, :value => key }
+ %td
+ %input{ :name => "param_value_" + iter.to_s, :size => 30, :value => value["content"] }
+ %td
+ %input{ :type => :button, :value => "Remove", :onClick => "return removeProperty(this)" }
+ %input{ :type => :button, :name => "commit", :value => "Add new property", :onClick => "return AddNewPproperty('propertyTable')" }
+ %p
+ %br
+ %label
+ Cpu:
+ %p
+ %input{ :name => :cpu, :size => 50, :value => @dmtfitem["cpu"], :style => "width:50%;" }
+ %br
+ %label
+ Memory:
+ %p
+ %input{ :name => :memory_quantity, :size => 20, :value => @dmtfitem["memory"]["quantity"], :style => "width:10%;" }
+ %input{ :name => :memory_units, :size => 20, :value => @dmtfitem["memory"]["units"], :style => "width:10%;" }
+ %br
+ %label
+ Disk:
+ %p
+ %table{ :style => "width:50%;", :id => "diskTable"}
+ - if @dmtfitem["disk"]
+ - if @dmtfitem["disk"].kind_of?(Array)
+ - property_object = @dmtfitem["disk"]
+ - else
+ - property_object = [@dmtfitem["disk"]]
+
+ - iter = -1
+ %tr
+ %td
+ %label
+ Quantity
+ %td
+ %label
+ Units
+ %td
+ %label
+ GuestInterface
+ %td
+ - property_object.each do |disk|
+ - iter += 1
+ %tr
+ %td
+ %input{ :name => "disk_quantity_" + iter.to_s, :size => 10, :value => disk["capacity"]["quantity"] }
+ %td
+ %input{ :name => "disk_units_" + iter.to_s, :size => 10, :value => disk["capacity"]["units"] }
+ %td
+ %input{ :name => "disk_guestInterface_" + iter.to_s, :size => 30, :value => disk["guestInterface"] }
+ %td
+ %input{ :type => :button, :value => "Remove", :onClick => "return removeProperty(this)" }
+ %input{ :type => :button, :name => "commit", :value => "Add new disk", :onClick => "return addDiskRow('diskTable')" }
+
+ %br
+ %label
+ EntityMetadata:
+ %br
+
+:javascript
+ function fixupXml(theNode) {
+ var xmlData = "<?xml version='1.0' encoding='utf-8' ?>";
+ xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://www.dmtf.org/cimi'>";
+ xmlData += getStandardData(theNode);
+ xmlData += "<cpu>" + $(theNode.form).attr("cpu").value + "</cpu>";
+ xmlData += "<memory quantity='" + $(theNode.form).attr("memory_quantity").value + "' units='";
+ xmlData += $(theNode.form).attr("memory_units").value + "' />"
+
+ var index=0;
+ subDisk = ""
+ while ($(theNode.form).attr("disk_quantity_" + index)) {
+ if ($(theNode.form).attr("disk_quantity_" + index).value != null &&
+ $(theNode.form).attr("disk_quantity_" + index).value.length > 0) {
+ subDisk += "<capacity quantity='" + $(theNode.form).attr("disk_quantity_" + index).value + "' units='" +
+ $(theNode.form).attr("disk_units_" + index).value + "' />";
+ subDisk += "<guestInterface>" + $(theNode.form).attr("disk_guestInterface_" + index).value + "</guestInterface>";
+ }
+ index++;
+ }
+ if (subDisk.length > 0) {
+ xmlData += "<disk>" + subDisk + "</disk>";
+ }
+
+ xmlData += "</" + $(theNode.form).attr("xmlRootNode").value + ">";
+
+ return xmlData;
+ }
+
+ function addDiskRow(tableId) {
+ var tbl = document.getElementById(tableId);
+ var lastRow = tbl.rows.length;
+ // if there's no header row in the table, then iteration = lastRow + 1
+ var iteration = lastRow - 1;
+ var row = tbl.insertRow(lastRow);
+
+ elNames = ['disk_quantity_', 'disk_units_', 'disk_guestInterface_'];
+ elSizes = [10, 10, 30]
+ elValues = ["200", "megabyte", ""]
+
+ for (var index=0; index<elNames.length; index++) {
+ var aCellTD = row.insertCell(index);
+ var aCell = document.createElement('input');
+ aCell.type = 'text';
+ aCell.name = elNames[index] + iteration;
+ aCell.id = aCell.name;
+ aCell.size = elSizes[index];
+ aCell.value = elValues[index];
+ aCellTD.appendChild(aCell);
+ }
+
+ // select cell
+ var cellRightBut = row.insertCell(elNames.length);
+ var er = document.createElement('input');
+ er.type = 'button';
+ er.name = 'param_remove' + iteration;
+ er.id = 'param_remove' + iteration;
+ er.value = "Remove";
+ er.tableRow = row
+ $(er).click(function() {
+ removeProperty(this);
+ })
+
+ cellRightBut.appendChild(er);
+ }
\ No newline at end of file
Added: incubator/deltacloud/trunk/server/views/cimi/machine_images/show.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/machine_images/show.html.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/machine_images/show.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/machine_images/show.html.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,79 @@
+%h1 View/Edit machine image
+
+%form{ :action => machine_images_url }
+ %input{ :name => :id, :type => :hidden, :value => @dmtfitem["uri"] }/
+ %input{ :name => :xmlRootNode, :type => :hidden, :value => @xml_root_node }/
+ %input{ :name => :refreshURI, :type => :hidden, :value => machine_images_url }/
+ %p
+ %label
+ Name:
+ %p
+ %input{ :name => :name, :size => 50, :value => @dmtfitem["name"], :style => "width:50%;" }
+ %input{ :name => :created, :type => :hidden, :size => 50, :value => @dmtfitem["created"] }
+ %p
+ %br
+ %label
+ Description:
+ %p
+ %textarea{ :name => :description, :cols => 50, :rows => 4, :style => "width:50%;" } #{@dmtfitem['description']}
+ %p
+ %br
+ %label
+ Properties:
+ %p
+ %table{ :style => "width:50%;", :id => "propertyTable"}
+ - if @dmtfitem["property"]
+ - if @dmtfitem["property"]["name"] && @dmtfitem["property"]["content"]
+ - property_object = {"#{@dmtfitem['property']['name']}" => {"content" => @dmtfitem["property"]["content"]}}
+ - else
+ - property_object = @dmtfitem["property"]
+
+ - iter = -1
+ - property_object.each_pair do |key, value|
+ - iter += 1
+ %tr
+ %td
+ %input{ :name => "param_name_" + iter.to_s, :size => 30, :value => key }
+ %td
+ %input{ :name => "param_value_" + iter.to_s, :size => 30, :value => value["content"] }
+ %td
+ %input{ :type => :button, :value => "Remove", :onClick => "return removeProperty(this)" }
+ %input{ :type => :button, :name => "commit", :value => "Add new property", :onClick => "return AddNewPproperty('propertyTable')" }
+ %p
+ %br
+ %label
+ Image Location:
+ %p
+ %input{ :name => :imageLocation, :size => 50, :value => @dmtfitem["imageLocation"], :style => "width:50%;" }
+ %br
+ %label
+ Image Data:
+ %p
+ %textarea{:style=> "width:50%;height:100px;", :name => "imageData"}
+ %br
+ %label
+ EntityMetadata:
+ %br
+ %div{:style => "width:90%;"}
+ %pre
+ - if @metadata
+ = convert_xml_to_html @metadata
+ %br
+
+:javascript
+ function fixupXml(theNode) {
+ var xmlData = "<?xml version='1.0' encoding='utf-8' ?>";
+ xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://www.dmtf.org/cimi'>";
+ xmlData += getStandardData(theNode);
+ xmlData += "<imageLocation href='" + $(theNode.form).attr("imageLocation").value + "' />";
+ xmlData += "<imageData>" + $(theNode.form).attr("imageData").value + "</imageData>";
+
+ //we handle entityMetadata here
+ if ($(theNode.form).attr("entityMetadata") != null && $(theNode.form).attr("entityMetadata").value) {
+ xmlData += $(theNode.form).attr("entityMetadata").value
+ }
+
+ xmlData += "</" + $(theNode.form).attr("xmlRootNode").value + ">";
+
+ return xmlData;
+ }
\ No newline at end of file
Added: incubator/deltacloud/trunk/server/views/cimi/machines/show.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/machines/show.html.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/machines/show.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/machines/show.html.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,177 @@
+%h1 View/Edit machine
+
+%form{ :action => machines_url }
+ %input{ :name => :id, :type => :hidden, :value => @dmtfitem["uri"] }/
+ %input{ :name => :xmlRootNode, :type => :hidden, :value => @xml_root_node }/
+ %input{ :name => :refreshURI, :type => :hidden, :value => machines_url }/
+ %p
+ %label
+ Name:
+ %p
+ %input{ :name => :name, :size => 50, :value => @dmtfitem["name"], :style => "width:50%;" }
+ %input{ :name => :created, :type => :hidden, :size => 50, :value => @dmtfitem["created"] }
+ %p
+ %br
+ %label
+ Description:
+ %p
+ %textarea{ :name => :description, :cols => 50, :rows => 4, :style => "width:50%;" } #{@dmtfitem['description']}
+ %p
+ %br
+ %label
+ Properties:
+ %p
+ %table{ :style => "width:50%;", :id => "propertyTable"}
+ - if @dmtfitem["property"]
+ - if @dmtfitem["property"]["name"] && @dmtfitem["property"]["content"]
+ - property_object = {"#{@dmtfitem['property']['name']}" => {"content" => @dmtfitem["property"]["content"]}}
+ - else
+ - property_object = @dmtfitem["property"]
+
+ - iter = -1
+ - property_object.each_pair do |key, value|
+ - iter += 1
+ %tr
+ %td
+ %input{ :name => "param_name_" + iter.to_s, :size => 25, :value => key }
+ %td
+ %input{ :name => "param_value_" + iter.to_s, :size => 25, :value => value["content"] }
+ %td
+ %input{ :type => :button, :value => "Remove", :onClick => "return removeProperty(this)" }
+ %input{ :type => :button, :name => "commit", :value => "Add new property", :onClick => "return AddNewPproperty('propertyTable')" }
+ %p
+ %br
+ %label
+ Status:
+ %p
+ %input{ :name => :status, :size => 50, :value => @dmtfitem["status"], :style => "width:50%;" }
+ %p
+ %br
+ %label
+ CPU:
+ %p
+ %input{ :name => :cpu, :size => 50, :value => @dmtfitem["cpu"], :style => "width:50%;" }
+ %br
+ %label
+ Memory:
+ %p
+ %input{ :name => :memory_quantity, :size => 20, :value => @dmtfitem["memory"]["quantity"], :style => "width:10%;" }
+ %input{ :name => :memory_units, :size => 20, :value => @dmtfitem["memory"]["units"], :style => "width:10%;" }
+ %br
+ %label
+ Disk:
+ %p
+ %table{ :style => "width:50%;", :id => "diskTable"}
+ - if @dmtfitem["disk"]
+ - if @dmtfitem["disk"].kind_of?(Array)
+ - property_object = @dmtfitem["disk"]
+ - else
+ - property_object = [@dmtfitem["disk"]]
+
+ - iter = -1
+ %tr
+ %td
+ %label
+ Quantity
+ %td
+ %label
+ Units
+ %td
+ %label
+ GuestInterface
+ %td
+ - property_object.each do |disk|
+ - iter += 1
+ %tr
+ %td
+ %input{ :name => "disk_quantity_" + iter.to_s, :size => 10, :value => disk["capacity"]["quantity"] }
+ %td
+ %input{ :name => "disk_units_" + iter.to_s, :size => 10, :value => disk["capacity"]["units"] }
+ %td
+ %input{ :name => "disk_guestInterface_" + iter.to_s, :size => 20, :value => disk["guestInterface"] }
+ %td
+ %input{ :type => :button, :value => "Remove", :onClick => "return removeProperty(this)" }
+ %input{ :type => :button, :name => "commit", :value => "Add new disk", :onClick => "return addDiskRow('diskTable')" }
+
+ %br
+ %label
+ EntityMetadata:
+ %br
+ %label
+ TODO Need to handle volumes:
+ %p
+ %br
+ %label
+ TODO Need to handle network interfaces:
+
+:javascript
+ function fixupXml(theNode) {
+ var xmlData = "<?xml version='1.0' encoding='utf-8' ?>";
+ xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://www.dmtf.org/cimi'>";
+ xmlData += getStandardData(theNode);
+ xmlData += "<cpu>" + $(theNode.form).attr("cpu").value + "</cpu>";
+ xmlData += "<memory quantity='" + $(theNode.form).attr("memory_quantity").value + "' units='";
+ xmlData += $(theNode.form).attr("memory_units").value + "' />"
+
+ var index=0;
+ subDisk = ""
+ while ($(theNode.form).attr("disk_quantity_" + index)) {
+ if ($(theNode.form).attr("disk_quantity_" + index).value != null &&
+ $(theNode.form).attr("disk_quantity_" + index).value.length > 0) {
+ subDisk += "<capacity quantity='" + $(theNode.form).attr("disk_quantity_" + index).value + "' units='" +
+ $(theNode.form).attr("disk_units_" + index).value + "' />";
+ subDisk += "<guestInterface>" + $(theNode.form).attr("disk_guestInterface_" + index).value + "</guestInterface>";
+ }
+ index++;
+ }
+ if (subDisk.length > 0) {
+ xmlData += "<disk>" + subDisk + "</disk>";
+ }
+
+ //we handle entityMetadata here
+ if ($(theNode.form).attr("entityMetadata").value) {
+ xmlData += $(theNode.form).attr("entityMetadata").value
+ }
+
+ xmlData += "</" + $(theNode.form).attr("xmlRootNode").value + ">";
+
+ return xmlData;
+ }
+
+ function addDiskRow(tableId) {
+ var tbl = document.getElementById(tableId);
+ var lastRow = tbl.rows.length;
+ // if there's no header row in the table, then iteration = lastRow + 1
+ var iteration = lastRow - 1;
+ var row = tbl.insertRow(lastRow);
+
+ elNames = ['disk_quantity_', 'disk_units_', 'disk_guestInterface_'];
+ elSizes = [10, 10, 20]
+ elValues = ["200", "megabyte", ""]
+
+ for (var index=0; index<elNames.length; index++) {
+ var aCellTD = row.insertCell(index);
+ var aCell = document.createElement('input');
+ aCell.type = 'text';
+ aCell.name = elNames[index] + iteration;
+ aCell.id = aCell.name;
+ aCell.size = elSizes[index];
+ aCell.value = elValues[index];
+ aCellTD.appendChild(aCell);
+ }
+
+ // select cell
+ var cellRightBut = row.insertCell(elNames.length);
+ var er = document.createElement('input');
+ er.type = 'button';
+ er.name = 'param_remove' + iteration;
+ er.id = 'param_remove' + iteration;
+ er.value = "Remove";
+ er.tableRow = row
+ $(er).click(function() {
+ removeProperty(this);
+ })
+
+ cellRightBut.appendChild(er);
+
+ }
\ No newline at end of file
Added: incubator/deltacloud/trunk/server/views/cimi/volume/show.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/cimi/volume/show.html.haml?rev=1185284&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/cimi/volume/show.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/cimi/volume/show.html.haml Mon Oct 17 17:04:45 2011
@@ -0,0 +1,68 @@
+%h1 View/Edit volume
+
+%form{ :action => volumes_url }
+ %input{ :name => :id, :type => :hidden, :value => @dmtfitem["uri"] }/
+ %input{ :name => :xmlRootNode, :type => :hidden, :value => @xml_root_node }/
+ %input{ :name => :refreshURI, :type => :hidden, :value => volumes_url }/
+ %p
+ %label
+ Name:
+ %p
+ %input{ :name => :name, :size => 50, :value => @dmtfitem["name"], :style => "width:50%;" }
+ %input{ :name => :created, :type => :hidden, :size => 50, :value => @dmtfitem["created"] }
+ %p
+ %br
+ %label
+ Description:
+ %p
+ %textarea{ :name => :description, :cols => 50, :rows => 4, :style => "width:50%;" } #{@dmtfitem['description']}
+ %p
+ %br
+ %label
+ Properties:
+ %p
+ %table{ :style => "width:50%;", :id => "propertyTable"}
+ - if @dmtfitem["property"]
+ - if @dmtfitem["property"]["name"] && @dmtfitem["property"]["content"]
+ - property_object = {"#{@dmtfitem['property']['name']}" => {"content" => @dmtfitem["property"]["content"]}}
+ - else
+ - property_object = @dmtfitem["property"]
+
+ - iter = -1
+ - property_object.each_pair do |key, value|
+ - iter += 1
+ %tr
+ %td
+ %input{ :name => "param_name_" + iter.to_s, :size => 30, :value => key }
+ %td
+ %input{ :name => "param_value_" + iter.to_s, :size => 30, :value => value["content"] }
+ %td
+ %input{ :type => :button, :value => "Remove", :onClick => "return removeProperty(this)" }
+ %input{ :type => :button, :name => "commit", :value => "Add new property", :onClick => "return AddNewPproperty('propertyTable')" }
+ %p
+ %br
+ %label
+ Capacity:
+ %p
+ %input{ :name => :capacity_quantity, :size => 20, :value => @dmtfitem["capacity"]["quantity"], :style => "width:10%;" }
+ %input{ :name => :capacity_units, :size => 20, :value => @dmtfitem["capacity"]["units"], :style => "width:10%;" }
+ %br
+ %label
+ EntityMetadata:
+ %br
+
+:javascript
+ function fixupXml(theNode) {
+ var xmlData = "<?xml version='1.0' encoding='utf-8' ?>";
+ xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://www.dmtf.org/cimi'>";
+ xmlData += getStandardData(theNode);
+ xmlData += "<cpu>" + $(theNode.form).attr("cpu").value + "</cpu>";
+ xmlData += "<memory quantity='" + $(theNode.form).attr("memory_quantity").value + "' units='";
+ xmlData += $(theNode.form).attr("memory_units").value + "' />"
+
+ var index=0;
+
+ xmlData += "</" + $(theNode.form).attr("xmlRootNode").value + ">";
+
+ return xmlData;
+ }
\ No newline at end of file
Modified: incubator/deltacloud/trunk/tests/ec2/support/env.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/tests/ec2/support/env.rb?rev=1185284&r1=1185283&r2=1185284&view=diff
==============================================================================
--- incubator/deltacloud/trunk/tests/ec2/support/env.rb (original)
+++ incubator/deltacloud/trunk/tests/ec2/support/env.rb Mon Oct 17 17:04:45 2011
@@ -1,11 +1,15 @@
SERVER_DIR = File::expand_path(File::join(File::dirname(__FILE__), "../../../server"))
+
+$top_srcdir = SERVER_DIR
+$:.unshift File::join($top_srcdir, 'lib')
+
Dir.chdir(SERVER_DIR)
ENV['API_DRIVER'] = 'ec2'
require 'rubygems'
require 'nokogiri'
-require '../server/server'
+require 'deltacloud/server'
require 'rack/test'
Sinatra::Application.set :environment, :test
@@ -53,4 +57,3 @@ World do
end
end
-
Modified: incubator/deltacloud/trunk/tests/mock/support/env.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/tests/mock/support/env.rb?rev=1185284&r1=1185283&r2=1185284&view=diff
==============================================================================
--- incubator/deltacloud/trunk/tests/mock/support/env.rb (original)
+++ incubator/deltacloud/trunk/tests/mock/support/env.rb Mon Oct 17 17:04:45 2011
@@ -1,11 +1,14 @@
SERVER_DIR = File::expand_path(File::join(File::dirname(__FILE__), "../../../server"))
+$top_srcdir = SERVER_DIR
+$:.unshift File::join($top_srcdir, 'lib')
+
ENV['API_DRIVER'] = 'mock'
Dir.chdir(SERVER_DIR)
require 'rubygems'
require 'nokogiri'
-require '../server/server'
+require 'deltacloud/server'
require 'rack/test'
Sinatra::Application.set :environment, :test
@@ -43,4 +46,3 @@ World do
end
end
-
Modified: incubator/deltacloud/trunk/tests/rhevm/support/env.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/tests/rhevm/support/env.rb?rev=1185284&r1=1185283&r2=1185284&view=diff
==============================================================================
--- incubator/deltacloud/trunk/tests/rhevm/support/env.rb (original)
+++ incubator/deltacloud/trunk/tests/rhevm/support/env.rb Mon Oct 17 17:04:45 2011
@@ -1,9 +1,13 @@
SERVER_DIR = File::expand_path(File::join(File::dirname(__FILE__), "../../../server"))
+
+$top_srcdir = SERVER_DIR
+$:.unshift File::join($top_srcdir, 'lib')
+
Dir.chdir(SERVER_DIR)
require 'rubygems'
require 'nokogiri'
-require '../server/server'
+require 'deltacloud/server'
require 'rack/test'
Sinatra::Application.set :environment, :test
@@ -59,4 +63,3 @@ World do
end
end
-
Modified: incubator/deltacloud/trunk/tests/sbc/support/env.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/tests/sbc/support/env.rb?rev=1185284&r1=1185283&r2=1185284&view=diff
==============================================================================
--- incubator/deltacloud/trunk/tests/sbc/support/env.rb (original)
+++ incubator/deltacloud/trunk/tests/sbc/support/env.rb Mon Oct 17 17:04:45 2011
@@ -1,12 +1,15 @@
SERVER_DIR = File::expand_path(File::join(File::dirname(__FILE__), "../../../server"))
+$top_srcdir = SERVER_DIR
+$:.unshift File::join($top_srcdir, 'lib')
+
ENV['API_DRIVER'] = 'sbc'
Dir.chdir(SERVER_DIR)
require 'rubygems'
require 'nokogiri'
-require '../server/server'
+require 'deltacloud/server'
require 'rack/test'
Sinatra::Application.set :environment, :test
@@ -62,4 +65,3 @@ World do
end
end
-