juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svi...@apache.org
Subject cvs commit: ws-juddi/webapp/WEB-INF juddi.properties
Date Mon, 21 Mar 2005 00:21:57 GMT
sviens      2005/03/20 16:21:57

  Modified:    src/java/org/apache/juddi/registry RegistryServlet.java
                        RegistryEngine.java
               webapp/WEB-INF juddi.properties
  Added:       src/java/org/apache/juddi/i18n
                        MessagesBundle_en_UK.properties
                        MessagesBundle_en_US.properties
                        MessagesBundle.properties
                        RegistryResourceBundle.java
  Log:
  Implementing working localization (i18n) of UDDI error messages.
  
  Revision  Changes    Path
  1.1                  ws-juddi/src/java/org/apache/juddi/i18n/MessagesBundle_en_UK.properties
  
  Index: MessagesBundle_en_UK.properties
  ===================================================================
  #    Translation instructions.
  #
  # 1. Each message line is of the form key=value. Translate 
  #    the value, DO NOT translate the key.
  #
  # 2. The messages may contain arguments that will be filled 
  #    in by the runtime. These are of the form: {0}, {1}, etc.
  #    These must appear as is in the message, though the order
  #    may be changed to support proper language syntax.
  #
  # 3. If a single quote character is to appear in the resulting
  #    message, it must appear in this file as two consecutive
  #    single quote characters.
  #
  # 4. Lines beginning with "#" (like this one) are comment 
  #    lines and may contain translation instructions.  They 
  #    need not be translated unless your translated file, 
  #    rather than this file, will serve as a base for other 
  #    translators.
  
  E_accountLimitExceeded=Authentication token information has timed out.
  E_assertionNotFound=A particular publisher assertion cannot be identified in a save or delete
operation.
  E_authTokenExpired=Authentication token information has timed out.
  E_authTokenRequired=An invalid authentication token was passed to an API call that requires
authentication.
  E_busy=The request cannot be processed at the current time.
  E_categorizationNotAllowed=The data provided does not conform to the restrictions placed
on the category used.
  E_fatalError=A serious technical exception has occurred while processing the request.
  E_invalidCategory=The given keyValue did not correspond to a category within the taxonomy
identified by the tModelKey.
  E_invalidCompletionStatus=One of the assertion status values passed is unrecognized.
  E_invalidKeyPassed=The uuid_key value passed did not match with any known key values.
  E_invalidProjection=An attempt was made to save a business entity containing a service projection
that does not match the business service being projected.
  E_invalidTime=Signifies that the time period, the date/time, or the pair of date/time is
invalid. The error structure signifies the condition that occurred and the error text clearly
calls out the cause of the problem.
  E_invalidURLPassed=An exception occurred during processing of a save server involving accessing
data from a remote URL.
  E_invalidValue=A value that was passed in a keyValue attribute did not pass validation.
This applies to checked categorizations, identifiers and other validated code lists.
  E_keyRetired=A uuid_key value passed has been removed from the registry.
  E_languageError=An exception was detected while processing elements that were annotated
with xml:lang qualifiers.
  E_messageTooLarge=The message is too large.
  E_nameTooLong=The partial name value passed exceeds the maximum name length designated by
the policy of an implementation or Operator Site.
  E_operatorMismatch=An attempt was made to use the publishing API to change data that is
mastered at another Operator Site.
  E_publisherCancelled=The target publisher cancelled the custody transfer.
  E_requestDenied=A custody transfer request has been refused.
  E_resultSetTooLarge=Signifies that the UDDI node deems that a result set from an inquiry
is too large, and requests to obtain the results are not honored, even using subsets. The
inquiry that triggered this error should be refined and re-issued.
  E_requestTimeout=The request could not be carried out because a needed web service, such
as validate_values, did not respond in a reasonable amount of time.
  E_secretUnknown=The target publisher was unable to match the shared secret and the five
(5) attempt limit was exhausted. The target publisher automatically cancelled the transfer
operation.
  E_tooManyOptions=Incompatible arguments were passed.
  E_transferAborted=Signifies that a custody transfer request will not succeed.
  E_unknownUser=The user ID and password pair passed in a get_authToken message is not known
to the Operator Site or is not valid.
  E_unrecognizedVersion=The value of the generic attribute passed is unsupported by the Operator
Instance being queried.
  E_unsupported=The implementor does not support a feature or API.
  E_unvalidatable=The information provided could not be validated.
  E_userMismatch=An attempt was made to use the publishing API to change data that is controlled
by another party.
  E_valueNotAllowed=A value did not pass validation because of contextual issues. The value
