perfsonar-dev - perfsonar: r4757 - in branches/WebAdmin: ant perfSONARWebAdmin/admin/exist perfSONARWebAdmin/admin/stitching perfSONARWebAdmin/auxiliary perfSONARWebAdmin/auxiliary/stitching perfSONARWebAdmin/auxiliary/xmlDB
Subject: perfsonar development work
List archive
perfsonar: r4757 - in branches/WebAdmin: ant perfSONARWebAdmin/admin/exist perfSONARWebAdmin/admin/stitching perfSONARWebAdmin/auxiliary perfSONARWebAdmin/auxiliary/stitching perfSONARWebAdmin/auxiliary/xmlDB
Chronological Thread
- From:
- To:
- Subject: perfsonar: r4757 - in branches/WebAdmin: ant perfSONARWebAdmin/admin/exist perfSONARWebAdmin/admin/stitching perfSONARWebAdmin/auxiliary perfSONARWebAdmin/auxiliary/stitching perfSONARWebAdmin/auxiliary/xmlDB
- Date: Tue, 9 Dec 2008 11:33:43 -0500
Author: pgerakios
Date: 2008-12-09 11:33:42 -0500 (Tue, 09 Dec 2008)
New Revision: 4757
Modified:
branches/WebAdmin/ant/const.properties
branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
branches/WebAdmin/perfSONARWebAdmin/auxiliary/AuthenticatorImpl.java
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/ElementParser.java
branches/WebAdmin/perfSONARWebAdmin/auxiliary/xmlDB/existAuthenticatorImpl.java
Log:
Version 0.9.2c - fixed rrdma xml parser
Modified: branches/WebAdmin/ant/const.properties
===================================================================
--- branches/WebAdmin/ant/const.properties 2008-12-09 13:36:04 UTC (rev
4756)
+++ branches/WebAdmin/ant/const.properties 2008-12-09 16:33:42 UTC (rev
4757)
@@ -9,7 +9,7 @@
target.server=127.0.0.1
service.name=perfsonar-web-admin
jarfilename=perfsonar-web-admin
-version=0.9.1c
+version=0.9.2c
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/exist/eXistAdmin.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
2008-12-09 13:36:04 UTC (rev 4756)
+++ branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
2008-12-09 16:33:42 UTC (rev 4757)
@@ -208,6 +208,7 @@
// A log in request arrives only by post
if (request.getParameter("login") != null
&&
!request.getMethod().equals("GET")) {
+ //new Throwable().printStackTrace();
// Getting username and password
// TO DO: ENCODE PASSWORD AND USER NAME
String user =
request.getParameter("username");
@@ -220,9 +221,10 @@
session.setAttribute("authenticated", false);
try {
// Authenticate user
-
+ // System.out.println("AUTHENTICATING
USER : user " + user + " password : " + password);
if (authenticator.authenticate(user,
password)) {
+ //
System.out.println("AUTHENTICATED USER : user " + user + " password : " +
password);
// If the user is
authenticated then create the db
// manager
manager = new
xmlDBManagerImpl("xmldb:exist://"
@@ -235,6 +237,7 @@
session.setAttribute("manager", manager);
collections_page(out,
request);
} else {
+ //System.out.println("NOT
AUTHENTICATED USER : user " + user + " password : " + password);
login_page(out, false);
}
@@ -248,7 +251,8 @@
// users?
String function = request.getParameter("function");
if (function != null) {
- if ((Boolean)
session.getAttribute("authenticated")) {
+ if ((Boolean)
session.getAttribute("authenticated"))
+ {
// Go to the user manage page
if (function.equals("users")) {
@@ -290,7 +294,8 @@
} else {
if (session.getAttribute("authenticated") != null) {
if
(Boolean.parseBoolean(session.getAttribute("authenticated")
- .toString())) {
+ .toString()))
+ {
if ((Boolean)
session.getAttribute("authenticated")) {
// If so get the db manager
manager = (xmlDBManager)
session
@@ -314,7 +319,7 @@
login_page(out, false);
} else
- login_page(out, false);
+ login_page(out, false); // first time
} else
login_page(out, false);
}
@@ -1565,6 +1570,7 @@
*/
private void login_page(ServletOutputStream out, boolean logged)
throws IOException {
+ //new Throwable().printStackTrace();
String login = "";
preempt(out, logged,"collections");
out.println("<div class=\"manage_exist\" >");
Modified:
branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
2008-12-09 13:36:04 UTC (rev 4756)
+++ branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
2008-12-09 16:33:42 UTC (rev 4757)
@@ -200,11 +200,13 @@
String user = nameAndPassword.substring(0,
index);
String password =
nameAndPassword.substring(index + 1);
+ //System.out.println("STITCHING SERVLET :
username : " + user + " password: " + password);
// Using the authenticator to authenticate
the user
if (authenticator.authenticate(user,
password)) {
// Authetnication was successful we
show the user all
// properties to be configured
session.setAttribute("authenticated",
true);
+ //System.out.println("Authenticated!");
try {
// If all checks out OK the
we are in bussiness
@@ -214,6 +216,7 @@
}
} else {
+ //System.out.println("Not Authenticated!");
askForPassword(response);
session.invalidate();
}
Modified: branches/WebAdmin/perfSONARWebAdmin/auxiliary/AuthenticatorImpl.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/auxiliary/AuthenticatorImpl.java
2008-12-09 13:36:04 UTC (rev 4756)
+++ branches/WebAdmin/perfSONARWebAdmin/auxiliary/AuthenticatorImpl.java
2008-12-09 16:33:42 UTC (rev 4757)
@@ -53,6 +53,8 @@
* java.lang.String)
*/
public boolean authenticate(String userName, String password) {
+// System.out.println("AUTH user: " + userName + " password: "
+ password +
+// " against
user: " + properties.getUserName() + " password: " +
properties.getPassword());
if (userName.equals(properties.getUserName())
&& password.equals(properties.getPassword()))
{
return true;
Modified:
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/ElementParser.java
===================================================================
---
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/ElementParser.java
2008-12-09 13:36:04 UTC (rev 4756)
+++
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/ElementParser.java
2008-12-09 16:33:42 UTC (rev 4757)
@@ -70,21 +70,50 @@
xmlDoc = builder
.build(new
ByteArrayInputStream(metadata.getBytes()));
}
+ System.out.println("PARSING METADATA " + metadata );
Element meta = xmlDoc.getRootElement();
if (meta != null) {
ifaceInfo[7] = meta.getAttributeValue("id");
Element eventType = meta.getChild("eventType", nmwg);
- if (eventType != null) {
- String namespace = eventType.getTextTrim();
- ifaceInfo[8]=namespace;
- Element subject = meta.getChild("subject",
Namespace
- .getNamespace(namespace +
"/"));
- if (subject != null) {
+ String namespace = "";
+ if (eventType != null)
+ {
+ namespace = eventType.getTextTrim();
+ }
+ else
+ {
+ Element params= meta.getChild("parameters",
nmwg);
+ if(params!=null)
+ {
+ ifaceInfo[8]="";
+ List parameters=
params.getChildren("parameter",nmwg);
+ Iterator it =parameters.iterator();
+ while(it.hasNext())
+ {
+ Element param=(Element)
it.next();
+ if(param.
+
getAttributeValue("name").
+
equals("supportedEventType"))
+
namespace=param.getText().trim();
+ }
+ }
+ }
+ ifaceInfo[8]=namespace;
+// System.out.println("Namespace = " + namespace);
- if (subject.getChild("interface",
nmwgt) != null) {
+ Element subject = meta.
+
getChild("subject",
+
Namespace
+
.getNamespace(namespace + "/"));
+
+ if (subject != null)
+ {
+
+ if (subject.getChild("interface",
nmwgt) != null)
+ {
Element iface =
subject.getChild("interface", nmwgt);
Iterator it =
iface.getChildren().iterator();
@@ -111,26 +140,50 @@
it
=parameters.iterator();
while(it.hasNext()){
Element
param=(Element) it.next();
-
//if(param.getAttributeValue("name").equals("keyword")&¶m.getAttributeValue("type").equals("project")){
if(param.getAttributeValue("name").equals("keyword")){
ifaceInfo[5]=param.getText().trim();
}
+
}
}else{
ifaceInfo[5]="";
}
return ifaceInfo;
- } else
+ }
+ else
+ {
+ System.out.println("HERE 1");
return null;
+ }
} else
- return null;
+
+ {
+ System.out.println("HERE 2");
+ return null;
+ }
- } else
- return null;
- } else
- return null;
+
+ //}
+ // else
+ // {
+ // System.out.println("HERE
3!!");
+ // return null;
+ // }
+
+
+
+ }
+ else
+ {
+ System.out.println("HERE 4");
+ return null;
+ }
+
+
+
+
}
/**
Modified:
branches/WebAdmin/perfSONARWebAdmin/auxiliary/xmlDB/existAuthenticatorImpl.java
===================================================================
---
branches/WebAdmin/perfSONARWebAdmin/auxiliary/xmlDB/existAuthenticatorImpl.java
2008-12-09 13:36:04 UTC (rev 4756)
+++
branches/WebAdmin/perfSONARWebAdmin/auxiliary/xmlDB/existAuthenticatorImpl.java
2008-12-09 16:33:42 UTC (rev 4757)
@@ -9,6 +9,7 @@
import org.xmldb.api.base.ResourceIterator;
import org.xmldb.api.base.ResourceSet;
import org.xmldb.api.base.XMLDBException;
+import org.xmldb.api.base.Resource;
import perfSONARWebAdmin.auxiliary.Authenticator;
@@ -94,13 +95,16 @@
try {
service.getName();
+ String prog =
"xmldb:authenticate('xmldb:exist:///db','"
+ + userName + "','" +
password + "')";
CompiledExpression compiled = service
-
.compile("xmldb:authenticate('xmldb:exist:///db','"
- + userName + "','" +
password + "')");
+ .compile(prog);
ResourceSet result = service.execute(compiled);
ResourceIterator it = result.getIterator();
- return (Boolean.parseBoolean((String)
it.nextResource()
- .getContent()));
+ Resource r = it.nextResource();
+// System.out.println("RESULT id=" + r.getId() + "
content=" +
+//
r.getContent() + "\nProg " + prog);
+ return (Boolean.parseBoolean((String)
r.getContent()));
}
catch( org.xmldb.api.base.XMLDBException e )
- perfsonar: r4757 - in branches/WebAdmin: ant perfSONARWebAdmin/admin/exist perfSONARWebAdmin/admin/stitching perfSONARWebAdmin/auxiliary perfSONARWebAdmin/auxiliary/stitching perfSONARWebAdmin/auxiliary/xmlDB, svnlog, 12/09/2008
Archive powered by MHonArc 2.6.16.