1 2 3 Previous Next 42 Replies Latest reply on Mar 23, 2005 5:28 AM by aloubyansky Go to original post
      • 30. Re: Kernel XML format
        bill.burke

        Is there anything yet for describing metadata (no property configuration). The way we do it in JBoss AOP right now is two different ways. One untyped, the other typed (annotated) metadata

        http://docs.jboss.org/aop/1.1/aspect-framework/reference/en/html/xml.html#xml-metadata

        http://docs.jboss.org/aop/1.1/aspect-framework/reference/en/html/xml.html#xml-annotation-introduction

        Thoughts?

        • 31. Re: Kernel XML format
          bill.burke

          Shit, ...catching up...I guess all the jaxb stuff is for providing any metadata format you want...

          I've said this before, but I think its important to try to be consistent on how XML/MetaObjects/Annotations all relate to one another. I've tried successfully to keep annotations and the metaobjects to be the same. (XML creates concrete implementations of the annotation).

          I also think this model is viable because it gives the user an easy to remember mapping from XML to annotation and back so that they can easily mix and match this stuff.

          • 32. Re: Kernel XML format
            aloubyansky

             

            "scott.stark@jboss.org" wrote:
            That is what I am going to try prototyping in the jbossxb testcases. I think it will have to be under a different namespace in order for jbossxb to know what to do with it:

            <deployment>
             <Import name = "org.jboss.test.kernel.xml.support.SimpleBeanImpl">SimpleBean</Import>
            
             <x:SimpleBean>
             <Other ref = "bean2"/>
             </x:SimpleBean>
            
             <x:SimpleBean name="bean2">
             <Constructor type = "String">Bean2</Constructor>
             </x:SimpleBean>
            
            </deployment>
            


            but this can actually make the document clearer.


            Whatever namespace it is under, the binding metadata will describe what should be done with the data. Just feed it a valid XML content and metadata.

            • 33. Re: Kernel XML format
              aloubyansky

               

              "scott.stark@jboss.org" wrote:
              Ok, so what I would like to see is that Adrian, myself and others provide as freakishly complex as needed xml documents and the associated object model as content that goes into the xml binding testsuite. We need to evolve the associated schema and if necessary, external binding metadata to the point that the xml to java binding is being completely driven by configuration outside of the micro-container.
              ...
              Additional binding metadata through schema annotations or an external jbossxb is fine to move beyond the jaxb compatible model.
              ....
              I'm working on an xsd schema for the current pojo server xml deployer object model as a starting point. I'll update the JBXB-5 environment with the testsuite resource location for the location of this when done, and any associated external schemas and document instances should be placed there as well.


              Excellent. Let's go.

              • 34. Re: Kernel XML format

                 

                "bill.burke@jboss.com" wrote:
                Is there anything yet for describing metadata (no property configuration). The way we do it in JBoss AOP right now is two different ways. One untyped, the other typed (annotated) metadata

                http://docs.jboss.org/aop/1.1/aspect-framework/reference/en/html/xml.html#xml-metadata

                http://docs.jboss.org/aop/1.1/aspect-framework/reference/en/html/xml.html#xml-annotation-introduction

                Thoughts?


                This should just be the same as it is now (in terms of implementation).
                The only difference is to expose the construction to depdendencies, e.g.
                classloading dependencies to wait for the annotation classes to be deployed.

                • 35. Re: Kernel XML format

                   

                  "alex.loubyansky@jboss.com" wrote:
                  "adrian@jboss.org" wrote:
                  Another issue that jumps out is how to reverse the process.
                  e.g. Given an MC metadata config how do we identify the marshalling
                  of these javabeans back into an xml file?


                  With marshalling metadata.


                  Yes, but where do I store this? I have a metadata object model that maps
                  to a well defined schema, but there is also a requirement to have an
                  "ANY object" injected into my metadata model as an Object reference.

                  This is fine XML -> Objects because the schema references are in the XML.

                  But Objects->XML how do I/you know the relevent schema? There could be any
                  number of schemas that could have constructed the Object I reference.

                  • 36. Re: Kernel XML format

                     

                    "scott.stark@jboss.org" wrote:


                    The following issue can aggregate the tasks needed to do this:
                    http://jira.jboss.com/jira/browse/JBXB-5


                    I've updated the examples to include some of the extra features.
                    I assume we are now waiting for the ability to "define the mapping in the schema"
                    that will reproduce the commented out code in the test?

                    • 37. Re: Kernel XML format
                      starksm64

                      Yes, the next step is for Alexey to show how we get started with a binding driven by the xsd. I am working on another example that combines the deployer xsd + 2 xsds for ejb cache and pool extension points where the metadata is coming from the foreign schemas.

                      • 38. Re: Kernel XML format
                        aloubyansky

                         

                        "adrian@jboss.org" wrote:
                        "alex.loubyansky@jboss.com" wrote:
                        "adrian@jboss.org" wrote:
                        Another issue that jumps out is how to reverse the process.
                        e.g. Given an MC metadata config how do we identify the marshalling
                        of these javabeans back into an xml file?


                        With marshalling metadata.


                        Yes, but where do I store this? I have a metadata object model that maps
                        to a well defined schema, but there is also a requirement to have an
                        "ANY object" injected into my metadata model as an Object reference.

                        This is fine XML -> Objects because the schema references are in the XML.

                        But Objects->XML how do I/you know the relevent schema? There could be any
                        number of schemas that could have constructed the Object I reference.


                        There should be (un)marshalling metadata for each possible value of ANY type.
                        Before marshalling, this metadata should be added to object graph's marshalling metadata. Or we could have a metadata library where we could store metadata for types we know/expect.

                        If ANY value is not recognized (metadata is not provided/found in the library or otherwise not availble), we could apply default marshalling rules (default metadata) and still marshal the value. The resulting document still can be valid.
                        Validation rules for ANY can be found here http://www.zvon.org/xxl/xmlSchema2001Reference/Standard//xmlschema-1.html#Wildcard_details

                        • 39. Re: Kernel XML format
                          aloubyansky

                          Also, default marshalling and unmarshalling binding rules/metadata are supposed to be in-sync, i.e. if something was marshalled with default rules, it should be possible to unmarshal that thing back using default unmarshalling rules and vice versa.

                          • 40. Re: Kernel XML format
                            aloubyansky

                            So, actually, the defaults define serialization.

                            • 41. Re: Kernel XML format

                              You are missing my point.

                              You have something like

                              <known-schema:value><random-schema1:x/></known-schema:value>
                              <known-schema:value><random-schema2:x/></known-schema:value>
                              


                              Now known-schema:value can take any object from the ANY that is constructed
                              from the one of the random-schemas.

                              known-schema:value maps to
                              public class MyValue
                              {
                               public Object getValue();
                               public void setValue(Object value);
                              }
                              


                              We then tell it to marshall MyValue back to XML, we know this should be
                              done with known-schema, but what happens when it hits getValue()?
                              How does it know which of the random-schemas to use?
                              The information has been lost after the xml is parsed.

                              My solution was to have something like:
                              public class XMLMyValue extends MyValue implements XMLAnyTarget
                              {
                               public String getAnySchema();
                               public void setAnySchema(String schema);
                              }
                              


                              where setAnySchema was invoked during the unmarshalling
                              and getAnySchema can be used when we want to remarshall.

                              • 42. Re: Kernel XML format
                                aloubyansky

                                This looks like what XMLBeans do, i.e. the object model contains data and XML binding info.

                                I thought about looking at the value type, i.e. its package and class name. And based on that information choose a schema to marshal the value with. Of course, it implies that there is at least many-to-one (for marshalling) association between the value type and the schema. Is this approach acceptable?

                                1 2 3 Previous Next