may be valid in some contexts, but not in the contextused.
  
  
  
  1.1                  ws-juddi/src/java/org/apache/juddi/i18n/MessagesBundle_en_US.properties
  
  Index: MessagesBundle_en_US.properties
  ===================================================================
  #    Translation instructions.
  #
  # 1. Each message line is of the form key=value. Translate 
  #    the value, DO NOT translate the key.
  #
  # 2. The messages may contain arguments that will be filled 
  #    in by the runtime. These are of the form: {0}, {1}, etc.
  #    These must appear as is in the message, though the order
  #    may be changed to support proper language syntax.
  #
  # 3. If a single quote character is to appear in the resulting
  #    message, it must appear in this file as two consecutive
  #    single quote characters.
  #
  # 4. Lines beginning with "#" (like this one) are comment 
  #    lines and may contain translation instructions.  They 
  #    need not be translated unless your translated file, 
  #    rather than this file, will serve as a base for other 
  #    translators.
  
  E_accountLimitExceeded=Authentication token information has timed out.
  E_assertionNotFound=A particular publisher assertion cannot be identified in a save or delete
operation.
  E_authTokenExpired=Authentication token information has timed out.
  E_authTokenRequired=An invalid authentication token was passed to an API call that requires
authentication.
  E_busy=The request cannot be processed at the current time.
  E_categorizationNotAllowed=The data provided does not conform to the restrictions placed
on the category used.
  E_fatalError=A serious technical exception has occurred while processing the request.
  E_invalidCategory=The given keyValue did not correspond to a category within the taxonomy
identified by the tModelKey.
  E_invalidCompletionStatus=One of the assertion status values passed is unrecognized.
  E_invalidKeyPassed=The uuid_key value passed did not match with any known key values.
  E_invalidProjection=An attempt was made to save a business entity containing a service projection
that does not match the business service being projected.
  E_invalidTime=Signifies that the time period, the date/time, or the pair of date/time is
invalid. The error structure signifies the condition that occurred and the error text clearly
calls out the cause of the problem.
  E_invalidURLPassed=An exception occurred during processing of a save server involving accessing
data from a remote URL.
  E_invalidValue=A value that was passed in a keyValue attribute did not pass validation.
This applies to checked categorizations, identifiers and other validated code lists.
  E_keyRetired=A uuid_key value passed has been removed from the registry.
  E_languageError=An exception was detected while processing elements that were annotated
with xml:lang qualifiers.
  E_messageTooLarge=The message is too large.
  E_nameTooLong=The partial name value passed exceeds the maximum name length designated by
the policy of an implementation or Operator Site.
  E_operatorMismatch=An attempt was made to use the publishing API to change data that is
mastered at another Operator Site.
  E_publisherCancelled=The target publisher cancelled the custody transfer.
  E_requestDenied=A custody transfer request has been refused.
  E_resultSetTooLarge=Signifies that the UDDI node deems that a result set from an inquiry
is too large, and requests to obtain the results are not honored, even using subsets. The
inquiry that triggered this error should be refined and re-issued.
  E_requestTimeout=The request could not be carried out because a needed web service, such
as validate_values, did not respond in a reasonable amount of time.
  E_secretUnknown=The target publisher was unable to match the shared secret and the five
(5) attempt limit was exhausted. The target publisher automatically cancelled the transfer
operation.
  E_tooManyOptions=Incompatible arguments were passed.
  E_transferAborted=Signifies that a custody transfer request will not succeed.
  E_unknownUser=The user ID and password pair passed in a get_authToken message is not known
to the Operator Site or is not valid.
  E_unrecognizedVersion=The value of the generic attribute passed is unsupported by the Operator
Instance being queried.
  E_unsupported=The implementor does not support a feature or API.
  E_unvalidatable=The information provided could not be validated.
  E_userMismatch=An attempt was made to use the publishing API to change data that is controlled
by another party.
  E_valueNotAllowed=A value did not pass validation because of contextual issues. The value
may be valid in some contexts, but not in the contextused.
  
  
  
  1.1                  ws-juddi/src/java/org/apache/juddi/i18n/MessagesBundle.properties
  
  Index: MessagesBundle.properties
  ===================================================================
  #    Translation instructions.
  #
  # 1. Each message line is of the form key=value. Translate 
  #    the value, DO NOT translate the key.
  #
  # 2. The messages may contain arguments that will be filled 
  #    in by the runtime. These are of the form: {0}, {1}, etc.
  #    These must appear as is in the message, though the order
  #    may be changed to support proper language syntax.
  #
  # 3. If a single quote character is to appear in the resulting
  #    message, it must appear in this file as two consecutive
  #    single quote characters.
  #
  # 4. Lines beginning with "#" (like this one) are comment 
  #    lines and may contain translation instructions.  They 
  #    need not be translated unless your translated file, 
  #    rather than this file, will serve as a base for other 
  #    translators.
  
  E_accountLimitExceeded=Authentication token information has timed out.
  E_assertionNotFound=A particular publisher assertion cannot be identified in a save or delete
