taylor 2003/08/28 13:32:42
Modified: src/java/org/apache/jetspeed/modules/actions/portlets
LogfileViewerAction.java
src/java/org/apache/jetspeed/util/parser
ValidationParameterParser.java
Log:
Added short data type support to validation parameter parser
Revision Changes Path
1.2 +2 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/LogfileViewerAction.java
Index: LogfileViewerAction.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/LogfileViewerAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LogfileViewerAction.java 25 Aug 2003 06:18:41 -0000 1.1
+++ LogfileViewerAction.java 28 Aug 2003 20:32:42 -0000 1.2
@@ -170,7 +170,7 @@
if (fileName != null)
{
String content = readFile(fileName);
- context.put("logfile", "Her kommer det snart innholdet av loggfilen
" + fileName + "\n" + content);
+ context.put("logfile", content);
}
else
{
1.5 +19 -4
jakarta-jetspeed/src/java/org/apache/jetspeed/util/parser/ValidationParameterParser.java
Index: ValidationParameterParser.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/parser/ValidationParameterParser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ValidationParameterParser.java 20 Aug 2003 05:40:22 -0000 1.4
+++ ValidationParameterParser.java 28 Aug 2003 20:32:42 -0000 1.5
@@ -185,7 +185,14 @@
}
Object[] args = getArguments(prop);
- setter.invoke(bean, args);
+ try
+ {
+ setter.invoke(bean, args);
+ }
+ catch (Throwable t)
+ {
+ System.out.println("Validation: EXCEPTION (prop): " + prop.getName());
+ }
}
@@ -203,6 +210,10 @@
{
args[0] = getInteger(prop.getName());
}
+ else if (propclass == Short.class || propclass == Short.TYPE)
+ {
+ args[0] = new Short((short)(getInteger(prop.getName()).intValue()));
+ }
else if (propclass == Long.class || propclass == Long.TYPE)
{
args[0] = new Long(getLong(prop.getName()));
@@ -312,13 +323,16 @@
{
return ValidationHelper.isInteger(getString(prop.getName()), false);
}
+ else if (propclass == Short.class || propclass == Short.TYPE)
+ {
+ return ValidationHelper.isInteger(getString(prop.getName()), false);
+ }
else if (propclass == Long.class || propclass == Long.TYPE)
{
return ValidationHelper.isDecimal(getString(prop.getName()), false);
}
else if (propclass == Boolean.class || propclass == Boolean.TYPE)
{
- System.err.println("Auto validate: Boolean -- NOT IMPLEMENTED");
return true;// WORK NEEDED
}
else if (propclass == Double.class || propclass == Double.TYPE)
@@ -348,7 +362,7 @@
}
else if (propclass == Date.class)
{
- System.err.println("Auto validate: Date -- NOT IMPLEMENTED");
+ // System.err.println("Auto validate: Date -- NOT IMPLEMENTED");
return true;//work needed
}
else if (propclass == NumberKey.class)
@@ -397,6 +411,7 @@
}
return null;
}
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]