Found a bug in the version I'm currently using. And I'm guessing that this bug may pop up in other places.
In XuiBuilder.java, I'm binding a static table to a XComboBox, but only using "target" and "source" as attributes to the binding. I'm getting a ClassNotFoundException from the following code in the addBindings(XPage, XmlElement) method:
if ( adapterStr != null ) {
// Following line throws ClassNotFoundException
XModelAdapter adapter = ( XModelAdapter ) Class.forName( adapterStr ).newInstance();
XModel tableModel = ( XModel )rootNode.get( srcStr );
adapter.setModel( tableModel );
binding = new XListBinding( targetComp, adapter );
}
Now, I'm currently experimenting with JaxpElements as my XmlElement, and the documentation for the Jaxp getAttribute(param) method states that if no attribute matches the parameter, an EMPTY string is returned. So, your above code should read as follows in the if statement:
if (adapterStr!=null && !adapterStr.equals("")) {
// rest of code
}
This bug appears at least 4 other times in this same method.
Paul Cooper
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the feedback. This is something which has come up previously in testing, but this instance obviously got past the radar. The code for version 1.0.4 has been finalised now, but we would be happy give you access to a modified version which will form part of the next iteration.
Perhaps you would be interested in contributing to the project as you seem to have specific requirements in mind for using XUI? In the meantime you could post a bug on the site so that it is not missed.
Regards,
Val
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would love to get my hands on the modified version so that I can get past this problem, as it is a showstopper right now. Although I may just patch my copy of the source and rebuild locally.
As for contributing, I'd love to, when I get something to contribute. What I would LOVE to see is the XModel supporting XPath queries, so that XUI could use XML as a "poor man's" database. The project I'm currently working on does just that, uses XML to store data locally, then uploads the XML data to a web service when the mobile machine is docked. I'm trying to work JDOM in as the base for XModel, but I haven't gotten very far with it.
I'll post the bug now.
Paul
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If this is delaying your development then I would recommend patching your version of the code for now as it may take us some time to get around to starting the development of the next version
It's not documented very well but the XModel does support 'XPath like' queries, in fact that was one of the main objectives when designing the XModel. If you could post more specific requirements I could try to identify whether or not they can be handled by the current XModel. Otherwise, we may be able to put some documentation on the syntax into the user manual which we are currently compiling.
It sounds like the type of store and forward mechanisms you are hoping to put in place would be a very useful contribution to the project if not as part of the core then as an extra library specifically for this type of use. Let me know what you think,
Regards,
Val
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Our XML structure is much different from the "recommended" XModel structure, in that we do not use attributes, but rather multiple nested elements. For example:
So, we'd write an XPath query like the following to find all vehicles that are manufactured by Ford:
//manufacturer[contains(text(),'Ford')]
I noticed in the documentation for Xui 1.0.4 that there were similarities to XPath in some of your XModel.get() examples, but the "contains" part of the above query didn't work.
I understand the need to minimize the memory footprint in Xui by using the NanoXml classes, but once the application moves to a P4 2.2 with 512MB RAM, memory usage becomes less of an issue. So I'm trying to bolt on JDom (which has a simple XML structure but supports XPath and is relatively small).
I don't suppose you have an Ant build script for Xui floating around somewhere I could grab, so I didn't have to reinvent one???
Thanks for being here. You have a great product. I've been a Swing developer for a while, and Xui really simplifies quick-and-dirty Swing development, and it seems open enough to allow customization along the way.
Paul
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had a quick discussion with Luan and we reckon it would be pretty simple to implement the 'contains' function. A custom XModel class can be specified in the startup.properties which could be written to do the more indepth lookups such as 'contains'. We can already evaluate a given path so once reached it would be simple to iterate the end nodes children to find the required child XModels. These could be returned as a vector.
I take your point about the more powerful machine and that is why we made the parser optional.
I wrote an Ant script some time ago but it's pretty verbose. This is something else which needs to be updated as part of the release along with everything else. Anyway, I can send you that version if you wish but I have to warn you it will require quite a bit of modification.
Thanks for the vote of confidence. It's encouraging to find like minded people who can appreciate the work being done.
Val
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've now got a patched version of XUI running. I found your ant file in the attic in CVS, so I downloaded it, made some modifications, and have now successfully built a local XUI.
You used the word "reckon"....where are you from? ;-)
If you want to go down the path of supporting "contains" be my guest, but my guess is that I will continue to bug you with more requests for XPath support. Hopefully I'll get JDom integrated, and I can make that available to any other XUI enthusiast.
One word of warning. I'm now compiling with JDK1.5, and I get errors when I build with that version of the JDK. You have made heavy use of the following code:
Enumeration enum = thingie.enumeration();
ENUM is now a reserved word in Java1.5, so you might want to change that variable name to something else. Just a word of warning.
Anyway, thanks for your help, I'm now moving forward again.
Paul
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Val and I are based in Dublin, Ireland. How about you?
We mostly built with JDK 1.4.x as JBuilder 8 is used extensively. For the next version we will probably move to NetBeans 4.x and consequently JDK 1.5 (and we will also build through Ant scripts). We already run alot of XUI applications on JDK 1.5.
The issue of warnings is something we may have to look at in more depth as there are already quite a few warnings that result from our support for JDK1.1.8 and the deprecated methods that requires.
Regards
Luan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Found a bug in the version I'm currently using. And I'm guessing that this bug may pop up in other places.
In XuiBuilder.java, I'm binding a static table to a XComboBox, but only using "target" and "source" as attributes to the binding. I'm getting a ClassNotFoundException from the following code in the addBindings(XPage, XmlElement) method:
if ( adapterStr != null ) {
// Following line throws ClassNotFoundException
XModelAdapter adapter = ( XModelAdapter ) Class.forName( adapterStr ).newInstance();
XModel tableModel = ( XModel )rootNode.get( srcStr );
adapter.setModel( tableModel );
binding = new XListBinding( targetComp, adapter );
}
Now, I'm currently experimenting with JaxpElements as my XmlElement, and the documentation for the Jaxp getAttribute(param) method states that if no attribute matches the parameter, an EMPTY string is returned. So, your above code should read as follows in the if statement:
if (adapterStr!=null && !adapterStr.equals("")) {
// rest of code
}
This bug appears at least 4 other times in this same method.
Paul Cooper
Paul,
Thanks for the feedback. This is something which has come up previously in testing, but this instance obviously got past the radar. The code for version 1.0.4 has been finalised now, but we would be happy give you access to a modified version which will form part of the next iteration.
Perhaps you would be interested in contributing to the project as you seem to have specific requirements in mind for using XUI? In the meantime you could post a bug on the site so that it is not missed.
Regards,
Val
Val,
Thanks for getting back to me so quickly.
I would love to get my hands on the modified version so that I can get past this problem, as it is a showstopper right now. Although I may just patch my copy of the source and rebuild locally.
As for contributing, I'd love to, when I get something to contribute. What I would LOVE to see is the XModel supporting XPath queries, so that XUI could use XML as a "poor man's" database. The project I'm currently working on does just that, uses XML to store data locally, then uploads the XML data to a web service when the mobile machine is docked. I'm trying to work JDOM in as the base for XModel, but I haven't gotten very far with it.
I'll post the bug now.
Paul
Paul,
If this is delaying your development then I would recommend patching your version of the code for now as it may take us some time to get around to starting the development of the next version
It's not documented very well but the XModel does support 'XPath like' queries, in fact that was one of the main objectives when designing the XModel. If you could post more specific requirements I could try to identify whether or not they can be handled by the current XModel. Otherwise, we may be able to put some documentation on the syntax into the user manual which we are currently compiling.
It sounds like the type of store and forward mechanisms you are hoping to put in place would be a very useful contribution to the project if not as part of the core then as an extra library specifically for this type of use. Let me know what you think,
Regards,
Val
Val,
Our XML structure is much different from the "recommended" XModel structure, in that we do not use attributes, but rather multiple nested elements. For example:
<Vehicle>
<type>truck</type>
<vin>1234567</vin>
<manufacturer>Ford</manufacturer>
<mileage>98765</mileage>
</Vehicle>
So, we'd write an XPath query like the following to find all vehicles that are manufactured by Ford:
//manufacturer[contains(text(),'Ford')]
I noticed in the documentation for Xui 1.0.4 that there were similarities to XPath in some of your XModel.get() examples, but the "contains" part of the above query didn't work.
I understand the need to minimize the memory footprint in Xui by using the NanoXml classes, but once the application moves to a P4 2.2 with 512MB RAM, memory usage becomes less of an issue. So I'm trying to bolt on JDom (which has a simple XML structure but supports XPath and is relatively small).
I don't suppose you have an Ant build script for Xui floating around somewhere I could grab, so I didn't have to reinvent one???
Thanks for being here. You have a great product. I've been a Swing developer for a while, and Xui really simplifies quick-and-dirty Swing development, and it seems open enough to allow customization along the way.
Paul
Paul,
I had a quick discussion with Luan and we reckon it would be pretty simple to implement the 'contains' function. A custom XModel class can be specified in the startup.properties which could be written to do the more indepth lookups such as 'contains'. We can already evaluate a given path so once reached it would be simple to iterate the end nodes children to find the required child XModels. These could be returned as a vector.
I take your point about the more powerful machine and that is why we made the parser optional.
I wrote an Ant script some time ago but it's pretty verbose. This is something else which needs to be updated as part of the release along with everything else. Anyway, I can send you that version if you wish but I have to warn you it will require quite a bit of modification.
Thanks for the vote of confidence. It's encouraging to find like minded people who can appreciate the work being done.
Val
Val,
I've now got a patched version of XUI running. I found your ant file in the attic in CVS, so I downloaded it, made some modifications, and have now successfully built a local XUI.
You used the word "reckon"....where are you from? ;-)
If you want to go down the path of supporting "contains" be my guest, but my guess is that I will continue to bug you with more requests for XPath support. Hopefully I'll get JDom integrated, and I can make that available to any other XUI enthusiast.
One word of warning. I'm now compiling with JDK1.5, and I get errors when I build with that version of the JDK. You have made heavy use of the following code:
Enumeration enum = thingie.enumeration();
ENUM is now a reserved word in Java1.5, so you might want to change that variable name to something else. Just a word of warning.
Anyway, thanks for your help, I'm now moving forward again.
Paul
Paul,
Val and I are based in Dublin, Ireland. How about you?
We mostly built with JDK 1.4.x as JBuilder 8 is used extensively. For the next version we will probably move to NetBeans 4.x and consequently JDK 1.5 (and we will also build through Ant scripts). We already run alot of XUI applications on JDK 1.5.
The issue of warnings is something we may have to look at in more depth as there are already quite a few warnings that result from our support for JDK1.1.8 and the deprecated methods that requires.
Regards
Luan
Paul,
I think you're right about being dragged into matching the features of XPath, so for now it can remain as an idea.
Thanks for the pointer regarding the enum keyword. I've just started using netbeans 4 and as you said, many errors.
We can try to integrate your JDom work when it is ready. If you wish to contribute directly then we could give you developer access to the project.
Regards,
Val