operation.
  E_authTokenExpired=Authentication token information has timed out.
  E_authTokenRequired=An invalid authentication token was passed to an API call that requires
authentication.
  E_busy=The request cannot be processed at the current time.
  E_categorizationNotAllowed=The data provided does not conform to the restrictions placed
on the category used.
  E_fatalError=A serious technical exception has occurred while processing the request.
  E_invalidCategory=The given keyValue did not correspond to a category within the taxonomy
identified by the tModelKey.
  E_invalidCompletionStatus=One of the assertion status values passed is unrecognized.
  E_invalidKeyPassed=The uuid_key value passed did not match with any known key values.
  E_invalidProjection=An attempt was made to save a business entity containing a service projection
that does not match the business service being projected.
  E_invalidTime=Signifies that the time period, the date/time, or the pair of date/time is
invalid. The error structure signifies the condition that occurred and the error text clearly
calls out the cause of the problem.
  E_invalidURLPassed=An exception occurred during processing of a save server involving accessing
data from a remote URL.
  E_invalidValue=A value that was passed in a keyValue attribute did not pass validation.
This applies to checked categorizations, identifiers and other validated code lists.
  E_keyRetired=A uuid_key value passed has been removed from the registry.
  E_languageError=An exception was detected while processing elements that were annotated
with xml:lang qualifiers.
  E_messageTooLarge=The message is too large.
  E_nameTooLong=The partial name value passed exceeds the maximum name length designated by
the policy of an implementation or Operator Site.
  E_operatorMismatch=An attempt was made to use the publishing API to change data that is
mastered at another Operator Site.
  E_publisherCancelled=The target publisher cancelled the custody transfer.
  E_requestDenied=A custody transfer request has been refused.
  E_resultSetTooLarge=Signifies that the UDDI node deems that a result set from an inquiry
is too large, and requests to obtain the results are not honored, even using subsets. The
inquiry that triggered this error should be refined and re-issued.
  E_requestTimeout=The request could not be carried out because a needed web service, such
as validate_values, did not respond in a reasonable amount of time.
  E_secretUnknown=The target publisher was unable to match the shared secret and the five
(5) attempt limit was exhausted. The target publisher automatically cancelled the transfer
operation.
  E_tooManyOptions=Incompatible arguments were passed.
  E_transferAborted=Signifies that a custody transfer request will not succeed.
  E_unknownUser=The user ID and password pair passed in a get_authToken message is not known
to the Operator Site or is not valid.
  E_unrecognizedVersion=The value of the generic attribute passed is unsupported by the Operator
Instance being queried.
  E_unsupported=The implementor does not support a feature or API.
  E_unvalidatable=The information provided could not be validated.
  E_userMismatch=An attempt was made to use the publishing API to change data that is controlled
by another party.
  E_valueNotAllowed=A value did not pass validation because of contextual issues. The value
