3 # A DDL file for the data query plugins.
5 # Query plugins can today take only one input by convention in the DDL that
6 # is called :query, otherwise the input is identical to the standard input.
8 # metadata :name => "Agent",
9 # :description => "Meta data about installed MColletive Agents",
10 # :author => "R.I.Pienaar <rip@devco.net>",
11 # :license => "ASL 2.0",
13 # :url => "http://marionette-collective.org/",
16 # dataquery :description => "Agent Meta Data" do
18 # :prompt => "Agent Name",
19 # :description => "Valid agent name",
21 # :validation => /^[\w\_]+$/,
24 # [:license, :timeout, :description, :url, :version, :author].each do |item|
26 # :description => "Agent #{item}",
27 # :display_as => item.to_s.capitalize
31 def dataquery(input, &block)
32 raise "Data queries need a :description" unless input.include?(:description)
33 raise "Data queries can only have one definition" if @entities[:data]
35 @entities[:data] = {:description => input[:description],
39 @current_entity = :data
40 block.call if block_given?
44 def input(argument, properties)
45 raise "The only valid input name for a data query is 'query'" if argument != :query
50 # Returns the interface for the data query
51 def dataquery_interface
52 @entities[:data] || {}