-
1. Re: getting access to arbitrary content
starksm64 Aug 25, 2005 4:40 PM (in response to bill.burke)So what is the java object representation for the ANY content in the metamodel? JBossXB supports binding ANY content to an object specified by another schema from a seperate namespace. The xml login module has an options java.util.Map there the map key element is part of its security-config_4_1.xsd schema while the value element is arbitrary. Here is a fragment where the userInfo module option is an object represented by an xml fragment conforming to a foreign user-roles_1_0.xsd schema, along with a simple unauthenticatedIdentity option which is just a string:
<jaas:login-module code="org.jboss.security.auth.spi.XMLLoginModule" flag="required"> <jaas:module-option name="userInfo"> <ur:users xsi:schemaLocation="urn:jboss:user-roles user-roles_1_0.xsd" xmlns:ur="urn:jboss:user-roles"> <ur:user name="jduke" password="theduke"> <ur:role name="Role1"/> <ur:role name="Role2"/> <ur:role name="Echo"/> <ur:role name="callerJduke" group="CallerPrincipal"/> </ur:user> </ur:users> </jaas:module-option> <jaas:module-option name="unauthenticatedIdentity">guest</jaas:module-option> </jaas:login-module>
-
2. Re: getting access to arbitrary content
bill.burke Aug 25, 2005 5:14 PM (in response to bill.burke)so, I have to use the
<jbxb:class>
element? I'm using raw SchemaBinding stuff with TypeBindings and all that junk. I'm not using an ObjectModelFactory.
I'm not even sure what the <jbxb:class> does. Does it even work for non-ObjectModelFactory? (SchemaBinding).
thanks -
3. Re: getting access to arbitrary content
starksm64 Aug 25, 2005 5:22 PM (in response to bill.burke)If your building the SchemaBinding directly, you essentially are not using the xsd annotations. Your just using an alternate java centric parsing configuration that ultimately drive an ObjectModelFactory that Alexey wrote. The problem with this is that you are not allowing users to control the type of the objects that show up in the schema wildcard extension points (ANY content locations). I guess it could be made to work if you detected when ANY content element was from a new namespace, but this would seem to be duplicating the work Alexey has already done.
Why aren't you defining the SchemaBinding from the aop document schema annotations? -
4. Re: getting access to arbitrary content
bill.burke Aug 25, 2005 5:26 PM (in response to bill.burke)ALso, the any type I am creating is in the same namespace. it is just arbitrary XML that is not bound to any real object, but rather generic objects are created from it.
In other words, I just want to browse, generically, the elements under the method element. I want to look at the element name and the simplecontent of that element, genericall through a generic API (like I would with Xerces) -
5. Re: getting access to arbitrary content
starksm64 Aug 25, 2005 5:33 PM (in response to bill.burke)So why isn't that some type of named collection. Propagating xml into the metamodel is just does not make sense. If its truly an extension point I should be able to define the type I want introduced into the metamodel using another schema. I don't know that jbossxb currently has support for mapping an ANY from the current namespace to one thing vs an ANY from another namespace. Alexey would have to comment on that.
-
6. Re: getting access to arbitrary content
bill.burke Aug 25, 2005 5:36 PM (in response to bill.burke)"scott.stark@jboss.org" wrote:
If your building the SchemaBinding directly, you essentially are not using the xsd annotations. Your just using an alternate java centric parsing configuration that ultimately drive an ObjectModelFactory that Alexey wrote. The problem with this is that you are not allowing users to control the type of the objects that show up in the schema wildcard extension points (ANY content locations). I guess it could be made to work if you detected when ANY content element was from a new namespace, but this would seem to be duplicating the work Alexey has already done.
I need to be backward compatible with my old stuff and my old stuff uses xerces to create generic data holders from xerces Elements. I can't remove this backward compatibility
Why aren't you defining the SchemaBinding from the aop document schema annotations? -
7. Re: getting access to arbitrary content
bill.burke Aug 25, 2005 5:38 PM (in response to bill.burke)Plus, how do I hook in Adrian's schema binding?
-
8. Re: getting access to arbitrary content
bill.burke Aug 25, 2005 5:39 PM (in response to bill.burke)what I mean is, Adrian is using a raw SchemaBinding, if I go th ObjectModelFactory approach, how do I hook in processing for his stuff?
-
9. Re: getting access to arbitrary content
bill.burke Aug 25, 2005 5:48 PM (in response to bill.burke)ObjectModelFactories seem like it would support what I want to do, but, how would I hook in another schema binding like Adrian's.
Basically, what I should be able to do is not use JBoss XB features if I don't want to and just process raw elements. -
10. Re: getting access to arbitrary content
starksm64 Aug 25, 2005 6:07 PM (in response to bill.burke)First, Adrian has moved away from the explicit SchemaBinding usage as far as I know so you need to synch up to ensure you are on the same page.
Let's get a simple testcase for the type of parsing you need. It sounds like what is needed is the ability to map an ANY in the aop document namespace to the dom element for the content, while a foreign namespace triggers the parsing based on the associated schema annotations.
ObjectModelFactories seem like it would support what I want to do, but, how would I hook in another schema binding like Adrian's.
I don't think the mapping of namespace to ObjectModelFactory is exposed to the ObjectModelFactory api. I want to see a testcase that demonstrates support of your legacy (although evil) dom usage in addition to allowing for user defined objects to be introduced into the metamodel. You, me and Adrian need to agree on the testcase. What is the configuration hiearchy here?
MC
+ AOP
+ User Defined -
11. Re: getting access to arbitrary content
adrian.brock Aug 25, 2005 6:30 PM (in response to bill.burke)"scott.stark@jboss.org" wrote:
First, Adrian has moved away from the explicit SchemaBinding usage as far as I know
Not yet, but I will be changing over to the schema annotation approach.
i.e. schema.xsd defines xml -> object bindings
this coupled with the ANY processing should allow us to mix and match
and also define new bindings "on the fly". -
12. Re: getting access to arbitrary content
bill.burke Aug 25, 2005 6:40 PM (in response to bill.burke)"adrian@jboss.org" wrote:
"scott.stark@jboss.org" wrote:
First, Adrian has moved away from the explicit SchemaBinding usage as far as I know
Not yet, but I will be changing over to the schema annotation approach.
i.e. schema.xsd defines xml -> object bindings
this coupled with the ANY processing should allow us to mix and match
and also define new bindings "on the fly".
I'm getting seriously annoyed here...as it seems the week+ work I have done learning and partially implement AOP parsing using the SchemaBinding approach needs to be trashed and I have to wait until Adrian finishes his ObjectModelFactory version before I can complete the AOP/MC XML stuff (and actually make it usable so I can use it in stuff like Embeddable EJB3). yet again, I am waiting on somebody and there's a good chance I'll get involved into something else and won't be able to work on this shit for yet another few months...
Then again, I could just write the XML stuff for Microcontainer myself, which would annoy me too, but hey, at least i'd be moving in some forward direction. -
13. Re: getting access to arbitrary content
bill.burke Aug 25, 2005 6:42 PM (in response to bill.burke)Also, I think the schema.xsd approach sucks because you are coupling your object model to the schema. If you refactor your model, you have to push out another version of the schema.
-
14. Re: getting access to arbitrary content
adrian.brock Aug 25, 2005 7:16 PM (in response to bill.burke)This was discussed and agreed back in March:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=61570&postdays=0&postorder=asc&start=20
The change makes no difference to end users and allows greater flexibilty
in our own parsing without having to know the details or worry about backwards/forwards
compatibility.
Alex has already prototyped, I believe?