Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4652 - in branches/WebAdmin: . ant perfSONARWebAdmin/admin/service perfSONARWebAdmin/admin/wizard perfSONARWebAdmin/auxiliary/wizard

Subject: perfsonar development work

List archive

perfsonar: r4652 - in branches/WebAdmin: . ant perfSONARWebAdmin/admin/service perfSONARWebAdmin/admin/wizard perfSONARWebAdmin/auxiliary/wizard


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4652 - in branches/WebAdmin: . ant perfSONARWebAdmin/admin/service perfSONARWebAdmin/admin/wizard perfSONARWebAdmin/auxiliary/wizard
  • Date: Wed, 22 Oct 2008 09:37:12 -0400

Author: pgerakios
Date: 2008-10-22 09:37:11 -0400 (Wed, 22 Oct 2008)
New Revision: 4652

Modified:
branches/WebAdmin/CHANGELOG
branches/WebAdmin/ant/const.properties
branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
branches/WebAdmin/perfSONARWebAdmin/admin/wizard/Wizard.java

branches/WebAdmin/perfSONARWebAdmin/auxiliary/wizard/ConfigurationHandler.java
Log:
0.9.8b

Modified: branches/WebAdmin/CHANGELOG
===================================================================
--- branches/WebAdmin/CHANGELOG 2008-10-22 13:06:34 UTC (rev 4651)
+++ branches/WebAdmin/CHANGELOG 2008-10-22 13:37:11 UTC (rev 4652)
@@ -6,3 +6,7 @@
- index.jsp -> dead code has been removed
- Better support for exceptions

+
+version 0.9.8b
+
+- Fixed some unknown bugs introduced by version 0.9.7b

Modified: branches/WebAdmin/ant/const.properties
===================================================================
--- branches/WebAdmin/ant/const.properties 2008-10-22 13:06:34 UTC (rev
4651)
+++ branches/WebAdmin/ant/const.properties 2008-10-22 13:37:11 UTC (rev
4652)
@@ -9,7 +9,7 @@
target.server=127.0.0.1
service.name=perfsonar-web-admin
jarfilename=perfsonar-web-admin
-version=0.9.7b
+version=0.9.8b

antcontrib.jar=${basedir}/lib/misc/ant-contrib-1.0b3.jar
antpsbase.jar=${basedir}/lib/misc/perfsonar-base-ant-1.0.20080303.jar

Modified: branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
2008-10-22 13:06:34 UTC (rev 4651)
+++ branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
2008-10-22 13:37:11 UTC (rev 4652)
@@ -20,6 +20,7 @@

import org.apache.commons.codec.binary.Base64;

+import perfSONARWebAdmin.auxiliary.MaskedException;
import perfSONARWebAdmin.auxiliary.Authenticator;
import perfSONARWebAdmin.auxiliary.AuthenticatorImpl;
import perfSONARWebAdmin.auxiliary.PerfsonarProperties;
@@ -38,6 +39,7 @@
* Class used for administrating the properties files of perfSONAR Java
services
*
* @author Michalis Michael, CyNet
+ * @author Prodromos Gerakios GRNET
*
*/
@SuppressWarnings("all")
@@ -68,11 +70,11 @@
//
-----------------------------------------------------------------------
// public methods

