configurationengine/source/plugins/example/ConeExamplePlugin/examplemlplugin/exampleml_reader.py
changeset 3 e7e0ae78773e
parent 0 2e8eeb919028
--- a/configurationengine/source/plugins/example/ConeExamplePlugin/examplemlplugin/exampleml_reader.py	Fri Mar 12 08:30:17 2010 +0200
+++ b/configurationengine/source/plugins/example/ConeExamplePlugin/examplemlplugin/exampleml_reader.py	Tue Aug 10 14:29:28 2010 +0300
@@ -14,12 +14,16 @@
 # Description:
 #
 
-from cone.public import exceptions, plugin
+import pkg_resources
+from cone.public import exceptions, plugin, utils
 import exampleml_impl
 import exampleml_model
 
 class ExamplemlReader(plugin.ReaderBase):
     NAMESPACE = 'http://www.example.org/xml/exampleml/1'
+    NAMESPACE_ID = 'exampleml'
+    ROOT_ELEMENT_NAME = 'exampleml'
+    SCHEMA_PROBLEM_SUB_ID = 'exampleml'
     FILE_EXTENSIONS = ['exampleml']
     
     @classmethod
@@ -28,6 +32,10 @@
         outputs = reader._read_outputs(etree)
         return exampleml_impl.ExamplemlImpl(resource_ref, configuration, outputs)
     
+    @classmethod
+    def get_schema_data(cls):
+        return pkg_resources.resource_string('examplemlplugin', 'xsd/exampleml.xsd')
+    
     def _read_outputs(self, elem):
         """
         Read output objects from the given XML element.
@@ -46,4 +54,5 @@
             raise exceptions.ParseError("Element <output> does not have the mandatory 'file' attribute")
         return exampleml_model.Output(file     = file,
                                       encoding = elem.get('encoding', 'UTF-8'),
-                                      text     = elem.text or '')
\ No newline at end of file
+                                      text     = elem.text or '',
+                                      lineno   = utils.etree.get_lineno(elem))