ia64/xen-unstable
changeset 579:bd90bd0c8b23
bitkeeper revision 1.319.1.1 (3f0c3b96o9tI7VUO855zQI34KKV7Ew)
Update web interface and its build scripts to work with the new control interface; all domain control stuff has been ported. No VD stuff works yet.
Update web interface and its build scripts to work with the new control interface; all domain control stuff has been ported. No VD stuff works yet.
line diff
1.1 --- a/.rootkeys Wed Jul 09 14:00:09 2003 +0000 1.2 +++ b/.rootkeys Wed Jul 09 15:58:14 2003 +0000 1.3 @@ -9,7 +9,7 @@ 3e6377dbGcgnisKw16DPCaND7oGO3Q tools/bal 1.4 3eb781edFwm_pW9FwnQACIe68viLOw tools/control/Makefile 1.5 3eca6a96a31IwaKtkEa4jmzwTWlm8Q tools/control/README-xenctl 1.6 3eb781fceEYkUi1XHKf2V0KX7si2JA tools/control/build-cmdline.xml 1.7 -3ec41f7cWCxQ8pdH8ZWqhhv-38qQ1w tools/control/build-xen.xml 1.8 +3ec41f7cWCxQ8pdH8ZWqhhv-38qQ1w tools/control/build-web.xml 1.9 3ec41f7ca6IBXDSe0HVcMPp3PPloOQ tools/control/build.properties 1.10 3ec4ebe0g_MI1VqkbbyNB8gt6m0Adg tools/control/docs/empty_dir 1.11 3eb781fcabCKRogwxJA3-jJKstw9Vg tools/control/domctl.xml 1.12 @@ -70,8 +70,8 @@ 3ec41f7dVFBlviwXPQ06BlU3UybziA tools/con 1.13 3ec41f7dKX9YpwrfH7BZ7BogyWqqLA tools/control/src/org/xenoserver/control/VirtualDiskManager.java 1.14 3ec41f7dUPpYTwYL5QVpRBv6PLKPrg tools/control/src/org/xenoserver/control/XML.java 1.15 3ec41f7d7Try-2zmfnpaALwJjY0GCA tools/control/src/org/xenoserver/control/XMLHelper.java 1.16 -3ec41f7dOVZgjP4sQS6vjuBnExdlMQ tools/control/src/uk/ac/cam/cl/xeno/xenctl/RootBean.java 1.17 -3ec41f7dvPdszb0frNEkMnEdJUBVjA tools/control/src/uk/ac/cam/cl/xeno/xenctl/SystemConfigurationBean.java 1.18 +3ec41f7dOVZgjP4sQS6vjuBnExdlMQ tools/control/src/org/xenoserver/web/RootBean.java 1.19 +3ec41f7dvPdszb0frNEkMnEdJUBVjA tools/control/src/org/xenoserver/web/SystemConfigurationBean.java 1.20 3ec41f7dO6IuKGGLG4VRUhMDmkTn5g tools/control/web/WEB-INF/web.xml 1.21 3ec41f7dRAPXBA0jQUd1k6MB3xVidg tools/control/web/img/cambridge.gif 1.22 3ec41f7dvxVe1Vb3kVOLZcN5Jra2tQ tools/control/web/img/help.gif 1.23 @@ -95,7 +95,6 @@ 3ec41f7dZRDqKe8wk__95ztDQmaAOA tools/con 1.24 3ec41f7eTqbaFqMGU7lJG09vlEt0TQ tools/control/web/tmpl/index.tmpl 1.25 3ec41f7ed6_QZ1mg0vuA9Xu1wu1plw tools/control/web/tmpl/install.pl 1.26 3ec41f7emmAnjM4gsW6JWkqsjfi4Rg tools/control/web/tmpl/makefile 1.27 -3ec41f7eGeQD-tCpxZNxNVcnKt6HfA tools/control/web/tmpl/newdom.tmpl 1.28 3ec41f7eoDHD2raa4x6dBINr4QLO3A tools/control/web/tmpl/vd-fv.tmpl 1.29 3ec41f7eawycxV05Ow3LfZtOlHZJPA tools/control/web/tmpl/vd-pa.tmpl 1.30 3ec41f7ef4mVT4vwOEL40MKIzS4EeA tools/control/web/tmpl/vd-par.tmpl
2.1 --- a/BitKeeper/etc/ignore Wed Jul 09 14:00:09 2003 +0000 2.2 +++ b/BitKeeper/etc/ignore Wed Jul 09 15:58:14 2003 +0000 2.3 @@ -436,3 +436,5 @@ xen/drivers/block/xen_physdisk.c~ 2.4 tools/internal/xi_phys_grant.c~ 2.5 tools/internal/xi_phys_probe.c~ 2.6 tools/internal/xi_phys_revoke.c~ 2.7 +tools/control/dist-web/** 2.8 +tools/control/build-web/**
3.1 --- a/tools/control/Makefile Wed Jul 09 14:00:09 2003 +0000 3.2 +++ b/tools/control/Makefile Wed Jul 09 15:58:14 2003 +0000 3.3 @@ -1,8 +1,8 @@ 3.4 -default: cmdline 3.5 +default: cmdline web 3.6 3.7 -install: install-cmdline 3.8 +install: install-cmdline install-web 3.9 3.10 -clean: clean-cmdline 3.11 +clean: clean-cmdline clean-web 3.12 3.13 3.14 3.15 @@ -19,17 +19,15 @@ clean-cmdline: 3.16 3.17 3.18 3.19 -xenctl: FORCE 3.20 - (cd web/tmpl; make) 3.21 - ant -buildfile build-xen.xml dist 3.22 +web: FORCE 3.23 + ant -buildfile build-web.xml dist 3.24 3.25 -install-xenctl: xenctl 3.26 - -ant -buildfile build-xen.xml remove 3.27 - ant -buildfile build-xen.xml install 3.28 +install-web: xenctl 3.29 + ant -buildfile build-web.xml remove || true 3.30 + ant -buildfile build-web.xml install 3.31 3.32 -clean-xenctl: 3.33 - (cd web/tmpl; make clean) 3.34 - ant -buildfile build-xen.xml clean 3.35 - rm -f xenctl.jar 3.36 +clean-web: 3.37 + ant -buildfile build-web.xml clean 3.38 + rm -f xenctl-web.jar 3.39 3.40 FORCE:
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/tools/control/build-web.xml Wed Jul 09 15:58:14 2003 +0000 4.3 @@ -0,0 +1,511 @@ 4.4 +<!-- 4.5 + General purpose build script for web applications and web services, 4.6 + including enhanced support for deploying directly to a Tomcat 4 4.7 + based server. 4.8 + 4.9 + This build script assumes that the source code of your web application 4.10 + is organized into the following subdirectories underneath the source 4.11 + code directory from which you execute the build script: 4.12 + 4.13 + docs Static documentation files to be copied to 4.14 + the "docs" subdirectory of your distribution. 4.15 + 4.16 + src Java source code (and associated resource files) 4.17 + to be compiled to the "WEB-INF/classes" 4.18 + subdirectory of your web applicaiton. 4.19 + 4.20 + web Static HTML, JSP, and other content (such as 4.21 + image files), including the WEB-INF subdirectory 4.22 + and its configuration file contents. 4.23 + 4.24 + $Id: build.xml.txt,v 1.7 2002/12/28 09:08:58 jfclere Exp $ 4.25 +--> 4.26 + 4.27 + 4.28 +<!-- A "project" describes a set of targets that may be requested 4.29 + when Ant is executed. The "default" attribute defines the 4.30 + target which is executed if no specific target is requested, 4.31 + and the "basedir" attribute defines the current working directory 4.32 + from which Ant executes the requested task. This is normally 4.33 + set to the current working directory. 4.34 +--> 4.35 + 4.36 +<project name="xenctl web interface" default="compile" basedir="."> 4.37 + 4.38 + 4.39 + 4.40 +<!-- ===================== Property Definitions =========================== --> 4.41 + 4.42 + 4.43 +<!-- 4.44 + 4.45 + Each of the following properties are used in the build script. 4.46 + Values for these properties are set by the first place they are 4.47 + defined, from the following list: 4.48 + 4.49 + * Definitions on the "ant" command line (ant -Dfoo=bar compile). 4.50 + 4.51 + * Definitions from a "build.properties" file in the top level 4.52 + source directory of this application. 4.53 + 4.54 + * Definitions from a "build.properties" file in the developer's 4.55 + home directory. 4.56 + 4.57 + * Default definitions in this build.xml file. 4.58 + 4.59 + You will note below that property values can be composed based on the 4.60 + contents of previously defined properties. This is a powerful technique 4.61 + that helps you minimize the number of changes required when your development 4.62 + environment is modified. Note that property composition is allowed within 4.63 + "build.properties" files as well as in the "build.xml" script. 4.64 + 4.65 +--> 4.66 + 4.67 + <property file="build.properties"/> 4.68 + <property file="${user.home}/build.properties"/> 4.69 + 4.70 + 4.71 +<!-- ==================== File and Directory Names ======================== --> 4.72 + 4.73 + 4.74 +<!-- 4.75 + 4.76 + These properties generally define file and directory names (or paths) that 4.77 + affect where the build process stores its outputs. 4.78 + 4.79 + app.name Base name of this application, used to 4.80 + construct filenames and directories. 4.81 + Defaults to "myapp". 4.82 + 4.83 + app.path Context path to which this application should be 4.84 + deployed (defaults to "/" plus the value of the 4.85 + "app.name" property). 4.86 + 4.87 + app.version Version number of this iteration of the application. 4.88 + 4.89 + build.home The directory into which the "prepare" and 4.90 + "compile" targets will generate their output. 4.91 + Defaults to "build". 4.92 + 4.93 + catalina.home The directory in which you have installed 4.94 + a binary distribution of Tomcat 4. This will 4.95 + be used by the "deploy" target. 4.96 + 4.97 + dist.home The name of the base directory in which 4.98 + distribution files are created. 4.99 + Defaults to "dist". 4.100 + 4.101 + manager.password The login password of a user that is assigned the 4.102 + "manager" role (so that he or she can execute 4.103 + commands via the "/manager" web application) 4.104 + 4.105 + manager.url The URL of the "/manager" web application on the 4.106 + Tomcat installation to which we will deploy web 4.107 + applications and web services. 4.108 + 4.109 + manager.username The login username of a user that is assigned the 4.110 + "manager" role (so that he or she can execute 4.111 + commands via the "/manager" web application) 4.112 + 4.113 +--> 4.114 + 4.115 + <property name="app.name" value="myapp"/> 4.116 + <property name="app.path" value="/${app.name}"/> 4.117 + <property name="app.version" value="0.1-dev"/> 4.118 + <property name="build.home" value="${basedir}/build-web"/> 4.119 + <property name="catalina.home" value="../../../.."/> <!-- UPDATE THIS! --> 4.120 + <property name="dist.home" value="${basedir}/dist-web"/> 4.121 + <property name="docs.home" value="${basedir}/docs"/> 4.122 +<!-- <property name="manager.url" value="http://localhost:8080/manager"/> --> 4.123 + <property name="src.home" value="${basedir}/src"/> 4.124 + <property name="web.home" value="${basedir}/web"/> 4.125 + 4.126 + 4.127 +<!-- ================== Custom Ant Task Definitions ======================= --> 4.128 + 4.129 + 4.130 +<!-- 4.131 + 4.132 + These properties define custom tasks for the Ant build tool that interact 4.133 + with the "/manager" web application installed with Tomcat 4. Before they 4.134 + can be successfully utilized, you must perform the following steps: 4.135 + 4.136 + - Copy the file "server/lib/catalina-ant.jar" from your Tomcat 4 4.137 + installation into the "lib" directory of your Ant installation. 4.138 + 4.139 + - Create a "build.properties" file in your application's top-level 4.140 + source directory (or your user login home directory) that defines 4.141 + appropriate values for the "manager.password", "manager.url", and 4.142 + "manager.username" properties described above. 4.143 + 4.144 + For more information about the Manager web application, and the functionality 4.145 + of these tasks, see <http://localhost:8080/tomcat-docs/manager-howto.html>. 4.146 + 4.147 +--> 4.148 + 4.149 + <taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/> 4.150 + <taskdef name="list" classname="org.apache.catalina.ant.ListTask"/> 4.151 + <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/> 4.152 + <taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/> 4.153 + 4.154 + 4.155 +<!-- ==================== Compilation Control Options ==================== --> 4.156 + 4.157 +<!-- 4.158 + 4.159 + These properties control option settings on the Javac compiler when it 4.160 + is invoked using the <javac> task. 4.161 + 4.162 + compile.debug Should compilation include the debug option? 4.163 + 4.164 + compile.deprecation Should compilation include the deprecation option? 4.165 + 4.166 + compile.optimize Should compilation include the optimize option? 4.167 + 4.168 +--> 4.169 + 4.170 + <property name="compile.debug" value="true"/> 4.171 + <property name="compile.deprecation" value="false"/> 4.172 + <property name="compile.optimize" value="true"/> 4.173 + 4.174 + 4.175 + 4.176 +<!-- ==================== External Dependencies =========================== --> 4.177 + 4.178 + 4.179 +<!-- 4.180 + 4.181 + Use property values to define the locations of external JAR files on which 4.182 + your application will depend. In general, these values will be used for 4.183 + two purposes: 4.184 + * Inclusion on the classpath that is passed to the Javac compiler 4.185 + * Being copied into the "/WEB-INF/lib" directory during execution 4.186 + of the "deploy" target. 4.187 + 4.188 + Because we will automatically include all of the Java classes that Tomcat 4 4.189 + exposes to web applications, we will not need to explicitly list any of those 4.190 + dependencies. You only need to worry about external dependencies for JAR 4.191 + files that you are going to include inside your "/WEB-INF/lib" directory. 4.192 + 4.193 +--> 4.194 + 4.195 +<!-- Dummy external dependency --> 4.196 +<!-- 4.197 + <property name="foo.jar" 4.198 + value="/path/to/foo.jar"/> 4.199 +--> 4.200 + 4.201 + 4.202 +<!-- ==================== Compilation Classpath =========================== --> 4.203 + 4.204 +<!-- 4.205 + 4.206 + Rather than relying on the CLASSPATH environment variable, Ant includes 4.207 + features that makes it easy to dynamically construct the classpath you 4.208 + need for each compilation. The example below constructs the compile 4.209 + classpath to include the servlet.jar file, as well as the other components 4.210 + that Tomcat makes available to web applications automatically, plus anything 4.211 + that you explicitly added. 4.212 + 4.213 +--> 4.214 + 4.215 + <path id="compile.classpath"> 4.216 + 4.217 + <!-- Include all JAR files that will be included in /WEB-INF/lib --> 4.218 + <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> 4.219 +<!-- 4.220 + <pathelement location="${foo.jar}"/> 4.221 +--> 4.222 + 4.223 + <!-- Include all elements that Tomcat exposes to applications --> 4.224 + <pathelement location="${catalina.home}/common/classes"/> 4.225 + <fileset dir="${catalina.home}/common/endorsed"> 4.226 + <include name="*.jar"/> 4.227 + </fileset> 4.228 + <fileset dir="${catalina.home}/common/lib"> 4.229 + <include name="*.jar"/> 4.230 + </fileset> 4.231 + <pathelement location="${catalina.home}/shared/classes"/> 4.232 + <fileset dir="${catalina.home}/shared/lib"> 4.233 + <include name="*.jar"/> 4.234 + </fileset> 4.235 + 4.236 + </path> 4.237 + 4.238 + 4.239 + 4.240 +<!-- ==================== All Target ====================================== --> 4.241 + 4.242 +<!-- 4.243 + 4.244 + The "all" target is a shortcut for running the "clean" target followed 4.245 + by the "compile" target, to force a complete recompile. 4.246 + 4.247 +--> 4.248 + 4.249 + <target name="all" depends="clean,compile" 4.250 + description="Clean build and dist directories, then compile"/> 4.251 + 4.252 + 4.253 + 4.254 +<!-- ==================== Clean Target ==================================== --> 4.255 + 4.256 +<!-- 4.257 + 4.258 + The "clean" target deletes any previous "build" and "dist" directory, 4.259 + so that you can be ensured the application can be built from scratch. 4.260 + 4.261 +--> 4.262 + 4.263 + <target name="clean" 4.264 + description="Delete old build and dist directories"> 4.265 + <delete dir="${build.home}"/> 4.266 + <delete dir="${dist.home}"/> 4.267 + <exec executable="make" dir="${web.home}/tmpl"><arg value="clean"/></exec> 4.268 + </target> 4.269 + 4.270 + 4.271 + 4.272 +<!-- ==================== Compile Target ================================== --> 4.273 + 4.274 +<!-- 4.275 + 4.276 + The "compile" target transforms source files (from your "src" directory) 4.277 + into object files in the appropriate location in the build directory. 4.278 + This example assumes that you will be including your classes in an 4.279 + unpacked directory hierarchy under "/WEB-INF/classes". 4.280 + 4.281 +--> 4.282 + 4.283 + <target name="compile" depends="prepare" 4.284 + description="Compile Java sources"> 4.285 + 4.286 + <!-- Compile Java classes as necessary --> 4.287 + <mkdir dir="${build.home}/WEB-INF/classes"/> 4.288 + <javac srcdir="${src.home}" 4.289 + destdir="${build.home}/WEB-INF/classes" 4.290 + debug="${compile.debug}" 4.291 + deprecation="${compile.deprecation}" 4.292 + optimize="${compile.optimize}"> 4.293 + <classpath refid="compile.classpath"/> 4.294 + <include name="org/xenoserver/control/**"/> 4.295 + <include name="org/xenoserver/web/**"/> 4.296 + </javac> 4.297 + 4.298 + <!-- Copy application resources --> 4.299 + <copy todir="${build.home}/WEB-INF/classes"> 4.300 + <fileset dir="${src.home}" excludes="**/*.java"/> 4.301 + </copy> 4.302 + 4.303 + </target> 4.304 + 4.305 + 4.306 + 4.307 +<!-- ==================== Dist Target ===================================== --> 4.308 + 4.309 + 4.310 +<!-- 4.311 + 4.312 + The "dist" target creates a binary distribution of your application 4.313 + in a directory structure ready to be archived in a tar.gz or zip file. 4.314 + Note that this target depends on two others: 4.315 + 4.316 + * "compile" so that the entire web application (including external 4.317 + dependencies) will have been assembled 4.318 + 4.319 + * "javadoc" so that the application Javadocs will have been created 4.320 + 4.321 +--> 4.322 + 4.323 + <target name="dist" depends="compile" 4.324 + description="Create binary distribution"> 4.325 + 4.326 + <!-- Copy documentation subdirectories --> 4.327 + <mkdir dir="${dist.home}/docs"/> 4.328 + <copy todir="${dist.home}/docs"> 4.329 + <fileset dir="${docs.home}"/> 4.330 + </copy> 4.331 + 4.332 + <!-- Create application JAR file --> 4.333 + <jar jarfile="${dist.home}/${app.name}-${app.version}.war" 4.334 + basedir="${build.home}"/> 4.335 + 4.336 + <!-- Copy additional files to ${dist.home} as necessary --> 4.337 + 4.338 + </target> 4.339 + 4.340 + 4.341 + 4.342 +<!-- ==================== Install Target ================================== --> 4.343 + 4.344 +<!-- 4.345 + 4.346 + The "install" target tells the specified Tomcat 4 installation to dynamically 4.347 + install this web application and make it available for execution. It does 4.348 + *not* cause the existence of this web application to be remembered across 4.349 + Tomcat restarts; if you restart the server, you will need to re-install all 4.350 + this web application. 4.351 + 4.352 + If you have already installed this application, and simply want Tomcat to 4.353 + recognize that you have updated Java classes (or the web.xml file), use the 4.354 + "reload" target instead. 4.355 + 4.356 + NOTE: This target will only succeed if it is run from the same server that 4.357 + Tomcat is running on. 4.358 + 4.359 + NOTE: This is the logical opposite of the "remove" target. 4.360 + 4.361 +--> 4.362 + 4.363 + <target name="install" depends="compile" 4.364 + description="Install application to servlet container"> 4.365 + 4.366 + <install url="${manager.url}" 4.367 + username="${manager.username}" 4.368 + password="${manager.password}" 4.369 + path="${app.path}" 4.370 + war="file://${build.home}"/> 4.371 + 4.372 + </target> 4.373 + 4.374 + 4.375 +<!-- ==================== Javadoc Target ================================== --> 4.376 + 4.377 +<!-- 4.378 + 4.379 + The "javadoc" target creates Javadoc API documentation for the Java 4.380 + classes included in your application. Normally, this is only required 4.381 + when preparing a distribution release, but is available as a separate 4.382 + target in case the developer wants to create Javadocs independently. 4.383 + 4.384 +--> 4.385 + 4.386 + <target name="javadoc" depends="compile" 4.387 + description="Create Javadoc API documentation"> 4.388 + 4.389 + <mkdir dir="${dist.home}/docs/api"/> 4.390 + <javadoc sourcepath="${src.home}" 4.391 + destdir="${dist.home}/docs/api" 4.392 + packagenames="*"> 4.393 + <classpath refid="compile.classpath"/> 4.394 + </javadoc> 4.395 + 4.396 + </target> 4.397 + 4.398 + 4.399 + 4.400 +<!-- ====================== List Target =================================== --> 4.401 + 4.402 +<!-- 4.403 + 4.404 + The "list" target asks the specified Tomcat 4 installation to list the 4.405 + currently running web applications, either loaded at startup time or 4.406 + installed dynamically. It is useful to determine whether or not the 4.407 + application you are currently developing has been installed. 4.408 + 4.409 +--> 4.410 + 4.411 + <target name="list" 4.412 + description="List installed applications on servlet container"> 4.413 + 4.414 + <list url="${manager.url}" 4.415 + username="${manager.username}" 4.416 + password="${manager.password}"/> 4.417 + 4.418 + </target> 4.419 + 4.420 + 4.421 +<!-- ==================== Prepare Target ================================== --> 4.422 + 4.423 +<!-- 4.424 + 4.425 + The "prepare" target is used to create the "build" destination directory, 4.426 + and copy the static contents of your web application to it. If you need 4.427 + to copy static files from external dependencies, you can customize the 4.428 + contents of this task. 4.429 + 4.430 + Normally, this task is executed indirectly when needed. 4.431 + 4.432 +--> 4.433 + 4.434 + <target name="prepare"> 4.435 + 4.436 + <!-- Create build directories as needed --> 4.437 + <mkdir dir="${build.home}"/> 4.438 + <mkdir dir="${build.home}/WEB-INF"/> 4.439 + <mkdir dir="${build.home}/WEB-INF/classes"/> 4.440 + 4.441 + <!-- create templates --> 4.442 + <exec executable="make" dir="${web.home}/tmpl"/> 4.443 + 4.444 + <!-- Copy static content of this web application --> 4.445 + <copy todir="${build.home}"> 4.446 + <fileset dir="${web.home}"/> 4.447 + </copy> 4.448 + 4.449 + <!-- Copy external dependencies as required --> 4.450 + <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> 4.451 + <mkdir dir="${build.home}/WEB-INF/lib"/> 4.452 +<!-- 4.453 + <copy todir="${build.home}/WEB-INF/lib" file="${foo.jar}"/> 4.454 +--> 4.455 + 4.456 + <!-- Copy static files from external dependencies as needed --> 4.457 + <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> 4.458 + 4.459 + </target> 4.460 + 4.461 + 4.462 +<!-- ==================== Reload Target =================================== --> 4.463 + 4.464 +<!-- 4.465 + 4.466 + The "reload" target tells the specified Tomcat 4 installation to dynamically 4.467 + reload this web application, to reflect changes in the underlying classes or 4.468 + the "web.xml" deployment descriptor. 4.469 + 4.470 +--> 4.471 + 4.472 + <target name="reload" depends="compile" 4.473 + description="Reload application on servlet container"> 4.474 + 4.475 + <reload url="${manager.url}" 4.476 + username="${manager.username}" 4.477 + password="${manager.password}" 4.478 + path="${app.path}"/> 4.479 + 4.480 + </target> 4.481 + 4.482 + 4.483 +<!-- ==================== Remove Target =================================== --> 4.484 + 4.485 +<!-- 4.486 + 4.487 + The "remove" target tells the specified Tomcat 4 installation to dynamically 4.488 + remove this web application from service. 4.489 + 4.490 + NOTE: This is the logical opposite of the "install" target. 4.491 + 4.492 +--> 4.493 + 4.494 + <target name="remove" 4.495 + description="Remove application on servlet container"> 4.496 + 4.497 + <remove url="${manager.url}" 4.498 + username="${manager.username}" 4.499 + password="${manager.password}" 4.500 + path="${app.path}"/> 4.501 + 4.502 + </target> 4.503 + 4.504 + 4.505 + <target name="help"> 4.506 + <echo>all clean, them compile</echo> 4.507 + <echo>dist create war file</echo> 4.508 + <echo>install install application in servlet container</echo> 4.509 + <echo>list list applications installed in servelet container</echo> 4.510 + <echo>reload reload application in servlet container</echo> 4.511 + <echo>remove dynamically remove web application</echo> 4.512 + </target> 4.513 + 4.514 +</project>
5.1 --- a/tools/control/build-xen.xml Wed Jul 09 14:00:09 2003 +0000 5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 5.3 @@ -1,506 +0,0 @@ 5.4 -<!-- 5.5 - General purpose build script for web applications and web services, 5.6 - including enhanced support for deploying directly to a Tomcat 4 5.7 - based server. 5.8 - 5.9 - This build script assumes that the source code of your web application 5.10 - is organized into the following subdirectories underneath the source 5.11 - code directory from which you execute the build script: 5.12 - 5.13 - docs Static documentation files to be copied to 5.14 - the "docs" subdirectory of your distribution. 5.15 - 5.16 - src Java source code (and associated resource files) 5.17 - to be compiled to the "WEB-INF/classes" 5.18 - subdirectory of your web applicaiton. 5.19 - 5.20 - web Static HTML, JSP, and other content (such as 5.21 - image files), including the WEB-INF subdirectory 5.22 - and its configuration file contents. 5.23 - 5.24 - $Id: build.xml.txt,v 1.7 2002/12/28 09:08:58 jfclere Exp $ 5.25 ---> 5.26 - 5.27 - 5.28 -<!-- A "project" describes a set of targets that may be requested 5.29 - when Ant is executed. The "default" attribute defines the 5.30 - target which is executed if no specific target is requested, 5.31 - and the "basedir" attribute defines the current working directory 5.32 - from which Ant executes the requested task. This is normally 5.33 - set to the current working directory. 5.34 ---> 5.35 - 5.36 -<project name="My Project" default="compile" basedir="."> 5.37 - 5.38 - 5.39 - 5.40 -<!-- ===================== Property Definitions =========================== --> 5.41 - 5.42 - 5.43 -<!-- 5.44 - 5.45 - Each of the following properties are used in the build script. 5.46 - Values for these properties are set by the first place they are 5.47 - defined, from the following list: 5.48 - 5.49 - * Definitions on the "ant" command line (ant -Dfoo=bar compile). 5.50 - 5.51 - * Definitions from a "build.properties" file in the top level 5.52 - source directory of this application. 5.53 - 5.54 - * Definitions from a "build.properties" file in the developer's 5.55 - home directory. 5.56 - 5.57 - * Default definitions in this build.xml file. 5.58 - 5.59 - You will note below that property values can be composed based on the 5.60 - contents of previously defined properties. This is a powerful technique 5.61 - that helps you minimize the number of changes required when your development 5.62 - environment is modified. Note that property composition is allowed within 5.63 - "build.properties" files as well as in the "build.xml" script. 5.64 - 5.65 ---> 5.66 - 5.67 - <property file="build.properties"/> 5.68 - <property file="${user.home}/build.properties"/> 5.69 - 5.70 - 5.71 -<!-- ==================== File and Directory Names ======================== --> 5.72 - 5.73 - 5.74 -<!-- 5.75 - 5.76 - These properties generally define file and directory names (or paths) that 5.77 - affect where the build process stores its outputs. 5.78 - 5.79 - app.name Base name of this application, used to 5.80 - construct filenames and directories. 5.81 - Defaults to "myapp". 5.82 - 5.83 - app.path Context path to which this application should be 5.84 - deployed (defaults to "/" plus the value of the 5.85 - "app.name" property). 5.86 - 5.87 - app.version Version number of this iteration of the application. 5.88 - 5.89 - build.home The directory into which the "prepare" and 5.90 - "compile" targets will generate their output. 5.91 - Defaults to "build". 5.92 - 5.93 - catalina.home The directory in which you have installed 5.94 - a binary distribution of Tomcat 4. This will 5.95 - be used by the "deploy" target. 5.96 - 5.97 - dist.home The name of the base directory in which 5.98 - distribution files are created. 5.99 - Defaults to "dist". 5.100 - 5.101 - manager.password The login password of a user that is assigned the 5.102 - "manager" role (so that he or she can execute 5.103 - commands via the "/manager" web application) 5.104 - 5.105 - manager.url The URL of the "/manager" web application on the 5.106 - Tomcat installation to which we will deploy web 5.107 - applications and web services. 5.108 - 5.109 - manager.username The login username of a user that is assigned the 5.110 - "manager" role (so that he or she can execute 5.111 - commands via the "/manager" web application) 5.112 - 5.113 ---> 5.114 - 5.115 - <property name="app.name" value="myapp"/> 5.116 - <property name="app.path" value="/${app.name}"/> 5.117 - <property name="app.version" value="0.1-dev"/> 5.118 - <property name="build.home" value="${basedir}/build"/> 5.119 - <property name="catalina.home" value="../../../.."/> <!-- UPDATE THIS! --> 5.120 - <property name="dist.home" value="${basedir}/dist"/> 5.121 - <property name="docs.home" value="${basedir}/docs"/> 5.122 -<!-- <property name="manager.url" value="http://localhost:8080/manager"/> --> 5.123 - <property name="src.home" value="${basedir}/src"/> 5.124 - <property name="web.home" value="${basedir}/web"/> 5.125 - 5.126 - 5.127 -<!-- ================== Custom Ant Task Definitions ======================= --> 5.128 - 5.129 - 5.130 -<!-- 5.131 - 5.132 - These properties define custom tasks for the Ant build tool that interact 5.133 - with the "/manager" web application installed with Tomcat 4. Before they 5.134 - can be successfully utilized, you must perform the following steps: 5.135 - 5.136 - - Copy the file "server/lib/catalina-ant.jar" from your Tomcat 4 5.137 - installation into the "lib" directory of your Ant installation. 5.138 - 5.139 - - Create a "build.properties" file in your application's top-level 5.140 - source directory (or your user login home directory) that defines 5.141 - appropriate values for the "manager.password", "manager.url", and 5.142 - "manager.username" properties described above. 5.143 - 5.144 - For more information about the Manager web application, and the functionality 5.145 - of these tasks, see <http://localhost:8080/tomcat-docs/manager-howto.html>. 5.146 - 5.147 ---> 5.148 - 5.149 - <taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/> 5.150 - <taskdef name="list" classname="org.apache.catalina.ant.ListTask"/> 5.151 - <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/> 5.152 - <taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/> 5.153 - 5.154 - 5.155 -<!-- ==================== Compilation Control Options ==================== --> 5.156 - 5.157 -<!-- 5.158 - 5.159 - These properties control option settings on the Javac compiler when it 5.160 - is invoked using the <javac> task. 5.161 - 5.162 - compile.debug Should compilation include the debug option? 5.163 - 5.164 - compile.deprecation Should compilation include the deprecation option? 5.165 - 5.166 - compile.optimize Should compilation include the optimize option? 5.167 - 5.168 ---> 5.169 - 5.170 - <property name="compile.debug" value="true"/> 5.171 - <property name="compile.deprecation" value="false"/> 5.172 - <property name="compile.optimize" value="true"/> 5.173 - 5.174 - 5.175 - 5.176 -<!-- ==================== External Dependencies =========================== --> 5.177 - 5.178 - 5.179 -<!-- 5.180 - 5.181 - Use property values to define the locations of external JAR files on which 5.182 - your application will depend. In general, these values will be used for 5.183 - two purposes: 5.184 - * Inclusion on the classpath that is passed to the Javac compiler 5.185 - * Being copied into the "/WEB-INF/lib" directory during execution 5.186 - of the "deploy" target. 5.187 - 5.188 - Because we will automatically include all of the Java classes that Tomcat 4 5.189 - exposes to web applications, we will not need to explicitly list any of those 5.190 - dependencies. You only need to worry about external dependencies for JAR 5.191 - files that you are going to include inside your "/WEB-INF/lib" directory. 5.192 - 5.193 ---> 5.194 - 5.195 -<!-- Dummy external dependency --> 5.196 -<!-- 5.197 - <property name="foo.jar" 5.198 - value="/path/to/foo.jar"/> 5.199 ---> 5.200 - 5.201 - 5.202 -<!-- ==================== Compilation Classpath =========================== --> 5.203 - 5.204 -<!-- 5.205 - 5.206 - Rather than relying on the CLASSPATH environment variable, Ant includes 5.207 - features that makes it easy to dynamically construct the classpath you 5.208 - need for each compilation. The example below constructs the compile 5.209 - classpath to include the servlet.jar file, as well as the other components 5.210 - that Tomcat makes available to web applications automatically, plus anything 5.211 - that you explicitly added. 5.212 - 5.213 ---> 5.214 - 5.215 - <path id="compile.classpath"> 5.216 - 5.217 - <!-- Include all JAR files that will be included in /WEB-INF/lib --> 5.218 - <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> 5.219 -<!-- 5.220 - <pathelement location="${foo.jar}"/> 5.221 ---> 5.222 - 5.223 - <!-- Include all elements that Tomcat exposes to applications --> 5.224 - <pathelement location="${catalina.home}/common/classes"/> 5.225 - <fileset dir="${catalina.home}/common/endorsed"> 5.226 - <include name="*.jar"/> 5.227 - </fileset> 5.228 - <fileset dir="${catalina.home}/common/lib"> 5.229 - <include name="*.jar"/> 5.230 - </fileset> 5.231 - <pathelement location="${catalina.home}/shared/classes"/> 5.232 - <fileset dir="${catalina.home}/shared/lib"> 5.233 - <include name="*.jar"/> 5.234 - </fileset> 5.235 - 5.236 - </path> 5.237 - 5.238 - 5.239 - 5.240 -<!-- ==================== All Target ====================================== --> 5.241 - 5.242 -<!-- 5.243 - 5.244 - The "all" target is a shortcut for running the "clean" target followed 5.245 - by the "compile" target, to force a complete recompile. 5.246 - 5.247 ---> 5.248 - 5.249 - <target name="all" depends="clean,compile" 5.250 - description="Clean build and dist directories, then compile"/> 5.251 - 5.252 - 5.253 - 5.254 -<!-- ==================== Clean Target ==================================== --> 5.255 - 5.256 -<!-- 5.257 - 5.258 - The "clean" target deletes any previous "build" and "dist" directory, 5.259 - so that you can be ensured the application can be built from scratch. 5.260 - 5.261 ---> 5.262 - 5.263 - <target name="clean" 5.264 - description="Delete old build and dist directories"> 5.265 - <delete dir="${build.home}"/> 5.266 - <delete dir="${dist.home}"/> 5.267 - </target> 5.268 - 5.269 - 5.270 - 5.271 -<!-- ==================== Compile Target ================================== --> 5.272 - 5.273 -<!-- 5.274 - 5.275 - The "compile" target transforms source files (from your "src" directory) 5.276 - into object files in the appropriate location in the build directory. 5.277 - This example assumes that you will be including your classes in an 5.278 - unpacked directory hierarchy under "/WEB-INF/classes". 5.279 - 5.280 ---> 5.281 - 5.282 - <target name="compile" depends="prepare" 5.283 - description="Compile Java sources"> 5.284 - 5.285 - <!-- Compile Java classes as necessary --> 5.286 - <mkdir dir="${build.home}/WEB-INF/classes"/> 5.287 - <javac srcdir="${src.home}" 5.288 - destdir="${build.home}/WEB-INF/classes" 5.289 - debug="${compile.debug}" 5.290 - deprecation="${compile.deprecation}" 5.291 - optimize="${compile.optimize}"> 5.292 - <classpath refid="compile.classpath"/> 5.293 - </javac> 5.294 - 5.295 - <!-- Copy application resources --> 5.296 - <copy todir="${build.home}/WEB-INF/classes"> 5.297 - <fileset dir="${src.home}" excludes="**/*.java"/> 5.298 - </copy> 5.299 - 5.300 - </target> 5.301 - 5.302 - 5.303 - 5.304 -<!-- ==================== Dist Target ===================================== --> 5.305 - 5.306 - 5.307 -<!-- 5.308 - 5.309 - The "dist" target creates a binary distribution of your application 5.310 - in a directory structure ready to be archived in a tar.gz or zip file. 5.311 - Note that this target depends on two others: 5.312 - 5.313 - * "compile" so that the entire web application (including external 5.314 - dependencies) will have been assembled 5.315 - 5.316 - * "javadoc" so that the application Javadocs will have been created 5.317 - 5.318 ---> 5.319 - 5.320 - <target name="dist" depends="compile,javadoc" 5.321 - description="Create binary distribution"> 5.322 - 5.323 - <!-- Copy documentation subdirectories --> 5.324 - <mkdir dir="${dist.home}/docs"/> 5.325 - <copy todir="${dist.home}/docs"> 5.326 - <fileset dir="${docs.home}"/> 5.327 - </copy> 5.328 - 5.329 - <!-- Create application JAR file --> 5.330 - <jar jarfile="${dist.home}/${app.name}-${app.version}.war" 5.331 - basedir="${build.home}"/> 5.332 - 5.333 - <!-- Copy additional files to ${dist.home} as necessary --> 5.334 - 5.335 - </target> 5.336 - 5.337 - 5.338 - 5.339 -<!-- ==================== Install Target ================================== --> 5.340 - 5.341 -<!-- 5.342 - 5.343 - The "install" target tells the specified Tomcat 4 installation to dynamically 5.344 - install this web application and make it available for execution. It does 5.345 - *not* cause the existence of this web application to be remembered across 5.346 - Tomcat restarts; if you restart the server, you will need to re-install all 5.347 - this web application. 5.348 - 5.349 - If you have already installed this application, and simply want Tomcat to 5.350 - recognize that you have updated Java classes (or the web.xml file), use the 5.351 - "reload" target instead. 5.352 - 5.353 - NOTE: This target will only succeed if it is run from the same server that 5.354 - Tomcat is running on. 5.355 - 5.356 - NOTE: This is the logical opposite of the "remove" target. 5.357 - 5.358 ---> 5.359 - 5.360 - <target name="install" depends="compile" 5.361 - description="Install application to servlet container"> 5.362 - 5.363 - <install url="${manager.url}" 5.364 - username="${manager.username}" 5.365 - password="${manager.password}" 5.366 - path="${app.path}" 5.367 - war="file://${build.home}"/> 5.368 - 5.369 - </target> 5.370 - 5.371 - 5.372 -<!-- ==================== Javadoc Target ================================== --> 5.373 - 5.374 -<!-- 5.375 - 5.376 - The "javadoc" target creates Javadoc API documentation for the Java 5.377 - classes included in your application. Normally, this is only required 5.378 - when preparing a distribution release, but is available as a separate 5.379 - target in case the developer wants to create Javadocs independently. 5.380 - 5.381 ---> 5.382 - 5.383 - <target name="javadoc" depends="compile" 5.384 - description="Create Javadoc API documentation"> 5.385 - 5.386 - <mkdir dir="${dist.home}/docs/api"/> 5.387 - <javadoc sourcepath="${src.home}" 5.388 - destdir="${dist.home}/docs/api" 5.389 - packagenames="*"> 5.390 - <classpath refid="compile.classpath"/> 5.391 - </javadoc> 5.392 - 5.393 - </target> 5.394 - 5.395 - 5.396 - 5.397 -<!-- ====================== List Target =================================== --> 5.398 - 5.399 -<!-- 5.400 - 5.401 - The "list" target asks the specified Tomcat 4 installation to list the 5.402 - currently running web applications, either loaded at startup time or 5.403 - installed dynamically. It is useful to determine whether or not the 5.404 - application you are currently developing has been installed. 5.405 - 5.406 ---> 5.407 - 5.408 - <target name="list" 5.409 - description="List installed applications on servlet container"> 5.410 - 5.411 - <list url="${manager.url}" 5.412 - username="${manager.username}" 5.413 - password="${manager.password}"/> 5.414 - 5.415 - </target> 5.416 - 5.417 - 5.418 -<!-- ==================== Prepare Target ================================== --> 5.419 - 5.420 -<!-- 5.421 - 5.422 - The "prepare" target is used to create the "build" destination directory, 5.423 - and copy the static contents of your web application to it. If you need 5.424 - to copy static files from external dependencies, you can customize the 5.425 - contents of this task. 5.426 - 5.427 - Normally, this task is executed indirectly when needed. 5.428 - 5.429 ---> 5.430 - 5.431 - <target name="prepare"> 5.432 - 5.433 - <!-- Create build directories as needed --> 5.434 - <mkdir dir="${build.home}"/> 5.435 - <mkdir dir="${build.home}/WEB-INF"/> 5.436 - <mkdir dir="${build.home}/WEB-INF/classes"/> 5.437 - 5.438 - 5.439 - <!-- Copy static content of this web application --> 5.440 - <copy todir="${build.home}"> 5.441 - <fileset dir="${web.home}"/> 5.442 - </copy> 5.443 - 5.444 - <!-- Copy external dependencies as required --> 5.445 - <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> 5.446 - <mkdir dir="${build.home}/WEB-INF/lib"/> 5.447 -<!-- 5.448 - <copy todir="${build.home}/WEB-INF/lib" file="${foo.jar}"/> 5.449 ---> 5.450 - 5.451 - <!-- Copy static files from external dependencies as needed --> 5.452 - <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> 5.453 - 5.454 - </target> 5.455 - 5.456 - 5.457 -<!-- ==================== Reload Target =================================== --> 5.458 - 5.459 -<!-- 5.460 - 5.461 - The "reload" target tells the specified Tomcat 4 installation to dynamically 5.462 - reload this web application, to reflect changes in the underlying classes or 5.463 - the "web.xml" deployment descriptor. 5.464 - 5.465 ---> 5.466 - 5.467 - <target name="reload" depends="compile" 5.468 - description="Reload application on servlet container"> 5.469 - 5.470 - <reload url="${manager.url}" 5.471 - username="${manager.username}" 5.472 - password="${manager.password}" 5.473 - path="${app.path}"/> 5.474 - 5.475 - </target> 5.476 - 5.477 - 5.478 -<!-- ==================== Remove Target =================================== --> 5.479 - 5.480 -<!-- 5.481 - 5.482 - The "remove" target tells the specified Tomcat 4 installation to dynamically 5.483 - remove this web application from service. 5.484 - 5.485 - NOTE: This is the logical opposite of the "install" target. 5.486 - 5.487 ---> 5.488 - 5.489 - <target name="remove" 5.490 - description="Remove application on servlet container"> 5.491 - 5.492 - <remove url="${manager.url}" 5.493 - username="${manager.username}" 5.494 - password="${manager.password}" 5.495 - path="${app.path}"/> 5.496 - 5.497 - </target> 5.498 - 5.499 - 5.500 - <target name="help"> 5.501 - <echo>all clean, them compile</echo> 5.502 - <echo>dist create war file</echo> 5.503 - <echo>install install application in servlet container</echo> 5.504 - <echo>list list applications installed in servelet container</echo> 5.505 - <echo>reload reload application in servlet container</echo> 5.506 - <echo>remove dynamically remove web application</echo> 5.507 - </target> 5.508 - 5.509 -</project>
6.1 --- a/tools/control/src/org/xenoserver/control/Command.java Wed Jul 09 14:00:09 2003 +0000 6.2 +++ b/tools/control/src/org/xenoserver/control/Command.java Wed Jul 09 15:58:14 2003 +0000 6.3 @@ -14,6 +14,19 @@ public abstract class Command { 6.4 * @throws CommandFailedException if the command could not be completed. 6.5 */ 6.6 public abstract String execute() throws CommandFailedException; 6.7 + 6.8 + /** 6.9 + * Wraps execute() suitable for the web interface: all exceptions are 6.10 + * converted into output strings. 6.11 + * @return Output string, whether command succeeded or not. 6.12 + */ 6.13 + public String executeWeb() { 6.14 + try { 6.15 + return execute(); 6.16 + } catch (CommandFailedException e) { 6.17 + return e.getMessage(); 6.18 + } 6.19 + } 6.20 6.21 /** 6.22 * Construct a string to report the execution of a command.
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/tools/control/src/org/xenoserver/web/RootBean.java Wed Jul 09 15:58:14 2003 +0000 7.3 @@ -0,0 +1,174 @@ 7.4 +/* 7.5 + * RootBean.java 7.6 + * 03.05.05 aho creation 7.7 + */ 7.8 + 7.9 +package org.xenoserver.web; 7.10 + 7.11 +import javax.servlet.http.HttpSessionBindingEvent; 7.12 +import javax.servlet.http.HttpSessionBindingListener; 7.13 + 7.14 +import org.xenoserver.control.PartitionManager; 7.15 +import org.xenoserver.control.Settings; 7.16 +import org.xenoserver.control.VirtualDiskManager; 7.17 +import org.xenoserver.control.XML; 7.18 + 7.19 +public class RootBean implements HttpSessionBindingListener { 7.20 + static String state_filename_out = "/var/lib/xen/vdstate.xml"; 7.21 + static String partition_filename = "/proc/partitions"; 7.22 + static int default_sector_size = 512; 7.23 + 7.24 + PartitionManager pm; 7.25 + VirtualDiskManager vdm; 7.26 + 7.27 + public RootBean() { 7.28 + valueBound(null); 7.29 + } 7.30 + 7.31 + public void valueBound(HttpSessionBindingEvent event) { 7.32 + pm = PartitionManager.IT; 7.33 + vdm = VirtualDiskManager.IT; 7.34 + XML.loadState(pm, vdm, Settings.STATE_INPUT_FILE); 7.35 + } 7.36 + 7.37 + public void valueUnbound(HttpSessionBindingEvent event) { 7.38 + doFlushState(); 7.39 + } 7.40 + 7.41 +/* 7.42 + public int getPartitionCount() { 7.43 + return pm.getPartitionCount(); 7.44 + } 7.45 + 7.46 + public Partition getPartition(int index) { 7.47 + return pm.getPartition(index); 7.48 + } 7.49 + 7.50 + public String doAddPartition(String partition, String chunksize) { 7.51 + Partition p = pm.get_partition(partition); 7.52 + String result = "done"; 7.53 + int loop; 7.54 + long size; 7.55 + 7.56 + if (p == null) { 7.57 + return (" eh? what partition: " + partition); 7.58 + } 7.59 + 7.60 + size = Library.parse_size(chunksize) / default_sector_size; 7.61 + if (size == 0) { 7.62 + return ("error: invalid chunk size"); 7.63 + } 7.64 + vdm.add_xeno_partition(p, size); 7.65 + pm.add_xeno_partition(p); 7.66 + 7.67 + return "done"; 7.68 + } 7.69 + 7.70 + public int getVirtualDiskCount() { 7.71 + return vdm.getVirtualDiskCount(); 7.72 + } 7.73 + 7.74 + public VirtualDisk getVirtualDisk(int index) { 7.75 + return vdm.getVirtualDisk(index); 7.76 + } 7.77 + 7.78 + public VirtualDisk getVirtualDiskKey(String key) { 7.79 + return vdm.get_virtual_disk_key(key); 7.80 + } 7.81 + 7.82 + public String doCreateVirtualDisk(String name, String size, long expiry) { 7.83 + VirtualDisk vd; 7.84 + Date date = new Date(); 7.85 + long parse_size; 7.86 + 7.87 + parse_size = Library.parse_size(size) / default_sector_size; 7.88 + if (parse_size == 0) { 7.89 + return ("error: invalid size"); 7.90 + } 7.91 + vd = 7.92 + vdm.create_virtual_disk( 7.93 + name, 7.94 + parse_size, 7.95 + new Date(date.getTime() + expiry)); 7.96 + 7.97 + return ("Virtual Disk created with key: " + vd.get_key()); 7.98 + 7.99 + } 7.100 + 7.101 + public String doDeleteVirtualDisk(String key) { 7.102 + if (key == null || key.trim().equals("")) { 7.103 + return ("error: no virtual disk specified"); 7.104 + } 7.105 + vdm.delete_virtual_disk(key); 7.106 + 7.107 + return ("okay"); 7.108 + } 7.109 + 7.110 + public String doRefreshVirtualDisk(String key, long expiry) { 7.111 + VirtualDisk vd = vdm.get_virtual_disk_key(key); 7.112 + Date date; 7.113 + String s = ""; 7.114 + 7.115 + if (vd == null) { 7.116 + return ("disk not found: " + key); 7.117 + } 7.118 + s = vd.get_expiry().toString(); 7.119 + date = new Date(vd.get_expiry().getTime() + expiry); 7.120 + vd.set_expiry(date); 7.121 + 7.122 + return ("okay " + expiry + " " + s + " " + date.toString()); 7.123 + } 7.124 + 7.125 + public int getFreeExtentCount() { 7.126 + VirtualDisk free = vdm.getFreeVirtualDisk(); 7.127 + return free.getExtentCount(); 7.128 + } 7.129 + 7.130 + public Extent getFreeExtent(int index) { 7.131 + VirtualDisk free = vdm.getFreeVirtualDisk(); 7.132 + return free.getExtent(index); 7.133 + } 7.134 + 7.135 + public Enumeration getVirtualBlockDevices() { 7.136 + return vdm.getVirtualBlockDevices(); 7.137 + } 7.138 + 7.139 + public String doCreateVirtualBlockDevice( 7.140 + String vd_key, 7.141 + int domain, 7.142 + int vbd_num, 7.143 + String mode) { 7.144 + VirtualBlockDevice vbd; 7.145 + VirtualDisk vd; 7.146 + 7.147 + vbd = vdm.create_virtual_block_device(vd_key, domain, vbd_num, mode); 7.148 + if (vbd != null) { 7.149 + String command; 7.150 + FileWriter fw; 7.151 + 7.152 + vd = vdm.get_virtual_disk_key(vd_key); 7.153 + command = vd.dump_xen(vbd); 7.154 + 7.155 + try { 7.156 + fw = new FileWriter("/proc/xeno/dom0/vhd"); 7.157 + fw.write(command); 7.158 + fw.flush(); 7.159 + fw.close(); 7.160 + } catch (Exception e) { 7.161 + return (e.toString()); 7.162 + } 7.163 + return command; 7.164 + } else { 7.165 + return "Error encountered"; 7.166 + } 7.167 + } 7.168 + 7.169 + public String doFlushVirtualBlockDevices() { 7.170 + vdm.flush_virtual_block_devices(); 7.171 + return "done"; 7.172 + } 7.173 +*/ 7.174 + public void doFlushState() { 7.175 + XML.saveState(pm, vdm, Settings.STATE_OUTPUT_FILE); 7.176 + } 7.177 +}
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8.2 +++ b/tools/control/src/org/xenoserver/web/SystemConfigurationBean.java Wed Jul 09 15:58:14 2003 +0000 8.3 @@ -0,0 +1,20 @@ 8.4 +/* 8.5 + * SystemConfigurationBean.java 8.6 + * 03.05.06 aho creation 8.7 + */ 8.8 + 8.9 +package org.xenoserver.web; 8.10 + 8.11 +import org.xenoserver.control.Defaults; 8.12 + 8.13 +public class SystemConfigurationBean { 8.14 + private Defaults defaults; 8.15 + 8.16 + public SystemConfigurationBean() { 8.17 + defaults = new Defaults(); 8.18 + } 8.19 + 8.20 + public Defaults getDefaults() { 8.21 + return defaults; 8.22 + } 8.23 +}
9.1 --- a/tools/control/src/uk/ac/cam/cl/xeno/xenctl/RootBean.java Wed Jul 09 14:00:09 2003 +0000 9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 9.3 @@ -1,239 +0,0 @@ 9.4 -/* 9.5 - * RootBean.java 9.6 - * 03.05.05 aho creation 9.7 - */ 9.8 - 9.9 -package uk.ac.cam.cl.xeno.xenctl; 9.10 - 9.11 -import java.io.FileWriter; 9.12 -import java.util.Date; 9.13 -import java.util.Enumeration; 9.14 -import javax.servlet.http.HttpSessionBindingEvent; 9.15 -import javax.servlet.http.HttpSessionBindingListener; 9.16 - 9.17 -public class 9.18 -RootBean 9.19 - implements HttpSessionBindingListener 9.20 -{ 9.21 - static String state_filename_in = "/var/lib/xen/vdstate.xml"; 9.22 - static String state_filename_out = "/var/lib/xen/vdstate.xml"; 9.23 - static String partition_filename = "/proc/partitions"; 9.24 - static int default_sector_size = 512; 9.25 - 9.26 - PartitionManager pm; 9.27 - VirtualDiskManager vdm; 9.28 - 9.29 - int counter = 0; 9.30 - 9.31 - public 9.32 - RootBean () 9.33 - { 9.34 - valueBound(null); 9.35 - } 9.36 - 9.37 - public void 9.38 - valueBound (HttpSessionBindingEvent event) 9.39 - { 9.40 - pm = new PartitionManager(partition_filename); 9.41 - vdm = new VirtualDiskManager(); 9.42 - XML.load_state(pm, vdm, state_filename_in); 9.43 - } 9.44 - 9.45 - public void 9.46 - valueUnbound (HttpSessionBindingEvent event) 9.47 - { 9.48 - doFlushState(); 9.49 - } 9.50 - 9.51 - public int 9.52 - getDebugCounter() 9.53 - { 9.54 - return counter++; 9.55 - } 9.56 - 9.57 - /*************************************************************************/ 9.58 - 9.59 - public int 9.60 - getPartitionCount() 9.61 - { 9.62 - return pm.getPartitionCount(); 9.63 - } 9.64 - 9.65 - public Partition 9.66 - getPartition(int index) 9.67 - { 9.68 - return pm.getPartition(index); 9.69 - } 9.70 - 9.71 - public String 9.72 - doAddPartition(String partition, String chunksize ) 9.73 - { 9.74 - Partition p = pm.get_partition(partition); 9.75 - String result="done"; 9.76 - int loop; 9.77 - long size; 9.78 - 9.79 - if (p == null) 9.80 - { 9.81 - return (" eh? what partition: " + partition); 9.82 - } 9.83 - 9.84 - size = Library.parse_size(chunksize) / default_sector_size; 9.85 - if (size == 0) 9.86 - { 9.87 - return ("error: invalid chunk size"); 9.88 - } 9.89 - vdm.add_xeno_partition(p, size); 9.90 - pm.add_xeno_partition(p); 9.91 - 9.92 - /* return pm.dump(true); */ 9.93 - return "done"; 9.94 - } 9.95 - 9.96 - /*************************************************************************/ 9.97 - 9.98 - public int 9.99 - getVirtualDiskCount () 9.100 - { 9.101 - return vdm.getVirtualDiskCount(); 9.102 - } 9.103 - 9.104 - public VirtualDisk 9.105 - getVirtualDisk (int index) 9.106 - { 9.107 - return vdm.getVirtualDisk(index); 9.108 - } 9.109 - 9.110 - public VirtualDisk 9.111 - getVirtualDiskKey (String key) 9.112 - { 9.113 - return vdm.get_virtual_disk_key(key); 9.114 - } 9.115 - 9.116 - public String 9.117 - doCreateVirtualDisk (String name, String size, long expiry) 9.118 - { 9.119 - VirtualDisk vd; 9.120 - Date date = new Date(); 9.121 - long parse_size; 9.122 - 9.123 - 9.124 - parse_size = Library.parse_size(size)/default_sector_size; 9.125 - if (parse_size == 0) 9.126 - { 9.127 - return ("error: invalid size"); 9.128 - } 9.129 - vd = vdm.create_virtual_disk(name, parse_size, 9.130 - new Date(date.getTime() + expiry)); 9.131 - 9.132 - return ("Virtual Disk created with key: " + vd.get_key()); 9.133 - 9.134 - } 9.135 - 9.136 - public String 9.137 - doDeleteVirtualDisk (String key) 9.138 - { 9.139 - if (key == null || 9.140 - key.trim().equals("")) 9.141 - { 9.142 - return ("error: no virtual disk specified"); 9.143 - } 9.144 - vdm.delete_virtual_disk(key); 9.145 - 9.146 - return ("okay"); 9.147 - } 9.148 - 9.149 - public String 9.150 - doRefreshVirtualDisk (String key, long expiry) 9.151 - { 9.152 - VirtualDisk vd = vdm.get_virtual_disk_key(key); 9.153 - Date date; 9.154 - String s = ""; 9.155 - 9.156 - if (vd == null) 9.157 - { 9.158 - return ("disk not found: " + key); 9.159 - } 9.160 - s = vd.get_expiry().toString(); 9.161 - date = new Date(vd.get_expiry().getTime() + expiry); 9.162 - vd.set_expiry(date); 9.163 - 9.164 - return ("okay " + expiry + " " + s + " " + date.toString()); 9.165 - } 9.166 - 9.167 - /*************************************************************************/ 9.168 - 9.169 - public int 9.170 - getFreeExtentCount () 9.171 - { 9.172 - VirtualDisk free = vdm.getFreeVirtualDisk(); 9.173 - return free.getExtentCount(); 9.174 - } 9.175 - 9.176 - public Extent 9.177 - getFreeExtent (int index) 9.178 - { 9.179 - VirtualDisk free = vdm.getFreeVirtualDisk(); 9.180 - return free.getExtent(index); 9.181 - } 9.182 - 9.183 - /*************************************************************************/ 9.184 - 9.185 - public Enumeration 9.186 - getVirtualBlockDevices () 9.187 - { 9.188 - return vdm.getVirtualBlockDevices(); 9.189 - } 9.190 - 9.191 - public String 9.192 - doCreateVirtualBlockDevice (String vd_key, int domain, 9.193 - int vbd_num, String mode) 9.194 - { 9.195 - VirtualBlockDevice vbd; 9.196 - VirtualDisk vd; 9.197 - 9.198 - vbd = vdm.create_virtual_block_device(vd_key, domain, vbd_num, mode); 9.199 - if (vbd != null) 9.200 - { 9.201 - String command; 9.202 - FileWriter fw; 9.203 - 9.204 - vd = vdm.get_virtual_disk_key(vd_key); 9.205 - command = vd.dump_xen(vbd); 9.206 - 9.207 - try 9.208 - { 9.209 - fw = new FileWriter("/proc/xeno/dom0/vhd"); 9.210 - fw.write(command); 9.211 - fw.flush(); 9.212 - fw.close(); 9.213 - } 9.214 - catch (Exception e) 9.215 - { 9.216 - return (e.toString()); 9.217 - } 9.218 - return command; 9.219 - } 9.220 - else 9.221 - { 9.222 - return "Error encountered"; 9.223 - } 9.224 - } 9.225 - 9.226 - public String 9.227 - doFlushVirtualBlockDevices() 9.228 - { 9.229 - vdm.flush_virtual_block_devices(); 9.230 - return "done"; 9.231 - } 9.232 - 9.233 - /*************************************************************************/ 9.234 - 9.235 - 9.236 - public void 9.237 - doFlushState () 9.238 - { 9.239 - XML.dump_state(pm, vdm, state_filename_out); 9.240 - } 9.241 - 9.242 -}
10.1 --- a/tools/control/src/uk/ac/cam/cl/xeno/xenctl/SystemConfigurationBean.java Wed Jul 09 14:00:09 2003 +0000 10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 10.3 @@ -1,30 +0,0 @@ 10.4 -/* 10.5 - * SystemConfigurationBean.java 10.6 - * 03.05.06 aho creation 10.7 - */ 10.8 - 10.9 -package uk.ac.cam.cl.xeno.xenctl; 10.10 - 10.11 -import java.io.*; 10.12 -import java.lang.Process; 10.13 -import java.lang.Runtime; 10.14 -import uk.ac.cam.cl.xeno.domctl.Defaults; 10.15 - 10.16 -public class 10.17 -SystemConfigurationBean 10.18 -{ 10.19 - Defaults defaults; 10.20 - 10.21 - public 10.22 - SystemConfigurationBean () 10.23 - { 10.24 - defaults = new Defaults(); 10.25 - } 10.26 - 10.27 - public Defaults 10.28 - getDefaults () 10.29 - { 10.30 - return defaults; 10.31 - } 10.32 - 10.33 -}
11.1 --- a/tools/control/web/tmpl/dom-del.tmpl Wed Jul 09 14:00:09 2003 +0000 11.2 +++ b/tools/control/web/tmpl/dom-del.tmpl Wed Jul 09 15:58:14 2003 +0000 11.3 @@ -15,9 +15,15 @@ INCLUDE&dommenu.tmpl 11.4 <tbody> 11.5 <tr><td> 11.6 <% 11.7 - CommandList command_list = new CommandList(); 11.8 - Defaults d = sc.getDefaults(); 11.9 - Domain domains[] = command_list.executeCommand(d); 11.10 + CommandDomainList list = new CommandDomainList(sc.getDefaults()); 11.11 + String output = list.executeWeb(); 11.12 + Domain domains[] = list.domains(); 11.13 + if (output != null) 11.14 + { 11.15 +%> 11.16 +<%= output %> 11.17 +<% 11.18 + } else { 11.19 %> 11.20 11.21 <table cellpadding="2" cellspacing="0" border="0"> 11.22 @@ -45,6 +51,10 @@ INCLUDE&dommenu.tmpl 11.23 </table> 11.24 </td></tr> 11.25 11.26 +<% 11.27 + } 11.28 +%> 11.29 + 11.30 ##WHITESPACE## ##GREYLINE1## ##WHITESPACE## 11.31 11.32 <tr><td>
12.1 --- a/tools/control/web/tmpl/dom-delr.tmpl Wed Jul 09 14:00:09 2003 +0000 12.2 +++ b/tools/control/web/tmpl/dom-delr.tmpl Wed Jul 09 15:58:14 2003 +0000 12.3 @@ -17,7 +17,6 @@ INCLUDE&dommenu.tmpl 12.4 <% 12.5 HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request); 12.6 Defaults d = sc.getDefaults(); 12.7 - CommandDestroy command_destroy = new CommandDestroy(); 12.8 12.9 String domains[] = hsrw.getParameterValues("dom"); 12.10 boolean force = hsrw.getParameter("force").equals("true"); 12.11 @@ -34,8 +33,8 @@ Error: no domain specified.<br> 12.12 { 12.13 %> 12.14 result <%= domains[i] %> = 12.15 - <%= command_destroy.executeCommand(d, Integer.parseInt(domains[i]), 12.16 - force) %> <br> 12.17 + <%= new CommandDomainDestroy(d, Integer.parseInt(domains[i]), 12.18 + force).executeWeb() %> <br> 12.19 <% 12.20 } 12.21 }
13.1 --- a/tools/control/web/tmpl/dom-lis.tmpl Wed Jul 09 14:00:09 2003 +0000 13.2 +++ b/tools/control/web/tmpl/dom-lis.tmpl Wed Jul 09 15:58:14 2003 +0000 13.3 @@ -11,9 +11,15 @@ INCLUDE&dommenu.tmpl 13.4 <td valign="top"> 13.5 13.6 <% 13.7 - CommandList command_list = new CommandList(); 13.8 - Defaults d = sc.getDefaults(); 13.9 - Domain domains[] = command_list.executeCommand(d); 13.10 + CommandDomainList list = new CommandDomainList(sc.getDefaults()); 13.11 + String output = list.executeWeb(); 13.12 + Domain domains[] = list.domains(); 13.13 + if (output != null) 13.14 + { 13.15 +%> 13.16 +<%= output %> 13.17 +<% 13.18 + } else { 13.19 %> 13.20 13.21 <table cellpadding="2" cellspacing="0" border="0"> 13.22 @@ -38,7 +44,9 @@ INCLUDE&dommenu.tmpl 13.23 %> 13.24 </tbody> 13.25 </table> 13.26 - 13.27 +<% 13.28 + } 13.29 +%> 13.30 13.31 </td> 13.32 </tbody>
14.1 --- a/tools/control/web/tmpl/dom-new.tmpl Wed Jul 09 14:00:09 2003 +0000 14.2 +++ b/tools/control/web/tmpl/dom-new.tmpl Wed Jul 09 15:58:14 2003 +0000 14.3 @@ -95,19 +95,19 @@ INCLUDE&dommenu.tmpl 14.4 <td></td> <td></td> 14.5 <td class="block" align="right">IP address</td> 14.6 <td></td> 14.7 - <td> <input type="text" size="15" name="ip" value="<%= d.NWIP %>"> </td> 14.8 + <td> <input type="text" size="15" name="ip" value="<%= d.nwIP %>"> </td> 14.9 </tr> 14.10 <tr> 14.11 <td></td> <td></td> 14.12 <td class="block" align="right">Gateway</td> 14.13 <td></td> 14.14 - <td> <input type="text" size="15" name="gw" value="<%= d.NWGW %>"> </td> 14.15 + <td> <input type="text" size="15" name="gw" value="<%= d.nwGateway %>"> </td> 14.16 </tr> 14.17 <tr> 14.18 <td></td> <td></td> 14.19 <td class="block" align="right">Netmask</td> 14.20 <td></td> 14.21 - <td> <input type="text" size="15" name="mask" value="<%= d.NWMask %>"> </td> 14.22 + <td> <input type="text" size="15" name="mask" value="<%= d.nwMask %>"> </td> 14.23 </tr> 14.24 14.25 ##WHITESPACE## ##GREYLINE14## ##WHITESPACE## 14.26 @@ -121,11 +121,11 @@ INCLUDE&dommenu.tmpl 14.27 14.28 <tr> 14.29 <td></td> 14.30 - <td align="right">NFS<input type="radio" name="root" value="nfs"></td> 14.31 + <td align="right">NFS<input type="radio" checked name="root" value="nfs"></td> 14.32 <td align="right">path</td> 14.33 <td></td> 14.34 <td> 14.35 - <input type="text" size="40" name="nfsroot" value="<%= d.NWNFSRoot %>"> 14.36 + <input type="text" size="40" name="nfsroot" value="<%= d.nwNFSRoot %>"> 14.37 </td> 14.38 </tr> 14.39 <tr> 14.40 @@ -133,7 +133,7 @@ INCLUDE&dommenu.tmpl 14.41 <td align="right">server</td> 14.42 <td></td> 14.43 <td> 14.44 - <input type="text" size="15" name="nfsserver" value="<%= d.NWNFSServer%>"> 14.45 + <input type="text" size="15" name="nfsserver" value="<%= d.nwNFSServer%>"> 14.46 </td> 14.47 </tr> 14.48 ##WHITESPACE## 14.49 @@ -143,13 +143,13 @@ INCLUDE&dommenu.tmpl 14.50 <td align="right">path</td> 14.51 <td></td> 14.52 <td> 14.53 - <input type="text" size="40" name="rd" value="/usr/isolinux/initrd.gz"> 14.54 + <input type="text" size="40" name="rd" value="<%= d.domainInitRD %>"> 14.55 </td> 14.56 </tr> 14.57 ##WHITESPACE## 14.58 <tr> 14.59 <td></td> 14.60 - <td align="right">physical disk<input type="radio" checked name="root" value="pdisk"></td> 14.61 + <td align="right">physical disk<input type="radio" name="root" value="pdisk"></td> 14.62 <td align="right">path</td> 14.63 <td></td> 14.64 <td><input type="text" size="40" name="pdisk" value="/dev/sda8"></td> 14.65 @@ -172,7 +172,7 @@ INCLUDE&dommenu.tmpl 14.66 <td></td> 14.67 <td colspan=2 align="right"></td> 14.68 <td></td> 14.69 - <td> <input type="text" size="40" name="args" value="ro"> </td> 14.70 + <td> <input type="text" size="40" name="args" value="<%= d.args %>"> </td> 14.71 </tr> 14.72 14.73
15.1 --- a/tools/control/web/tmpl/dom-newr.tmpl Wed Jul 09 14:00:09 2003 +0000 15.2 +++ b/tools/control/web/tmpl/dom-newr.tmpl Wed Jul 09 15:58:14 2003 +0000 15.3 @@ -16,7 +16,6 @@ INCLUDE&dommenu.tmpl 15.4 <% 15.5 HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request); 15.6 Defaults d = sc.getDefaults(); 15.7 - CommandNew command_new = new CommandNew(); 15.8 String root_device = hsrw.getParameter("root"); 15.9 15.10 String nfsroot = null; 15.11 @@ -73,8 +72,9 @@ nw_host = <%= hsrw.getParameter("hostnam 15.12 <br> 15.13 root = <%= disk %> 15.14 <br> 15.15 -output = <br><%= 15.16 - command_new.executeCommand(d, 15.17 +output = <br> 15.18 +<% 15.19 + CommandDomainNew command_new = new CommandDomainNew(d, 15.20 hsrw.getParameter("name"), 15.21 Integer.parseInt(hsrw.getParameter("size")), 15.22 hsrw.getParameter("image"), 15.23 @@ -87,7 +87,20 @@ output = <br><%= 15.24 hsrw.getParameter("gw"), 15.25 hsrw.getParameter("mask"), 15.26 nfsserver, 15.27 - hsrw.getParameter("hostname")) 15.28 + hsrw.getParameter("hostname")); 15.29 + String oneline = command_new.executeWeb(); 15.30 + if ( oneline != null ) { 15.31 +%> 15.32 +<%= oneline %><br> 15.33 +<% 15.34 + } else { 15.35 + String[] output = command_new.output(); 15.36 + for (int i = 0; i < output.length; i++) { 15.37 +%> 15.38 +<%= output[i] %><br> 15.39 +<% 15.40 + } 15.41 + } 15.42 %> 15.43 15.44 </td>
16.1 --- a/tools/control/web/tmpl/dom-sta.tmpl Wed Jul 09 14:00:09 2003 +0000 16.2 +++ b/tools/control/web/tmpl/dom-sta.tmpl Wed Jul 09 15:58:14 2003 +0000 16.3 @@ -15,9 +15,15 @@ INCLUDE&dommenu.tmpl 16.4 <tbody> 16.5 <tr><td> 16.6 <% 16.7 - CommandList command_list = new CommandList(); 16.8 - Defaults d = sc.getDefaults(); 16.9 - Domain domains[] = command_list.executeCommand(d); 16.10 + CommandDomainList list = new CommandDomainList(sc.getDefaults()); 16.11 + String output = list.executeWeb(); 16.12 + Domain domains[] = list.domains(); 16.13 + if (output != null) 16.14 + { 16.15 +%> 16.16 +<%= output %> 16.17 +<% 16.18 + } else { 16.19 %> 16.20 16.21 <table cellpadding="2" cellspacing="0" border="0"> 16.22 @@ -44,6 +50,9 @@ INCLUDE&dommenu.tmpl 16.23 </tbody> 16.24 </table> 16.25 </td></tr> 16.26 +<% 16.27 + } 16.28 +%> 16.29 16.30 ##WHITESPACE## ##GREYLINE1## ##WHITESPACE## 16.31
17.1 --- a/tools/control/web/tmpl/dom-star.tmpl Wed Jul 09 14:00:09 2003 +0000 17.2 +++ b/tools/control/web/tmpl/dom-star.tmpl Wed Jul 09 15:58:14 2003 +0000 17.3 @@ -17,7 +17,6 @@ INCLUDE&dommenu.tmpl 17.4 <% 17.5 HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request); 17.6 Defaults d = sc.getDefaults(); 17.7 - CommandStart command_start = new CommandStart(); 17.8 17.9 String domains[] = hsrw.getParameterValues("dom"); 17.10 17.11 @@ -32,8 +31,8 @@ Error: no domain specified.<br> 17.12 for (int i = 0; i < domains.length; i++) 17.13 { 17.14 %> 17.15 -result <%= domains[i] %> =<br> 17.16 -<%= command_start.executeCommand(d, Integer.parseInt(domains[i])) %> <br> 17.17 +result <%= domains[i] %> = 17.18 +<%= new CommandDomainStart(d, Integer.parseInt(domains[i])).executeWeb() %><br> 17.19 <% 17.20 } 17.21 }
18.1 --- a/tools/control/web/tmpl/dom-stp.tmpl Wed Jul 09 14:00:09 2003 +0000 18.2 +++ b/tools/control/web/tmpl/dom-stp.tmpl Wed Jul 09 15:58:14 2003 +0000 18.3 @@ -15,9 +15,15 @@ INCLUDE&dommenu.tmpl 18.4 <tbody> 18.5 <tr><td> 18.6 <% 18.7 - CommandList command_list = new CommandList(); 18.8 - Defaults d = sc.getDefaults(); 18.9 - Domain domains[] = command_list.executeCommand(d); 18.10 + CommandDomainList list = new CommandDomainList(sc.getDefaults()); 18.11 + String output = list.executeWeb(); 18.12 + Domain domains[] = list.domains(); 18.13 + if (output != null) 18.14 + { 18.15 +%> 18.16 +<%= output %> 18.17 +<% 18.18 + } else { 18.19 %> 18.20 18.21 <table cellpadding="2" cellspacing="0" border="0"> 18.22 @@ -44,6 +50,9 @@ INCLUDE&dommenu.tmpl 18.23 </tbody> 18.24 </table> 18.25 </td></tr> 18.26 +<% 18.27 + } 18.28 +%> 18.29 18.30 ##WHITESPACE## ##GREYLINE1## ##WHITESPACE## 18.31
19.1 --- a/tools/control/web/tmpl/dom-stpr.tmpl Wed Jul 09 14:00:09 2003 +0000 19.2 +++ b/tools/control/web/tmpl/dom-stpr.tmpl Wed Jul 09 15:58:14 2003 +0000 19.3 @@ -17,7 +17,6 @@ INCLUDE&dommenu.tmpl 19.4 <% 19.5 HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request); 19.6 Defaults d = sc.getDefaults(); 19.7 - CommandStop command_stop = new CommandStop(); 19.8 19.9 String domains[] = hsrw.getParameterValues("dom"); 19.10 19.11 @@ -33,7 +32,7 @@ Error: no domain specified.<br> 19.12 { 19.13 %> 19.14 result <%= domains[i] %> = 19.15 - <%= command_stop.executeCommand(d, Integer.parseInt(domains[i])) %> <br> 19.16 +<%= new CommandDomainStop(d, Integer.parseInt(domains[i])).executeWeb() %><br> 19.17 <% 19.18 } 19.19 }
20.1 --- a/tools/control/web/tmpl/dom.tmpl Wed Jul 09 14:00:09 2003 +0000 20.2 +++ b/tools/control/web/tmpl/dom.tmpl Wed Jul 09 15:58:14 2003 +0000 20.3 @@ -16,7 +16,7 @@ INCLUDE&dommenu.tmpl 20.4 <tr><td nowrap="nowrap">Domain Manager</td></tr> 20.5 <tr><td></td></tr> 20.6 <!-- 20.7 - <tr><td><%= d.XIToolsDir %></td></tr> 20.8 + <tr><td><%= d.xiToolsDir %></td></tr> 20.9 --> 20.10 </tbody> 20.11 </table>
21.1 --- a/tools/control/web/tmpl/makefile Wed Jul 09 14:00:09 2003 +0000 21.2 +++ b/tools/control/web/tmpl/makefile Wed Jul 09 15:58:14 2003 +0000 21.3 @@ -1,5 +1,5 @@ 21.4 src0 = xenostyle.css 21.5 -src1 = index.jsp newdom.jsp about.jsp help.jsp vd.jsp \ 21.6 +src1 = index.jsp about.jsp help.jsp vd.jsp \ 21.7 vd-pv.jsp vd-pa.jsp vd-vdv.jsp vd-vdc.jsp vd-vdd.jsp vd-vdr.jsp \ 21.8 vd-fv.jsp vd-vbdv.jsp vd-vbdc.jsp vd-vbdd.jsp vd-vbdf.jsp \ 21.9 vd-par.jsp vd-vdcr.jsp vd-vddr.jsp vd-vdrr.jsp \ 21.10 @@ -7,7 +7,8 @@ src1 = index.jsp newdom.jsp about.jsp he 21.11 dom.jsp dom-lis.jsp dom-new.jsp dom-newr.jsp dom-sta.jsp dom-star.jsp \ 21.12 dom-stp.jsp dom-stpr.jsp dom-del.jsp dom-delr.jsp 21.13 target = .. 21.14 -target1 = $(target)/index.jsp $(target)/newdom.jsp $(target)/vd.jsp \ 21.15 +target0 = $(target)/xenostyle.css 21.16 +target1 = $(target)/index.jsp $(target)/vd.jsp \ 21.17 $(target)/vd-pv.jsp $(target)/vd-pa.jsp $(target)/vd-vdv.jsp \ 21.18 $(target)/vd-vdc.jsp $(target)/vd-vdd.jsp $(target)/vd-vdr.jsp \ 21.19 $(target)/vd-fv.jsp $(target)/vd-vbdv.jsp $(target)/vd-vbdc.jsp \ 21.20 @@ -22,14 +23,18 @@ target1 = $(target)/index.jsp $(target)/ 21.21 21.22 .SUFFIXES: .tmpl .jsp 21.23 21.24 -.tmpl.jsp: 21.25 - ./install.pl $* 21.26 +all: $(target1) $(target0) 21.27 + 21.28 +$(target)/index.jsp: index.tmpl 21.29 + ./install.pl -s -home index 21.30 + mv index.jsp $(target) 21.31 21.32 -all: $(src0) $(src1) 21.33 - ./install.pl -s -home index 21.34 - mv *.jsp $(target) 21.35 +$(target)/%.jsp: %.tmpl 21.36 + ./install.pl $* 21.37 + mv $*.jsp $(target) 21.38 + 21.39 +$(target0): $(src0) 21.40 cp -f $(src0) $(target) 21.41 21.42 clean: 21.43 - rm -f $(target1) 21.44 - rm -f $(target)/$(src0) 21.45 + rm -f $(target1) $(target0)
22.1 --- a/tools/control/web/tmpl/newdom.tmpl Wed Jul 09 14:00:09 2003 +0000 22.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 22.3 @@ -1,172 +0,0 @@ 22.4 -New Domain 22.5 -SECTION&XenoServers 22.6 - 22.7 -<!-- content --> 22.8 -<img src="pixel.gif" class="block" width="1" height="12"> 22.9 - 22.10 -<form> 22.11 -<table cellpadding="0" cellspacing="0" border="0"> 22.12 -<tbody> 22.13 -<tr> 22.14 - <td width="50"></td> 22.15 - <td></td> 22.16 - <td></td> 22.17 - <td width="7"></td> 22.18 - <td></td> 22.19 -</tr> 22.20 - 22.21 -<tr> 22.22 - <td></td> 22.23 - <td class="block" colspan=4><b>Create A New Domain</b></td> 22.24 -</tr> 22.25 - 22.26 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## 22.27 - 22.28 -<tr> 22.29 - <td></td> 22.30 - <td class="block" colspan=4>Memory Size</td> 22.31 -</tr> 22.32 -<tr> 22.33 - <td></td> <td></td> <td></td> <td></td> 22.34 - <td> <input type="text" size="5" value="64"> MB </td> 22.35 -</tr> 22.36 - 22.37 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## 22.38 - 22.39 -<tr> 22.40 - <td></td> 22.41 - <td class="block" colspan=4>Kernel Image</td> 22.42 -</tr> 22.43 -<tr> 22.44 - <td></td> 22.45 - <td colspan=2 align="right">path</td> 22.46 - <td></td> 22.47 - <td> <input type="text" size="40" value="/usr/src/xeno/install/xenolinux.gz"> </td> 22.48 -</tr> 22.49 - 22.50 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## 22.51 - 22.52 -<tr> 22.53 - <td></td> 22.54 - <td class="block" colspan=4>IP Config</td> 22.55 -</tr> 22.56 -<tr> 22.57 - <td></td> <td></td> 22.58 - <td class="block" align="right">IP address</td> 22.59 - <td></td> 22.60 - <td> <input type="text" size="15" value="128.232.35.202"> </td> 22.61 -</tr> 22.62 -<tr> 22.63 - <td></td> <td></td> 22.64 - <td class="block" align="right">Gateway</td> 22.65 - <td></td> 22.66 - <td> <input type="text" size="15" value="128.232.32.1"> </td> 22.67 -</tr> 22.68 -<tr> 22.69 - <td></td> <td></td> 22.70 - <td class="block" align="right">Netmask</td> 22.71 - <td></td> 22.72 - <td> <input type="text" size="15" value="255.255.240.0"> </td> 22.73 -</tr> 22.74 -<tr> 22.75 - <td></td> <td></td> 22.76 - <td class="block" align="right">New Name</td> 22.77 - <td></td> 22.78 - <td> <input type="text" size="15"> </td> 22.79 -</tr> 22.80 - 22.81 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## 22.82 - 22.83 -<tr> 22.84 - <td></td> 22.85 - <td class="block" colspan=2>Root File System</td> 22.86 -</tr> 22.87 - 22.88 -##WHITESPACE## 22.89 - 22.90 -<tr> 22.91 - <td></td> 22.92 - <td align="right">NFS<input type="radio" name="root" value="nfs"></td> 22.93 - <td align="right">path</td> 22.94 - <td></td> 22.95 - <td><input type="text" size="40" value="/usr/groups/xeno/srgboot/mousetrap/root0"></td> 22.96 -</tr> 22.97 -<tr> 22.98 - <td></td> <td></td> 22.99 - <td align="right">server</td> 22.100 - <td></td> 22.101 - <td><input type="text" size="15" value="128.232.32.20"></td> 22.102 -</tr> 22.103 - ##WHITESPACE## 22.104 -<tr> 22.105 - <td></td> 22.106 - <td align="right">ramdisk<input type="radio" name="root" value="ram"></td> 22.107 - <td align="right">path</td> 22.108 - <td></td> 22.109 - <td><input type="text" size="40" value="/usr/isolinux/initrd.gz"></td> 22.110 -</tr> 22.111 - ##WHITESPACE## 22.112 -<tr> 22.113 - <td></td> 22.114 - <td align="right">raw partition<input type="radio" name="root" value="raw"></td> 22.115 - <td align="right">path</td> 22.116 - <td></td> 22.117 - <td><input type="text" size="40" value="/dev/xsda8"></td> 22.118 -</tr> 22.119 - ##WHITESPACE## 22.120 -<tr> 22.121 - <td></td> 22.122 - <td align="right">virtual disk<input type="radio" checked name="root" value="virtual"></td> 22.123 - <td align="right">path</td> 22.124 - <td></td> 22.125 - <td><input type="text" size="40" value="/dev/xvda0"></td> 22.126 -</tr> 22.127 - 22.128 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## 22.129 - 22.130 -<tr> 22.131 - <td></td> 22.132 - <td class="block" colspan=4>Extra Arguments</td> 22.133 -</tr> 22.134 -<tr> 22.135 - <td></td> 22.136 - <td colspan=2 align="right"></td> 22.137 - <td></td> 22.138 - <td> <input type="text" size="40"> </td> 22.139 -</tr> 22.140 - 22.141 - 22.142 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## 22.143 - 22.144 -<tr> 22.145 - <td></td> 22.146 - <td><input type="submit" value="refresh"></td> 22.147 -</tr> 22.148 - 22.149 -##WHITESPACE## 22.150 - 22.151 -<tr> 22.152 - <td></td> 22.153 - <td colspan=4> 22.154 - <textarea cols="60" rows="5" name="commandline"> 22.155 -When you press refresh, the sample command line shows 22.156 -up here. The user has the option of editing it before 22.157 -pressing execute below. e.g. 22.158 -./newdom 16000 image 128.232.35.202 ip=128.232.35.202:128.232.32.20:128.232.32.1:255.255.240.0::eth0:off root=/dev/xsda9 ro 22.159 -</textarea> 22.160 -</td></tr> 22.161 - 22.162 -##WHITESPACE## 22.163 - 22.164 -<tr> 22.165 - <td></td> 22.166 - <td><input type="submit" value="execute"></td> 22.167 -</tr> 22.168 - 22.169 -</tbody> 22.170 -</table> 22.171 -</form> 22.172 - 22.173 - 22.174 - 22.175 -<!-- end content -->
23.1 --- a/tools/control/web/tmpl/xenohead.def Wed Jul 09 14:00:09 2003 +0000 23.2 +++ b/tools/control/web/tmpl/xenohead.def Wed Jul 09 15:58:14 2003 +0000 23.3 @@ -1,13 +1,13 @@ 23.4 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 23.5 23.6 <jsp:useBean id="root" scope="application" 23.7 - class="uk.ac.cam.cl.xeno.xenctl.RootBean" /> 23.8 + class="org.xenoserver.web.RootBean" /> 23.9 <jsp:useBean id="sc" scope="application" 23.10 - class="uk.ac.cam.cl.xeno.xenctl.SystemConfigurationBean" /> 23.11 + class="org.xenoserver.web.SystemConfigurationBean" /> 23.12 <%@ page session="false" %> 23.13 -<%@ page import="uk.ac.cam.cl.xeno.xenctl.*" %> 23.14 -<%@ page import="uk.ac.cam.cl.xeno.domctl.*" %> 23.15 -<%@ page import="java.util.Enumeration" %> 23.16 +<%@ page import="org.xenoserver.web.*" %> 23.17 +<%@ page import="org.xenoserver.control.*" %> 23.18 +<%@ page import="java.util.Iterator" %> 23.19 <%@ page import="javax.servlet.http.HttpServletRequestWrapper" %> 23.20 23.21 <html lang="en"> 23.22 @@ -20,7 +20,7 @@ 23.23 23.24 <head> 23.25 23.26 -<title>##SECTION## ##SECTIONBREAK## ##TITLE## <%= root.getDebugCounter() %></title> 23.27 +<title>##SECTION## ##SECTIONBREAK## ##TITLE##</title> 23.28 23.29 <link rel="stylesheet" type="text/css" href="xenostyle.css"> 23.30