Chris Simons

Greenhorn
+ Follow
since Aug 29, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chris Simons

All,

I currently have a small GWT 2.2 project broken out into several
Composites and DialogBox subclasses. In particular, I have a sub-
class of DialogBox that contains a FormPanel (but it doesn't have
to). On this form, I am collecting some data that, once "submitted",
needs to be passed up to the parent.

I see getParent().fireEvent(), but this only contains very basic data
about the event. I actually want details of the form, or perhaps to
construct my own event and then fire that off.

I have seen some discussion of EventBus but this looks particular to
MVP, which I do not plan on using.

Therefore, I am looking for any tips/suggestions on how I would best
accomplish this task.

Any help would be appreciated; thanks.
13 years ago
GWT
I have come across a mock exam question in the Sierra/Bates SCJP Java 6 exam guide/CD that appears to be completely mistaken. It's also possible that I am completely wrong and am missing a valuable clue. However, the introduction to the question specifically lists an "mp.jar" that contains the MusicPlayer.class. However, one of the "correct" answer specifically mentions a "cp.jar", which is not even mentioned in the introduction.

Please validate my suspicions or let me know what I have missed.

Screenshot attached.
Oh my...that works perfectly. I must remember to Keep It Simple (Stupid).

Thank you!
13 years ago
I guess regular expressions are just not my thing.

To give some quick background, I am writing an installer using IzPack (great open-source product). Our requirements for the installer entail making sure that some of the paths/directories selected by the user for various inputs do not have spaces (but will accept all other normal path characters). I can accomplish this using IzPack's built-in regular expression validator, but I can't seem to nail the reg ex. I've been trying online resources and my own Java program to test, fix, test again, etc...

My understanding of regular expressions is not great; I understand the basics (start and ending of pattern, etc.). I know that /s should be used as the pattern for finding whitespace.

For anyone willing to spend a few minutes to show me where I have gone wrong, again, I am trying to determine whether or not the test string matches/works with a regular expression that will allow basically all characters *minus* whitespace. This is solely to avoid a potential issue with Windows in which the installed application basically hates any space in the directory/path (pretty common for older Windows apps).

Here are some examples of what I have tried for the reg ex:

^[a-zA-Z0-9]*\s$

^[a-zA-Z0-9\w]*\s$ Comment: \w should allow all characters, no?

^[a-zA-Z0-9]*\s$

^[a-zA-Z0-9]*.\s$


And here are some test strings that should or should not work:

Good: /home/username
Good: C:\Users\username
Bad: C:\Program Files\My Program\
Good: /usr/jdk1.6.20/
Bad: C:\Program Files\JavaSoft\Java 1.6\

Thank you!!
13 years ago
Tim - Thanks; I suppose in a way it is a bit like skinning. I could store some of these params and properties in our Theme template, which we can access via EL (#{theme.portlet}), etc. I guess I'm still wondering a bit about the way way to organize these parameters, though, such as being able to look them up via auto-complete, rather than having to remember the name of the params.
13 years ago
JSF
All,

We have a fairly large JSF/RichFaces/Seam application. Even with a great IDE like IntelliJ, we still struggle maintaining a list of available custom parameters for our facelets, the path/name of different facelet templates, and so forth.

I was wondering if by chance anyone has come up with any nifty solutions for this problem. For example, one thing we have started doing is to use a managed bean to store our standard properties for RichFaces components. So, for example, we have a DataTableBean that contains attributes such as sortMode, rowClasses, width, and so forth.

That helped a lot, but our struggle now is with facelets, in particular ui:param. Let's say we have a number of facelets/templates; each facelet can take a number of different ui:param's that alter the layout or functionality of said facelets. As a developer, I do not know what these parameters are until I dive into each facelet and discover the names and relevant values for each.

It would be nice to have an IDE-level or even bean-level approach to resolving this issue; does anyone have any ideas?

Thanks.
13 years ago
JSF
All - I hope some of you can provide some design and implementation ideas for something that I am sure most of you have encountered at some point in time.

Objective:
Our Web application needs to *pull* data from a variety of Oracle databases located across our organization's Intranet. The pulls need to be manageable, preferably through the web interface, so that an administrator can start/run/stop different "jobs" to have a variety of information pulled back, in most cases saved to our own database, and also displayed in real-time (probably pulling from our local data, but not always).

System:
We have a Java EE Web application built using JBoss Seam, Hibernate/JPA, EJB 3, and JSF/RichFaces. The data backend is Oracle 10gR2 and our app server is Oracle WebLogic 11g. Previously, we used straight Oracle database links and stored procedures + jobs to pull information and save it to our database. Although this is reliable, it doesn't leave much flexibility and we'd like to keep at a minimum things like stored procedures and Oracle jobs.

Current Ideas:

1) Create a simple framework to make JDBC calls directly to these other data sources and pull/retrieve information through straight SQL queries.

