Return-Path: X-Original-To: apmail-deltacloud-commits-archive@www.apache.org Delivered-To: apmail-deltacloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E37F9314 for ; Thu, 8 Dec 2011 16:22:36 +0000 (UTC) Received: (qmail 5536 invoked by uid 500); 8 Dec 2011 16:22:36 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 5518 invoked by uid 500); 8 Dec 2011 16:22:36 -0000 Mailing-List: contact commits-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list commits@deltacloud.apache.org Received: (qmail 5507 invoked by uid 99); 8 Dec 2011 16:22:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 16:22:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 16:22:34 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 131D92388ACC for ; Thu, 8 Dec 2011 16:22:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1211952 - in /deltacloud/trunk/server/lib/cimi: model.rb model/entity_metadata_collection.rb Date: Thu, 08 Dec 2011 16:22:13 -0000 To: commits@deltacloud.apache.org From: marios@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111208162214.131D92388ACC@eris.apache.org> Author: marios Date: Thu Dec 8 16:22:13 2011 New Revision: 1211952 URL: http://svn.apache.org/viewvc?rev=1211952&view=rev Log: Adds CIMI::EntityMetadataCollection - note this is not a 'proper' top-level collection in CIMI... and won't appear as such in CloudEntryPoint. Implemented to help avoiding xml parsing by hand in the the CIMI html UI Added: deltacloud/trunk/server/lib/cimi/model/entity_metadata_collection.rb Modified: deltacloud/trunk/server/lib/cimi/model.rb Modified: deltacloud/trunk/server/lib/cimi/model.rb URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model.rb?rev=1211952&r1=1211951&r2=1211952&view=diff ============================================================================== --- deltacloud/trunk/server/lib/cimi/model.rb (original) +++ deltacloud/trunk/server/lib/cimi/model.rb Thu Dec 8 16:22:13 2011 @@ -44,3 +44,4 @@ require 'cimi/model/volume_configuration require 'cimi/model/volume_image_collection' require 'cimi/model/volume_template_collection' require 'cimi/model/entity_metadata' +require 'cimi/model/entity_metadata_collection' Added: deltacloud/trunk/server/lib/cimi/model/entity_metadata_collection.rb URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/entity_metadata_collection.rb?rev=1211952&view=auto ============================================================================== --- deltacloud/trunk/server/lib/cimi/model/entity_metadata_collection.rb (added) +++ deltacloud/trunk/server/lib/cimi/model/entity_metadata_collection.rb Thu Dec 8 16:22:13 2011 @@ -0,0 +1,31 @@ +# 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::Model::EntityMetadataCollection < CIMI::Model::Base + + array :entity_metadata do + scalar :href + end + + def self.default(context) + self.new( + :uri => context.entity_metadata_url, + :name => 'default', + :created => Time.now, + :entity_metadata => EntityMetadata.all(context).map{|em| {:href => em.uri}} + ) + end + +end