So then for the non-subsystem case we could use "*"? Since there won't
be a ModelNodeRegistration for anything other than *, and all children
will have the same model-description. E.g., for the domain root:
{
"description" => {},
"attributes" => {},
"children" => {
"profile" => {
"description" => "The profiles",
"required" => true,
"model-description" => {
"*" => {
"description" => "A profile",
"attributes" => {},
"children" => {
"subsystem" => {
"description" => "The subsystems",
"required" => true,
"model-description" => {
"jmx" => {
"description" => "The JMX subsystem",
"attributes" => {},
"children? => {}
},
"web" => {
"description" => "The web subsystem",
"attributes" => {},
"children? => {}
}
}
}
}
}
}
}
}
}
That seems to work.
On 1/15/11 5:35 AM, Kabir Khan wrote:
Actually that output is complete garbage :-) The idea is that for
every children=>model-description to add something like this:
model-description => {
subsystem1 => {
description=>{},
attributes=>{},
children=> {
child => {
description=>{},
required=>"true",
model-description=>{
childa=>{
description=>{}.
attributes=>{}
},
childb=>{
description=>{}.
attributes=>{},
}
}
}
}
},
subsystem2 =>{
description=>{},
attributes=>{},
children=> {},
},
}
On 15 Jan 2011, at 11:09, Kabir Khan wrote:
> For the recursive read-resource-description operation I have come up with something
which lives at
https://github.com/kabir/jboss-as/tree/detyped-recursive-description. I did
not bother getting the tests to pass until we've decided on something. The model
description elements have an intermediate layer (child-name =>
actual-model-description}. Getting the recursive model description for the test model set
up in GlobalOperationsTestCase returns the following:
>
>
>
> {
> "description" => "The root node of the test management
API",
> "children" => {
> "profile" => {
> "description" => "A list of profiles",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "model-description" => {
> "profileB" => {
> "description" => "A named set of subsystem
configs",
> "attributes" => {"name" => {
> "type" => STRING,
> "description" => "The name of the
profile",
> "required" => true,
> "min-length" => 1
> }},
> "children" => {
> "subsystem" => {
> "description" => "The subsystems that make
up the profile",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "model-description" => {"subsystem3"
=> {
> "description" => "A test subsystem
1",
> "attributes" => {"attr1" =>
{
> "type" => INT,
> "description" => "The
value",
> "required" => true
> }},
> "children" => {}
> }}
> }
> },
> "profileC" => {
> "description" => "A named set of subsystem
configs",
> "attributes" => {"name" => {
> "type" => STRING,
> "description" => "The name of the
profile",
> "required" => true,
> "min-length" => 1
> }},
> "children" => {
> "subsystem" => {
> "description" => "The subsystems that make
up the profile",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "model-description" => {
> "subsystem5" => {
> "description" => "A value",
> "attributes" => {
> "name" => {
> "type" => STRING,
> "description" => "The name of
the thing",
> "required" => true
> },
> "value" => {
> "type" => STRING,
> "description" => "The name of
the thing",
> "required" => false
> }
> },
> "children" => {
> "type1" => {
> "description" => "The
children1",
> "min-occurs" => 0,
> "model-description" => undefined
> },
> "model-description" =>
{"thing1" => {"description" => "A subsystem"}}
> }
> },
> "subsystem4" => {
> "description" => "A subsystem",
> "attributes" => {"name" => {
> "type" => STRING,
> "description" => "The name of
the thing",
> "required" => false
> }},
> "children" => {"type1" => {
> "description" => "The
children1",
> "min-occurs" => 0,
> "model-description" => undefined
> }}
> }
> }
> }
> },
> "profileA" => {
> "description" => "A named set of subsystem
configs",
> "attributes" => {"name" => {
> "type" => STRING,
> "description" => "The name of the
profile",
> "required" => true,
> "min-length" => 1
> }},
> "children" => {
> "subsystem" => {
> "description" => "The subsystems that make
up the profile",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "model-description" => {
> "subsystem1" => {
> "description" => "A test subsystem
1",
> "attributes" => {"attr1" =>
{
> "type" => LIST,
> "value-type" => INT,
> "description" => "The
values",
> "required" => true
> }},
> "children" => {
> "type1" => {
> "description" => "The
children1",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "type2" => {
> "description" => "The
children2",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "model-description" => {
> "*" => {
> "description" => "A type
1",
> "attributes" => {
> "name" => {
> "type" => STRING,
> "description" =>
"The name of the thing",
> "required" => true
> },
> "value" => {
> "type" => INT,
> "description" =>
"The value of the thing",
> "required" => true
> }
> }
> },
> "other" => {
> "description" => "A type
2",
> "attributes" =>
{"name" => {
> "type" => STRING,
> "description" =>
"The name of the thing",
> "required" => true
> }}
> }
> }
> }
> },
> "subsystem2" => {
> "description" => "A test subsystem
2",
> "attributes" => {
> "bigdecimal" => {
> "type" => BIG_DECIMAL,
> "description" => "A big
decimal",
> "required" => true
> },
> "biginteger" => {
> "type" => BIG_DECIMAL,
> "description" => "A big
integer",
> "required" => true
> },
> "boolean" => {
> "type" => BOOLEAN,
> "description" => "A
boolean",
> "required" => true
> },
> "bytes" => {
> "type" => BYTES,
> "description" => "A
bytes",
> "required" => true
> },
> "double" => {
> "type" => DOUBLE,
> "description" => "A
double",
> "required" => true
> },
> "expression" => {
> "type" => UNDEFINED,
> "description" => "A
double",
> "required" => true
> },
> "int" => {
> "type" => INT,
> "description" => "A
int",
> "required" => true
> },
> "list" => {
> "type" => LIST,
> "value-type" => STRING,
> "description" => "A
list",
> "required" => true
> },
> "long" => {
> "type" => LONG,
> "description" => "A
long",
> "required" => true
> },
> "object" => {
> "type" => OBJECT,
> "value-type" => STRING,
> "description" => "A
object",
> "required" => true
> },
> "property" => {
> "type" => UNDEFINED,
> "value-type" => STRING,
> "description" => "A
property",
> "required" => true
> },
> "string1" => {
> "type" => STRING,
> "description" => "A
string",
> "required" => true
> },
> "string2" => {
> "type" => STRING,
> "description" => "A
string",
> "required" => true
> },
> "type" => {
> "type" => TYPE,
> "description" => "A
type",
> "required" => true
> }
> }
> }
> }
> }
> }
> }
> }
> }
> {
> "description" => "The root node of the test management
API",
> "children" => {
> "profile" => {
> "description" => "A list of profiles",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "model-description" => {
> "profileB" => {
> "description" => "A named set of subsystem
configs",
> "attributes" => {"name" => {
> "type" => STRING,
> "description" => "The name of the
profile",
> "required" => true,
> "min-length" => 1
> }},
> "children" => {
> "subsystem" => {
> "description" => "The subsystems that make
up the profile",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "model-description" => {"subsystem3"
=> {
> "description" => "A test subsystem
1",
> "attributes" => {"attr1" =>
{
> "type" => INT,
> "description" => "The
value",
> "required" => true
> }},
> "children" => {}
> }}
> }
> },
> "profileC" => {
> "description" => "A named set of subsystem
configs",
> "attributes" => {"name" => {
> "type" => STRING,
> "description" => "The name of the
profile",
> "required" => true,
> "min-length" => 1
> }},
> "children" => {
> "subsystem" => {
> "description" => "The subsystems that make
up the profile",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "model-description" => {
> "subsystem5" => {
> "description" => "A value",
> "attributes" => {
> "name" => {
> "type" => STRING,
> "description" => "The name of
the thing",
> "required" => true
> },
> "value" => {
> "type" => STRING,
> "description" => "The name of
the thing",
> "required" => false
> }
> },
> "children" => {
> "type1" => {
> "description" => "The
children1",
> "min-occurs" => 0,
> "model-description" => undefined
> },
> "model-description" =>
{"thing1" => {"description" => "A subsystem"}}
> }
> },
> "subsystem4" => {
> "description" => "A subsystem",
> "attributes" => {"name" => {
> "type" => STRING,
> "description" => "The name of
the thing",
> "required" => false
> }},
> "children" => {"type1" => {
> "description" => "The
children1",
> "min-occurs" => 0,
> "model-description" => undefined
> }}
> }
> }
> }
> },
> "profileA" => {
> "description" => "A named set of subsystem
configs",
> "attributes" => {"name" => {
> "type" => STRING,
> "description" => "The name of the
profile",
> "required" => true,
> "min-length" => 1
> }},
> "children" => {
> "subsystem" => {
> "description" => "The subsystems that make
up the profile",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "model-description" => {
> "subsystem1" => {
> "description" => "A test subsystem
1",
> "attributes" => {"attr1" =>
{
> "type" => LIST,
> "value-type" => INT,
> "description" => "The
values",
> "required" => true
> }},
> "children" => {
> "type1" => {
> "description" => "The
children1",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "type2" => {
> "description" => "The
children2",
> "min-occurs" => 1,
> "model-description" => undefined
> },
> "model-description" => {
> "*" => {
> "description" => "A type
1",
> "attributes" => {
> "name" => {
> "type" => STRING,
> "description" =>
"The name of the thing",
> "required" => true
> },
> "value" => {
> "type" => INT,
> "description" =>
"The value of the thing",
> "required" => true
> }
> }
> },
> "other" => {
> "description" => "A type
2",
> "attributes" =>
{"name" => {
> "type" => STRING,
> "description" =>
"The name of the thing",
> "required" => true
> }}
> }
> }
> }
> },
> "subsystem2" => {
> "description" => "A test subsystem
2",
> "attributes" => {
> "bigdecimal" => {
> "type" => BIG_DECIMAL,
> "description" => "A big
decimal",
> "required" => true
> },
> "biginteger" => {
> "type" => BIG_DECIMAL,
> "description" => "A big
integer",
> "required" => true
> },
> "boolean" => {
> "type" => BOOLEAN,
> "description" => "A
boolean",
> "required" => true
> },
> "bytes" => {
> "type" => BYTES,
> "description" => "A
bytes",
> "required" => true
> },
> "double" => {
> "type" => DOUBLE,
> "description" => "A
double",
> "required" => true
> },
> "expression" => {
> "type" => UNDEFINED,
> "description" => "A
double",
> "required" => true
> },
> "int" => {
> "type" => INT,
> "description" => "A
int",
> "required" => true
> },
> "list" => {
> "type" => LIST,
> "value-type" => STRING,
> "description" => "A
list",
> "required" => true
> },
> "long" => {
> "type" => LONG,
> "description" => "A
long",
> "required" => true
> },
> "object" => {
> "type" => OBJECT,
> "value-type" => STRING,
> "description" => "A
object",
> "required" => true
> },
> "property" => {
> "type" => UNDEFINED,
> "value-type" => STRING,
> "description" => "A
property",
> "required" => true
> },
> "string1" => {
> "type" => STRING,
> "description" => "A
string",
> "required" => true
> },
> "string2" => {
> "type" => STRING,
> "description" => "A
string",
> "required" => true
> },
> "type" => {
> "type" => TYPE,
> "description" => "A
type",
> "required" => true
> }
> }
> }
> }
> }
> }
> }
> }
> }
>
>
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev