Re: generated faults java names

2006-03-28 Thread pat
Hi Lawrence,

big thanks for your explanation, it helped.

Once again thanks.

Pat

Lawrence Jones wrote:
> Hi Pat
> 
> Hmmm. Let me describe it a bit and we can go from there.
> 
> First of all XmlBeans is not a WSDL-based tool. It is a schema-based
> tool. Since a WSDL can contain a schema in its  section there is
> extra code in XmlBeans such that you can pass in a WSDL document to
> scomp (or the ant task). XmlBeans will then extract any 
> elements from the  section and will then simply generate types
> based on those schema(s). But it does no further analysis of the WSDL
> and specifically takes no action based on anything outside of the
>  section.
> 
> So when we are looking at your example below all that matters is the
> schema part - the  etc have no effect.
> 
> Your schema defines a complex type with name "Exception" and
> targetNamespace "http://exc.pat";. I presume that somewhere else in your
> schema (not included below) there is an element called "Exception" which
> references that type?
> 
> In that circumstance XmlBeans generates an ExceptionDocument interface
> (and underlying impl) to represent the element and an Exception
> interface (and underlying impl) to represent the complex type. This is
> the normal default behavior.
> 
> You can override the names of the generated classes to be whatever you
> want (with the obvious exception that the generated interface for the
> element and the generated interface for the complex type must have
> different names) using a .xsdconfig file as discussed on a different
> thread -
> http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200603.mbox/%3c99
> [EMAIL PROTECTED] 
> 
> When you actually have XML flowing around what you have is elements (not
> complex types). Elements have a name, complex types are like the
> template for everything that an element can have/contain but without the
> element name (of course they can have a complex type name but that
> doesn't appear in the XML instance document). So you really want to be,
> e.g., parsing incoming XML using the element class, not the complex type
> class and that's the class you should map your exception to.
> 
> But lastly, assuming the above doesn't help you, you have only looked at
> the STS.documentTypes() method. This returns all the SchemaType objects
> for elements which can represent a document (ie it returns the same as
> STS.globalElements() except as SchemaType's instead of
> SchemaGlobalElement's). If instead you really do want the global types
> then I would call STS.globalTypes() instead.
> 
> Cheers,
> 
> Lawrence
> 
> 
>>-Original Message-
>>From: pat [mailto:[EMAIL PROTECTED]
>>Sent: Sunday, March 26, 2006 8:52 AM
>>To: user@xmlbeans.apache.org
>>Subject: generated faults java names
>>
>>Hi all,
>>
>>I'm trying to find out the place where the WSDL fault names are
>>converted to Java names (and the classes arround it).
>>
>>In company we want to use AXIS2 and XMLBeans. So, we have a WSDL and
> 
> we
> 
>>are able generate stub and beans, but there's a request to "hack" stub
>>generator to generate stub methods with faults as exceptions not as
> 
> xml
> 
>>beans.
>>
>>I've played with it a bit and found way to "hack" AXIS2 stub generator
>>to do that, but there's "missing" the support from the XMLBeans side.
>>
>>The fault type definition is something like this:
>>http://exc.pat";
>>elementFormDefault="qualified" attributeFormDefault="qualified">
>>
>>
>>
>>---the original package is pat.exc
>>
>>The method definition is:
>>
>> 
> name="methodStringRequest"/>
> 
>>>name="methodStringResponse"/>
>>
>>
>>
>>When I run XMLBeans generator the final package structure generated
> 
> is:
> 
>>pat.exc.Exception - an interface
>>pat.exc.impl.ExceptionImpl - the interface implementation
>>pattest.ExceptionDocument - an interface
>>pattest.impl.ExceptionDocumentImpl - the interface implementation
>>
>>This is still acceptable. The pronlem starts in the SchemaTypeSystem,
>>because in the STS the bundle between QName({http://pattest}Exception)
>>and the real Java name contains only information about
>>pattest.ExceptionDocument, but I need to push the STS to return
>>pat.exc.Exception for the QName({http://pattest}Exception). Where is
> 
> the
> 
>>place to "hack" the STS - I've dabug a lot, but without luck :-\
>>
>>I'm using methods STS.documentTypes().getDocumentElementName() and
>>STS.documentTypes().getFullJavaName() for getting QName and Java name
>>
>>Can someone help me ???
>>
>>Thanks to all.
>>
>>  Pat
>>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Announce] Stylus Studio 2006 Release 2 Now Available

2006-03-28 Thread Stylus Studio
[announce] Hey Everyone,

Release 2 of Stylus Studio 2006 has just been released.  The following
are some of the highlights of Stylus Studio 2006 Release 2 XML
Enterprise Edition:

* Enhanced EDI Support: Stylus Studio's EDI-to-XML and XML-to-EDI
tools now support hundreds of  message and transaction set types of
EDIFACT and X12 - across dozens of versions - allowing EDI to be used
as easily as XML as input to XSLT and XQuery programs. And those same
programs can write output through the adapter, generating EDI
transparently and automatically.  Stylus Studio supports the newest
release of X12, 5030, keeping the tradition of providing comprehensive
support of available versions of X12. Preliminary versions of EDIFACT
are also supported.  Stylus Studio can now automatically convert to
and from EDIFACT versions from the prototype 88-1 to the present D05A
version.  The International Air Transport Association dialect of EDI,
IATA PADIS, an EDI standard for air transportation, is also supported.
Learn more at: http://www.stylusstudio.com/edi/

* Convert IATA to XML Schema: A new Document Wizard allows you to
convert an IATA documents to XML Schema, simplifying the verification
of IATA files converted to XML.

* Invoke Web Services from XQuery: Use the Stylus Studio Web Service
Call Composer to design and test any Web service invocation, then
generate the XQuery code needed to invoke the same SOAP request
directly in your XQuery application - Learn more at:
http://www.stylusstudio.com/xquery.html

* Integration with xqDoc: Generate user-friendly documentation of your
XQuery libraries and modules for reference purposes - learn more at:
http://www.stylusstudio.com/xquery/xqdoc.html

* Support for Saxon 8.7 XSLT and XQuery Processor: Updated support for
developing applications using the Saxon schema-aware XQuery and XSLT
processor - learn more at:
http://www.stylusstudio.com/saxon_xquery_processor.html

* Support for WSDL to Java Bindings: Integrated support for Apache
Axis Java code generation directly within the Stylus Studio Web
Service Call Composer - learn more at:
http://www.stylusstudio.com/web_services.html

* XML Adapter API Enhancements: Seamless access to relational
databases, EDI, flat files, and other legacy data from your XSLT
stylesheets or XQuery expressions can be done using Stylus Studio's
Java adapter components that are now easier to embed and offer even
faster streaming data performance - learn more at:
http://www.stylusstudio.com/deployment/

You can download Stylus Studio(r) 2006 Release 2 today here:
http://www.stylusstudio.com/xml_download.html

Sincerely,
The Stylus Studio Team
http://www.stylusstudio.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



alternate representations of collections in XMLBeans??

2006-03-28 Thread Tim Parker



The XMLBeans 
representation of a collection (for something with a maxOccurs GT 1) is a bit 
limiting... I'm looking to extend it to look more like a Map interface... and 
I'm hitting some brick walls...
 
For discussion sake, 
I'll use a structure with three fields:
 
struct 
foo
{
    
int ID;
    
String name;
    
HashMap metadata;
}
 
The 'metadata' field 
contains arbitrary name/value pairs - for simplicity we'll say 'name' and 
'value' fields in the hashmap are always strings...
 
The obvious (to me, 
at least) schema for this is something like:
 
   
 
 
 

  

    

    

    

  




 
I could build 
another layer on top of this, but this could get ugly - What I really 
need is a way to extend NVPCollection so I can address items by name (like in a 
HashMap) rather than by position...  
 
The ideal would be 
something like (assuming that we have a mechanism to bind the 'name' field to 
the map key and the 'value' field to be the one of 
interest)...
 
NVPCollection 
thisCollection;
 
// some magic here 
to get the collection populated...
 
someValue = 
thisCollection.GetByMap("someArbitraryName");
 
 Or we could 
save some binding complexity by doing ...GetByMap("someArbitraryName","value"), 
saying "get the field 'value' from the collection member whose key 
field contains 'someArbitraryName'" (The presumption is that the binding to 
the key field 'name' would need to be established earlier so the map can be 
maintained)
 

 
As I read the 
documentation, I could build an extension like this, but I'm hosed if I want to 
do anything more sophisticated than a linear search through the collection on 
each 'get' call - Unless I'm missing something, I need a place to put an 
instance-specific HashMap object to maintain mapping between the key field 
('name') and the array index... more than a little difficult with the 'static 
method' requirement for the extension  (Not to mention the population 
problem for the HashMap object itself, but a preSet or postSet implementation 
would work as long as I never try to delete anything)..
 
Presumably I could 
also build an 'extendedNVPCollection' class, based on the NVPCollection class 
generated by XMLBeans, but how would I wire that back into my 
(XMLBeans-generated) 'testCase' class?  I don't want to get into creating 
wrapper classes for every layer...
 
I tried ignoring 
the "don't touch - generated code" warnings and added some stuff 
directly to the generated classes for the NVPCollection object, but things 
started breaking - I'm not sure if the problem is a flaw in my hacking or a 
fundamental problem I won't solve, so I'm seeking advice - am I tilting at 
windmills here?
 
Does anyone have ideas as to 
better ways to do this?
=== 
Tim Parker Senior 
Developer PaperThin, Inc. 617-471-4440 x 203 [EMAIL PROTECTED] www.paperthin.com 
=== 
PaperThin, Inc. was recently named to KMWorld’s “100 
Companies that Matter in Knowledge Management”. 
Find out more at www.paperthin.com.
 


RE: alternate representations of collections in XMLBeans??

2006-03-28 Thread Cezar Andrei








Tim,

 

I would recommend using the extensions,
otherwise modifying the generated code is definitely possible but missing even
a small thing would break the code.

 

Back to using extensions, if one wants to
store a state he can do it by using XmlBookmark – which stays with the
xml entity even if moved. In your case the hash map should be stored on ‘metadata’
element.

Also the pre/post Set methods are called
every time the document is about to change, so you’ll get calls for all creation/modification/deletion
events, made through XmlObject interfaces. Modification through other interfaces
like XmlCursor or DOM will not trigger the calls to the pre/post Set methods.

 

Cezar

 











From: Tim Parker
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 28, 2006 1:11
PM
To: user@xmlbeans.apache.org
Subject: alternate representations
of collections in XMLBeans??



 



The XMLBeans representation of a collection (for something
with a maxOccurs GT 1) is a bit limiting... I'm looking to extend it to look
more like a Map interface... and I'm hitting some brick walls...





 





For discussion sake, I'll use a structure with three fields:





 





struct foo





{





    int ID;





    String name;





    HashMap metadata;





}





 





The 'metadata' field contains arbitrary name/value pairs -
for simplicity we'll say 'name' and 'value' fields in the hashmap are always
strings...





 





The obvious (to me, at least) schema for this is
something like:





 





 
  
   
  
  
 





 





 
  
   
  
 





 











  





    





    





    





  











 











 





I could build another layer on top of this, but this
could get ugly - What I really need is a way to extend NVPCollection so I
can address items by name (like in a HashMap) rather than by position...  





 





The ideal would be something like (assuming that we have a
mechanism to bind the 'name' field to the map key and the 'value' field to be
the one of interest)...





 





NVPCollection thisCollection;





 





// some magic here to get the collection populated...





 





someValue =
thisCollection.GetByMap("someArbitraryName");





 





 Or we could save some binding complexity by doing
...GetByMap("someArbitraryName","value"), saying "get
the field 'value' from the collection member whose key field contains
'someArbitraryName'" (The presumption is that the binding to the key field
'name' would need to be established earlier so the map can be maintained)





 











 





As I read the documentation, I could build an extension like
this, but I'm hosed if I want to do anything more sophisticated than a linear
search through the collection on each 'get' call - Unless I'm missing
something, I need a place to put an instance-specific HashMap object to
maintain mapping between the key field ('name') and the array index... more
than a little difficult with the 'static method' requirement for the
extension  (Not to mention the population problem for the HashMap object
itself, but a preSet or postSet implementation would work as long as I never
try to delete anything)..





 





Presumably I could also build an 'extendedNVPCollection'
class, based on the NVPCollection class generated by XMLBeans, but how would I
wire that back into my (XMLBeans-generated) 'testCase' class?  I don't
want to get into creating wrapper classes for every layer...





 





I tried ignoring the "don't touch - generated
code" warnings and added some stuff directly to the generated classes
for the NVPCollection object, but things started breaking - I'm not sure
if the problem is a flaw in my hacking or a fundamental problem I won't solve,
so I'm seeking advice - am I tilting at windmills here?





 





Does anyone have ideas as to better ways to do this?



===


Tim
Parker 
Senior
Developer 
PaperThin,
Inc. 
617-471-4440
x 203 
[EMAIL PROTECTED]

www.paperthin.com


===


PaperThin,
Inc. was recently named to KMWorld’s “100 Companies that Matter in
Knowledge Management”. 

Find out
more at www.paperthin.com.



 










___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.


RE: alternate representations of collections in XMLBeans??

2006-03-28 Thread Tim Parker



Thank you for the quick reply - I'll look into the 
XMLBookmark idea...
 
Is there anything else I need to know about the preSet and 
postSet methods?  I found documentation (including the operationType 
values) at http://dev2dev.bea.com/pub/a/2004/11/Configuring_XMLBeans.html - 
is this the latest-and-greatest, or is there a better and/or more current 
reference available?
 
Tim


From: Cezar Andrei [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 28, 2006 2:29 PMTo: 
user@xmlbeans.apache.orgSubject: RE: alternate representations of 
collections in XMLBeans??


Tim,
 
I would recommend using 
the extensions, otherwise modifying the generated code is definitely possible 
but missing even a small thing would break the 
code.
 
Back to using 
extensions, if one wants to store a state he can do it by using XmlBookmark – 
which stays with the xml entity even if moved. In your case the hash map should 
be stored on ‘metadata’ element.
Also the pre/post Set 
methods are called every time the document is about to change, so you’ll get 
calls for all creation/modification/deletion events, made through XmlObject 
interfaces. Modification through other interfaces like XmlCursor or DOM will not 
trigger the calls to the pre/post Set methods.
 
Cezar
 





From: Tim 
Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 1:11 
PMTo: 
user@xmlbeans.apache.orgSubject: alternate representations of 
collections in XMLBeans??
 

The XMLBeans representation of a 
collection (for something with a maxOccurs GT 1) is a bit limiting... I'm 
looking to extend it to look more like a Map interface... and I'm hitting some 
brick walls...

 

For discussion sake, I'll use a 
structure with three fields:

 

struct 
foo

{

    int 
ID;

    String 
name;

    HashMap 
metadata;

}

 

The 'metadata' field contains 
arbitrary name/value pairs - for simplicity we'll say 'name' and 'value' fields 
in the hashmap are always strings...

 

The obvious (to me, at 
least) schema for this is something 
like:

 

   

 

 

 



  


    

    

    

  




 



 

I could build another layer on top 
of this, but this could get ugly - What I really need is a way to 
extend NVPCollection so I can address items by name (like in a HashMap) rather 
than by position...  

 

The ideal would be something like 
(assuming that we have a mechanism to bind the 'name' field to the map key and 
the 'value' field to be the one of 
interest)...

 

NVPCollection 
thisCollection;

 

// some magic here to get the 
collection populated...

 

someValue = 
thisCollection.GetByMap("someArbitraryName");

 

 Or we could save some binding 
complexity by doing ...GetByMap("someArbitraryName","value"), saying "get the 
field 'value' from the collection member whose key field contains 
'someArbitraryName'" (The presumption is that the binding to the key field 
'name' would need to be established earlier so the map can be 
maintained)

 



 

As I read the documentation, I could 
build an extension like this, but I'm hosed if I want to do anything more 
sophisticated than a linear search through the collection on each 'get' call - 
Unless I'm missing something, I need a place to put an instance-specific HashMap 
object to maintain mapping between the key field ('name') and the array index... 
more than a little difficult with the 'static method' requirement for the 
extension  (Not to mention the population problem for the HashMap object 
itself, but a preSet or postSet implementation would work as long as I never try 
to delete anything)..

 

Presumably I could also build an 
'extendedNVPCollection' class, based on the NVPCollection class generated by 
XMLBeans, but how would I wire that back into my (XMLBeans-generated) 'testCase' 
class?  I don't want to get into creating wrapper classes for every 
layer...

 

I tried ignoring the "don't 
touch - generated code" warnings and added some stuff directly to the 
generated classes for the NVPCollection object, but things started 
breaking - I'm not sure if the problem is a flaw in my hacking or a 
fundamental problem I won't solve, so I'm seeking advice - am I tilting at 
windmills here?

 

Does anyone have ideas as to better 
ways to do this?
=== 

Tim 
Parker Senior Developer 
PaperThin, Inc. 
617-471-4440 x 203 
[EMAIL PROTECTED] 
www.paperthin.com 

=== 

PaperThin, Inc. was recently named 
to KMWorld’s “100 Companies that Matter in Knowledge Management”. 

Find out more at www.paperthin.com.

 ___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the int

RE: alternate representations of collections in XMLBeans??

2006-03-28 Thread Cezar Andrei








That is a good article to read, also check
out the tests under test\cases\xbean\extensions.

 

Cezar

 











From: Tim Parker
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 28, 2006 3:08
PM
To: user@xmlbeans.apache.org
Subject: RE: alternate
representations of collections in XMLBeans??



 

Thank you for the quick reply - I'll look
into the XMLBookmark idea...

 

Is there anything else I need to know
about the preSet and postSet methods?  I found documentation (including
the operationType values) at http://dev2dev.bea.com/pub/a/2004/11/Configuring_XMLBeans.html -
is this the latest-and-greatest, or is there a better and/or more current
reference available?

 

Tim

 







From: Cezar
Andrei [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 28, 2006 2:29
PM
To: user@xmlbeans.apache.org
Subject: RE: alternate
representations of collections in XMLBeans??

Tim,

 

I would recommend using the extensions,
otherwise modifying the generated code is definitely possible but missing even
a small thing would break the code.

 

Back to using extensions, if one wants to
store a state he can do it by using XmlBookmark – which stays with the
xml entity even if moved. In your case the hash map should be stored on
‘metadata’ element.

Also the pre/post Set methods are called
every time the document is about to change, so you’ll get calls for all
creation/modification/deletion events, made through XmlObject interfaces.
Modification through other interfaces like XmlCursor or DOM will not trigger
the calls to the pre/post Set methods.

 

Cezar

 











From: Tim Parker
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 28, 2006 1:11
PM
To: user@xmlbeans.apache.org
Subject: alternate representations
of collections in XMLBeans??



 



The XMLBeans representation of a collection (for something
with a maxOccurs GT 1) is a bit limiting... I'm looking to extend it to look
more like a Map interface... and I'm hitting some brick walls...





 





For discussion sake, I'll use a structure with three fields:





 





struct foo





{





    int ID;





    String name;





    HashMap metadata;





}





 





The 'metadata' field contains arbitrary name/value pairs -
for simplicity we'll say 'name' and 'value' fields in the hashmap are always
strings...





 





The obvious (to me, at least) schema for this is
something like:





 





 
  
   
  
  
 





 





 
  
   
  
 





 











  





    





    





    





  











 











 





I could build another layer on top of this, but this
could get ugly - What I really need is a way to extend NVPCollection so I
can address items by name (like in a HashMap) rather than by position...  





 





The ideal would be something like (assuming that we have a
mechanism to bind the 'name' field to the map key and the 'value' field to be
the one of interest)...





 





NVPCollection thisCollection;





 





// some magic here to get the collection populated...





 





someValue =
thisCollection.GetByMap("someArbitraryName");





 





 Or we could save some binding complexity by doing
...GetByMap("someArbitraryName","value"), saying "get
the field 'value' from the collection member whose key field contains
'someArbitraryName'" (The presumption is that the binding to the key field
'name' would need to be established earlier so the map can be maintained)





 











 





As I read the documentation, I could build an extension like
this, but I'm hosed if I want to do anything more sophisticated than a linear
search through the collection on each 'get' call - Unless I'm missing
something, I need a place to put an instance-specific HashMap object to
maintain mapping between the key field ('name') and the array index... more
than a little difficult with the 'static method' requirement for the extension 
(Not to mention the population problem for the HashMap object itself, but a
preSet or postSet implementation would work as long as I never try to delete
anything)..





 





Presumably I could also build an 'extendedNVPCollection'
class, based on the NVPCollection class generated by XMLBeans, but how would I
wire that back into my (XMLBeans-generated) 'testCase' class?  I don't
want to get into creating wrapper classes for every layer...





 





I tried ignoring the "don't touch - generated
code" warnings and added some stuff directly to the generated classes
for the NVPCollection object, but things started breaking - I'm not sure
if the problem is a flaw in my hacking or a fundamental problem I won't solve,
so I'm seeking advice - am I tilting at windmills here?





 





Does anyone have ideas as to better ways to do this?



===


Tim
Parker 
Senior
Developer 
PaperThin,
Inc. 
617-471-4440
x 203 
[EMAIL PROTECTED]

www.paperthin.com


===


PaperThin,
Inc. was recently named to KMWorld’s “100 Companies that Matter i

XMLBookmark question...

2006-03-28 Thread Tim Parker



As a follow-on to the HashMap implementation 
questions...  I feel like I may be missing something but... I'm looking at 
creating an extension method for my NVPCollection class something 
like:
 
public String getValueByMap(String 
keyName)
 
If I hang the hashmap on a bookmark, how do I get the 
bookmark without having to do a newCursor() every time?  Or is it OK to run 
newCursor() dozens or hundreds of times without risk of performance or memory 
problems?  Am I missing something?
 
Tim
 
 


From: Cezar Andrei [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 28, 2006 4:33 PMTo: 
user@xmlbeans.apache.orgSubject: RE: alternate representations of 
collections in XMLBeans??


That is a good article 
to read, also check out the tests under 
test\cases\xbean\extensions.
 
Cezar
 





From: Tim 
Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 3:08 
PMTo: 
user@xmlbeans.apache.orgSubject: RE: alternate representations of 
collections in XMLBeans??
 
Thank you for the quick 
reply - I'll look into the XMLBookmark idea...
 
Is there anything else 
I need to know about the preSet and postSet methods?  I found documentation 
(including the operationType values) at http://dev2dev.bea.com/pub/a/2004/11/Configuring_XMLBeans.html - 
is this the latest-and-greatest, or is there a better and/or more current 
reference available?
 
Tim
 



From: Cezar 
Andrei [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 2:29 
PMTo: 
user@xmlbeans.apache.orgSubject: RE: alternate representations of 
collections in XMLBeans??
Tim,
 
I would recommend using 
the extensions, otherwise modifying the generated code is definitely possible 
but missing even a small thing would break the 
code.
 
Back to using 
extensions, if one wants to store a state he can do it by using XmlBookmark – 
which stays with the xml entity even if moved. In your case the hash map should 
be stored on ‘metadata’ element.
Also the pre/post Set 
methods are called every time the document is about to change, so you’ll get 
calls for all creation/modification/deletion events, made through XmlObject 
interfaces. Modification through other interfaces like XmlCursor or DOM will not 
trigger the calls to the pre/post Set methods.
 
Cezar
 





From: Tim 
Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 1:11 
PMTo: 
user@xmlbeans.apache.orgSubject: alternate representations of 
collections in XMLBeans??
 

The XMLBeans representation of a 
collection (for something with a maxOccurs GT 1) is a bit limiting... I'm 
looking to extend it to look more like a Map interface... and I'm hitting some 
brick walls...

 

For discussion sake, I'll use a 
structure with three fields:

 

struct 
foo

{

    int 
ID;

    String 
name;

    HashMap 
metadata;

}

 

The 'metadata' field contains 
arbitrary name/value pairs - for simplicity we'll say 'name' and 'value' fields 
in the hashmap are always strings...

 

The obvious (to me, at 
least) schema for this is something 
like:

 

   

 

 

 



  


    

    

    

  




 



 

I could build another layer on top 
of this, but this could get ugly - What I really need is a way to 
extend NVPCollection so I can address items by name (like in a HashMap) rather 
than by position...  

 

The ideal would be something like 
(assuming that we have a mechanism to bind the 'name' field to the map key and 
the 'value' field to be the one of 
interest)...

 

NVPCollection 
thisCollection;

 

// some magic here to get the 
collection populated...

 

someValue = 
thisCollection.GetByMap("someArbitraryName");

 

 Or we could save some binding 
complexity by doing ...GetByMap("someArbitraryName","value"), saying "get the 
field 'value' from the collection member whose key field contains 
'someArbitraryName'" (The presumption is that the binding to the key field 
'name' would need to be established earlier so the map can be 
maintained)

 



 

As I read the documentation, I could 
build an extension like this, but I'm hosed if I want to do anything more 
sophisticated than a linear search through the collection on each 'get' call - 
Unless I'm missing something, I need a place to put an instance-specific HashMap 
object to maintain mapping between the key field ('name') and the array index... 
more than a little difficult with the 'static method' requirement for the 
extension  (Not to mention the population problem for the HashMap object 
itself, but a preSet or postSet implementation would work as long as I never try 
to delete anything)..

 

Presumably I could also build an 
'extendedNVPCollection' class, based on the NVPCollection class generated by 
XMLBeans, but how would I wire that back into my (XMLBeans-generated) 'testCase' 
class?  I don't want to get into creating wrapper classes for every 
layer...

 

I tried ignoring the "don't 
touch - generated code" warnings and added some stuff directly to the 
generated classes for the NVPCollection object, but t

Nil element

2006-03-28 Thread Jinyuan Zhou



Hi 
there,
When I call 
setCity(null) on the address object, xmlbeans  give me a   
Whic I don't want 
becuase the schema for the City element is not nillable.  Being an optional 
elment, I expect xml will just give me a normal empty element or not adding the 
City element. It looks like xmlbeans by default treat a null argument as a nil 
elment on setters. Is there method set***City which will ignore the the call 
when City is not nillable and the passed value is null?
Thanks,
 


RE: option to trim element values

2006-03-28 Thread Radu Preotiuc-Pietro



Could you be more specific in what you are interested in? I 
can't really understand what you mean by "element values" and by "trimming" 
them.
 
Thanks,
Radu


From: Roache, Ed (Contr) 
[mailto:[EMAIL PROTECTED] Sent: Wednesday, March 22, 2006 1:34 
PMTo: user@xmlbeans.apache.orgSubject: option to trim 
element values

I was wondering if 
anybody knows of an option (or config parameter or whatever) to have xmlbeans 
trim element values. Given the necessity of null checking, etc.--- it would be 
nice if this were built-in.
 
Thanks,
 
Eddie
 
___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.


RE: Can I set noNamespaceSchemaLocation attribute (xmlbeans 1.0.4)

2006-03-28 Thread Radu Preotiuc-Pietro
Actually, XmlBeans doesn't have specific APIs to deal with
xsi:[noNamespace]schemaLocation attributes (maybe it should) You
would have to set it as an ordinary non-Schema declared attribute, like
that:

XmlCursor c = root.newCursor();
c.insertAttributeWithValue("noNamespaceSchemaLocation",
"http://www.w3.org/2001/XMLSchema-instance";, "yourValue");

Radu 

-Original Message-
From: Grant Lewis [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 23, 2006 6:46 AM
To: XMLBeans List
Subject: Can I set noNamespaceSchemaLocation attribute (xmlbeans 1.0.4)

I'm actually stuck using version 1.0.3 bundled with weblogic 8.1. I'm
calling a cold fusion web service that requires the
noNamespaceSchemaLocation attibute be set on the root element of the
request xml.

Is there a way I can add the attribute to the root element before I call
xmlText on the bean.

Grant

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Generating javadoc from schema annotations

2006-03-28 Thread Radu Preotiuc-Pietro
That would be nice indeed, there is JIRA issue XMLBEANS-82 tracking it,
but I never found the time to deal with it. If you are interested in
contributing something in that direction, I would of course be more than
happy to help.

Radu

-Original Message-
From: Erik van Zijst [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 23, 2006 3:14 PM
To: user@xmlbeans.apache.org
Subject: Generating javadoc from schema annotations

People,

Would it be possible for xmlbeans to read the documentation elements
inside the schema annotations and transform it into javadoc comments in
the generated code?

The current version already creates javadoc comments, but merely
populates them with high-level strings like "Gets the "id" attribute",
but it'd be nicer if it would use the element's documentation from the
schema where available.

cheers,
Erik van Zijst
--
To the systems programmer, users and applications serve only to provide
a test load.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: XmlBeans and Standalone app

2006-03-28 Thread Radu Preotiuc-Pietro



Actually, I have looked at that some time ago (like 2 yrs 
ago...), and what I remember is reaching the conclusion that there was no easy 
way to separate the big jar into multiple small ones in a useful way (I guess 
part of the reason was that the appeal of XmlBeans is that is offers so many 
things into one tightly integrated package)
 
What area of functionality that you are currently using you 
would be interested in seeing as a standalone jar?
 
Radu


From: Alex Soto [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 24, 2006 7:00 AMTo: 
user@xmlbeans.apache.orgSubject: Re: XmlBeans and Standalone 
app
I have the same problem too, but im using an embbeded computer, so it 
owuld be great if xml beans can come like spring jars, so you can use, the jars 
you really need.El dv 24 de 03 del 2006 a les 15:55 +0100, en/na Dominik 
Stoklosa va escriure: 
Hello,

I have an inquiry about the latest release of the Xml Beans  (2.1.0). To 
be more specific about the xbeans.jar size. The size of the jar file is 
  around 2,6 MB, which is not that much taking the capabilities of the 
present computers into consideration. However, I am deploying my 
application using java web start technology. The application is pretty 
big itself, it also uses several jar files (in fact none of them is such 
big as xml beans one) and adding such a huge jar to the deployment will 
affect the download speed, especially when the end user possess poor 
network bandwidth.

So, finally my question is what are my choices if i want to use xml 
beans? Is is possible to  use some smaller jar file? Do you plan to 
devide xml beans according to the functionality ?

The way I use the xml beans is to generate my own several object models 
and than I am using them in the application. The most common task is to 
load an existing xml file according to the corresponding xsd.

Any tips or help would be greatly appreciated.
Please also note that I would prefer to avoid removing unused classes 
manually from the XmlBeans jar file.

Regards,
osa


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



La información contenida en el presente e-mail es confidencial y está 
reservada para el uso exclusivo de su destinatario. Se prohíbe estrictamente la 
distribución, copia o utilización de esta información sin el previo permiso de 
su destinatario. Si usted no fuera el destinatario, por favor notifíquelo 
inmediatamente al remitente y elimine el presente mensaje de su sistema 
informático.Information contained in this e-mail is confidential and is 
intended for the use of the addressee only. Any dissemination, distribution, 
copying or use of this communication without prior permission of the addressee 
is strictly prohibited. If you are not the intended addressee, please notify the 
sender immediately by reply and then delete this message from your computer 
system. 
___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.


Re: XmlBeans and Standalone app

2006-03-28 Thread Dominik Stoklosa

Dear Radu,

Thanks for your response. As I wrote in the previous mail XmlBeans are 
definitely very useful in many certain ways. The only disadvantage (from 
my perspective) is the size of the package. I do realize that splitting 
the jar may be difficult, but it would be very useful.


Answering your question I am using the xmlbeans in the following ways :
1). generate the object model from the XSD schema
this is done olny ones. Each generated model is packed into the separate 
jar file, which is then used in the WebStart app.


2). having generated the java object model of the schema I am loading 
xml documents i.e. SomeXSDDocument.Factory.parse(xml_source) , changing 
them through JavaBeans-style accessors after the fashion of "getFoo" and 
"setFoo" and finally store them back.


So to conclude it would be perfect if I could get the functionality to 
parse the xml documents based on the generated XSD models bundled in one 
 jar.


Best regards,
osa

Radu Preotiuc-Pietro wrote:
Actually, I have looked at that some time ago (like 2 yrs ago...), and 
what I remember is reaching the conclusion that there was no easy way to 
separate the big jar into multiple small ones in a useful way (I guess 
part of the reason was that the appeal of XmlBeans is that is offers so 
many things into one tightly integrated package)
 
What area of functionality that you are currently using you would be 
interested in seeing as a standalone jar?
 
Radu



*From:* Alex Soto [mailto:[EMAIL PROTECTED]
*Sent:* Friday, March 24, 2006 7:00 AM
*To:* user@xmlbeans.apache.org
*Subject:* Re: XmlBeans and Standalone app

I have the same problem too, but im using an embbeded computer, so it 
owuld be great if xml beans can come like spring jars, so you can use, 
the jars you really need.


El dv 24 de 03 del 2006 a les 15:55 +0100, en/na Dominik Stoklosa va 
escriure:

Hello,

I have an inquiry about the latest release of the Xml Beans  (2.1.0). To 
be more specific about the xbeans.jar size. The size of the jar file is 
  around 2,6 MB, which is not that much taking the capabilities of the 
present computers into consideration. However, I am deploying my 
application using java web start technology. The application is pretty 
big itself, it also uses several jar files (in fact none of them is such 
big as xml beans one) and adding such a huge jar to the deployment will 
affect the download speed, especially when the end user possess poor 
network bandwidth.


So, finally my question is what are my choices if i want to use xml 
beans? Is is possible to  use some smaller jar file? Do you plan to 
devide xml beans according to the functionality ?


The way I use the xml beans is to generate my own several object models 
and than I am using them in the application. The most common task is to 
load an existing xml file according to the corresponding xsd.


Any tips or help would be greatly appreciated.
Please also note that I would prefer to avoid removing unused classes 
manually from the XmlBeans jar file.


Regards,
osa


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 

La información contenida en el presente e-mail es confidencial y está 
reservada para el uso exclusivo de su destinatario. Se prohíbe 
estrictamente la distribución, copia o utilización de esta información 
sin el previo permiso de su destinatario. Si usted no fuera el 
destinatario, por favor notifíquelo inmediatamente al remitente y 
elimine el presente mensaje de su sistema informático.


Information contained in this e-mail is confidential and is intended for 
the use of the addressee only. Any dissemination, distribution, copying 
or use of this communication without prior permission of the addressee 
is strictly prohibited. If you are not the intended addressee, please 
notify the sender immediately by reply and then delete this message from 
your computer system.


___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]