2006/unicorn/src/org/w3c/unicorn/action Action.java,1.14,1.15 ObserveAction.java,1.47,1.48

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/action
In directory hutz:/tmp/cvs-serv14938/src/org/w3c/unicorn/action

Modified Files:
	Action.java ObserveAction.java 
Log Message:
simpler way to make the Message level enum

Index: ObserveAction.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/ObserveAction.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- ObserveAction.java	1 Oct 2009 13:59:39 -0000	1.47
+++ ObserveAction.java	5 Oct 2009 14:25:42 -0000	1.48
@@ -203,7 +203,7 @@
 		resp.setContentType(aOutputModule.getMimeType() + "; charset=UTF-8");
 		
 		if (!reqParams.containsKey(paramPrefix + "uri") && !reqParams.containsKey(paramPrefix + "text") && !reqParams.containsKey(paramPrefix + "file")) {
-			messages.add(new Message(Message.Level.ERROR, "$message_nothing_to_validate", null));
+			messages.add(new Message(Message.ERROR, "$message_nothing_to_validate", null));
 			aOutputModule.produceError( mapOfStringObject, resp.getWriter());
 			return;
 		}
@@ -259,7 +259,7 @@
 			aUnicornCall.doTask();
 			messages.addAll(aUnicornCall.getMessages());
 			if (aUnicornCall.getResponses().size() == 0) {
-				messages.add(new Message(Message.Level.ERROR, "$message_no_observation_done", null));
+				messages.add(new Message(Message.ERROR, "$message_no_observation_done", null));
 				aOutputModule.produceError(mapOfStringObject, resp.getWriter());
 			} else {
 				aOutputModule.produceOutput(mapOfStringObject, resp.getWriter());
@@ -268,7 +268,7 @@
 			if (ucnException.getUnicornMessage() != null)
 				messages.add(ucnException.getUnicornMessage());
 			else
-				messages.add(new Message(Message.Level.ERROR, ucnException.getMessage(), null));
+				messages.add(new Message(Message.ERROR, ucnException.getMessage(), null));
 			aOutputModule.produceError(mapOfStringObject, resp.getWriter());
 		} catch (final Exception aException) {
 			logger.error("Exception : " + aException.getMessage(), aException);

Index: Action.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/Action.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- Action.java	30 Sep 2009 15:02:41 -0000	1.14
+++ Action.java	5 Oct 2009 14:25:42 -0000	1.15
@@ -72,17 +72,17 @@
 			return lang;
 		
 		if (!Language.isComplete(lang))
-			messages.add(new Message(Message.Level.INFO, "$message_incomplete_language. $message_translation", null));
+			messages.add(new Message(Message.INFO, "$message_incomplete_language. $message_translation", null));
 		else if (!Framework.getLanguageProperties().containsKey(req.getLocale().getLanguage()) && Property.get("SHOW_LANGUAGE_UNAVAILABLE_MESSAGE").equals("true"))
-			messages.add(new Message(Message.Level.INFO, "$message_unavailable_language (" + req.getLocale().getDisplayLanguage(req.getLocale()) + "). $message_translation", null));
+			messages.add(new Message(Message.INFO, "$message_unavailable_language (" + req.getLocale().getDisplayLanguage(req.getLocale()) + "). $message_translation", null));
 		else if (langParameter != null && !Framework.getLanguageProperties().containsKey(langParameter)) {
 			if (Language.isISOLanguageCode(langParameter)) {
 				Locale locale = Language.getLocale(langParameter);
 				if (locale == null)
 					logger.warn("Missing locale: " + langParameter + ". This locale should be installed on the system in order to translate Unicorn in this language.");
-				messages.add(new Message(Message.Level.INFO, "$message_unavailable_requested_language (" + locale.getDisplayLanguage(locale) + "). $message_translation", null));
+				messages.add(new Message(Message.INFO, "$message_unavailable_requested_language (" + locale.getDisplayLanguage(locale) + "). $message_translation", null));
 			} else {
-				messages.add(new Message(Message.Level.INFO, "$message_invalid_requested_language (" + langParameter + ")", null));
+				messages.add(new Message(Message.INFO, "$message_invalid_requested_language (" + langParameter + ")", null));
 			}
 		}
 		
@@ -101,10 +101,10 @@
 			return task;
 		
 		if (taskParameter == null) {
-			Message mess = new Message(Message.Level.WARNING, "$message_no_task " + "$default_task.getLongName($lang) ", null);
+			Message mess = new Message(Message.WARNING, "$message_no_task " + "$default_task.getLongName($lang) ", null);
 			messages.add(mess);
 		} else if (!Framework.mapOfTask.containsKey(taskParameter)) {
-			Message mess = new Message(Message.Level.WARNING, "$message_unknown_task " + "$default_task.getLongName($lang) ", null);
+			Message mess = new Message(Message.WARNING, "$message_unknown_task " + "$default_task.getLongName($lang) ", null);
 			messages.add(mess);
 		}
 		

Received on Monday, 5 October 2009 14:25:49 UTC