source: other-projects/trunk/gs3-release-maker/apache-ant-1.6.5/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadServlet.java@ 14627

Last change on this file since 14627 was 14627, checked in by oranfry, 17 years ago

initial import of the gs3-release-maker

File size: 2.2 KB
Line 
1/*
2 * Copyright 2001-2002,2004 The Apache Software Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18package org.apache.tools.ant.taskdefs.optional.ide;
19
20import java.util.Vector;
21
22/**
23 * A Remote Access to Tools Servlet to load a Project
24 * from the Repository into the Workbench. The following
25 * table describes the servlet parameters.
26 *
27 * <table>
28 * <tr>
29 * <td>Parameter</td>
30 * <td>Description</td>
31 * </tr>
32 * <tr>
33 * <td>project</td>
34 * <td>The name of the Project you want to load into
35 * the Workbench.</td>
36 * </tr>
37 * <tr>
38 * <td>version</td>
39 * <td>The version of the package you want to load into
40 * the Workbench.</td>
41 * </tr>
42 * </table>
43 *
44 */
45public class VAJLoadServlet extends VAJToolsServlet {
46
47 // constants for servlet param names
48 /**
49 * the version param string
50 */
51 public static final String VERSION_PARAM = "version";
52
53 /**
54 * Respond to a request to load a project from the Repository
55 * into the Workbench.
56 */
57 protected void executeRequest() {
58 String[] projectNames = getParamValues(PROJECT_NAME_PARAM);
59 String[] versionNames = getParamValues(VERSION_PARAM);
60
61 Vector projectDescriptions = new Vector(projectNames.length);
62 for (int i = 0; i < projectNames.length && i < versionNames.length; i++) {
63 VAJProjectDescription desc = new VAJProjectDescription();
64 desc.setName(projectNames[i]);
65 desc.setVersion(versionNames[i]);
66 projectDescriptions.addElement(desc);
67 }
68
69 util.loadProjects(projectDescriptions);
70 }
71}
Note: See TracBrowser for help on using the repository browser.