blob: 8757d2d198207593fe9d2d113b55d37c6f64741c [file] [log] [blame]
Felix Meschberger4c664132008-06-02 13:52:15 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
Felix Meschbergera3214dd2008-06-19 11:08:47 +000018function renderBundle( /* Array of Data Objects */ bundleData )
Felix Meschberger4c664132008-06-02 13:52:15 +000019{
20
Felix Meschbergera3214dd2008-06-19 11:08:47 +000021 // number of actions plus 3 -- id, name and state
22 var columns = bundleData.numActions + 3;
23 var startLevel = bundleData.startLevel;
Felix Meschberger4c664132008-06-02 13:52:15 +000024
Felix Meschbergera3214dd2008-06-19 11:08:47 +000025 header( columns );
Felix Meschberger4c664132008-06-02 13:52:15 +000026
Felix Meschbergera3214dd2008-06-19 11:08:47 +000027 installForm( startLevel );
28
29 if (bundleData.error)
Felix Meschberger4c664132008-06-02 13:52:15 +000030 {
Felix Meschbergera3214dd2008-06-19 11:08:47 +000031 error( columns, bundleData.error );
Felix Meschberger4c664132008-06-02 13:52:15 +000032 }
33 else
34 {
Felix Meschbergera3214dd2008-06-19 11:08:47 +000035 data ( bundleData.data );
Felix Meschberger4c664132008-06-02 13:52:15 +000036 }
37
Felix Meschbergera3214dd2008-06-19 11:08:47 +000038 installForm( startLevel );
Felix Meschberger4c664132008-06-02 13:52:15 +000039
Felix Meschbergera3214dd2008-06-19 11:08:47 +000040 footer( columns );
Felix Meschberger4c664132008-06-02 13:52:15 +000041}
42
43
44function installForm( /* int */ startLevel )
45{
46 document.write( "<form method='post' enctype='multipart/form-data'>" );
47 document.write( "<tr class='content'>" );
48 document.write( "<td class='content'>&nbsp;</td>" );
49 document.write( "<td class='content'>" );
50 document.write( "<input type='hidden' name='action' value='install' />" );
Felix Meschberger0704b052008-06-25 08:44:16 +000051 document.write( "<input class='input' type='file' name='bundlefile' size='50'>" );
Felix Meschberger4c664132008-06-02 13:52:15 +000052 document.write( " - Start <input class='checkradio' type='checkbox' name='bundlestart' value='start'>" );
Felix Meschberger0704b052008-06-25 08:44:16 +000053 document.write( " - Start Level <input class='input' type='input' name='bundlestartelevel' value='" + startLevel + "' size='4'>" );
Felix Meschberger4c664132008-06-02 13:52:15 +000054 document.write( "</td>" );
55 document.write( "<td class='content' align='right' colspan='5' noWrap>" );
56 document.write( "<input class='submit' style='width:auto' type='submit' value='Install or Update'>" );
57 document.write( "&nbsp;" );
Felix Meschbergerc2af07c2008-06-12 22:18:03 +000058 document.write( "<input class='submit' style='width:auto' type='button' value='Refresh Packages' onClick='changeBundle(0, \"refreshPackages\");'>" );
Felix Meschberger4c664132008-06-02 13:52:15 +000059 document.write( "</td>" );
60 document.write( "</tr>" );
61 document.write( "</form>" );
62}