Project

General

Profile

Revision 3083

Added by Matt Jones over 14 years ago

Modified the configuration classes to allow configuration through the web interface of all of the properties set in the metacat.properties file. The layout of this form still needs work, in particular because java.util.Properties does not maintain any order for the properties, nor does it allow for metadata about each property to be set and saved in the file. We can probably overcome this by creating a shadow file that lists all of the options and their metadata (such as grouping, controlled values, etc).

View differences:

configure.jsp
1
<%@ page    language="java" %>
1
<%@ page    language="java" import="java.util.Enumeration" %>
2 2
<% 
3 3
/**
4 4
 *  '$RCSfile$'
......
29 29
<head>
30 30
<title>Metacat Configuration</title>
31 31
<style language="Javascript">
32
<!--
32
body {
33
    font-family: Arial, sans-serif;
34
    font-size: 12pt;
35
    margin-left: 30px;
36
    margin-right: 30px;
37
    width: 700px;
38
}
39

  
33 40
.section {
34 41
    font-size: 16pt;
35 42
    font-weight: bold;
36 43
    border-bottom: solid #dddddd 1px;
37 44
}
38
-->
45
label,input {
46
	display: block;
47
	width: 400px;
48
	float: left;
49
	margin-bottom: 10px;
50
}
51

  
52
label {
53
	text-align: right;
54
	width: 250px;
55
	padding-right: 20px;
56
}
57

  
58
br {
59
	clear: left;
60
}
61

  
62
input[type="submit"] {
63
    width: 50px;
64
}
39 65
</style>
40 66
</head>
41 67
<body>
42
<p><img src="metacat-logo.png" width="75px" align="right"/> 
68
<p><img src="metacat-logo.png" width="100px" align="right"/> 
43 69
<h2>Metacat Configuration</h2>
44 70
</p>
45 71

  
......
49 75
   up and running.
50 76
</p>
51 77
<br clear="right"/>
52
<p class="section">Database connection</p>
78

  
53 79
<form method="POST" action="/knb/metacat">
54
<p>Database Username: 
55
   <input type="text" name="user" value="<%= request.getAttribute("user") %>"/></p>
56
<p>Database Password: <input type="password" name="password" value="<%= request.getAttribute("password") %>"/></p>
57
<p><input type="hidden" name="action" value="configure"/>
80

  
81
<p class="section">All properties (unsorted, need to fix)</p>
82

  
83
<% 
84
   Enumeration optionsList = (Enumeration)request.getAttribute("optionslist");
85
   while (optionsList.hasMoreElements()) {
86
       String name = (String)optionsList.nextElement();
87
       if (!name.equals("configured")) {
88
%>
89
        <label for="<%= name %>"><%= name %></label>
90
	    <input id="<%= name %>" name="<%= name %>" 
91
	           value="<%= request.getAttribute(name) %>"
92
	           <% if (name.equals("password")) { %>
93
	           type="password"
94
	           <% } else { %>
95
	           type="text" 
96
	           <% } %>
97
	           /><br/>
98
<%
99
       }
100
   }
101
%>
102

  
103
<input type="hidden" name="action" value="configure"/>
58 104
<p><input type="submit" value="Save"/></p>
105

  
59 106
</form>
60 107

  
61
<p class="section">Access controls</p>
62
<p>More options go here.</p>
63

  
64 108
</body>
65 109
</html>

Also available in: Unified diff