Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r3377 - in branches/WebAdmin: . perfSONARWebAdmin/admin/exist perfSONARWebAdmin/admin/service perfSONARWebAdmin/test

Subject: perfsonar development work

List archive

perfsonar: r3377 - in branches/WebAdmin: . perfSONARWebAdmin/admin/exist perfSONARWebAdmin/admin/service perfSONARWebAdmin/test


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r3377 - in branches/WebAdmin: . perfSONARWebAdmin/admin/exist perfSONARWebAdmin/admin/service perfSONARWebAdmin/test
  • Date: Tue, 19 Feb 2008 02:01:26 -0500

Author: michalis
Date: 2008-02-19 02:01:25 -0500 (Tue, 19 Feb 2008)
New Revision: 3377

Modified:
branches/WebAdmin/default.css
branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
branches/WebAdmin/perfSONARWebAdmin/test/PractisingWizard.java
branches/WebAdmin/perfSONARWebAdmin/test/Tester.java
Log:
Committing code and css changes

Modified: branches/WebAdmin/default.css
===================================================================
--- branches/WebAdmin/default.css 2008-02-19 07:00:26 UTC (rev 3376)
+++ branches/WebAdmin/default.css 2008-02-19 07:01:25 UTC (rev 3377)
@@ -1,171 +1,181 @@
-/* standard elements */
-html {
- min-height: 100%;
-}
-
-* {
- margin: 0;
- padding: 0;
-}
-
-body {
- background-color: #ffffff;
- font-family: arial;
-}
-/* title */
-.top {
- display: block;
- font-family: arial;
- font-weight: bold;
- margin: 2% 1% 0 1%;
- border-top: 1px solid green;
- border-right: 1px solid green;
- border-left: 1px solid green;
- padding: 7px;
- background: #afdfc0;
-}
-
-.properties {
- font-family: arial;
- border: 1px solid green;
- padding: 10px;
- margin: 0% 1% 0 1%;
-}
-
-.properties p {
- font-size: 120%;
-}
-
-.properties table {
- border-bottom: 1px solid green;
- margin-bottom: 20px;
-}
-
-.properties td {
- padding: 15px;
-}
-
-.properties em {
- display: block;
- color: red;
- font-size: 95%;
-}
-
-.info {
- font-family: arial;
- font-size: 120%;
-}
-
-.info p {
- position: relative;
- left: -230px;
-}
-
-.tablessContent {
- margin: 2% 1% 0 1%;
- background: #ffffff;
- border-top: 1px solid green;
- border-left: 1px solid green;
- border-right: 1px solid green;
-}
-
-.content {
- font-family: arial;
- font-size: 120%;
- margin: 2% 1% 0 1%;
- background: #ffffff;
-}
-
-.content ul {
- margin-top: 5px;
- display: block;
- list-style: none outside;
- padding: 5px;
- border-top: 1px solid green;
- border-left: 1px solid green;
- border-right: 1px solid green;
-}
-
-.content li {
- margin: 0 0 0 0;
- padding: 0px;
- display: block;
- float: left;
- position: relative;
- top: -1.32em;
-}
-
-.content a {
- padding: 5px;
- text-decoration: none;
- color: green;
- background: #ffffff;
-}
-
-.content a:hover {
- background: #3CB371;
- color: green;
-}
-
-.content #selected {
-}
-
-.content #selected a {
- font-weight: bold;
- color: green;
- background: #3CB3A1;
-}
-
-.manage {
- background: #ffffff;
- border-bottom: 1px solid green;
- border-left: 1px solid green;
- border-right: 1px solid green;
- margin: 0 1% 0 1%;
- padding: 1em;
-}
-
-.manage table {
- padding: 5px;
-}
-
-.manage td {
- padding: 5px;
-}
-
-.manage th {
- padding: 5px;
- text-align: left;
-}
-
-.showResource {
- font-weight: bold;
- text-indent: 0%;
- text-align: inherit;
- background: #ffffff;
-}
-
-.showResource td {
- padding: 7px;
-}
-
-.input {
- padding: 1em;
- font-size: 110%;
- font-family: arial;
-}
-
-.input table {
- padding: 5px;
-}
-
-.input td {
- padding: 5px;
-}
-
-.input th {
- padding: 5px;
- text-align: left;
-}
-
-
+/* standard elements */
+html {
+ min-height: 100%;
+}
+
+* {
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ background-color: #ffffff;
+ font-family: arial;
+}
+/* title */
+.top {
+ display: block;
+ font-family: arial;
+ font-weight: bold;
+ margin: 2% 1% 0 1%;
+ border-top: 1px solid green;
+ border-right: 1px solid green;
+ border-left: 1px solid green;
+ padding: 7px;
+ background: #afdfc0;
+}
+
+.properties {
+ font-family: arial;
+ font-size: 15px;
+ border: 1px solid green;
+ padding: 10px;
+ margin: 0% 1% 0 1%;
+}
+
+.properties p {
+ font-size: 120%;
+}
+
+.properties div{
+
+}
+.properties table {
+ margin-bottom: 20px;
+ border-bottom: 1px solid green;
+}
+
+.properties td {
+ padding: 15px;
+ width: 27%;
+}
+
+.properties em {
+ display: block;
+ color: red;
+ font-size: 95%;
+}
+
+.main{
+ padding: 10px;
+}
+.info {
+ font-family: arial;
+ font-size: 120%;
+ padding: 10px;
+ border: 1px solid green;
+}
+
+.info p {
+ position: relative;
+ #left: -30px;
+}
+
+.tablessContent {
+ margin: 2% 1% 0 1%;
+ background: #ffffff;
+ border-top: 1px solid green;
+ border-left: 1px solid green;
+ border-right: 1px solid green;
+}
+
+.content {
+ font-family: arial;
+ font-size: 120%;
+ margin: 2% 1% 0 1%;
+ background: #ffffff;
+}
+
+.content ul {
+ margin-top: 5px;
+ display: block;
+ list-style: none outside;
+ padding: 5px;
+ border-top: 1px solid green;
+ border-left: 1px solid green;
+ border-right: 1px solid green;
+}
+
+.content li {
+ margin: 0 0 0 0;
+ padding: 0px;
+ display: block;
+ float: left;
+ position: relative;
+ top: -1.32em;
+}
+
+.content a {
+ padding: 5px;
+ text-decoration: none;
+ color: green;
+ background: #ffffff;
+}
+
+.content a:hover {
+ background: #3CB371;
+ color: green;
+}
+
+.content #selected {
+}
+
+.content #selected a {
+ font-weight: bold;
+ color: green;
+ background: #3CB3A1;
+}
+
+.manage {
+ background: #ffffff;
+ border-bottom: 1px solid green;
+ border-left: 1px solid green;
+ border-right: 1px solid green;
+ margin: 0 1% 0 1%;
+ padding: 1em;
+}
+
+.manage table {
+ padding: 5px;
+}
+
+.manage td {
+ padding: 5px;
+}
+
+.manage th {
+ padding: 5px;
+ text-align: left;
+}
+
+.showResource {
+ font-weight: bold;
+ text-indent: 0%;
+ text-align: inherit;
+ background: #ffffff;
+}
+
+.showResource td {
+ padding: 7px;
+}
+
+.input {
+ padding: 1em;
+ font-size: 110%;
+ font-family: arial;
+}
+
+.input table {
+ padding: 5px;
+}
+
+.input td {
+ padding: 5px;
+}
+
+.input th {
+ padding: 5px;
+ text-align: left;
+}
+
+

