Author: rareddy
Date: 2012-01-20 16:33:25 -0500 (Fri, 20 Jan 2012)
New Revision: 3805
Modified:
trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java
trunk/admin/src/main/resources/org/teiid/adminapi/i18n.properties
trunk/admin/src/test/resources/parser-test-vdb.xml
Log:
TEIID-1906: correcting the typo for "allow-alter" to properly parse
Modified: trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java 2012-01-20
19:38:25 UTC (rev 3804)
+++ trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java 2012-01-20
21:33:25 UTC (rev 3805)
@@ -37,6 +37,7 @@
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
+import org.teiid.adminapi.AdminPlugin;
import org.teiid.adminapi.DataPolicy;
import org.teiid.adminapi.Model;
import org.teiid.adminapi.Translator;
@@ -63,7 +64,7 @@
parseVDB(reader, vdb);
return vdb;
default:
- throw new XMLStreamException("Unexpected element '" +
reader.getName() + "' encountered", reader.getLocation());
+ throw new
XMLStreamException(AdminPlugin.Util.gs("unexpected_element1",reader.getName(),
Element.VDB.getLocalName()), reader.getLocation());
}
}
return null;
@@ -98,7 +99,12 @@
// this is designer specific.
break;
default:
- throw new XMLStreamException("Unexpected element '" +
reader.getName() + "' encountered", reader.getLocation());
+ throw new
XMLStreamException(AdminPlugin.Util.gs("unexpected_element5",reader.getName(),
+ Element.DESCRIPTION.getLocalName(),
+ Element.PROPERTY.getLocalName(),
+ Element.MODEL.getLocalName(),
+ Element.TRANSLATOR.getLocalName(),
+ Element.DATA_ROLE.getLocalName()), reader.getLocation());
}
}
}
@@ -144,7 +150,10 @@
policy.addMappedRoleName(reader.getElementText());
break;
default:
- throw new XMLStreamException("Unexpected element '" +
reader.getName() + "' encountered", reader.getLocation());
+ throw new
XMLStreamException(AdminPlugin.Util.gs("unexpected_element2",reader.getName(),
+ Element.DESCRIPTION.getLocalName(),
+ Element.PERMISSION.getLocalName(),
+ Element.MAPPED_ROLE_NAME.getLocalName()), reader.getLocation());
}
}
}
@@ -176,7 +185,14 @@
break;
default:
- throw new XMLStreamException("Unexpected element '" +
reader.getName() + "' encountered", reader.getLocation());
+ throw new
XMLStreamException(AdminPlugin.Util.gs("unexpected_element7",reader.getName(),
+ Element.RESOURCE_NAME.getLocalName(),
+ Element.ALLOW_ALTER.getLocalName(),
+ Element.ALLOW_CREATE.getLocalName(),
+ Element.ALLOW_DELETE.getLocalName(),
+ Element.ALLOW_EXECUTE.getLocalName(),
+ Element.ALLOW_READ.getLocalName(),
+ Element.ALLOW_UPADTE), reader.getLocation());
}
}
}
@@ -194,7 +210,8 @@
parseProperty(reader, translator);
break;
default:
- throw new XMLStreamException("Unexpected element '" +
reader.getName() + "' encountered", reader.getLocation());
+ throw new
XMLStreamException(AdminPlugin.Util.gs("unexpected_element1",reader.getName(),
+ Element.PROPERTY.getLocalName()), reader.getLocation());
}
}
}
@@ -233,7 +250,11 @@
model.addError(ve);
break;
default:
- throw new XMLStreamException("Unexpected element '" +
reader.getName() + "' encountered", reader.getLocation());
+ throw new
XMLStreamException(AdminPlugin.Util.gs("unexpected_element4",reader.getName(),
+ Element.DESCRIPTION.getLocalName(),
+ Element.PROPERTY.getLocalName(),
+ Element.SOURCE.getLocalName(),
+ Element.VALIDATION_ERROR.getLocalName()), reader.getLocation());
}
}
}
@@ -280,7 +301,7 @@
ALLOW_UPADTE("allow-update"),
ALLOW_DELETE("allow-delete"),
ALLOW_EXECUTE("allow-execute"),
- ALLOW_ALTER("allow-alyer"),
+ ALLOW_ALTER("allow-alter"),
MAPPED_ROLE_NAME("mapped-role-name"),
ENTRY("entry");
Modified: trunk/admin/src/main/resources/org/teiid/adminapi/i18n.properties
===================================================================
--- trunk/admin/src/main/resources/org/teiid/adminapi/i18n.properties 2012-01-20 19:38:25
UTC (rev 3804)
+++ trunk/admin/src/main/resources/org/teiid/adminapi/i18n.properties 2012-01-20 21:33:25
UTC (rev 3805)
@@ -75,4 +75,11 @@
driver_not_defined=Driver {0} is not configured in the system, install the JDBC driver
first
connection_url_required=connection-url is required property
datasource_exists=Data source with name {0} already exists; choose a different deployment
name
-datasource_doesnot_exists=Data Source with name {0} does not exists in the system. Check
the deployment name.
\ No newline at end of file
+datasource_doesnot_exists=Data Source with name {0} does not exists in the system. Check
the deployment name.
+unexpected_element1=Unexpected Element {0} encountered, expecting one of {1}
+unexpected_element2=Unexpected Element {0} encountered, expecting one of {1} {2}
+unexpected_element3=Unexpected Element {0} encountered, expecting one of {1} {2} {3}
+unexpected_element4=Unexpected Element {0} encountered, expecting one of {1} {2} {3} {4}
+unexpected_element5=Unexpected Element {0} encountered, expecting one of {1} {2} {3} {4}
{5}
+unexpected_element6=Unexpected Element {0} encountered, expecting one of {1} {2} {3} {4}
{5} {6}
+unexpected_element7=Unexpected Element {0} encountered, expecting one of {1} {2} {3} {4}
{5} {6} {7}
\ No newline at end of file
Modified: trunk/admin/src/test/resources/parser-test-vdb.xml
===================================================================
--- trunk/admin/src/test/resources/parser-test-vdb.xml 2012-01-20 19:38:25 UTC (rev 3804)
+++ trunk/admin/src/test/resources/parser-test-vdb.xml 2012-01-20 21:33:25 UTC (rev 3805)
@@ -26,6 +26,10 @@
<resource-name>myTable.T2</resource-name>
<allow-read>false</allow-read>
<allow-delete>true</allow-delete>
+ <allow-alter>true</allow-alter>
+ <allow-create>true</allow-create>
+ <allow-update>true</allow-update>
+ <allow-execute>true</allow-execute>
</permission>
<mapped-role-name>ROLE1</mapped-role-name>
<mapped-role-name>ROLE2</mapped-role-name>