perfsonar-dev - perfsonar: r3546 - in branches/WebAdmin/perfSONARWebAdmin: admin/exist admin/service admin/wizard/services auxiliary/sqlma auxiliary/wizard
Subject: perfsonar development work
List archive
perfsonar: r3546 - in branches/WebAdmin/perfSONARWebAdmin: admin/exist admin/service admin/wizard/services auxiliary/sqlma auxiliary/wizard
Chronological Thread
- From:
- To:
- Subject: perfsonar: r3546 - in branches/WebAdmin/perfSONARWebAdmin: admin/exist admin/service admin/wizard/services auxiliary/sqlma auxiliary/wizard
- Date: Tue, 25 Mar 2008 06:22:52 -0400
Author: michalis
Date: 2008-03-25 06:22:51 -0400 (Tue, 25 Mar 2008)
New Revision: 3546
Removed:
branches/WebAdmin/perfSONARWebAdmin/admin/wizard/services/RRDMA.class
branches/WebAdmin/perfSONARWebAdmin/admin/wizard/services/RRDMAHandler.class
Modified:
branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
branches/WebAdmin/perfSONARWebAdmin/admin/wizard/services/RRDMAHandler.java
branches/WebAdmin/perfSONARWebAdmin/auxiliary/sqlma/HTMLOutput.java
branches/WebAdmin/perfSONARWebAdmin/auxiliary/wizard/HTMLOutput.java
Log:
Modifying look and feel for web admin
Modified: branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
2008-03-21 14:28:56 UTC (rev 3545)
+++ branches/WebAdmin/perfSONARWebAdmin/admin/exist/eXistAdmin.java
2008-03-25 10:22:51 UTC (rev 3546)
@@ -60,10 +60,10 @@
private static final String servicePropertiesPath = confPath
+ "service.properties";
-// The path to the exist properties
+ // The path to the exist properties
private static final String servletPropertiesPath = confPath
+ "servlet.properties";
-
+
// The driver to use for connecting to exist
public static final String driver = "org.exist.xmldb.DatabaseImpl";
@@ -93,12 +93,13 @@
super.init(config);
ServletContext sc = getServletContext();
- servicePath = sc.getRealPath("/");
-
+ servicePath = sc.getRealPath("/");
+
// Loading servlet properties and initializing authenticator
try {
servletProperties = new
eXistServletPropertiesImpl(servicePath
- +
servletPropertiesPath,servicePath+servicePropertiesPath);
+ + servletPropertiesPath, servicePath
+ + servicePropertiesPath);
authenticator = new
existAuthenticatorImpl("xmldb:exist://"
+
servletProperties.getModDBLocation(), servletProperties
.getAdminPassword());
@@ -141,7 +142,7 @@
HttpSession session = request.getSession(true);
ServletOutputStream out = response.getOutputStream();
servletProperties = new eXistServletPropertiesImpl(servicePath
- +
servletPropertiesPath,servicePath+servicePropertiesPath);
+ + servletPropertiesPath, servicePath +
servicePropertiesPath);
// Set the inactive interval for this session
if (session.isNew())
session.setMaxInactiveInterval(1800);
@@ -232,7 +233,7 @@
session.setAttribute("user",
user);
session.setAttribute("password", password);
session.setAttribute("manager", manager);
- login_page(out, true);
+ collections_page(out,
request);
} else {
login_page(out, false);
}
@@ -288,11 +289,34 @@
// Show the front page
} else {
if (session.getAttribute("authenticated") != null) {
- login_page(out,
Boolean.parseBoolean(session.getAttribute(
- "authenticated").toString()));
+ if
(Boolean.parseBoolean(session.getAttribute("authenticated")
+ .toString())) {
+ if ((Boolean)
session.getAttribute("authenticated")) {
+ // If so get the db manager
+ manager = (xmlDBManager)
session
+
.getAttribute("manager");
+ try {
+ manager = new
xmlDBManagerImpl("xmldb:exist://"
+ +
servletProperties.getModDBLocation(),
+
(String) session.getAttribute("user"),
+
(String) session.getAttribute("password"));
+ collection =
manager.getCollection(null);
+ collections_page(out,
request);
+ } catch (Exception e) {
+
+ error_page("Error
loading collections!\n", out,
+
false);
+ }
+
+ }
+
+ else
+ login_page(out, false);
+
+ } else
+ login_page(out, false);
} else
login_page(out, false);
-
}
}
@@ -312,7 +336,7 @@
private void collections_page(ServletOutputStream out,
HttpServletRequest request) throws Exception {
// Outputting the page
- preempt(out, true);
+ preempt(out, true, "collections");
String create = null;
String edit = null;
String action = null;
@@ -373,13 +397,10 @@
edit = request.getParameter("Edit");
// Outputting the management section. Contains all child and
resources
// of the requests collection starting with the root /db
- out.println("<div class=\"manage\" >");
+ out.println("<div class=\"manage_exist\" >");
out.println("<div class=\"showResource\" >");
- out.println("<br><p><h4>Collection Management<h4></p>");
- out.println("<p>");
-
try {
// The childCollection parameter states which is the
collection to
// be analized. To be honest it should be called
parent collection.
@@ -411,26 +432,13 @@
}
- out.println("<form action=\"eXistAdmin\" method=\"GET\"> ");
+ out.println("<form action=\"eXistAdmin\" method=\"POST\"> ");
- // Setting function as a hidded parameter for reference in
the next
- // request
- out
- .println("<input type=\"hidden\"
name=\"function\" value=\"collections\" >");
-
// Showing the contents of the current colection. Child
collections and
// resource
- out.println("<table cellpadding=\"5\" >");
+ out.println("<br/><table cellpadding=\"5\" >");
+ String parent = null;
- out.println("<tr>");
- out.println("<th/>");
- out.println("<th>Resource</th>");
- out.println("<th>Owner</th>");
- out.println("<th>Group</th>");
- out.println("<th>Permissions</th>");
- out.println("<th>Creation Date</th>");
- out.println("</tr>");
- String parent = null;
// A link to navigate back to the parent collection
if (currentCollection.getCollection().getParentCollection()
!= null) {
parent =
currentCollection.getCollection().getParentCollection()
@@ -447,15 +455,32 @@
out.println("<td/>");
out.println("</tr>");
}
+ out.println("<tr>");
+ out.println("<th>Edit/Delete</th>");
+ out.println("<th>Resource</th>");
+ out.println("<th>Owner</th>");
+ out.println("<th>Group</th>");
+ out.println("<th>Permissions</th>");
+ out.println("<th>Creation Date</th>");
+ out.println("</tr>");
+ boolean change = false;
+ String cssclass = "lightgrey";
// Getting child collections and their info
for (int i = 0; i < collections.length; i++) {
+ if (change) {
+ cssclass = "darkgrey";
+ change = false;
+ } else {
+ cssclass = "lightgrey";
+ change = true;
+ }
xmlDBCollection collection = new xmlDBCollectionImpl(
currentCollection.getCollection().getChildCollection(
collections[i]));
- out.println("<tr>");
- out.println("<td>");
+ out.println("<tr class=\"" + cssclass + "\" >");
+ out.println("<td align=\"center\">");
out.println("<input type=\"radio\"
name=\"collection\" value=\""
+ collection.getName() + "\" >");
out.println("</td>");
@@ -463,7 +488,6 @@
out
.println("<a
href=\"eXistAdmin?function=collections&ChildCollection="
+ collection.getName()
- + "\" "
+ "\" >"
+ collections[i] +
"</a>");
out.println("</td>");
@@ -495,14 +519,14 @@
document =
currentCollection.getBinaryDocument(documents[i]);
}
- out.println("<tr><td>");
+ out.println("<tr><td align=\"center\">");
out.println("<input type=\"radio\" name=\"document\"
value=\""
+ documents[i] + "\" >");
out.println("</td>");
out.println("<td>");
String DBLocation =
servletProperties.getModDBLocation();
DBLocation = DBLocation.substring(0,
DBLocation.indexOf("/xmlrpc"));
- DBLocation=getRealIp(DBLocation);
+ DBLocation = getRealIp(DBLocation);
out.println("<a href=http://" + DBLocation + "/rest/"
+ currentCollection.getName() + "/" +
documents[i] + " >"
+ documents[i] + "</a>");
@@ -527,18 +551,23 @@
// Give the user the choice to edit, create or delete a
resource or
// collection
out
- .println("<p><input type=\"submit\"
name=\"action\" value=\"Edit Resource\" >");
+ .println("<p><input class=\"edit_button_res\"
type=\"submit\" name=\"action\" value=\"Edit Resource\" >");
out
- .println("<input type=\"submit\"
name=\"action\" value=\"Create Resource\" >");
+ .println("<input class=\"create_button_res\"
type=\"submit\" name=\"action\" value=\"Create Resource\" >");
out
- .println("<input type=\"submit\"
name=\"action\" value=\"Delete Resource\" >");
+ .println("<input class=\"delete_button_res\"
type=\"submit\" name=\"action\" value=\"Delete Resource\" >");
out
.println("<input type=\"hidden\"
name=\"currentCollection\" value=\""
- + childCollection + "\" >
</p>");
+ + childCollection + "\" >");
out.println("<input type=\"hidden\" name=\"ChildCollection\"
value=\""
- + childCollection + "\" > </p>");
+ + childCollection + "\" > </p></p>");
- out.println("</form> ");
+ // Setting function as a hidded parameter for reference in
the next
+ // request
+ out
+ .println("<input type=\"hidden\"
name=\"function\" value=\"collections\" >");
+
+ out.println("</form><br/>");
out.println("</div>");
// If create is not null then the user wishes to create a new
collection
@@ -854,9 +883,8 @@
// Present the input fields
out.println("<div class=\"input\" >");
- out
- .println("<p><form
action=\"eXistAdmin\" method=\"POST\""
- +
enctype + "> ");
+ out.println("<form
action=\"eXistAdmin\" method=\"POST\""
+ + enctype + "> ");
// Passing needed hidden parameters
out
@@ -871,9 +899,36 @@
// If create then the user should
choose between a
// collection or a
resource-document(Just xml) and give the
// name or upload the file.
+ out.println("<table
class=\"input_table\">");
if (action.equals("Create Resource"))
{
+ out
+ .println("<tr
style=\"border-bottom: 1px solid #4169E1;\" >");
+ out
+ .println("<th
class=\"hilighted\">Create Collection/Resource:</th>");
+ out.println("<td
class=\"underlined\" > </td></tr>");
+ out
+
.println("<tr><th>Set Parameters:</th><th>Set Permissions</th></tr>");
- out.println("<p><table>");
+ } else {
+ out.println("<tr >");
+ out
+ .println("<th
class=\"hilighted\">Edit Selected Resource:</th>");
+ out.println("<th
class=\"underlined\">" + document
+ + "</th>");
+ out
+
.println("<input type=\"hidden\" name=\"resource\" value=\""
+
+ document + "\" >");
+ out
+
.println("<input type=\"hidden\" name=\"type\" value=\""
+
+ type + "\" >");
+ out.println("</td>");
+ out.println("</tr>");
+ out
+
.println("<tr><th>Set Parameters:</th><th>Set Permissions</th></tr>");
+ }
+ out.println("<tr><td>");
+ out.println("<table>");
+ if (action.equals("Create Resource"))
{
out.println("<tr>");
out.println("<th>Resource
Type</th>");
@@ -905,23 +960,13 @@
out
.println("Upload your resource(Only xml files will be accepted!)!");
out.println("</td></tr>");
- out.println("</table></p>");
+
} else {
// If this is an edit then we
just show the name of the
// resource to be edited
- out.println("<p><h4>Selected
Resource: " + document
- + "</h4>");
- out
-
.println("<input type=\"hidden\" name=\"resource\" value=\""
-
+ document + "\" >");
- out
-
.println("<input type=\"hidden\" name=\"type\" value=\""
-
+ type + "\" >");
+
}
- // The rest are common
- out.println("<p><table>");
- out.println("<tr>");
out.println("<th>Set Owner:</th>");
out.println("<td>");
// option to set owner or group
@@ -934,14 +979,13 @@
out
.println("<input
type=\"text\" name=\"group\" value=\"\" size=20 >");
out.println("</td></tr>");
- out.println("</table></p>");
+ out.println("</table>");
+ out.println("</td>");
- // Give permissions
-
out.println("<p><h4>Permissions:</h4></p>");
-
- out.println("<p><table >");
+ out.println("<td>");
+ out.println("<table>");
out.println("<tr>");
- out.println("<th/>");
+ out.println("<th></th>");
out.println("<th>Owner</th>");
out.println("<th>Group</th>");
out.println("<th>Others</th>");
@@ -988,13 +1032,18 @@
out
.println("<input
type=\"checkbox\" checked=\"yes\" name=\"OthersPerm\" value=\"1\" >");
out.println("</td></tr>");
- out.println("</table></p>");
-
+ out.println("</table>");
+ out.println("</td></tr>");
+ out.println("<tr><td>");
// The submit button
- out.println("<input type=\"submit\"
name=\"" + submit
+ out.println("<input type=\"submit\"
class=\"input_"
+ + submit + "_button\"
name=\"" + submit
+ "\" value=\"" +
submit + "\" >");
- out.println("</form><p> ");
+ out.println("</td></tr><td/>");
+ out.println("</table>");
+ out.println("</form>");
+
out.println("</div>");
out.println("</div>");
}
@@ -1008,11 +1057,12 @@
}
/**
- * Method used for converting localhost and 127.0.0.1 address to real
ip adress
+ * Method used for converting localhost and 127.0.0.1 address to real
ip
+ * adress
+ *
* @param location
- * The address of the DB
- * @return
- * The real ip of the db
+ * The address of the DB
+ * @return The real ip of the db
* @throws Exception
*/
private String getRealIp(String location) throws Exception {
@@ -1025,16 +1075,14 @@
Enumeration<NetworkInterface> e = NetworkInterface
.getNetworkInterfaces();
while (e.hasMoreElements()) {
- NetworkInterface netface = (NetworkInterface)
e
- .nextElement();
+ NetworkInterface netface = (NetworkInterface)
e.nextElement();
if (netface.getName().equals("eth0")) {
Enumeration e2 =
netface.getInetAddresses();
while (e2.hasMoreElements()) {
InetAddress ip =
(InetAddress) e2.nextElement();
-
if(!ip.getHostAddress().contains(":")){
- location = ip.getHostAddress()
- +
location.substring(location
-
.indexOf(":"));
+ if
(!ip.getHostAddress().contains(":")) {
+ location =
ip.getHostAddress()
+ +
location.substring(location.indexOf(":"));
}
}
@@ -1057,14 +1105,13 @@
private void users_page(ServletOutputStream out, HttpServletRequest
request)
throws Exception {
- preempt(out, true);
+ preempt(out, true, "users");
// Displaying all the users and their information
- out.println("<div class=\"manage\" >");
+ out.println("<div class=\"manage_exist\" >");
out.println("<div class=\"showResource\" >");
- out.println("<br><p><h4>User Management<h4></p>");
- out.println("<p>");
+ out.println("<br/>");
String[] user = null;
@@ -1075,16 +1122,25 @@
out.println("<table>");
out.println("<tr>");
- out.println("<th/>");
+ out.println("<th>Edit/Delete");
out.println("<th>User</th>");
out.println("<th>Groups</th>");
out.println("<th>Home</th>");
out.println("</tr>");
+ boolean change = false;
+ String cssclass = "lightgrey";
for (int i = 0; i < user.length; i++) {
- out.println("<tr>");
- out.println("<td>");
+ if (change) {
+ cssclass = "darkgrey";
+ change = false;
+ } else {
+ cssclass = "lightgrey";
+ change = true;
+ }
+ out.println("<tr class=\"" + cssclass + "\">");
+ out.println("<td align=\"center\">");
out.println("<input type=\"radio\" name=\"user\"
value=\""
+ user[i] + "\" >");
out.println("</td>");
@@ -1118,17 +1174,15 @@
// Giving the user some options(Edit|Create|Delete users)
out
- .println("<p><input type=\"submit\"
name=\"action\" value=\"Edit\" >");
+ .println("<p><input class=\"edit_button_res\"
type=\"submit\" name=\"action\" value=\"Edit\" >");
out
- .println("<input type=\"submit\"
name=\"action\" value=\"Create\" >");
+ .println("<input class=\"create_button_res\"
type=\"submit\" name=\"action\" value=\"Create\" >");
out
- .println("<input type=\"submit\"
name=\"action\" value=\"Delete\" >");
+ .println("<input class=\"delete_button_res\"
type=\"submit\" name=\"action\" value=\"Delete\" >");
out
- .println("<input type=\"hidden\"
name=\"function\" value=\"users\" > </p>");
- out.println("</form>");
+ .println("<input type=\"hidden\"
name=\"function\" value=\"users\" > </p><p/>");
+ out.println("</form><br/>");
- out.println("</p>");
-
out.println("</div>");
String action = (String) request.getParameter("action");
@@ -1349,10 +1403,11 @@
out.println("<div
class=\"input\">");
out
.println("<form action=\"eXistAdmin\" method=\"POST\"> ");
- out.println("<p><table>");
-
out.println("<tr><th>User:</th>");
+ out.println("<table
class=\"input_table\">");
+ out.println("<tr><th
class=\"hilighted\" >User:</th>");
if (action.equals("Edit")) {
- out.println("<td>" +
usr + "</td>");
+ out.println("<td
class=\"underlined\">" + usr
+ +
"</td>");
} else {
out
.println("<td><input type=\"text\" name=\"newUser\" value=\"\" size=20
></td>");
@@ -1386,18 +1441,24 @@
out
.println("<td><input type=\"text\" name=\"homeCollection\" value=\"\" size=20
></td>");
out.println("</tr>");
- out.println("</table></p>");
+
String name =
(action.equals("Edit")) ? "Change"
: "Create";
+ out.println("<tr><th></th>");
out
-
.println("<input type=\"submit\" name=\"Execute\" value=\""
-
+ name + "\" size=20>");
+
.println("<td><input type=\"text\" name=\"homeCollection\" value=\"\" size=20
>");
+
out
+
.println("<input class=\"execute_button_users\" type=\"submit\"
name=\"Execute\" value=\""
+
+ name + "\" size=20/></td>");
+ out.println("</tr>");
+ out.println("</table>");
+ out
.println("<input type=\"hidden\" name=\"function\" value=\"users\" >");
if (action.equals("Edit")) {
out
.println("<input type=\"hidden\" name=\"action\" value=\"Edit\" >");
- // Pass the user to
be edieted as a hidden
+ // Pass the user to
be edited as a hidden
// parameter.
out
.println("<input type=\"hidden\" name=\"editUser\" value=\""
@@ -1476,9 +1537,9 @@
private void error_page(String message, ServletOutputStream out,
boolean back) throws IOException {
- preempt(out, true);
+ preempt(out, true,"");
out.println("<div class=\"info\">");
- out.println("<br><p><h3>" + message + "</h3>");
+ out.println("<br><p><h4>" + message + "</h4>");
if (back) {
out.println("<a href=\"/perfSONAR/eXistAdmin\" \">Go
Back</a>");
}
@@ -1501,24 +1562,18 @@
private void login_page(ServletOutputStream out, boolean logged)
throws IOException {
String login = "";
- if (!logged) {
- login = "Please login in order to make
modifications.";
- }
- preempt(out, logged);
+ preempt(out, logged,"collections");
+ out.println("<div class=\"manage_exist\" >");
- out.println("<div class=\"manage\" >");
+ out.println("<div class=\"showResource\" >");
- out.println("<div class=\"showResource\" >");
+ out.println("<table class=\"login_table\">");
out
- .println("<br/><p>Welcome to the eXist
database configuration service for perfSONAR services. "
- + login);
-
+ .println("<tr><td>Welcome to the eXist
database configuration service for perfSONAR services.</td><td/></tr>");
if (!logged) {
-
+ out
+ .println("<tr><td>Please login in
order to make modifications.Logging in using the admin account is
recomended.</td><td/></tr>");
out.println("<form action=\"eXistAdmin\"
method=\"POST\"> ");
-
- out.println("<table>");
-
out.println("<tr><td>");
out
.println("Username: <input
type=\"text\" name=\"username\" value=\"\" size=20 >");
@@ -1526,14 +1581,12 @@
out.println("<tr><td>");
out
.println("Password: <input
type=\"password\" name=\"password\" value=\"\" size=20 >");
- out.println("</td></tr>");
+ out
+ .println("</td><td><input
class=\"login_button\" type=\"submit\" name=\"login\" value=\"login\"
/></td></tr>");
out.println("</table>");
- out
- .println("<input type=\"submit\"
name=\"login\" value=\"login\" />");
out.println("</form>");
- out.println("</p>");
} else {
- out.println("</p>");
+ out.println("</table>");
}
out.println("</div>");
@@ -1607,7 +1660,7 @@
out.println("<div class=\"info\">");
out.println("<p> ");
- out.println("<h3>" + message + "</h3>");
+ out.println(message);
out.println("<a href=\"eXistAdmin?function=" + manage
+ "&ChildCollection=" + collection +
"\">Refresh</a>");
out.println("</p>");
@@ -1623,33 +1676,46 @@
* @param logged
* @throws IOException
*/
- private void preempt(ServletOutputStream out, boolean logged)
- throws IOException {
+ private void preempt(ServletOutputStream out, boolean logged,
+ String function) throws IOException {
+ String userscss = "users_option_on";
+ String collectionscss = "collections_option_on";
+ if (function.equals("collections")) {
+ userscss = "users_option_off";
+ collectionscss = "collections_option_on";
+ } else {
+ userscss = "users_option_on";
+ collectionscss = "collections_option_off";
+ }
out.println("<html>");
out
.println("<head><link rel=\"stylesheet\"
type=\"text/css\" href=\"default.css\">");
out.println("<title >");
- out.println("perfSONAR eXist database administration page.");
+ out.println(" eXist database administration");
out.println("</title>");
out.println("</head>");
out.println("<body>");
-
- out.println("<div class=\"content\" >");
- out.println("<p>");
- out.println("<ul>");
+ out.println("<div>");
out
- .println("<li><a
href=\"eXistAdmin?function=collections\" >Manage Collections</a></li>");
- out
- .println("<li><a
href=\"eXistAdmin?function=users\" >Manage Users</a></li>");
-
+ .println("<p class=\"exist_welcome_text\"
>eXist Database Administration<p>");
+ out.println("</div>");
if (logged) {
+ out.println("<div class=\"logout\">");
out
- .println("<li><a
href=\"eXistAdmin?logout=LogOut\" >Log Out</a></li>");
+ .println("<a class=\"logoutoption\"
href=\"eXistAdmin?logout=LogOut\" ></a>");
+ out.println("</div>");
+ out.println("<div class=\"content\" >");
+ out.println("<p>");
+ out.println("<ul>");
+ out
+ .println("<li
class=\""+collectionscss+"\"><a href=\"eXistAdmin?function=collections\"
></a></li>");
+ out
+ .println("<li
class=\""+userscss+"\"><a href=\"eXistAdmin?function=users\" ></a></li>");
+ out.println("</ul>");
+ out.println("</p>");
+
+ out.println("</div>");
}
- out.println("</ul>");
- out.println("</p>");
- out.println("</div>");
-
}
}
Modified: branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
2008-03-21 14:28:56 UTC (rev 3545)
+++ branches/WebAdmin/perfSONARWebAdmin/admin/service/Admin.java
2008-03-25 10:22:51 UTC (rev 3546)
@@ -129,12 +129,10 @@
}
}
Authenticator authenticator = new
AuthenticatorImpl(servletProperties);
- String lock = "disabled";
+
String filePath = "";
response.setContentType("text/html");
- // Setting the path for the properties file based on the type
of
- // properties file
if (session.getAttribute("propertyType") != null) {
if (session.getAttribute("propertyType")
@@ -146,55 +144,130 @@
filePath = servicePath + serviceProperties;
Type = "serviceProperties";
}
- } /*
- * else { response.setContentType("text/html");
- * response.setStatus(response.SC_NOT_FOUND);
session.invalidate(); }
- */
-
- // If the properties haven't been set in session the set them
- if (session.getAttribute("properties") == null) {
-
- // Checking firstly if the files really exists
- if ((new File(filePath)).exists()) {
- properties = new PerfsonarPropertiesImpl();
- properties.loadProperties(new
FileInputStream(filePath));
- session.setAttribute("properties",
properties);
- }
- // Other wise we have a problem
- else {
- properties = null;
- session.setAttribute("properties",
properties);
- throw new ServletException("Properties file
does not exist! "
- + filePath + "\n" + filePath);
- }
}
- // Else get the properties from the session
- else {
- properties = (PerfsonarProperties) session
- .getAttribute("properties");
- }
- // If the user wants to lock the table then authenticated is
false
- if ((request.getParameter("Lock") != null)
- &&
(!request.getMethod().equalsIgnoreCase("GET"))) {
-
- session.setAttribute("authenticated", false);
- }
- // If the user hasn't been authenticated then the table is
locked
if (session.getAttribute("authenticated") != null) {
if (((Boolean) session.getAttribute("authenticated"))
.booleanValue()) {
- lock = "enabled";
- } else {
- lock = "disabled";
- }
- }
- // If the user wants to enable the table then he must be
validated
- if ((request.getParameter("enable") != null)
- &&
(!request.getMethod().equalsIgnoreCase("GET"))) {
+ // Setting the path for the properties file
based on the type of
+ // properties file
+ // If the properties haven't been set in
session the set them
+ if (session.getAttribute("properties") ==
null) {
+
+ // Checking firstly if the files
really exists
+ if ((new File(filePath)).exists()) {
+ properties = new
PerfsonarPropertiesImpl();
+ properties
+
.loadProperties(new FileInputStream(filePath));
+
session.setAttribute("properties", properties);
+ }
+ // Other wise we have a problem
+ else {
+ properties = null;
+
session.setAttribute("properties", properties);
+ throw new ServletException(
+ "Properties
file does not exist! " + filePath
+
+ "\n");
+ }
+ }
+ // Else get the properties from the session
+ else {
+ properties = (PerfsonarProperties)
session
+
.getAttribute("properties");
+ }
+
+ // The user wants to save the changes to the
properties table
+ if ((request.getParameter("store") != null)
+ &&
(!request.getMethod().equalsIgnoreCase("GET"))
+ && ((Boolean)
session.getAttribute("authenticated"))
+
.booleanValue()) {
+ Enumeration parameters =
request.getParameterNames();
+
+ // Creating the new Properties object
+ while (parameters.hasMoreElements()) {
+ String key = (String)
parameters.nextElement();
+ String value = (String)
request.getParameter(key);
+ if (!key.equals("store")) {
+ PerfsonarProperty
property = properties
+
.getProperty(key);
+ if (property != null)
{
+
property.setValue(value);
+
properties.setProperty(key, property);
+ }
+ }
+ }
+ if (properties != null) {
+ // Setting the new properties
+ // Modifying file
+ if (modifyFile(properties,
filePath)) {
+ // clearing up
session and ivalidating it
+
session.setAttribute("authenticated", false);
+
session.removeAttribute("properties");
+ restart_page(out,
Type);
+ } else {
+ error_page(
+ out,
+
"Error modifying properties file. PLease try again",
+ Type);
+ }
+ } else {
+ error_page(
+ out,
+ "Error
modyfying properties file. PLease try again",
+ Type);
+ }
+ } else {
+ if (servicePath == null)
+ error_page(
+ out,
+ "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
+ if
((request.getParameter("add") != null)) {
+ // Stroring the new
property to properties
+ PerfsonarProperty
property = new PerfsonarProperty(
+
request.getParameter("propertyName"),
+
request.getParameter("propertyValue"),
+
request.getParameter("propertyDescription"),
+
request.getParameter("propertyGroup"));
+
properties.setProperty(property.getKey(), property);
+ }
+ // Te user wants to remove a
property
+ if
((request.getParameter("remove") != null)) {
+ // Removing property
from properties
+
properties.removeProperty(request
+
.getParameter("property"));
+ }
+ // Showing the properties and
user options
+ if (properties != null) {
+
+ main_page(out,
groupProperies(properties),Type);
+ } else {
+ String path;
+ if
(Type.equals("loggingProperties")) {
+ path =
servicePath + this.log4jProperties;
+ } else {
+ path =
servicePath + this.serviceProperties;
+ }
+ error_page(out,
+
"service properties file does not exist! "
+
+ filePath + "\n" + path, Type);
+ }
+ }
+ }
+ } else {
+ // If "authenticated" is false we invalidate
the session so that
+ // the user can try again
+ session.invalidate();
+ }
+ } else {
+ // If the "authentcated" parameter has not been set
then we ask for
+ // a username and password
String authorization =
request.getHeader("Authorization");
+ // if there is non in the headers we ask for it
if (authorization == null) {
askForPassword(response);
} else {
@@ -212,92 +285,38 @@
// Using the authenticator to authenticate
the user
if (authenticator.authenticate(user,
password)) {
- lock = "enabled";
+ // Authetnication was successful we
show the user all
+ // properties to be configured
session.setAttribute("authenticated",
true);
- } else {
- askForPassword(response);
- session.setAttribute("authenticated",
false);
- }
+ if
(session.getAttribute("properties") == null) {
- }
- }
-
- // The user wants to save the changes to the properties table
- if ((request.getParameter("store") != null)
- &&
(!request.getMethod().equalsIgnoreCase("GET"))
- && ((Boolean)
session.getAttribute("authenticated"))
- .booleanValue()) {
- Enumeration parameters = request.getParameterNames();
-
- // Creating the new Properties object
- while (parameters.hasMoreElements()) {
- String key = (String)
parameters.nextElement();
- String value = (String)
request.getParameter(key);
- if (!key.equals("store")) {
- PerfsonarProperty property =
properties.getProperty(key);
- if (property != null) {
- property.setValue(value);
- properties.setProperty(key,
property);
+ // Checking firstly if the
files really exists
+ if ((new
File(filePath)).exists()) {
+ properties = new
PerfsonarPropertiesImpl();
+
properties.loadProperties(new FileInputStream(
+
filePath));
+
session.setAttribute("properties", properties);
+ }
+ // Other wise we have a
problem
+ else {
+ properties = null;
+
session.setAttribute("properties", properties);
+ throw new
ServletException(
+
"Properties file does not exist! "
+
+ filePath + "\n");
+ }
}
- }
- }
- if (properties != null) {
- // Setting the new properties
- // Modifying file
- if (modifyFile(properties, filePath)) {
- // clearing up session and
ivalidating it
- session.setAttribute("authenticated",
false);
- session.removeAttribute("properties");
- restart_page(out, Type);
- session.invalidate();
+ // Else get the properties from the
session
+ else {
+ properties =
(PerfsonarProperties) session
+
.getAttribute("properties");
+ }
+ main_page(out,
groupProperies(properties),Type);
} else {
- error_page(
- out,
- "Error modifying
properties file. PLease try again",
- Type);
+ askForPassword(response);
+ session.invalidate();
}
- } else {
- error_page(out,
- "Error modyfying properties
file. PLease try again",
- Type);
}
- } else {
- if (servicePath == null)
- error_page(
- out,
- "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
- if ((request.getParameter("add") != null)) {
- // Stroring the new property to
properties
- PerfsonarProperty property = new
PerfsonarProperty(request
-
.getParameter("propertyName"), request
-
.getParameter("propertyValue"), request
-
.getParameter("propertyDescription"), request
-
.getParameter("propertyGroup"));
-
properties.setProperty(property.getKey(), property);
- }
- // Te user wants to remove a property
- if ((request.getParameter("remove") != null))
{
- // Removing property from properties
-
properties.removeProperty(request.getParameter("property"));
- }
- // Showing the properties and user options
- if (properties != null) {
-
- main_page(out,
groupProperies(properties), lock);
- } else {
- String path;
- if (Type.equals("loggingProperties"))
{
- path = servicePath +
this.log4jProperties;
- } else {
- path = servicePath +
this.serviceProperties;
- }
- error_page(out, "service properties
file does not exist! "
- + filePath + "\n" +
path, Type);
- }
- }
}
}
@@ -424,51 +443,24 @@
}
private void main_page(ServletOutputStream out,
- Hashtable<String, PerfsonarProperties>
groupedProperties,
- String lock) throws IOException {
+ Hashtable<String, PerfsonarProperties>
groupedProperties,String type)
+ throws IOException {
preempt(out);
out.println("<div class=\"tablessContent\" >");
out.println("</div>");
out.println("<div class=\"manage\">");
+ String tableName="Service Properties Table";
+ if(!type.equals("serviceProperties")){
+ tableName="Logging Properties Table";
+ }
out
- .println("<h4>perfSONAR service properties
Administration page</h4><br/>");
+ .println("<p
class=\"welcometextlavender\">"+tableName+"</p>");
+ out.println("<br>The listed settings are optional. You can
configure them to customise your installation. Place your mouse cursor on a
setting to display help.</br><br/>");
+ out.println("<form action=\"ServiceAdmin\" method=\"POST\">
");
- // Different output depending on the user unlocking or
locking the table
- if (!lock.equals("enabled")) {
-
- out.println("<form action=\"ServiceAdmin\"
method=\"POST\"> ");
- out.println("<table>");
- out.println("<tr>");
- out
- .println("<th>Service Properties
Table</th><td><input type=\"submit\" name=\"enable\" value=\"Unlock\"/ >
Enter username and password to unlock</td>");
- out.println("</tr>");
- out.println("</table>");
- out.println("</form>");
- } else {
- out.println("<form action=\"ServiceAdmin\"
method=\"POST\"> ");
- out.println("<table>");
- out.println("<tr>");
- out
- .println("<th>Service Properties
Table <input type=\"submit\" name=\"Lock\" value=\"Lock\"/ ></th>");
- out.println("</tr>");
- out.println("<tr/>");
- out.println("<tr>");
- out
- .println("<th>Edit the right column
of the Service Properties Table and then press 'Apply'</th>");
- out.println("</tr>");
- out.println("</table>");
- out.println("</form>");
-
- }
- // If the table is enabled more options are available and the
user can
- // modify the table
- if (lock.equals("enabled")) {
- out.println("<form action=\"ServiceAdmin\"
method=\"POST\"> ");
- }
-
out.println("<table>");
- out.println("<tr>");
+ out.println("<tr class=\"headerlavender\">");
out.println("<th>Group</th>");
out.println("<th>Service Property</th>");
out.println("<th>Service Property Value</th>");
@@ -477,33 +469,40 @@
// Populating the table
Iterator it = groupedProperties.keySet().iterator();
+ String cssclass="lightgrey";
+ boolean change=false;
while (it.hasNext()) {
String group = (String) it.next();
PerfsonarProperties properties =
groupedProperties.get(group);
Iterator propIt = properties.getKeysIterator();
+ if(change){
+ cssclass="darkgrey";
+ change=false;
+ }else{
+ cssclass="lightgrey";
+ change=true;
+ }
String key = (String) propIt.next();
PerfsonarProperty property =
properties.getProperty(key);
- out.println("<tr>");
- out.println("<th>" + group + "</th><td/><td/>");
- out.println("</tr>");
- out.println("<tr>");
- out.println("<th/>");
+ out.println("<tr class=\""+cssclass+"\" >");
+ out.println("<th class=\"blueheader\">" + group +
"</th>");
group = group.replace("'", "\\'");
group = group.replace("(", "[").replace(")", "]");
String description =
property.getDescription().replace("'", "\\'");
description = description.replace(")", "]");
description = description.replace("(", "[");
description = description.replace("#", "");
- out.println("<td onmouseover=\"setTip(this,'" +
description + "')\" >");
+ out.println("<td onmouseover=\"setTip(this,'" +
description
+ + "','#009ACD')\" >");
out.println(property.getKey());
out.println("</td>");
- out.println("<td onmouseover=\"setTip(this,'" +
property.getValue()
- + "')\" >");
- out.println("<input " + lock + " type=\"text\"
size=60 name=\""
+ out.println("<td>");
+ out.println("<input "
+ + " type=\"text\"
class=\"input_style_blue\" size=60 name=\""
+ property.getKey() + "\" value=\"" +
property.getValue()
+ "\" onmouseover=\"setTip(null,'" +
property.getValue()
- + "')\" />");
+ + "','#009ACD')\" />");
out.println();
out.println("</td>");
out.println("</tr>");
@@ -515,41 +514,37 @@
description = description.replace(")", "]");
description = description.replace("(", "[");
description = description.replace("#", "");
- out.println("<tr>");
+ out.println("<tr class=\""+cssclass+"\">");
out.println("<td/>");
out.println("<td onmouseover=\"setTip(this,'"
+ description
- + "')\">");
+ + "','#009ACD')\">");
out.println(property.getKey());
out.println("</td>");
- out.println("<td onmouseover=\"setTip(this,'"
+ property.getValue()
- + "')\" >");
- out.println("<input " + lock
- + " type=\"text\" size=60
name=\"" + property.getKey()
- + "\" value=\"" +
property.getValue()
- + "\"
onmouseover=\"setTip(null,'" + property.getValue()
- + "')\" />");
+ out.println("<td>");
+ out
+ .println("<input
type=\"text\" class=\"input_style_blue\" size=60 name=\""
+ +
property.getKey()
+ + "\"
value=\""
+ +
property.getValue()
+ + "\"
onmouseover=\"setTip(null,'"
+ +
property.getValue() + "','#009ACD')\" />");
out.println();
out.println("</td>");
out.println("</tr>");
}
+
}
- if (lock.equals("enabled")) {
- out.println("<tr/>");
- out.println("<tr>");
- out.println("<td>");
- out
- .println("<input "
- + lock
- + " type=\"submit\"
name=\"store\" value=\"Apply\" /></td><td><input type=\"reset\"
value=\"Cancel\" /></td><td/>");
- out.println("</tr>");
- out.println("</table>");
- out.println("</form>");
- } else {
- out.println("</table>");
- }
+ out.println("<tr/>");
+ out.println("<tr>");
+ out.println("<th/><td/><td>");
+ out
+ .println("<input class=\"floatResetButton\"
id=\"ResetButton\" type=\"reset\" class=\"submit_button\" value=\"Cancel\"
/><input class=\"floatSubmitButton\" type=\"submit\" id=\"Button\"
name=\"store\" value=\"Apply\" class=\"submit_button\" /></td>");
+ out.println("</tr>");
+ out.println("</table>");
+ out.println("</form>");
- if (lock.equals("enabled") &&
extraFunctionalities.equals("on")) {
+ if (extraFunctionalities.equals("on")) {
// Options foa adding and deleting a property are
added
out.println("<form action=\"ServiceAdmin\"
method=\"POST\"> ");
Deleted: branches/WebAdmin/perfSONARWebAdmin/admin/wizard/services/RRDMA.class
Deleted:
branches/WebAdmin/perfSONARWebAdmin/admin/wizard/services/RRDMAHandler.class
Modified:
branches/WebAdmin/perfSONARWebAdmin/admin/wizard/services/RRDMAHandler.java
===================================================================
---
branches/WebAdmin/perfSONARWebAdmin/admin/wizard/services/RRDMAHandler.java
2008-03-21 14:28:56 UTC (rev 3545)
+++
branches/WebAdmin/perfSONARWebAdmin/admin/wizard/services/RRDMAHandler.java
2008-03-25 10:22:51 UTC (rev 3546)
@@ -355,7 +355,7 @@
/*
* This piece of code was commented after Romans request
because now the
* use of eXist in RRDMA is compalsury. Enyone else can use
the code if
- * he/she likes
+ * he/she wishes to
*/
// The first key is about using or not the database.So this
parameter is
@@ -601,8 +601,8 @@
while (it.hasNext()) {
String key = (String) it.next();
if (key.endsWith("xmldb.db_adminpassword")) {
- adminPass =
serviceProperties.getProperty(key).getValue()
- .trim();
+ // adminPass =
serviceProperties.getProperty(key).getValue()
+ // .trim();
newAdminPass =
finalProperties.getProperty(key).trim();
}
if (key.endsWith("xmldb.db_uri")) {
@@ -610,10 +610,6 @@
}
}
- // If admin pass is not set than its considered to be empty
- if (adminPass == null) {
- adminPass = "";
- }
it = finalProperties.orderedKeys();
// Iterating though tthe users input
@@ -624,18 +620,26 @@
// collection at the end of the URI
PerfsonarProperty property = new PerfsonarProperty();
if (!key.endsWith("xmldb.db_uri")) {
- property = serviceProperties.getProperty(key);
- // If property key does not exist throw an
exceptrion
- if (property == null) {
- throw new Exception("Key is invalid "
+ key + " ");
+ if (key.equals("old_adminpassword")) {
+
+ adminPass =
finalProperties.getProperty(key).trim();
+
} else {
-
property.setValue(finalProperties.getProperty(key));
- serviceProperties.setProperty(key,
property);
+ property =
serviceProperties.getProperty(key);
+ // If property key does not exist
throw an exceptrion
+ if (property == null) {
+ throw new Exception("Key is
invalid " + key + " ");
+ } else {
+
property.setValue(finalProperties.getProperty(key));
+
serviceProperties.setProperty(key, property);
+ }
}
} else {
+
property = serviceProperties.getProperty(key);
property.setValue(existURI + "/db/" +
dbCollection);
serviceProperties.setProperty(key, property);
+
}
// Setting also the wizard properties
properties.setWizardProperty(key, finalProperties
@@ -644,16 +648,22 @@
// Also getting all needed information in orer to
configure the
// exist db
if (key.endsWith("xmldb.db_username")) {
- username = finalProperties.getProperty(key);
+ username =
finalProperties.getProperty(key).trim();
}
if (key.endsWith("xmldb.db_password")) {
- password = finalProperties.getProperty(key);
+ password =
finalProperties.getProperty(key).trim();
}
if (key.endsWith("conf_file")) {
- confFile = finalProperties.getProperty(key);
+ confFile =
finalProperties.getProperty(key).trim();
}
+
}
+ // If admin pass is not set than its considered to be empty
+ if (adminPass == null) {
+ adminPass = "";
+ }
+
// Creating all necessary collections and users in exist
if (existURI == null) {
throw new Exception("eXist xmldb URI is empty!\n");
Modified: branches/WebAdmin/perfSONARWebAdmin/auxiliary/sqlma/HTMLOutput.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/auxiliary/sqlma/HTMLOutput.java
2008-03-21 14:28:56 UTC (rev 3545)
+++ branches/WebAdmin/perfSONARWebAdmin/auxiliary/sqlma/HTMLOutput.java
2008-03-25 10:22:51 UTC (rev 3546)
@@ -76,21 +76,22 @@
* @throws IOException
*/
public void mainPage(String message, String[] ibatisFileName,
- String[] type, String fileProperties[], String
ibatisFile,String function)
- throws IOException {
+ String[] type, String fileProperties[], String
ibatisFile,
+ String function) throws IOException {
String display = "block";
String onClick = " onclick=\"createFile();\"";
preempt("default.css", true);
- out.println("<div class=\"manage\" >");
- out.println("<p><h4>"+message+"</h4></p>");
- out.println("<div id=\"Options\" >");
+ out.println("<div class=\"manage_sqlma\" >");
+ out.println("<p class=\"welcometextlavender\">" + message +
"</p>");
+ out.println("<div class=\"Options\" >");
out.println("<br/>");
out.println("<form action=\"SQLMAdmin\" method=\"POST\" > ");
out.println("<table align=\"center\">");
out.println("<tr>");
out.println("<th>Choose File:</th>");
- out.println("<td><select name=\"ibatisFile\"
onchange=\"sendRequest(this.options[this.selectedIndex].value)\" >");
+ out
+ .println("<td><select name=\"ibatisFile\"
onchange=\"sendRequest(this.options[this.selectedIndex].value)\" >");
String selected = "";
for (int i = 0; i < ibatisFileName.length; i++) {
if (ibatisFile != null) {
@@ -109,81 +110,89 @@
out.println("</table>");
out
- .println("<input type=\"submit\"
name=\"Execute\" value=\"Edit File\" />");
+ .println("<br><input
class=\"execute_button_sqlma\" type=\"submit\" name=\"Execute\" value=\"Edit
File\" />");
out
- .println("<input type=\"submit\"
name=\"Execute\" value=\"Delete File\" onclick=\"return
confirmDelete(this.form)\"/>");
+ .println("<input
class=\"execute_button_sqlma\" type=\"submit\" name=\"Execute\"
value=\"Delete File\" onclick=\"return confirmDelete(this.form)\"/>");
out
- .println("<button type=\"button\"
name=\"Execute\" value=\"Create New\""
- + onClick + ">Create New
File</button>");
+ .println("<button
class=\"execute_button_sqlma\" type=\"button\" name=\"Execute\"
value=\"Create New\""
+ + onClick + ">Create New
File</button></br>");
out.println("</form>");
out.println("</div>");
if (ibatisFile != null && !ibatisFile.equals("")
&& fileProperties != null) {
-
+
display = "block";
-
- if(function.equals("Edit")){
- out.println("<div id=\"EditFile\" style=\"display:"
+ display
- + ";\">");
- out.println("<br/>");
- out
- .println("<form action=\"SQLMAdmin\"
method=\"POST\" onsubmit=\"return confirmForm(this)\"> ");
- out.println("<input type=\"hidden\"
name=\"ibatisFile\" value=\""
- + ibatisFile + "\" />");
- out.println("<input type=\"hidden\" name=\"metric\"
value=\""
- + fileProperties[0] + "\" />");
- out.println("<input type=\"hidden\" name=\"mapFile\"
value=\""
- + fileProperties[6] + "\" />");
- out.println("<table align=\"center\">");
- out.println("<tr><th>File Name:</th><td>" + ibatisFile
- + "</td><td/></tr>");
- out.println("<tr><th>Metric Type:</th>");
- out.println("<td>" + fileProperties[0] +
"</td><td/></tr>");
- out
- .println("<tr><th>Database
URL:</th><td><input type=\"text\" name=\"dataBaseURL\" value=\""
- + fileProperties[1] +
"\" size=\"20\" /></td></tr>");
- out
- .println("<tr><th>Database
Name:</th><td><input type=\"text\" name=\"databaseName\" value=\""
- + fileProperties[2] +
"\" size=\"20\" /></td></tr>");
- out
- .println("<tr><th>User
Name:</th><td><input type=\"text\" name=\"userName\" value=\""
- + fileProperties[3] +
"\" size=\"20\" /></td></tr>");
- out
- .println("<tr><th>User
Password:</th><td><input type=\"password\" name=\"userPassword\" value=\"\"
size=\"20\" /></td></tr>");
- out
- .println("<tr><th>Confirm
Password:</th><td><input type=\"password\" name=\"confirmPassword\"
value=\"\" size=\"20\" /></td></tr>");
- out
- .println("<tr><th>Table
Name:</th><td><input type=\"text\" name=\"tableName\" value=\""
- + fileProperties[4] +
"\" size=\"20\" /></td></tr>");
-
- out
- .println("<tr><td><input
type=\"submit\" name=\"Execute\" value=\"Edit\" /></td><td/></tr>");
- out.println("</table></form>");
- out.println("</div>");
- }
- else{
-
+ if (function.equals("Edit")) {
out.println("<div id=\"EditFile\"
style=\"display:" + display
+ ";\">");
- out.println("<table align=\"center\">");
- out.println("<tr><th>File Name:</th><td>" +
ibatisFile
- + "</td><td/></tr>");
+ out.println("<br/>");
+ out
+ .println("<form
action=\"SQLMAdmin\" method=\"POST\" onsubmit=\"return confirmForm(this)\">
");
+ out
+ .println("<input
type=\"hidden\" name=\"ibatisFile\" value=\""
+ + ibatisFile
+ "\" />");
+ out.println("<input type=\"hidden\"
name=\"metric\" value=\""
+ + fileProperties[0] + "\"
/>");
+ out.println("<input type=\"hidden\"
name=\"mapFile\" value=\""
+ + fileProperties[6] + "\"
/>");
+ out.println("<table class=\"input_table\"
align=\"center\">");
+ out
+ .println("<tr><th
class=\"hilighted\">File Name:</th><td class=\"underlined\" >"
+ + ibatisFile
+ + "</td><td
class=\"underlined\"> </td></tr>");
out.println("<tr><th>Metric Type:</th>");
out.println("<td>" + fileProperties[0] +
"</td><td/></tr>");
out
- .println("<tr><th>Database
URL:</th><td>"+ fileProperties[1] +"</td></tr>");
+ .println("<tr><th>Database
URL:</th><td><input type=\"text\" name=\"dataBaseURL\" value=\""
+ +
fileProperties[1]
+ + "\"
size=\"20\" /></td></tr>");
out
- .println("<tr><th>Database
Name:</th><td>"+ fileProperties[2] + "</td></tr>");
+ .println("<tr><th>Database
Name:</th><td><input type=\"text\" name=\"databaseName\" value=\""
+ +
fileProperties[2]
+ + "\"
size=\"20\" /></td></tr>");
out
- .println("<tr><th>User
Name:</th><td>"+ fileProperties[3] + "</td></tr>");
+ .println("<tr><th>User
Name:</th><td><input type=\"text\" name=\"userName\" value=\""
+ +
fileProperties[3]
+ + "\"
size=\"20\" /></td></tr>");
+ out
+ .println("<tr><th>User
Password:</th><td><input type=\"password\" name=\"userPassword\" value=\"\"
size=\"20\" /></td></tr>");
+ out
+ .println("<tr><th>Confirm
Password:</th><td><input type=\"password\" name=\"confirmPassword\"
value=\"\" size=\"20\" /></td></tr>");
out
- .println("<tr><th>Table
Name:</th><td>"+ fileProperties[4] + "</td></tr>");
+ .println("<tr><th>Table
Name:</th><td><input type=\"text\" name=\"tableName\" value=\""
+ +
fileProperties[4]
+ + "\"
size=\"20\" /></td></tr>");
+
+ out
+ .println("<tr><td><input
class=\"input_Edit_button\" type=\"submit\" name=\"Execute\" value=\"Edit\"
/></td><td/></tr>");
+ out.println("</table></form>");
+ out.println("</div>");
+ } else {
+
+ out.println("<div id=\"EditFile\"
style=\"display:" + display
+ + ";\">");
+ out.println("<table class=\"input_table\"
align=\"center\">");
+ out
+ .println("<tr><th
class=\"hilighted\">File Name:</th><td class=\"underlined\">"
+ + ibatisFile
+ + "</td><td
class=\"underlined\"> </td></tr>");
+ out.println("<tr><th>Metric Type:</th>");
+ out.println("<td>" + fileProperties[0] +
"</td><td/></tr>");
+ out.println("<tr><th>Database URL:</th><td>"
+ + fileProperties[1] +
"</td></tr>");
+ out.println("<tr><th>Database Name:</th><td>"
+ + fileProperties[2] +
"</td></tr>");
+ out.println("<tr><th>User Name:</th><td>" +
fileProperties[3]
+ + "</td></tr>");
+
+ out.println("<tr><th>Table Name:</th><td>" +
fileProperties[4]
+ + "</td></tr>");
out.println("</table>");
out.println("</div>");
-
+
}
}
@@ -193,9 +202,9 @@
out.println("<br/>");
out
.println("<form action=\"SQLMAdmin\"
method=\"POST\" onsubmit=\"return confirmForm(this)\"> ");
- out.println("<table align=\"center\">");
+ out.println("<table class=\"input_table\"
align=\"center\">");
out
- .println("<tr><th>File
Name:</th><td>ibatis-SqlMapConfig-<input type=\"text\" name=\"fileName\"
value=\"\" size=\"20\" />.xml</td></tr>");
+ .println("<tr><th class=\"hilighted\" >File
Name:</th><td class=\"underlined\">ibatis-SqlMapConfig-<input type=\"text\"
name=\"fileName\" value=\"\" size=\"20\" />.xml</td></tr>");
out
.println("<tr><th>Database
URL:</th><td><input type=\"text\" name=\"dataBaseURL\" value=\"\" size=\"20\"
/></td></tr>");
out
@@ -217,7 +226,7 @@
.println("<tr><th>Table Name:</th><td><input
type=\"text\" name=\"tableName\" value=\"\" size=\"20\" /></td></tr>");
out
- .println("<tr><td><input type=\"submit\"
name=\"Execute\" value=\"Create\" /></td></tr>");
+ .println("<tr><td><input
class=\"execute_button_sqlma\" type=\"submit\" name=\"Execute\"
value=\"Create\" /></td></tr>");
out.println("</table></form>");
out.println("</div>");
@@ -233,7 +242,8 @@
preempt("default.css", true);
String onClick = " onclick=\"showOptions()\"";
- out.println("<div align=\"left\" id=\"prompt\"
class=\"manage\">");
+ out
+ .println("<div align=\"left\" id=\"prompt\"
class=\"manage_sqlma\">");
out.println("<form action=\"SQLMAdmin\" method=\"POST\" > ");
out.println("<input type=\"hidden\" name=\"ibatisFile\"
value=\""
+ ibatisFile + "\" />");
@@ -250,8 +260,7 @@
String display = "none";
out.println("<div id=\"options\" style=\"display:" + display
+ ";\">");
out.println("<br/>");
- out
- .println("<form action=\"SQLMAdmin\"
method=\"POST\" > ");
+ out.println("<form action=\"SQLMAdmin\" method=\"POST\" > ");
out.println("<input type=\"hidden\" name=\"ibatisFile\"
value=\""
+ ibatisFile + "\" />");
out.println("<input type=\"hidden\" name=\"action\" value=\""
+ action
@@ -264,9 +273,9 @@
out
.println("<tr><th/><td><input
type=\"checkbox\" name=\"createTable\" value=\"Yes\"/>Initialize
Table</td></tr>");
out
- .println("<tr><th>Enter the SQL DB root password:
</th><td><input type=\"password\" size=20 name=\"rtPass\"
value=\"\"/></td></tr>");
+ .println("<tr><th>Enter the SQL DB root
password: </th><td><input type=\"password\" size=20 name=\"rtPass\"
value=\"\"/></td></tr>");
out
- .println("<tr><td><input type=\"submit\"
name=\"Execute\" value=\"Initialize\" /></td><td/></tr>");
+ .println("<tr><td><input
class=\"execute_button_sqlma\" type=\"submit\" name=\"Execute\"
value=\"Initialize\" /></td><td/></tr>");
out.println("</table></form>");
out.println("</div>");
@@ -301,7 +310,7 @@
out.println("<body>");
out.println(getScript());
out.println("<div class=\"tablessContent\" >");
- out.println("<br/><p> </p>");
+ out.println("<br/>");
out.println("</div>");
}
Modified: branches/WebAdmin/perfSONARWebAdmin/auxiliary/wizard/HTMLOutput.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/auxiliary/wizard/HTMLOutput.java
2008-03-21 14:28:56 UTC (rev 3545)
+++ branches/WebAdmin/perfSONARWebAdmin/auxiliary/wizard/HTMLOutput.java
2008-03-25 10:22:51 UTC (rev 3546)
@@ -112,7 +112,7 @@
+ values[i] +
"</input>");
}
} else {
- out.println("<input type=\"text\" name=\"" +
pr.getKey()
+ out.println("<input type=\"text\" name=\""
+ pr.getKey()
+ "\" size=60 value=\"" +
pr.getProposedValue()
+ " \"/>");
}
@@ -187,9 +187,9 @@
public void infoPage(String topMessage, String message) throws
IOException {
preemptModified("default.css");
out.println("<div align=\"left\" class=\"info\">");
- out.println("<br><h2>" + topMessage + "</h2></br>");
+ out.println("<br><h4 class=\"info_wizard\">" + topMessage +
"</h4></br>");
if (message != null) {
- out.println("<p>" + message + "</p>");
+ out.println("<p class=\"info_wizard\" >" + message +
"</p>");
}
out.println("</div>");
out.println("</div>");
@@ -216,13 +216,13 @@
Iterator groupIt = Properties.keySet().iterator();
preemptModified("default.css");
out.println("<div class=\"top\"><br>" + message +
"</br></div>");
- out.println("<div class=\"properties\">");
+ out.println("<div id=\"properties\" class=\"properties\">");
out.println("<form action=\"Wizard\" method=\"GET\"> ");
out
.println("<input type=\"hidden\"
name=\"function\" value=\"finish\" >");
while (groupIt.hasNext()) {
String group = (String) groupIt.next();
- out.println("<p>" + group + " Configuration:</p>");
+ out.println("<p class=\"groupheading\">" + group + "
Configuration:</p>");
WizardProperties pro = Properties.get(group);
Iterator it = pro.orderedKeys();
WizardProperty pr = pro.getWizardProperty((String)
it.next());
@@ -257,8 +257,7 @@
+
onClick + ">yes</input>");
out
.println("<input
type=\"radio\" checked name=\"useLS\" value=\"no\" "
- +
onClick + ">no</input>");
- out.println("</td></tr>");
+ +
onClick + ">no</input></td><td>");
} else {
out.println("<tr><td>" +
pr.getPropertyComment()
@@ -273,7 +272,7 @@
out.println("<input
type=\"radio\"" + checked
+ "
name=\"" + pr.getKey() + "\" value=\""
+
values[i] + "\" " + onClick + ">"
- +
values[i] + "</input>");
+ +
values[i] + "</input></td><td>");
}
}
}
@@ -303,8 +302,9 @@
out.println("</table>");
out.println("</div>");
}
+
out
- .println("<p><input type=\"submit\"
name=\"Submit\" value=\"Submit\"></p>");
+ .println("<p><input id=\"Button\"
class=\"submit_button\" type=\"submit\" name=\"Submit\" value=\"Submit
Changes\" /></p>");
out.println("</form> ");
out.println("</div>");
out.println("</div>");
@@ -315,7 +315,7 @@
}
//
-----------------------------------------------------------------------
- // private mmathods
+ // private methods
/**
* Used by older wizard servlet
@@ -419,7 +419,12 @@
* @throws IOException
*/
private void showProperty(WizardProperty pr) throws IOException {
- out.println("<tr><td>" + pr.getPropertyComment() +
"</td><td>");
+
+ String fill = " ";
+ if (pr.isRequired()) {
+ fill = "*";
+ }
+ out.println("<tr><td>" + pr.getPropertyComment()+"<span
class=\"greenasterisk\" >"+fill+"</span></td><td>");
String[] values = pr.getAcceptedValues();
if (values != null) {
@@ -433,20 +438,19 @@
} else {
String type = "text";
+ String value=pr.getProposedValue();
if (pr.isPassword()) {
type = "password";
+ value=" ";
}
- out.println("<input type=\"" + type + "\" name=\"" +
pr.getKey()
- + "\" size=40 value=\"" +
pr.getProposedValue() + " \"/>");
+ out.println("<input class=\"input_style\"
onmouseover=\"setTip(null,'"
+ +value + "','#B4EEB4')\" type=\"" +
type
+ + "\" name=\"" + pr.getKey() + "\"
size=40 value=\""
+ + value+ " \"/>");
}
- out.println("</td>");
- String fill = " ";
- if (pr.isRequired()) {
- fill = "*";
- }
- out.println("<td><label for=\"" + pr.getKey() + "\"><em>" +
fill
- + "</em></label></td></tr>");
+ out.println("</td></tr>");
+
}
/**
@@ -455,7 +459,14 @@
* @return The javascript
*/
private String getScript() {
- String script = "<script type=\"text/javascript\">\n"
+ String script = "<script src=\"Service_Admin.js\">"
+ + "</script>\n"
+ + "<script src=\"wz_tooltip.js\">"
+ + "</script>\n"
+ + "<script src=\"tip_balloon.js\">"
+ + "</script>\n"
+ + "</script>\n"
+ + "<script type=\"text/javascript\">\n"
+ "function checkIt(el) {\n"
+ "if (el.value
==document.getElementById(\"Vl_\"+el.name).value) {\n"
+
"document.getElementById(el.name).style.display = \"block\";\n"
- perfsonar: r3546 - in branches/WebAdmin/perfSONARWebAdmin: admin/exist admin/service admin/wizard/services auxiliary/sqlma auxiliary/wizard, svnlog, 03/25/2008
Archive powered by MHonArc 2.6.16.