Modified: branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
2008-02-19 07:00:26 UTC (rev 3376)
+++ branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
2008-02-19 07:01:25 UTC (rev 3377)
@@ -94,6 +94,7 @@
super.init(config);
ServletContext sc = getServletContext();
servicePath = sc.getRealPath("/");
+
// Loading servlet properties and initializing authenticator
try {
servletProperties = new
eXistServletPropertiesImpl(servicePath
@@ -1029,10 +1030,8 @@
if (netface.getName().equals("eth0")) {
Enumeration e2 =
netface.getInetAddresses();
while (e2.hasMoreElements()) {
- e2.nextElement();
InetAddress ip =
(InetAddress) e2.nextElement();
- String[]
pieces=location.split(":");
- if(pieces.length==2){
+
if(!ip.getHostAddress().contains(":")){
location = ip.getHostAddress()
+
location.substring(location

.indexOf(":"));

Modified: branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
2008-02-19 07:00:26 UTC (rev 3376)
+++ branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
2008-02-19 07:01:25 UTC (rev 3377)
@@ -47,9 +47,9 @@

// Path to service installation directory
private static String servicePath = null;
-
- private static String extraFunctionalities="off";

+ private static String extraFunctionalities = "off";
+
//
-----------------------------------------------------------------------
// public methods

@@ -110,12 +110,13 @@
// Loading the servlet properties
ServletProperties servletProperties = new
ServletPropertiesImpl(
servicePath + ServletPropertiesPath);
- String
extra=servletProperties.getProperties().getProperty("servlet.extra_functionalities");
- if(extra!=null){
- if(extra.equals("off")){
- extraFunctionalities="off";
- }else{
- extraFunctionalities="on";
+ String extra = servletProperties.getProperties().getProperty(
+ "servlet.extra_functionalities");
+ if (extra != null) {
+ if (extra.equals("off")) {
+ extraFunctionalities = "off";
+ } else {
+ extraFunctionalities = "on";
}
}
Authenticator authenticator = new
AuthenticatorImpl(servletProperties);
@@ -154,7 +155,7 @@
properties = null;
session.setAttribute("properties",
properties);
throw new ServletException("Properties file
does not exist! "
- + filePath + "\n"
+filePath);
+ + filePath + "\n" + filePath);
}
}
// Else get the properties from the session
@@ -272,14 +273,13 @@
main_page(out, properties, lock);
} else {
String path;
- if(Type.equals("loggingProperties")){
- path=
servicePath+this.log4jProperties;
+ if (Type.equals("loggingProperties"))
{
+ path = servicePath +
this.log4jProperties;
+ } else {
+ path = servicePath +
this.serviceProperties;
}
- else{
- path=
servicePath+this.serviceProperties;
- }
error_page(out, "service properties
file does not exist! "
- + filePath + "\n"
+path , Type);
+ + filePath + "\n" +
path, Type);
}
}
}
@@ -361,6 +361,9 @@
ServiceProperties properties, String lock) throws
IOException {

preempt(out);
+ out.println("<div class=\"tablessContent\" >");
+ out.println("<br/><p> </p>");
+ out.println("</div>");
out.println("<div class=\"manage\">");
out
.println("<h3>perfSONAR service properties
Administration page</h3>");
@@ -419,9 +422,9 @@
out.println("<input type=\"reset\" value=\"Cancel\"
/> ");
}
out.println("</p>");
- if
(lock.equals("enabled")&&extraFunctionalities.equals("on")) {
+ if (lock.equals("enabled") &&
extraFunctionalities.equals("on")) {
// Options foa adding and deleting a property are
added
-
+
out.println("<form action=\"ServiceAdmin\"
method=\"POST\"> ");
out
.println("<p>Add new property name to
the left column and the property value to the right column.</p>");

Modified: branches/WebAdmin/perfSONARWebAdmin/test/PractisingWizard.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/test/PractisingWizard.java
2008-02-19 07:00:26 UTC (rev 3376)
+++ branches/WebAdmin/perfSONARWebAdmin/test/PractisingWizard.java
2008-02-19 07:01:25 UTC (rev 3377)
@@ -3,26 +3,16 @@
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileInputStream;
+
import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
+
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
-import java.util.Properties;

-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.jdom.Element;
-import org.jdom.input.DOMBuilder;
-import org.jdom.output.XMLOutputter;
-import org.xml.sax.SAXException;
-
public class PractisingWizard {

- public static void main(String[] argv){
+ public static void main(String[] argv) {
String listener = "\n\n<listener>\n
<listener-class>org.perfsonar.service.base.container.listeners.StartupInitializer</listener-class>\n</listener>\n";
File web = new File("web.xml");
FileReader fr = null;
@@ -37,17 +27,17 @@
String line = "";
while (line != null) {
if (line.contains("<web-app>")) {
- int ch=line.indexOf("<web-app>") + 9;
- String webappbe = line.substring(0,ch);
- String
webapprest = "";
- if (ch+1 > line.length()) {
+ int ch = line.indexOf("<web-app>") + 9;
+ String webappbe = line.substring(0, ch);
+ String webapprest = "";
+ if (ch + 1 > line.length()) {
webapprest = "";
} else {
- webapprest = line.substring(ch+1);
+ webapprest = line.substring(ch + 1);
}
line = webappbe + listener + webapprest;
}
- contents.append(line+"\n");
+ contents.append(line + "\n");
try {
line = br.readLine();
} catch (IOException e) {
@@ -70,65 +60,37 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
-
- /* File web = new File("web.xml");
- FileInputStream stream = null;
- try {
- stream = new FileInputStream(web);
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- DocumentBuilderFactory dbfactory =
- DocumentBuilderFactory.newInstance();
dbfactory.setValidating(false);
- DocumentBuilder parser = null; DOMBuilder jparser = null;
- org.jdom.Document webDoc = null; try {
- parser =
- dbfactory.newDocumentBuilder();
- } catch (ParserConfigurationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } jparser = new DOMBuilder(); try {
-
- webDoc =
- jparser.build(parser.parse(stream));
- } catch (SAXException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } Element root =
- webDoc.getRootElement(); Element listenerEl = new
Element("listener");
- Element listenerClass = new Element("listener-class");
-
listenerClass.addContent("org.perfsonar.service.base.container.listeners.StartupInitializer");
- listenerEl.addContent(listenerClass);
- root.addContent(listenerEl);
- XMLOutputter outputter = new XMLOutputter();
FileOutputStream out = null;
- try {
- out = new FileOutputStream(web);
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } try {
- outputter.setIndent(true);
- outputter.setNewlines(true);
- outputter.output(root, out);
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- } try {
- out.close();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- try {
- stream.close();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+
+ /*
+ * File web = new File("web.xml"); FileInputStream stream =
null; try {
+ * stream = new FileInputStream(web); } catch
(FileNotFoundException e) { //
+ * TODO Auto-generated catch block e.printStackTrace(); }
+ * DocumentBuilderFactory dbfactory =
+ * DocumentBuilderFactory.newInstance();
dbfactory.setValidating(false);
+ * DocumentBuilder parser = null; DOMBuilder jparser = null;
+ * org.jdom.Document webDoc = null; try { parser =
+ * dbfactory.newDocumentBuilder(); } catch
(ParserConfigurationException
+ * e) { // TODO Auto-generated catch block
e.printStackTrace(); }
+ * jparser = new DOMBuilder(); try {
+ *
+ * webDoc = jparser.build(parser.parse(stream)); } catch
(SAXException
+ * e) { // TODO Auto-generated catch block
e.printStackTrace(); } catch
+ * (IOException e) { // TODO Auto-generated catch block
+ * e.printStackTrace(); } Element root =
webDoc.getRootElement();
+ * Element listenerEl = new Element("listener"); Element
listenerClass =
+ * new Element("listener-class");
+ *
listenerClass.addContent("org.perfsonar.service.base.container.listeners.StartupInitializer");
+ * listenerEl.addContent(listenerClass);
root.addContent(listenerEl);
+ * XMLOutputter outputter = new XMLOutputter();
FileOutputStream out =
+ * null; try { out = new FileOutputStream(web); } catch
+ * (FileNotFoundException e) { // TODO Auto-generated catch
block
+ * e.printStackTrace(); } try { outputter.setIndent(true);
+ * outputter.setNewlines(true); outputter.output(root, out);
} catch
+ * (IOException e1) { // TODO Auto-generated catch block
+ * e1.printStackTrace(); } try { out.close(); } catch
(IOException e) { //
+ * TODO Auto-generated catch block e.printStackTrace(); } try
{
+ * stream.close(); } catch (IOException e) { // TODO
Auto-generated
+ * catch block e.printStackTrace(); }
*/
}
}

Modified: branches/WebAdmin/perfSONARWebAdmin/test/Tester.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/test/Tester.java 2008-02-19
07:00:26 UTC (rev 3376)
+++ branches/WebAdmin/perfSONARWebAdmin/test/Tester.java 2008-02-19
07:01:25 UTC (rev 3377)
@@ -1,24 +1,47 @@
package perfSONARWebAdmin.test;

+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.Socket;
+import java.net.UnknownHostException;
+import java.util.Enumeration;

-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+public class Tester {

-public class Tester extends HttpServlet {
-
- public void doGet(HttpServletRequest request, HttpServletResponse
response){
- doPost(request,response);
+ public static void main(String[] args) throws UnknownHostException,
+ IOException {
+
+ Enumeration<NetworkInterface> e = NetworkInterface
+ .getNetworkInterfaces();
+ while (e.hasMoreElements()) {
+ NetworkInterface netface = (NetworkInterface)
e.nextElement();
+ System.out.println(netface.getName());
+ // if (netface.getName().equals("eth0")) {
+ Enumeration e2 = netface.getInetAddresses();
+ while (e2.hasMoreElements()) {
+ // e2.nextElement();
+ InetAddress ip = (InetAddress)
e2.nextElement();
+ //System.out.println(ip.getHostAddress());
+ if(!ip.getHostAddress().contains(":")){
+
System.out.println(ip.getHostAddress());
+ }
+ /*String[] pieces =
ip.getHostAddress().split(":");
+ if (pieces.length == 2) {
+ String location = ip.getHostAddress();
+ System.out.println("Real address: " +
location);
+ }*/
+ }
+
+ // }
+
+ }
+
+ Socket local = new Socket("localhost", 8080);
+ InetAddress address = local.getLocalAddress();
+ System.out.println(address.getHostAddress());
+ local.close();
+
}
- public void doPost(HttpServletRequest request, HttpServletResponse
response){
- ServletContext sc =getServletContext();
- String info=sc.getServerInfo();
- //String realPath = sc.getRealPath(arg0);
- String path = sc.getContextPath();
- String realPath =request.getServletPath();
-
-
- }

}



  • perfsonar: r3377 - in branches/WebAdmin: . perfSONARWebAdmin/admin/exist perfSONARWebAdmin/admin/service perfSONARWebAdmin/test, svnlog, 02/19/2008

Archive powered by MHonArc 2.6.16.

Top of Page