Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4190 - trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard

Subject: perfsonar development work

List archive

perfsonar: r4190 - trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4190 - trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard
  • Date: Mon, 14 Jul 2008 20:18:25 -0400

Author: michael.bischoff
Date: 2008-07-14 20:18:24 -0400 (Mon, 14 Jul 2008)
New Revision: 4190

Added:

trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/BasicConfigurationWriter.java
Modified:

trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/BasicServiceConfig.java

trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/WizzardResponse.java
Log:
Ls wizzard improvement

Added:
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/BasicConfigurationWriter.java

Modified:
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/BasicServiceConfig.java
===================================================================
---
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/BasicServiceConfig.java
2008-07-15 00:02:57 UTC (rev 4189)
+++
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/BasicServiceConfig.java
2008-07-15 00:18:24 UTC (rev 4190)
@@ -1,14 +1,11 @@
package org.perfsonar.service.measurementPoint.flowsubscription.wizard;
-
import java.io.FileInputStream;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

@@ -22,22 +19,14 @@

public class BasicServiceConfig implements ServiceConfig {

- private static final String SERVICE_LOG_LOG4J_CONFIG =
"service.log.log4j.config";
-
- private static final String SERVICE_SAX_PARSER_CONFIG =
"service.sax_parser.config";
-
private static final long serialVersionUID = 1L;

/** The path to the configuration directory */
public static final String CONFIGURATION_PATH =
"WEB-INF/classes/perfsonar/conf/";
/** The path to the service.properties file */
public static final String SERVICE_PROPERTIES_PATH =
CONFIGURATION_PATH + "service.properties";
- /** The path to the logging properties file */
- public static final String LOGGING_PROPERTIES_PATH =
CONFIGURATION_PATH + "log4j.properties";
- /** The path to the componenets.properties file */
+ /** The path to the components.properties file */
public static final String COMPONENTS_PROPERTIES_PATH =
CONFIGURATION_PATH + "components.properties";
- /** The path to the objects properties file */
- public static final String OBJECTS_DOT_CONFIG_PATH =
CONFIGURATION_PATH + "objects.config";
/** The path to the wizard.properties file */
public static final String WIZARD_PROPERTIES_PATH =
CONFIGURATION_PATH + "wizard.properties";
/** The path to the servlet.properties file */
@@ -64,7 +53,6 @@

private volatile boolean loaded;

-

private BasicServiceConfig(String servicePath,
Collection<ConfigurationHandler> checkList, Map<String, WizardProperties>
properties, String wizardUsername, String wizardPassword, long nanoTime) {
this.handlerList = checkList;
@@ -196,60 +184,12 @@
if(!loaded) {
throw new IllegalStateException("please load
the object first");
}
- PerfsonarProperties properties = new
PerfsonarPropertiesImpl();
- properties.loadProperties(new
FileInputStream(servicePath + SERVICE_PROPERTIES_PATH));

- for(Entry<String, WizardProperties> entry :
serviceProperties.entrySet()) {
- WizardProperties group = entry.getValue();
-
- for(Iterator<?> i = group.orderedKeys();
i.hasNext() ; ) {
- String key = (String) i.next();
- WizardProperty property =
group.getWizardProperty(key);
- properties.setProperty(
- key,
- new PerfsonarProperty(
-
property.getKey(),
-
property.getValue(),
-
property.getPropertyComment(),
-
property.getGroup()
- )
- );
- }
- }
-
- if(properties.getProperty(SERVICE_SAX_PARSER_CONFIG)
== null) {
-
properties.setProperty(SERVICE_SAX_PARSER_CONFIG, getSaxParserProperty());
- }
- if(properties.getProperty(SERVICE_LOG_LOG4J_CONFIG)
== null) {
-
properties.setProperty(SERVICE_LOG_LOG4J_CONFIG, getLog4jProperty());
- }
-
- ServletProperties servletProperties = new
ServletPropertiesImpl(servicePath + SERVLET_PROPERTIES_PATH);
- servletProperties.setUserName(wizardUsername);
- servletProperties.setPassword(wizardPassword);
-
- properties.storeProperties(new
FileOutputStream(servicePath + SERVICE_PROPERTIES_PATH));
+ BasicConfigurationWriter writer = new
BasicConfigurationWriter(servicePath,serviceProperties);
+ writer.write();
}
}

- private PerfsonarProperty getSaxParserProperty() {
- PerfsonarProperty property = new PerfsonarProperty();
- property.setKey(SERVICE_SAX_PARSER_CONFIG);
- property.setValue(servicePath + OBJECTS_DOT_CONFIG_PATH);
- property.setGroup("Internals");
- property.setDescription("Sax parser configuration paramater");
- return property;
- }
-
- private PerfsonarProperty getLog4jProperty() {
- PerfsonarProperty property = new PerfsonarProperty();
- property.setKey(SERVICE_LOG_LOG4J_CONFIG);
- property.setValue(servicePath + LOGGING_PROPERTIES_PATH);
- property.setGroup("Internals");
- property.setDescription("Logging Properties path");
- return property;
- }
-
public ServiceConfig copy() {
return new BasicServiceConfig(servicePath, new
ArrayList<ConfigurationHandler>(handlerList), serviceProperties,
wizardUsername, wizardPassword, System.nanoTime());
}
@@ -258,4 +198,5 @@
private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException {
lifecyleMutex = new Object();
}
+
}

Modified:
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/WizzardResponse.java
===================================================================
---
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/WizzardResponse.java
2008-07-15 00:02:57 UTC (rev 4189)
+++
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/WizzardResponse.java
2008-07-15 00:18:24 UTC (rev 4190)
@@ -126,20 +126,11 @@

WizardProperty pr = pro.getWizardProperty((String) it.next());

- if (group.equals("LS") || pr.getCheck()) {
+ if (pr.getCheck()) {
String onClick = "
onclick=\"showGroup(this,'"+group+"');\"";

- if (group.equals("LS")) {
+ if(pr.getCheck()) {
out.println("<tr>");
- out.println("<td><input type=\"hidden\"
value=\"yes\" id=\"Vl_useLS\" /> Do you wish to register with an LS?</td>");
- out.print("<td>");
- out.print("<input type=\"radio\"
name=\"useLS\" value=\"yes\" "+ onClick + "> yes </input>");
- out.print("<input type=\"radio\" checked
name=\"useLS\" value=\"no\" "+ onClick + "> no </input> ");

- out.print("</td>");
- out.println("</tr>");
- it = pro.orderedKeys();
- } else if(pr.getCheck()) {
- out.println("<tr>");
String[] values = pr.getAcceptedValues();
if(values.length == 2) {
out.println("<tr>");



  • perfsonar: r4190 - trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard, svnlog, 07/14/2008

Archive powered by MHonArc 2.6.16.

Top of Page