2) Since we are using Seam and a managed persistence context, create additional persistence contexts hooked into several WebLogic data sources. Utilize Hibernate and SFSBs to pull information as needed.

3) Continue to use Oracle (PL/SQL) to pull and and store the appropriate information; the frontend will merely trigger backend stored procedures.


I'm very curious what other ideas that you all may have. Keep in mind that a major limitation here is that Web Services are simply not an option.

Thanks for your assistance.

Hi All,

I'm experiencing an issue running our Seam application after migrating it from JBoss 4.2.2. to WebLogic 11g (10.3.1); the issue deals with entityManager.createQuery wherein no results are returned. Under JBoss, no NPE would be thrown, even if the query returned no results. Under WebLogic (same versions of Hibernate, Seam, JSF, etc.), an NPE is thrown - meaning I have to catch it to avoid this error.

Example:


Under JBoss AS and Hibernate/JPA, this query would return no results but this would be handled gracefully.

Now, under WebLogic (but ignore this fact, really, because it could happen under GlassFish or other JEE AS), I get a NullPointerException, such as:



If I catch the NPE, the application resumes normally. But why the difference? Since the returned value of this query is displayed using JSF EL, could that be the culprit?

Thanks.
Hmm, has anyone submitted this to RichFaces JIRA? Not that they'll ever fix it...; well, we can hope that they will.
15 years ago
JSF
All,

Is there an Eclipse plug-in or other IDE plug-in that hooks into the specified persistence container to allow for creation and testing of mock EJB-QL queries? It can be awfully difficult to get a query just right when you have to restart the app server or re-deploy each time you make a minor change. I've read you can do this with Eclipse and Hibernate but we've had trouble getting the plug-in setup correctly and have doubts about its effectiveness.

Our application stack is Seam 2.0 with EJB3 using Hibernate/JPA.

We're currently using Eclipse 3.3 with the JBoss Tools 2.0 plug-in.

Thanks!
Thanks I'll give that a try and see if it helps.
15 years ago
JSF
I am doing something similar; although I did not write a converter for java.util.Date, I am using a binding method for <f:convertDateTime> and also using some EL to perform a custom datePattern on <rich:calendar>.

<rich:calendar ...
datePattern="#{messages['output.datePattern']}">
<f:convertDateTime binding="#{globalUtil.convertDate}"/>
</rich:calendar>

"convertDate" is as follows:
Locale defaultLocale = Locale.US;
TimeZone defaultTimeZone = TimeZone.getTimeZone("GMT");

convertDate.setPattern(this.getProp("output.datePattern"));
convertDate.setDateStyle(this.getProp("output.dateStyle"));
convertDate.setLocale(defaultLocale );
convertDate.setDateStyle(this.getProp("output.dateStyle"));
convertDate.setType("date");
convertDate.setTimeZone(defaultTimeZone);


But perhaps this just isn't quite enough?
15 years ago
JSF
Also, I am using a custom converter for our <f:convertDateTime> calls, which we use everywhere that we display or input a date.

Still stuck on this issue. Very little help from RichFaces developers.
15 years ago
JSF
Thanks for the responses, all. So you are thinking it is a timezone issue after all? What about when you set the datePattern on the rich:calendar to not include any time? It shouldn't even keep track of the time or time zone, right? I think it still does, though, as when I just use "dd-mon-yyyy" it always shows "20:00 GMT" for the time.

With that in mind, I can't understand why it would decrease the day - since that would be a big jump in time.
15 years ago
JSF
All,

I'm looking for something to "plugin" to our current Seam/EJB3-based Web application to enable tracking of changes to entities. Now, I have looked at Envers and it's a bit more than we need. We don't necessarily need to compare the data between versions and we don't want to store multiple versions of each entity. However, what we are looking for is more in line of a simple framework that automatically tracks when entities are:
- created, modified, deleted, etc.

We want the information to be persisted to the database and for the information to be pulled back easily so that it may be displayed in a JSF data table or similar.

I have also approached this from the database-only side (Oracle) with the Log4J equivalent but we're looking for something database agnostic.

Thank you for any pointers or leads you might have.