may be valid in some contexts, but not in the contextused.
  
  
  
  1.1                  ws-juddi/src/java/org/apache/juddi/i18n/RegistryResourceBundle.java
  
  Index: RegistryResourceBundle.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.juddi.i18n;
  
  import java.util.Locale;
  import java.util.ResourceBundle;
  
  import org.apache.juddi.registry.RegistryEngine;
  import org.apache.juddi.util.Config;
  
  /**
   * @author Steve Viens (sviens@apache.org)
   */
  public class RegistryResourceBundle
  {
    private static final String BASE_MESSAGE_BUNDLE = "org.apache.juddi.i18n.MessagesBundle";
    
    private static ResourceBundle bundle = null;
    
    public static String getString(String key)
    {
      return getBundle().getString(key);
    }
    
    private static ResourceBundle getBundle()
    {
      if (bundle == null)
        bundle = createBundle();
      return bundle;
    }
    
    private static synchronized ResourceBundle createBundle()
    {
      if (bundle != null)
        return bundle;
      
      String language = Config.getStringProperty(RegistryEngine.PROPNAME_I18N_LANGUAGE_CODE);
  
      if ((language == null) || (language.trim().length() == 0))
        language = RegistryEngine.DEFAULT_I18N_LANGUAGE_CODE;
      
      String country = Config.getStringProperty(RegistryEngine.PROPNAME_I18N_COUNTRY_CODE);
      if ((country == null) || (country.trim().length() == 0))
        country = RegistryEngine.DEFAULT_I18N_COUNTRY_CODE;
      
      bundle = ResourceBundle.getBundle(
          BASE_MESSAGE_BUNDLE,
          new Locale(language,country));
      
      return bundle;
    }
    
    
    /***************************************************************************/
    /***************************** TEST DRIVER *********************************/
    /***************************************************************************/
  
  
    public static void main(String[] args)
    {
      System.out.println(RegistryResourceBundle.getString("E_authTokenRequired"));
    }
  }
  
  
  1.21      +8 -2      ws-juddi/src/java/org/apache/juddi/registry/RegistryServlet.java
  
  Index: RegistryServlet.java
  ===================================================================
  RCS file: /home/cvs/ws-juddi/src/java/org/apache/juddi/registry/RegistryServlet.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- RegistryServlet.java	17 Mar 2005 03:39:57 -0000	1.20
  +++ RegistryServlet.java	21 Mar 2005 00:21:57 -0000	1.21
  @@ -125,6 +125,12 @@
           props.put(RegistryEngine.PROPNAME_OPERATOR_NAME,
                     RegistryEngine.DEFAULT_OPERATOR_NAME);
           
  +        props.put(RegistryEngine.PROPNAME_I18N_LANGUAGE_CODE,
  +            RegistryEngine.DEFAULT_I18N_LANGUAGE_CODE);
  +  
  +        props.put(RegistryEngine.PROPNAME_I18N_COUNTRY_CODE,
  +            RegistryEngine.DEFAULT_I18N_COUNTRY_CODE);
  +  
           props.put(RegistryEngine.PROPNAME_DISCOVERY_URL,
                     RegistryEngine.DEFAULT_DISCOVERY_URL);
           
  @@ -392,7 +398,7 @@
           // FatalError DispositionReport within the message from the 
           // SAX parsing problem in the SOAP Fault anyway.
           
  -        errno = String.valueOf(Result.E_FATAL_ERROR);
  +        errno = String.valueOf(Result.E_FATAL_ERROR_NMBR);
           errCode = Result.E_FATAL_ERROR_CODE;
           errMsg = ex.getMessage();
         }
  @@ -421,7 +427,7 @@
           // subclass) but we're going to be friendly and include a
           // FatalError DispositionReport within the SOAP Fault anyway.
           
  -        errno = String.valueOf(Result.E_FATAL_ERROR);
  +        errno = String.valueOf(Result.E_FATAL_ERROR_NMBR);
           errCode = Result.E_FATAL_ERROR_CODE;
           errMsg = "An internal UDDI server error has " +
                    "occurred. Please report this error " +
  
  
  
  1.14      +8 -0      ws-juddi/src/java/org/apache/juddi/registry/RegistryEngine.java
  
  Index: RegistryEngine.java
  ===================================================================
  RCS file: /home/cvs/ws-juddi/src/java/org/apache/juddi/registry/RegistryEngine.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- RegistryEngine.java	17 Mar 2005 03:39:57 -0000	1.13
  +++ RegistryEngine.java	21 Mar 2005 00:21:57 -0000	1.14
  @@ -43,6 +43,10 @@
     // Registry Property Names
     //
     public static final String PROPNAME_OPERATOR_NAME = "juddi.operatorName";
  +  
  +  public static final String PROPNAME_I18N_LANGUAGE_CODE = "juddi.i18n.languageCode";
  +  public static final String PROPNAME_I18N_COUNTRY_CODE = "juddi.i18n.countryCode";
  +  
     public static final String PROPNAME_DISCOVERY_URL = "juddi.discoveryURL";
     public static final String PROPNAME_ADMIN_EMAIL_ADDRESS = "juddi.adminEmailAddress";
// unused
     public static final String PROPNAME_DATASOURCE_NAME = "juddi.dataSource";
  @@ -66,6 +70,10 @@
     // Registry Default Property Values
     //
     public static final String DEFAULT_OPERATOR_NAME = "Apache.org";
  +  
  +  public static final String DEFAULT_I18N_LANGUAGE_CODE = "en";
  +  public static final String DEFAULT_I18N_COUNTRY_CODE = "US";
  +  
     public static final String DEFAULT_DISCOVERY_URL = "http://localhost:8080/juddi/uddiget.jsp?";
     public static final String DEFAULT_ADMIN_EMAIL_ADDRESS = "nobody@apache.org"; // unused
     public static final String DEFAULT_DATASOURCE_NAME = "java:comp/env/jdbc/juddiDB";
  
  
  
  1.6       +4 -0      ws-juddi/webapp/WEB-INF/juddi.properties
  
  Index: juddi.properties
  ===================================================================
  RCS file: /home/cvs/ws-juddi/webapp/WEB-INF/juddi.properties,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- juddi.properties	17 Mar 2005 03:39:58 -0000	1.5
  +++ juddi.properties	21 Mar 2005 00:21:57 -0000	1.6
  @@ -4,6 +4,10 @@
   # The UDDI Operator Name
   juddi.operatorName = jUDDI.org
   
  +# The i18n locale default codes
  +juddi.i18n.languageCode = en
  +juddi.i18n.countryCode = US
  +
   # The UDDI DiscoveryURL Prefix
   juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
   
  
  
  

Mime
View raw message