Author: rareddy
Date: 2010-04-05 16:53:25 -0400 (Mon, 05 Apr 2010)
New Revision: 2024
Modified:
trunk/client/src/main/java/org/teiid/adminapi/Model.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
trunk/client/src/main/resources/vdb-deployer.xsd
trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
Log:
TEIID-998: Adding "description" field to "Model" element for use by
the tooling.
Modified: trunk/client/src/main/java/org/teiid/adminapi/Model.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Model.java 2010-04-05 19:52:52 UTC (rev
2023)
+++ trunk/client/src/main/java/org/teiid/adminapi/Model.java 2010-04-05 20:53:25 UTC (rev
2024)
@@ -34,6 +34,12 @@
enum Type {PHYSICAL, VIRTUAL, FUNCTION};
+ /**
+ * Description about the model
+ * @return
+ */
+ String getDescription();
+
/**
* Determine if this model is a Source model.
*
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-04-05
19:52:52 UTC (rev 2023)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-04-05
20:53:25 UTC (rev 2024)
@@ -44,6 +44,7 @@
@XmlAccessorType(XmlAccessType.NONE)
@XmlType(name = "", propOrder = {
+ "description",
"JAXBProperties",
"sources",
"errors"
@@ -65,6 +66,9 @@
@XmlAttribute(name = "type")
protected String modelType = Type.PHYSICAL.name();
+ @XmlElement(name = "description")
+ protected String description;
+
@XmlAttribute(name = "path")
protected String path;
@@ -84,6 +88,16 @@
public void setName(String name) {
super.setName(name);
}
+
+ @Override
+ @ManagementProperty(description = "Model description")
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
@Override
@ManagementProperty(description = "Is Model Source model")
Modified: trunk/client/src/main/resources/vdb-deployer.xsd
===================================================================
--- trunk/client/src/main/resources/vdb-deployer.xsd 2010-04-05 19:52:52 UTC (rev 2023)
+++ trunk/client/src/main/resources/vdb-deployer.xsd 2010-04-05 20:53:25 UTC (rev 2024)
@@ -11,6 +11,7 @@
<xs:element name="model" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
+ <xs:element name="description"
type="xs:string" minOccurs="0"/>
<xs:element name="property" type="property"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="source" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
Modified: trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
===================================================================
--- trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-04-05
19:52:52 UTC (rev 2023)
+++ trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-04-05
20:53:25 UTC (rev 2024)
@@ -60,6 +60,7 @@
modelOne.addProperty("model-prop", "model-value-override");
//$NON-NLS-1$ //$NON-NLS-2$
modelOne.setVisible(false);
modelOne.addError("ERROR", "There is an error in VDB");
//$NON-NLS-1$ //$NON-NLS-2$
+ modelOne.setDescription("model description");
vdb.addModel(modelOne);
@@ -124,7 +125,7 @@
assertEquals(Model.Type.PHYSICAL, modelOne.getModelType());
assertEquals("model-value-override",
modelOne.getPropertyValue("model-prop")); //$NON-NLS-1$ //$NON-NLS-2$
assertFalse(modelOne.isVisible());
-
+ assertEquals("model description", modelOne.getDescription());
modelTwo = vdb.getModel("model-two"); //$NON-NLS-1$
assertEquals("model-two", modelTwo.getName()); //$NON-NLS-1$
Show replies by date