Re: [i18n] man available

2005-02-15 Thread Anaximandro (Woody)
Hello Daniel,

Yup, the ConfigManager not prove to be very usefull. This class is
increasing the coupling level to give me a few features set (the con
figuration features itself) and gave me much more code to delegate ...

But you don't think necessary some code to configure the behaviours of
this component? For instance: in your version when the component not
find one message id they throw one unchecked exception. The component
dont't force me to write one try catch block for each LocalizedEntry but
force me to write all messages ids in their respective resource to avoid
one exception. Avoid try catch blocks is cool, very cool, but this only
make my code more clean, however the cost to do this is high: I must write
the messages id (at least) to don't break the application, but if I forget
one id the application will break in same mode.

Using some code to configure this helps in this situation. I can talk to
component: hey pal, use the message id or entry id as default when you not
find someone. Don't throw an exception, instead, write this in log. I
will write these messages later ok?

Hence I think is better to leave this decision to the user component. I
know you wanna a small and easy to use component, I want the same think,
but ... I think is more easy to use a componente wich can be configured
than one wich we can't do this.

Sorry if I'm talking to much, I really wanna help but my english make this
more hard than really is.

Only one MessageManager? no getInstance? As I see the problem exists
when many threads (with different Locales) try to get a message. I don't
see any problem with diferent applications (sure, the unique ID is requi
red). If you use only one MessageManager you will need to always provide
the desired Locale (in constructor or in getXXX method) because there is
no more a place to store a default Locale info since the older place
(setLocale/getLocale) will be shared by this threads. More than this,
doing this will bestrew Locale info in resulting client code making this
more hard to update. Well, this is just my opinion.

I try to solve this writing the getInstance (as you suggest in email)
but with this I create another problem: how to link a message with their
respective manager? Passing this guy as parameter? nope, this is ugly. So
writing some method to returns the current manager? Yes, make sense, then:
getCurrentInstance, but, again, I created another problem: I need to write
monitor code to lock unlock the instance to avoid data corruption (between
threads). I think this is the last thing I need to close my version. I will
do this (is a little hard to me because I never do this before).

I'm right im my point? I miss something?

Did you find some good idea in my code? If you do I can revise and generate
the apropriate patch to you.

Good luck with envinronment (to be honest I need to learn maven, I just
used eclipse, always redoing the configuration when I need).

Woody

Hi Woody,
I'm currently trying to improve the maven environment, so that releases and
tests can easily be done.
My goal is to complete the component in the actual state in order to build
a
usable release as soon as possible.
I've already had a look at your proposed changes. I'd like to include some
changes into the current version (LocalizedRuntimeException), but I'm not
sure with the ConfigManager. This one introduces a lot of complexity.
In order to keep the i18n-component very simple my suggestions would be to
keep only one MessageManager with static methods and advice the user to use
unique message keys (comparable to java package names). This should avoid
trouble when using multiple applications. Agreed?
Next steps are to remove misleading methods (as we discussed earlier) and
to
complete the javadocs and provide some more tutorials. This is the part
where help would be very much appreciated ;-)


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



Re: [i18n] proposals

2005-02-06 Thread Anaximandro (Woody)
Hi Daniel,

The ConfigManager in my idea is used for store specific configurations, as I
see the MessageManager don't have this responsabilitie. If I store any
configuration on MessageManager I will need specific instances of this guy
for each thread with a diferent configuration.

Well, in your code you don't let the user of this component to configure the
behaviours of log, exceptions and default language. I do some code to do
this in mine and,  becouse this, I need to store these configurations on a
isolated place. Store these guys inside MessageManager is not a good idea.

The MessageManager only store the message providers and delegate calls to
these providers.

The main objective behind this is to write less code in cases wich I need to
specify Locales differents than default Locale. Instead of write:

Locale userLocale = getUserLocale( userId );
LocalizedText txt1 = new LocalizedText( consts.ID1, userLocale );// each
message need to set the user locale
LocalizedText txt2 = new LocalizedText( consts.ID2, userLocale );//
LocalizedText txtN = new LocalizedText( consts.IDN, userLocale );  //

I think in write:

String  servletID= getServletUUID();

ConfigManager config = new ConfigManager.getInstance( servletID );
config.setLocale( getUserLocale( userId ) );
// Only one place set the user locale

LocalizedText txt1 = new LocalizedText( consts.ID1 );
LocalizedText txt2 = new LocalizedText( consts.ID2 );
LocalizedText txtN = new LocalizedText( consts.IDN );

