From 6f04c2ba7629c5ffa7d123a344d0f53d171830a7 Mon Sep 17 00:00:00 2001 From: Valerii Kovalchuk Date: Mon, 13 Jun 2016 17:49:40 +0300 Subject: [PATCH] Implement meta-classes for UI hints The following meta-classes are implemented and placed to the core library: Title, Description, HelpText, Hidden, Section, Position. They can be attached to the different MuranoPL entities and used during the automatic UI definition generation. Also meta-class ModelBuilder is added for marking special static methods. Change-Id: I474d69b2cadb9b200e70d4d9daaef3e87d9cb3a5 Partially-implements: blueprint muranopl-forms --- .../Classes/metadata/Description.yaml | 22 +++++++++++++ meta/io.murano/Classes/metadata/HelpText.yaml | 22 +++++++++++++ .../Classes/metadata/ModelBuilder.yaml | 19 +++++++++++ meta/io.murano/Classes/metadata/Position.yaml | 28 ++++++++++++++++ meta/io.murano/Classes/metadata/Title.yaml | 22 +++++++++++++ .../Classes/metadata/forms/Hidden.yaml | 19 +++++++++++ .../Classes/metadata/forms/Section.yaml | 32 +++++++++++++++++++ meta/io.murano/manifest.yaml | 8 +++++ .../notes/meta-for-ui-72f5b58c6d17599f.yaml | 4 +++ 9 files changed, 176 insertions(+) create mode 100644 meta/io.murano/Classes/metadata/Description.yaml create mode 100644 meta/io.murano/Classes/metadata/HelpText.yaml create mode 100644 meta/io.murano/Classes/metadata/ModelBuilder.yaml create mode 100644 meta/io.murano/Classes/metadata/Position.yaml create mode 100644 meta/io.murano/Classes/metadata/Title.yaml create mode 100644 meta/io.murano/Classes/metadata/forms/Hidden.yaml create mode 100644 meta/io.murano/Classes/metadata/forms/Section.yaml create mode 100644 releasenotes/notes/meta-for-ui-72f5b58c6d17599f.yaml diff --git a/meta/io.murano/Classes/metadata/Description.yaml b/meta/io.murano/Classes/metadata/Description.yaml new file mode 100644 index 000000000..30b4cbb95 --- /dev/null +++ b/meta/io.murano/Classes/metadata/Description.yaml @@ -0,0 +1,22 @@ +# 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. + +Namespaces: + =: io.murano.metadata + +Name: Description +Usage: Meta +Inherited: true + +Properties: + text: + Contract: $.string().notNull() diff --git a/meta/io.murano/Classes/metadata/HelpText.yaml b/meta/io.murano/Classes/metadata/HelpText.yaml new file mode 100644 index 000000000..c41e120e4 --- /dev/null +++ b/meta/io.murano/Classes/metadata/HelpText.yaml @@ -0,0 +1,22 @@ +# 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. + +Namespaces: + =: io.murano.metadata + +Name: HelpText +Usage: Meta +Inherited: true + +Properties: + text: + Contract: $.string().notNull() diff --git a/meta/io.murano/Classes/metadata/ModelBuilder.yaml b/meta/io.murano/Classes/metadata/ModelBuilder.yaml new file mode 100644 index 000000000..555cec182 --- /dev/null +++ b/meta/io.murano/Classes/metadata/ModelBuilder.yaml @@ -0,0 +1,19 @@ +# 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. + +Namespaces: + =: io.murano.metadata + +Name: ModelBuilder +Usage: Meta +Applies: Method +Inherited: true diff --git a/meta/io.murano/Classes/metadata/Position.yaml b/meta/io.murano/Classes/metadata/Position.yaml new file mode 100644 index 000000000..ba310d541 --- /dev/null +++ b/meta/io.murano/Classes/metadata/Position.yaml @@ -0,0 +1,28 @@ +# 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. + +Namespaces: + =: io.murano.metadata + +Name: Position +Usage: Meta +Applies: [Property, Argument] +Inherited: true + +Properties: + index: + Contract: $.int() + Default: null + + section: + Contract: $.string() + Default: null diff --git a/meta/io.murano/Classes/metadata/Title.yaml b/meta/io.murano/Classes/metadata/Title.yaml new file mode 100644 index 000000000..e65cf18ac --- /dev/null +++ b/meta/io.murano/Classes/metadata/Title.yaml @@ -0,0 +1,22 @@ +# 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. + +Namespaces: + =: io.murano.metadata + +Name: Title +Usage: Meta +Inherited: true + +Properties: + text: + Contract: $.string().notNull() diff --git a/meta/io.murano/Classes/metadata/forms/Hidden.yaml b/meta/io.murano/Classes/metadata/forms/Hidden.yaml new file mode 100644 index 000000000..74abe16fd --- /dev/null +++ b/meta/io.murano/Classes/metadata/forms/Hidden.yaml @@ -0,0 +1,19 @@ +# 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. + +Namespaces: + =: io.murano.metadata.forms + +Name: Hidden +Usage: Meta +Applies: [Property, Argument] +Inherited: true diff --git a/meta/io.murano/Classes/metadata/forms/Section.yaml b/meta/io.murano/Classes/metadata/forms/Section.yaml new file mode 100644 index 000000000..81f3365bc --- /dev/null +++ b/meta/io.murano/Classes/metadata/forms/Section.yaml @@ -0,0 +1,32 @@ +# 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. + +Namespaces: + =: io.murano.metadata.forms + +Name: Section +Usage: Meta +Cardinality: Many +Applies: [Type, Method] +Inherited: true + +Properties: + name: + Contract: $.string().notNull() + + title: + Contract: $.string() + Default: $.name + + index: + Contract: $.int() + Default: null diff --git a/meta/io.murano/manifest.yaml b/meta/io.murano/manifest.yaml index 4df59cff8..2aadac760 100644 --- a/meta/io.murano/manifest.yaml +++ b/meta/io.murano/manifest.yaml @@ -69,4 +69,12 @@ Classes: io.murano.system.AwsSecurityGroupManager: system/AwsSecurityGroupManager.yaml io.murano.system.MistralClient: system/MistralClient.yaml + io.murano.metadata.Description: metadata/Description.yaml + io.murano.metadata.HelpText: metadata/HelpText.yaml + io.murano.metadata.ModelBuilder: metadata/ModelBuilder.yaml + io.murano.metadata.Position: metadata/Position.yaml + io.murano.metadata.Title: metadata/Title.yaml + io.murano.metadata.forms.Hidden: metadata/forms/Hidden.yaml + io.murano.metadata.forms.Section: metadata/forms/Section.yaml + io.murano.test.TestFixture: test/TestFixture.yaml diff --git a/releasenotes/notes/meta-for-ui-72f5b58c6d17599f.yaml b/releasenotes/notes/meta-for-ui-72f5b58c6d17599f.yaml new file mode 100644 index 000000000..d61ee709f --- /dev/null +++ b/releasenotes/notes/meta-for-ui-72f5b58c6d17599f.yaml @@ -0,0 +1,4 @@ +--- +features: + - The meta-classes Title, Description, HelpText, Hidden, Section, Position, + ModelBuilder are implemented and placed to the core library .