- private static String getLog4jProperty()
+ private static String getLog4jProperty() throws IOException
{
- String log4j_keyprop = null;
+ String log4j_keyprop = "service.log.log4j.config";

- if( log4j_keyprop == null ) try
+ try
{
Properties pr = new Properties();
pr.load(new
java.io.FileInputStream(new java.io.File(servicePath+
ServletPropertiesPath)));
@@ -84,22 +86,28 @@
}
catch( Throwable t )
{
- t.printStackTrace();
+ output.error_page("An error has
occured " + t.getMessage() ,"");
}

- if( log4j_keyprop != null ) // update logging path
+ PerfsonarProperty p = null;
+
+ try
+ {
+ p = new
PerfsonarPropertiesImpl(servicePath+serviceProperties).getProperty(log4j_keyprop);
+ }
+ catch( Throwable t )
{
- try
- {
- PerfsonarProperty p = new
PerfsonarPropertiesImpl(servicePath+serviceProperties).getProperty(log4j_keyprop);
- if( p != null && p.getValue() != null )
return p.getValue().trim();
- }
- catch( Throwable t )
- {
- t.printStackTrace();
- }
+ output.error_page("An error has
occured " + t.getMessage() ,"");
}
- return "log4j.properties";
+
+ if( p != null && p.getValue() != null ) return
p.getValue().trim();
+ else
+ {
+
output.error_page("Misconfigured service.properties file : Could not find
property " +
+
log4j_keyprop + ". Please update
service.properties file and press the reload button on your browser."
+
,"");
+ return null;
+ }
}
/*
* (non-Javadoc)
@@ -161,8 +169,9 @@
String extra = servletProperties.getProperties().getProperty(
"servlet.extra_functionalities");

- log4jProperties = confPath + getLog4jProperty();
-
+ log4jProperties = getLog4jProperty();
+ if( log4jProperties == null ) return;
+
if (extra != null) {
if (extra.equals("off")) {
extraFunctionalities = "off";
@@ -182,7 +191,7 @@

if (session.getAttribute("propertyType")
.equals("loggingProperties")) {
- filePath = servicePath + log4jProperties;
+ filePath = log4jProperties;
Type = "loggingProperties";
// throw new IOException("that was logging
selected");
} else {
@@ -264,7 +273,7 @@
} else {
if (servicePath == null)
output.error_page(
- "Config file
points to non existing service.\n Please input the right service to the
servlet.properties file",
+ "Config file
points to non-existing service.\n Please input the right service to the
servlet.properties file",
Type);
else {
// In this case the user
wants to add a new property
@@ -290,7 +299,7 @@
} else {
String path;
if
(Type.equals("loggingProperties")) {
- path =
servicePath + this.log4jProperties;
+ path =
this.log4jProperties;
} else {
path =
servicePath + this.serviceProperties;
}

Modified: branches/WebAdmin/perfSONARWebAdmin/admin/wizard/Wizard.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/admin/wizard/Wizard.java
2008-10-22 13:06:34 UTC (rev 4651)
+++ branches/WebAdmin/perfSONARWebAdmin/admin/wizard/Wizard.java
2008-10-22 13:37:11 UTC (rev 4652)
@@ -37,7 +37,7 @@
import perfSONARWebAdmin.auxiliary.MaskedException;

/**
- * Servlet to be used as a wizard for configurating perfSONAR service
+ * Servlet to be used as a wizard for configuring perfSONAR service
*
* @author Michalis Michael, CyNet
*
@@ -75,6 +75,7 @@
// A class responsible for generation the html code
private static HTMLOutput output = null;

+ private static final String goBack = "<a href=\"Wizard\">Back</a>";
//
-----------------------------------------------------------------------
// public methods

@@ -95,8 +96,7 @@
try {
output = new HTMLOutput();
// Loading the wizard properties
- properties.loadFromXML(sc.getResourceAsStream("/"
- + WizardPropertiesPath));
+ properties.loadFromXML(sc.getResourceAsStream("/"+
WizardPropertiesPath));
// Preparing properties into groups
groupedProperties = prepareProperties(properties);
// Check to see if there is a configuration handler
avalable
@@ -197,7 +197,6 @@
// finish then we have the right input
String function =
request.getParameter("function").trim();
if (function.equals("finish")) {
- String goBack = "<a
href=\"Wizard\">Back</a>";
try {

handler.handleRequest(request);
output.infoPage
@@ -207,7 +206,6 @@
}
catch (MaskedException e) {
e.print();
- // If an exceprion
has happened we notify the user

output.infoPage("perfSONAR configuration Wizard",

"Problem occured while finishing the configuration process."

+ goBack + "\n" + getFault(e));

Modified:
branches/WebAdmin/perfSONARWebAdmin/auxiliary/wizard/ConfigurationHandler.java
===================================================================
---
branches/WebAdmin/perfSONARWebAdmin/auxiliary/wizard/ConfigurationHandler.java
2008-10-22 13:06:34 UTC (rev 4651)
+++
branches/WebAdmin/perfSONARWebAdmin/auxiliary/wizard/ConfigurationHandler.java
2008-10-22 13:37:11 UTC (rev 4652)
@@ -28,8 +28,7 @@
protected static final String confPath =
"WEB-INF/classes/perfsonar/conf/";

// The path to the service.properties file
- protected static final String ServicePropertiesPath = confPath
- + "service.properties";
+ protected static final String ServicePropertiesPath = confPath +
"service.properties";

// The path to the logging properties file
protected static String LoggingPropertiesPath = confPath +
"log4j.properties";
@@ -51,16 +50,15 @@

protected static HTMLOutput output = null;

- protected static boolean configured = false;

private static final String log4j_key =
"servlet.log4j_path";

- private static String log4j_keyprop = null;
+ private static String log4j_keyprop =
"service.log.log4j.config";

private void updateLoggingPath( String str ) throws
MaskedException
{
- if( str != null &&
str.indexOf(java.io.File.separator) < 0)
- LoggingPropertiesPath = confPath + str.trim();
+ if( str != null )
+ LoggingPropertiesPath = str.trim();
else throw new MaskedException(new
Exception(),"Invalid logging path " + str + "\n");
}

@@ -70,7 +68,7 @@
this.properties = properties;
this.groupedProperties = groupedProperties;

- if( log4j_keyprop == null ) try
+ try
{
Properties pr = new Properties();
pr.load(new
java.io.FileInputStream(new java.io.File(ServicePath+
ServletPropertiesPath)));
@@ -82,21 +80,30 @@
}
catch( Throwable t )
{
- t.printStackTrace();
+ throw new RuntimeException("An error has
occured." + t.getMessage());
}

- if( log4j_keyprop != null ) // update logging path
+ PerfsonarProperty p = null;
+
+ try
+ {
+ p = new
PerfsonarPropertiesImpl(ServicePath+ServicePropertiesPath).getProperty(log4j_keyprop);
+ }
+ catch( Throwable t )
{
- try
- {
- PerfsonarProperty p = new
PerfsonarPropertiesImpl(ServicePath+ServicePropertiesPath).getProperty(log4j_keyprop);
- if( p != null )
updateLoggingPath(p.getValue());
- }
- catch( Throwable t )
- {
- t.printStackTrace();
- }
+ throw new RuntimeException("An error has
occured." + t.getMessage());
}
+
+ if( p != null ) try
+ {
+ updateLoggingPath(p.getValue());
+ }
+ catch( MaskedException e )
+ {
+ throw new RuntimeException("Misconfigured
service.properties file : " + e.getMessage());
+ }
+ else throw new RuntimeException("Misconfigured
service.properties file : Could not find property " +
+
log4j_keyprop + ". Please update
service.properties file and press the reload button on your browser.");
}

/**
@@ -124,18 +131,6 @@
}

/**
- * Method that indicates if that all configuration actions have been
done
- * successfully
- *
- * @return A boolean stating if configuration is finished and
succesful or
- * not
- */
- public final boolean isConfigured()
- {
- return configured;
- }
-
- /**
* Method used by the wizard servlet in order to set the HTMLOutoput
Object
* used by the cinfiguration handler
*
@@ -149,18 +144,15 @@

private final void finishConfiguration(HttpServletRequest request)
throws MaskedException
{
- if( log4j_keyprop != null )
- {
- String value =
request.getParameter(log4j_keyprop).trim();
- if( value != null ) updateLoggingPath(value);
- }
+ String value = request.getParameter(log4j_keyprop);
+ if( value != null ) updateLoggingPath(value);

try
{
PerfsonarPropertiesImpl.
update(ServicePath + ServicePropertiesPath,
- new
PerfsonarProperty("service.sax_parser.config",ServicePath +
ObjectsConfigPath,"Internals","Sax parser configuration parameter"),
- new
PerfsonarProperty("service.log.log4j.config",ServicePath +
LoggingPropertiesPath,"Internals","Logging Properties path")
+ new
PerfsonarProperty("service.sax_parser.config",ServicePath +
ObjectsConfigPath,"Sax parser configuration parameter","Internals"),
+ new PerfsonarProperty(log4j_keyprop,
LoggingPropertiesPath,"Logging Properties path","Internals")
);
}
catch (Exception e)



  • perfsonar: r4652 - in branches/WebAdmin: . ant perfSONARWebAdmin/admin/service perfSONARWebAdmin/admin/wizard perfSONARWebAdmin/auxiliary/wizard, svnlog, 10/22/2008

Archive powered by MHonArc 2.6.16.

Top of Page