I agree with your idea, keep it simple here is the best thing to do, but how
to setup aditional information without a mediator to store?
The code in first example can be a problem, he multiply locale information
(configuration) in many places where I have a message ...

In my code I write:

- In LocalizedText, LocalizedMessage, LocalizedError, LocalizedException I
change the extensions. Instead of cascating extensios I do direct extensions
(LocalizedText extends LocalizedBundle, LocalizedMessage extends
LocalizedBundle, LocalizedError extends LocalizedBundle ...)
- new class: LocalizedRuntimeException (like your LocalizedException);

* new class: ConfigManager (LocalizedBundle delegate to this class);
- service locator;
- code to config excetions and defaults ( useMessageIdAsDeafult(),
useEntryIdAsDefault(), if both was false, then, we throw exceptions)
- code to config log levels (setLevelLog2Info, setLevelLog2Warning and
setLevelLog2Error);
- code to setLocale (used by all messages in a given instance);
- this class delegate calls to MessageManager;

* In MessageManager:
- service locator;
- methods to getProvider, removeProviders and reset/clear MessageManager;
- move exception handling to ConfigManager (now it is configurable);
- this class delegates class to each provider;

* In XMLMessageProvider:
- service locator;
- move exception handling to ConfigManager;
- more 2 xml formats (one file per message - as resource bundle does and a
mix);

* In ResourceBundleMessageProvider:
- service locator;
- move exception handling to ConfigManager;

- In all classes I do some enhacements with final keyword;

I do a lot of code and don't think is a good idea to put them here. How can
I provide this to you? Did you have any email to I sent this? (sure, if you
wish to see)

Man, sorry by my english. Is more easy to me write code than write email ...
If I write anything offensive, please, sorry and talk with me.

Woody

- Original Message - 
From: Daniel Florey [EMAIL PROTECTED]
To: 'Jakarta Commons Developers List' commons-dev@jakarta.apache.org
Sent: Saturday, February 05, 2005 5:58 AM
Subject: AW: [i18n] status


Hi Woody,
Where did you post your proposals/patches? I'm very interested in improving
the i18n/contract components.
If you have any suggestions the best way is to describe the idea behind it
so that it can be discussed in the mailing list. You can also post the
related patches/files as attachment to a bugzilla entry (enhancement
request).
Please try to describe each single idea / enhancement and include some code
snippets in the mail if it makes the idea clearer.
Regarding the proposal of a ConfigManager:
I'd like to keep the components as simple as possible. I've understood that
we need to have the ability to have more than one MessageManager per VM. So
my proposal would be just to add a getInstance(String messageManager) method
to the MessageManager and get rid of the static methods.
But perhaps I've missed the point. So it would be great if you could explain
in more detail what the ConfigManager is for.

Cheers,
Daniel

 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 Im Auftrag von Anaximandro (Woody)
 Gesendet: Samstag, 5. Februar 2005 06:03
 An: Jakarta Commons Developers List; [EMAIL PROTECTED]
 Betreff: Re: [i18n] status

 Thanx Oliver.

 I will wait for him,  :o

 Woody

 - Original Message -
 From: Oliver Zeigermann [EMAIL PROTECTED]
 To: Anaximandro (Woody) [EMAIL

Re: [i18n] status

2005-02-04 Thread Anaximandro (Woody)
Oliver, I sent one proposal too (another class diagram, with a macro vision
of my suggestions).

The idea behind my suggestion is write one mediator (ConfigManager) to
retain one specific configuration (I can have many threads running with
diferent configurations) and put one service locator in MessageManager.

Each message (LocalizedText, LocalizedMessage, etc) comunicates with
MessageManager through your configuration.

I write a lot of code to test this ideas and to be more confident with this
project, but now I stuck, this project is not mine and I need to take easy
with ideas 8(

You wanna see this class diagram? I'm boring you?

Sorry

Woody


 I mainly work on xmlio, but am not aware of any proposed changes to
 the project. The class diagrams you sent have been put online by me.

 Oliver


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



Re: VOTE: FeedParser move to Commons Proper...

2005-02-04 Thread Anaximandro (Woody)
Tim O'Brien, please, sorry by my stupidity, but how do you means with:

 To promote feedparser out of commons at this point might create the
 possibility for another BCEL.

?

Woody

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



Re: [i18n] status

2005-02-04 Thread Anaximandro (Woody)
Thanx Oliver.

I will wait for him,  :o

Woody

- Original Message - 
From: Oliver Zeigermann [EMAIL PROTECTED]
To: Anaximandro (Woody) [EMAIL PROTECTED]
Cc: Jakarta Commons Developers List commons-dev@jakarta.apache.org
Sent: Friday, February 04, 2005 3:47 PM
Subject: Re: [i18n] status


 I am sure that your suggestions are valueable and you do not bore me
 at all. However, the proposals you made should be inspected by Daniel,
 as I have no deeper insight into neither contract nor i18n.

 Oliver


 On Fri, 4 Feb 2005 19:55:21 -0800, Anaximandro (Woody)
 [EMAIL PROTECTED] wrote:
  Oliver, I sent one proposal too (another class diagram, with a macro
vision
  of my suggestions).
 
  The idea behind my suggestion is write one mediator (ConfigManager) to
  retain one specific configuration (I can have many threads running with
  diferent configurations) and put one service locator in MessageManager.
 
  Each message (LocalizedText, LocalizedMessage, etc) comunicates with
  MessageManager through your configuration.
 
  I write a lot of code to test this ideas and to be more confident with
this
  project, but now I stuck, this project is not mine and I need to take
easy
  with ideas 8(
 
  You wanna see this class diagram? I'm boring you?
 
  Sorry
 
  Woody
 
  
   I mainly work on xmlio, but am not aware of any proposed changes to
   the project. The class diagrams you sent have been put online by me.
  
   Oliver
 
 

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



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



Re: [resources] complete class diagram

2005-02-02 Thread Anaximandro (Woody)
enhancement ticket? I dono if I really understand this ...

Well, lets go 

If anyone needs the model (rose) send me a note.

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

Re: [resources] complete class diagram

2005-02-02 Thread Anaximandro (Woody)
Ohh, Know I understand ...
Sorry. I will post this today.

 I think James wants an enhancement issue in bugzilla with the file 
 attached.
 
 -- Dirk
 
 Anaximandro (Woody) wrote:
 
  enhancement ticket? I dono if I really understand this ...
  
  Well, lets go 
  
  If anyone needs the model (rose) send me a note.
  
  Woody


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



[contract] class diagram

2005-02-01 Thread Anaximandro (Woody)
This server is not so good, but works sometimes ...
http://www.drianoxaman.kit.net/sandbox/contract.zip

Woody

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



[i18n] class diagram suggested

2005-02-01 Thread Anaximandro (Woody)
Hi folks, I make some changes in my i18n version and the final class diagram
is given in link below:
http://www.drianoxaman.kit.net/sandbox/i18n_suggestion.zip

Woody


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



[dbutils] component proposal

2005-02-01 Thread Anaximandro (Woody)
Hi folks, I dono if you are open for this idea or if this topic was already
discussed but let me explain:

I´m working on a project where I decide to use the pattern Data Transfer
Rowset (a fast lane reader) given by Marinescu on book EJB Design Patterns.
When I decided this (four months ago) I do some research and look for some
open source implementations but the only implementation I found was the sun
CachedRowset implementation (with SCSL license and, for java 1.4.2, the
sources is unavailable).

The version done by sun was done for use with java 1.4.2 (and I was using
WAS 4, with java 1.3.1!!!)
I faced many problems with this (and my envinronment) and, yet now, does not
exist a CachedRowset implementation ...

Months ago, when sun releases tiger, I try to see the sources looking for
the CachedRowsetImpl but this source is not given yet (and, as I see, never
will).

I know there is another implementation, but is not open source too (is from
oracle, with huge bugs).

I think this is the right place to a component like this. I'm right?
I have some work done in this direction and wanna knows if can I help (with
hands on).

Tks

Woody


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



Re: [dbutils] component proposal

2005-02-01 Thread Anaximandro (Woody)
 DbUtils is a small JDBC helper library.  We don't implement features that
 already exist in the standard Java distro.

 David

David, I don't think this feature is standard (you need to download 2 jars
from sun to use this feature)
But is ok, thanx by reply.

Woody


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



[resources] complete class diagram

2005-02-01 Thread Anaximandro (Woody)
I wish it helps
http://www.drianoxaman.kit.net/commons/resources.zip

Woody

PS: this server is very busy, if you receive a timeout retry again

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



[i18n] sugestion patch

2005-01-31 Thread Anaximandro (Woody)
Index: LocalizedBundle.java
===
RCS file:
/home/cvspublic/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18
n/LocalizedBundle.java,v
retrieving revision 1.3
diff -u -r1.3 LocalizedBundle.java
--- LocalizedBundle.java 29 Dec 2004 17:03:55 - 1.3
+++ LocalizedBundle.java 1 Feb 2005 03:07:12 -
@@ -35,21 +35,19 @@
  * that might be used to include dynamic values into the message text and
knows nothing
  *
  */
-public class LocalizedBundle implements Serializable {
-public final static String ID = id;
-public final static String ARGUMENTS = arguments;
+public abstract class LocalizedBundle implements Serializable {

-protected String id;
-protected Object[] arguments;
+private final String id;
+private final Object[] arguments;

 /**
  * @param messageId The messageId refers the corresponding bundle in
the file containing
  * the localized messages. The format of the message file depends on
the implementation of the
  * MessageManager.
  */
-public LocalizedBundle(String messageId) {
+public LocalizedBundle(final String messageId) {
 this.id = messageId;
-this.arguments = new Object[0];
+this.arguments = null;
 }

 /**
@@ -59,7 +57,7 @@
  * @param arguments An array of objects containing argument for the
messages. These arguments
  * are used to insert dynamic values into the localized messages.
  */
-public LocalizedBundle(String messageId, Object[] arguments) {
+public LocalizedBundle(final String messageId, final Object[]
arguments) {
 this.id = messageId;
 this.arguments = arguments;
 }
@@ -68,14 +66,14 @@
  * @return returns the id of this bundle
  */
 public String getId() {
-return id;
+return this.id;
 }

 /**
  * @return returns the arguments associated with this message bundle
  */
 public Object[] getArguments() {
- return arguments;
+ return this.arguments;
 }

 /**
@@ -85,8 +83,8 @@
  * @throws MessageNotFoundException if an entry with the given key can
not be found
  * in this bundle
  */
-public String getText(String key, Locale locale) throws
MessageNotFoundException {
-return MessageManager.getText(id, key, arguments, locale);
+public String getEntry(final String key, final Locale locale) throws
MessageNotFoundException {
+return MessageManager.getText(this.id, key, this.arguments,
locale);
 }

 /**
@@ -95,7 +93,7 @@
  * @param defaultText the text to be returned if no entry was found for
the given key
  * @return returns the localized text
  */
-public String getText(String key, String defaultText, Locale locale) {
-return MessageManager.getText(id, key, arguments, locale,
defaultText);
+public String getEntry(final String key, final String defaultText,
final Locale locale) {
+return MessageManager.getText(this.id, key, this.arguments, locale,
defaultText);
 }
 }
\ No newline at end of file
Index: LocalizedError.java
===
RCS file:
/home/cvspublic/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18
n/LocalizedError.java,v
retrieving revision 1.1
diff -u -r1.1 LocalizedError.java
--- LocalizedError.java 4 Oct 2004 13:41:09 - 1.1
+++ LocalizedError.java 1 Feb 2005 03:07:12 -
@@ -37,34 +37,34 @@
 }

 public String getSummary() throws MessageNotFoundException {
-return getText(SUMMARY, Locale.getDefault());
+return getEntry(SUMMARY, Locale.getDefault());
 }

 public String getSummary(Locale locale) throws MessageNotFoundException
{
-return getText(SUMMARY, locale);
+return getEntry(SUMMARY, locale);
 }

 public String getSummary(String defaultSummary) {
-return getText(SUMMARY, defaultSummary, Locale.getDefault());
+return getEntry(SUMMARY, defaultSummary, Locale.getDefault());
 }

 public String getSummary(Locale locale, String defaultSummary) {
-return getText(SUMMARY, defaultSummary, locale);
+return getEntry(SUMMARY, defaultSummary, locale);
 }

 public String getDetails() throws MessageNotFoundException {
-return getText(DETAILS, Locale.getDefault());
+return getEntry(DETAILS, Locale.getDefault());
 }

 public String getDetails(Locale locale) throws MessageNotFoundException
{
-return getText(DETAILS, locale);
+return getEntry(DETAILS, locale);
 }

 public String getDetails(String defaultDetails) {
-return getText(DETAILS, defaultDetails, Locale.getDefault());
+return getEntry(DETAILS, defaultDetails, Locale.getDefault());
 }

 public String getDetails(Locale locale, String defaultDetails) {
-return getText(DETAILS, defaultDetails, locale);
+return getEntry(DETAILS, 

[i18n] suggestion

2005-01-31 Thread Anaximandro (Woody)
What do you think about rename class LocalizedBundle to AbstractEntry?

Woody

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



[i18n] suggestion patch

2005-01-31 Thread Anaximandro (Woody)
final enhancements
Index: LocalizedText.java
===
RCS file:
/home/cvspublic/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18
n/LocalizedText.java,v
retrieving revision 1.1
diff -u -r1.1 LocalizedText.java
--- LocalizedText.java 4 Oct 2004 13:41:09 - 1.1
+++ LocalizedText.java 1 Feb 2005 03:16:21 -
@@ -25,29 +25,29 @@
 import java.util.Locale;

 public class LocalizedText extends LocalizedBundle {
-public final static String TEXT = text;
+private static final String TEXT = text;

-public LocalizedText(String messageId) {
+public LocalizedText(final String messageId) {
 super(messageId);
 }

-public LocalizedText(String messageId, Object[] arguments) {
+public LocalizedText(final String messageId, final Object[] arguments)
{
 super(messageId, arguments);
 }

 public String getText() throws MessageNotFoundException  {
-return getText(TEXT, Locale.getDefault());
+return getEntry(TEXT, Locale.getDefault());
 }

-public String getText(Locale locale) throws MessageNotFoundException  {
-return getText(TEXT, locale);
+public String getText(final Locale locale) throws
MessageNotFoundException  {
+return getEntry(TEXT, locale);
 }

-public String getText(String defaultText) {
-return getText(TEXT, defaultText, Locale.getDefault());
+public String getText(final String defaultText) {
+return getEntry(TEXT, defaultText, Locale.getDefault());
 }

-public String getText(Locale locale, String defaultText) {
-return getText(TEXT, defaultText, locale);
+public String getText(final Locale locale, final String defaultText) {
+return getEntry(TEXT, defaultText, locale);
 }
 }
\ No newline at end of file


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



[18n] suggestion patch - LocalizedMessage.java

2005-01-31 Thread Anaximandro (Woody)
final enhacements
Index: LocalizedMessage.java
===
RCS file:
/home/cvspublic/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18
n/LocalizedMessage.java,v
retrieving revision 1.1
diff -u -r1.1 LocalizedMessage.java
--- LocalizedMessage.java 4 Oct 2004 13:41:09 - 1.1
+++ LocalizedMessage.java 1 Feb 2005 03:21:20 -
@@ -25,29 +25,29 @@
 import java.util.Locale;

 public class LocalizedMessage extends LocalizedText {
-public static String TITLE = title;
+private static final String TITLE = title;

-public LocalizedMessage(String messageId) {
+public LocalizedMessage(final String messageId) {
 super(messageId);
 }

-public LocalizedMessage(String messageId, Object[] arguments) {
+public LocalizedMessage(final String messageId, final Object[]
arguments) {
 super(messageId, arguments);
 }

 public String getTitle() throws MessageNotFoundException {
-return getText(TITLE, Locale.getDefault());
+return getEntry(TITLE, Locale.getDefault());
 }

-public String getTitle(Locale locale) throws MessageNotFoundException {
-return getText(TITLE, locale);
+public String getTitle(final Locale locale) throws
MessageNotFoundException {
+return getEntry(TITLE, locale);
 }

-public String getTitle(String defaultTitle) {
-return getText(TITLE, defaultTitle, Locale.getDefault());
+public String getTitle(final String defaultTitle) {
+return getEntry(TITLE, defaultTitle, Locale.getDefault());
 }

-public String getTitle(Locale locale, String defaultTitle) {
-return getText(TITLE, defaultTitle, locale);
+public String getTitle(final Locale locale, final String defaultTitle)
{
+return getEntry(TITLE, defaultTitle, locale);
 }
 }


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



[i18n] suggestion patch - LocalizedError.java

2005-01-31 Thread Anaximandro (Woody)
final enhacements
Index: LocalizedError.java
===
RCS file:
/home/cvspublic/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18
n/LocalizedError.java,v
retrieving revision 1.1
diff -u -r1.1 LocalizedError.java
--- LocalizedError.java 4 Oct 2004 13:41:09 - 1.1
+++ LocalizedError.java 1 Feb 2005 03:24:20 -
@@ -28,43 +28,43 @@
 private final static String SUMMARY = summary;
 private final static String DETAILS = details;

-public LocalizedError(String messageId) {
+public LocalizedError(final String messageId) {
 super(messageId);
 }

-public LocalizedError(String messageId, Object[] arguments) {
+public LocalizedError(final String messageId, final Object[] arguments)
{
 super(messageId, arguments);
 }

 public String getSummary() throws MessageNotFoundException {
-return getText(SUMMARY, Locale.getDefault());
+return getEntry(SUMMARY, Locale.getDefault());
 }

-public String getSummary(Locale locale) throws MessageNotFoundException
{
-return getText(SUMMARY, locale);
+public String getSummary(final Locale locale) throws
MessageNotFoundException {
+return getEntry(SUMMARY, locale);
 }

-public String getSummary(String defaultSummary) {
-return getText(SUMMARY, defaultSummary, Locale.getDefault());
+public String getSummary(final String defaultSummary) {
+return getEntry(SUMMARY, defaultSummary, Locale.getDefault());
 }

-public String getSummary(Locale locale, String defaultSummary) {
-return getText(SUMMARY, defaultSummary, locale);
+public String getSummary(final Locale locale, final String
defaultSummary) {
+return getEntry(SUMMARY, defaultSummary, locale);
 }

 public String getDetails() throws MessageNotFoundException {
-return getText(DETAILS, Locale.getDefault());
+return getEntry(DETAILS, Locale.getDefault());
 }

-public String getDetails(Locale locale) throws MessageNotFoundException
{
-return getText(DETAILS, locale);
+public String getDetails(final Locale locale) throws
MessageNotFoundException {
+return getEntry(DETAILS, locale);
 }

-public String getDetails(String defaultDetails) {
-return getText(DETAILS, defaultDetails, Locale.getDefault());
+public String getDetails(final String defaultDetails) {
+return getEntry(DETAILS, defaultDetails, Locale.getDefault());
 }

-public String getDetails(Locale locale, String defaultDetails) {
-return getText(DETAILS, defaultDetails, locale);
+public String getDetails(final Locale locale, final String
defaultDetails) {
+return getEntry(DETAILS, defaultDetails, locale);
 }
 }
\ No newline at end of file


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



[i18n] suggestion patch - LocalizedException

2005-01-31 Thread Anaximandro (Woody)
final enhancements
Index: LocalizedException.java
===
RCS file:
/home/cvspublic/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18
n/LocalizedException.java,v
retrieving revision 1.1
diff -u -r1.1 LocalizedException.java
--- LocalizedException.java 4 Oct 2004 13:41:09 - 1.1
+++ LocalizedException.java 1 Feb 2005 03:27:55 -
@@ -25,19 +25,19 @@
 import java.util.Locale;

 public class LocalizedException extends Exception {
-private LocalizedError errorMessage;
+private final LocalizedError errorMessage;

-public LocalizedException(LocalizedError errorMessage, Throwable
throwable) {
+public LocalizedException(final LocalizedError errorMessage, final
Throwable throwable) {
 super(errorMessage.getSummary(Locale.getDefault(),
throwable.getMessage()), throwable);
 this.errorMessage = errorMessage;
 }

-public LocalizedException(LocalizedError errorMessage) {
+public LocalizedException(final LocalizedError errorMessage) {
 super(errorMessage.getSummary(Locale.getDefault(), no message
available));
 this.errorMessage = errorMessage;
 }

 public LocalizedError getErrorMessage() {
-return errorMessage;
+return this.errorMessage;
 }
 }
\ No newline at end of file


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



[contract] suggestion patch

2005-01-31 Thread Anaximandro (Woody)
method rename
Index: ParameterMessage.java
===
RCS file:
/home/cvspublic/jakarta-commons-sandbox/contract/src/java/org/apache/commons
/contract/i18n/ParameterMessage.java,v
retrieving revision 1.2
diff -u -r1.2 ParameterMessage.java
--- ParameterMessage.java 7 Dec 2004 20:52:18 - 1.2
+++ ParameterMessage.java 1 Feb 2005 04:03:11 -
@@ -21,18 +21,18 @@
 }

 public String getPrompt() {
-return getText(PROMPT, Locale.getDefault());
+return getEntry(PROMPT, Locale.getDefault());
 }

 public String getPrompt(Locale locale) {
-return getText(PROMPT, locale);
+return getEntry(PROMPT, locale);
 }

 public String getPrompt(String defaultPrompt) {
-return getText(PROMPT, defaultPrompt, Locale.getDefault());
+return getEntry(PROMPT, defaultPrompt, Locale.getDefault());
 }

 public String getPrompt(Locale locale, String defaultPrompt) {
-return getText(PROMPT, defaultPrompt, locale);
+return getEntry(PROMPT, defaultPrompt, locale);
 }
 }
\ No newline at end of file

Woody


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



[i18n] suggestion/problem ...

2005-01-31 Thread Anaximandro (Woody)
Well, once MessageManager (and everything inside) is static we can have only
one manager to all aplications running on vm. What you think to do when we
need one diferent manager, by example, to supply another application ? I
dono what messages id this application will have but if there is some id
repeated this will overrides messages across aplications ...

Woody


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



Re: [i18n] suggestion

2005-01-31 Thread Anaximandro (Woody)
What do you think about rename class LocalizedBundle to LocalizedEntry?
I think this is a better name ...

Woody

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



Re: [i18n,xmlio] current class diagrams

2005-01-27 Thread Anaximandro (Woody)
Ok Oliver, as you wish.

Today, soon as possible I will send one patch suggestion to i18n (and a so
so complete test suit to all then).

I change a lot of things (respecting main idea), but, to be honest, I became
motivated and code, code and code ...

As I told is a suggestion (shure), but, please, don´t throw my code through
the window!!! hhehehehe

Is more easy to me produce code than write emails (english is hard, painful
and slow to me).

I wish it really helps.

Tks ...

Woody

PS: I´m doing this to start my work in contract (my main interest) but, in
this week, by chance, I start a job with a huge necessity of a good i18n
solution.

- Original Message - 
From: Oliver Zeigermann [EMAIL PROTECTED]
To: Anaximandro (Woody) [EMAIL PROTECTED]
Sent: Thursday, January 27, 2005 2:32 PM
Subject: Re: [i18n,xmlio] current class diagrams


 Hi,

 commons is currently migrating to SVN, but I will check in your stuff
 as soon as this has been done.

 Thanks,
 Oliver

 On Thu, 27 Jan 2005 00:36:46 +0100, Oliver Zeigermann
 [EMAIL PROTECTED] wrote:
  Yes, thanks,
 
  I will add them to the documentation ASAP!
 
  Oliver
 
  On Wed, 26 Jan 2005 18:45:01 -0800, Anaximandro (Woody)
  [EMAIL PROTECTED] wrote:
   Did you get the files?
   I send then to you ...
  
   Woody
  
 


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



Re: [i18n,xmlio] current class diagrams

2005-01-26 Thread Anaximandro (Woody)
Is your server up? I wanted to have a look at your diagrams, but the
request timed out :(
Oliver

Well, I´m in Brazil. This server is not so good ...
Please, can you try more one time and reply to me knows?

Thanx
Woody


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



Re: [i18n,xmlio] current class diagrams

2005-01-26 Thread Anaximandro (Woody)
I see somewhere in jakarta docs one advise (as I see is more one
'suggestion') about don´t post attachs here. Well, this files are small ...

Woody

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

Re: [i18n,xmlio] current class diagrams

2005-01-26 Thread Anaximandro (Woody)
Are you a commons committer? If so, are you aware that apache provides
each committer a homepage available that you can use for this sort of
stuff?

Simon, I´m not a commiter yet, maybe soon. Who knows?
Thanx by note

Woody


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



[i18n,xmlio] current class diagrams

2005-01-25 Thread Anaximandro (Woody)
I'm doing some revisions on i18n and, to do this, I reverse the class
diagrams below:

i18n
http://www.drianoxaman.kit.net/sandbox/i18n.gif
http://www.drianoxaman.kit.net/sandbox/i18n.doc

xmlio (in):
http://www.drianoxaman.kit.net/sandbox/xml-in.gif
http://www.drianoxaman.kit.net/sandbox/xmlio-in.doc

xmlio (out):
http://www.drianoxaman.kit.net/sandbox/xml-out.gif
http://www.drianoxaman.kit.net/sandbox/xmlio-out.doc

and the respective rose model (i18n and xmlio packages):
http://www.drianoxaman.kit.net/sandbox/i18n-rose.zip

I´m finishing a junit test suit to i18n too.

I wish it help

Woody


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



[contract] german translate ...

2005-01-24 Thread Anaximandro (Woody)
Please, anyone with german knowledge can translate the missing parts in
exceptions.xml?

Thanx

Woody

PS: David, I know you knows german (because you write this xml) but can you
do this?


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



[contract] german translate

2005-01-24 Thread Anaximandro (Woody)
Please, anyone with german knowledge can translate the missing parts in
exceptions.xml?

Thanx

Woody

PS: David, I know you knows german (because you write this xml) but can you
do this?

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



[i18n] changes

2005-01-24 Thread Anaximandro (Woody)
How can I send some changes I have made in i18n? David?

I see some guys putting cvs dif here. This is the normal process?

Thanx

Woody

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



[contract] Suggestions

2005-01-23 Thread Anaximandro (Woody)
Hi felows, I´m new here and if this message is on wong place, please, sorry
...

I dono if I need to introduce myself, besides I will go direct to the
subject ok?

Daniel, what dou you think about put constraints rules on some type of
propertie file? These constraints must have some type of identification (in
one ore more contexts). This is flexible and make the code more clean (and,
like ejb, can be changed without the need to recompile the code).

Do you know OCL?

Woody


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



Re: [contract] Suggestions

2005-01-23 Thread Anaximandro (Woody)
Thanx Daniel, I´ve already see the sources of contract, i18n and xmlio but I
never see before the other project you told (Slide/Projector). This other is
a jakarta project?

In contract sources I see all constraints classes (these classes is similar
to the classes suggested in book Hardcore Java, from O'Reilly) and the
processor class and interface. But I need to see more i18n (I see your name
there is some place ...).

This is a good starting point for learning to deal
with the contract and the related i18n component.
I will do this.

The idea behind the constraint classes is to have a powerful way not only
to
describe the constraints of a special value but also to be able to verbose
these constraints in a human-readable way.
Let user decides what form choose to use right? Good, I think is a very good
idea!!! If he wants a programmatic or declarative form he only need to
decide!!

Do you plan to use this library (can I call Library?) in some developing
process? Like UML Components (Chesman and Daniels)?

Man, I have a book filled with ideas (and a very bad english!!!).
I´m newbie here, maybe I need some help ok?

Thanx
Woody


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



Re: [contract] Suggestions

2005-01-23 Thread Anaximandro (Woody)
  Daniel, what dou you think about put constraints rules on some type of
  propertie file? These constraints must have some type of identification
(in
  one ore more contexts). This is flexible and make the code more clean
(and,
  like ejb, can be changed without the need to recompile the code).
 I guess it would have been an alternative to use meta information tags
 using @ in Javadocs as well. However, I understand that Daniel did all
 this as a philosophical decision.
   more one javadoc tag? I dono, are you suggesting to use the own source
   code as a propertie file or generate another source like xdoclet does?

 Specifying everything in Java does
 not require to learn any new language and makes debugging very easy.
   I dont't agree with debugging facilitie you told. Debug more code is
more
   hard than debug less code. Don't have to learn another language to use
   the library is a facilitie, I agree, but I´m not talking about another
language,
   I´m talking about another way, more easy and flexible, to do the same
   thing. By example:

?xml version=1.0?
contract
  extend../another/contract.xml/extend
  nameContract Sample/name
  idsampleContract/id
  currentVersion0.1/currentVersion

  constexts
context
  nameSpeedCalculator/name
  idSpeedCalculator/id
/context
  /contexts

  constraints
constraint
  namedistance/caption
  iddistance/id
  typejava.lang.Number/type
  nullablefalse/nullable
  default0/default
  minvalue0minvalue
  maxvalue99maxvalue
  inclusivetrue/inclusive
  /constraint
constraint
  nameunit/caption
  idunit/id
  typejava.lang.String/type
  nullablefalse/nullable
  domain
value id=h caption=h   comment=hours/
value id=m caption=min comment=minutes/
value id=d caption=s   comment=seconds/
  /domain
  defaulth/default
  /constraint
constraint
  nametime/caption
  idtime/id
  typejava.lang.Long/type
  nullablefalse/nullable
  /constraint
  /constraints

  parameters
parameter
  captiondistance/caption
  iddistance/id
  typejava.lang.Number/type
  contraintdistance/constraint
  /parameter
parameter
  captionunit/caption
  idunit/id
  typejava.lang.String/type
  contraintunit/constraint
  /parameter
parameter
  captiontime/caption
  idtime/id
  typejava.lang.Long/type
  contrainttime/constraint
  /parameter
  /parameters

  results
  /results

/contract

with this contract defined I think in this code:

public Number speedCalculator( final Number distance, final String unit,
final Long time ) throws ContractException {

final String context = speedCalculator;
final Contract parameters = Contract.getInstance().getContext(
context ).getParameters();
final Contract result = Contract.getInstance().getContext(
context ).getResult();

float distance = ((Number) parameters.set(distance));
String timeUnit = ((String) parameters.set(unit);
float time = ((Number) parameters.set(time));
parameters.verifyContract();

float speed;
if (timeUnit.equals(s))
speed = distance / time;
else if (timeUnit.equals(min))
speed = distance * 60 / time;
else
speed = distance * 3600 / time;

// I dono if I really need to check result
speed = ((float) result.set( speed ));
result.verifyContract();

return speed;
}


  Do you know OCL?

 I think it would be suitable for describing those contract
 information, but wouldn't this require some sort of OCL parser and
 then engine? Wouldn't this be out of scope for a simple tool like
 this?

 I agree, make a OCL parser is out of THIS scope. In fact we don't need all
ideas in
 OCL but I think is a good start point to study right? Is there any OCL
parser
 implementation? No? Cool!!!

Woody


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