source: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Construct.java@ 5107

Last change on this file since 5107 was 5107, checked in by kjdon, 21 years ago

service descriptions now include a displayItem called description which is, funnily enough, a description of the service

  • Property svn:keywords set to Author Date Id Revision
File size: 21.8 KB
Line 
1/*
2 * GS2Construct.java
3 * Copyright (C) 2002 New Zealand Digital Library, http://www.nzdl.org
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19package org.greenstone.gsdl3.service;
20
21import org.greenstone.gsdl3.util.*;
22import org.greenstone.gsdl3.build.*;
23
24import org.w3c.dom.Document;
25import org.w3c.dom.Node;
26import org.w3c.dom.Text;
27import org.w3c.dom.Element;
28import org.w3c.dom.NodeList;
29
30import java.util.Collections;
31import java.util.HashMap;
32import java.util.Map;
33import java.util.List;
34import java.util.ArrayList;
35import java.io.File;
36import java.util.Locale;
37
38/**
39 * A Services class for building collections
40 * provides a wrapper around the old perl scripts
41 *
42 * @author <a href="mailto:[email protected]">Katherine Don</a>
43 * @version $Revision: 5107 $
44 */
45public class GS2Construct
46 extends ServiceRack {
47
48 // services offered
49 private static final String NEW_SERVICE = "NewCollection";
50 private static final String ADD_DOC_SERVICE = "AddDocument";
51 private static final String IMPORT_SERVICE = "ImportCollection";
52 private static final String BUILD_SERVICE = "BuildCollection";
53 private static final String ACTIVATE_SERVICE = "ActivateCollection";
54 private static final String DELETE_SERVICE = "DeleteCollection";
55 private static final String RELOAD_SERVICE = "ReloadCollection";
56
57 // params used
58 private static final String COL_PARAM = "collection";
59 private static final String NEW_COL_TITLE_PARAM = "collTitle";
60 private static final String NEW_COL_ABOUT_PARAM = "collAbout";
61 private static final String CREATOR_PARAM = "creator";
62 private static final String NEW_FILE_PARAM = "newfile";
63 private static final String PROCESS_ID_PARAM = GSCGI.PROCESS_ID_ARG;
64 private static final String BUILDTYPE_PARAM = "buildType";
65 private static final String BUILDTYPE_MG = "mg";
66 private static final String BUILDTYPE_MGPP = "mgpp";
67
68 // the list of the collections - store between some method calls
69 private String[] collection_list = null;
70
71 // set of listeners for any construction commands
72 protected Map listeners = null;
73
74 public GS2Construct() {
75 this.listeners = Collections.synchronizedMap(new HashMap());
76
77 }
78
79 /** returns a specific service description */
80 protected Element getServiceDescription(String service, String lang) {
81
82 Element description = this.doc.createElement(GSXML.SERVICE_ELEM);
83 description.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
84 description.setAttribute(GSXML.NAME_ATT, service);
85 description.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_NAME, getTextString(service+".name", lang)));
86 description.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_DESCRIPTION, getTextString(service+".description", lang)));
87 description.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_SUBMIT, getTextString(service+".submit", lang)));
88
89 Element param_list = this.doc.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
90 description.appendChild(param_list);
91
92 if (service.equals(NEW_SERVICE)) {
93
94 Element param = GSXML.createParameterDescription(this.doc, NEW_COL_TITLE_PARAM, getTextString("param."+NEW_COL_TITLE_PARAM, lang), GSXML.PARAM_TYPE_STRING, null, null, null);
95 param_list.appendChild(param);
96 param = GSXML.createParameterDescription(this.doc, CREATOR_PARAM, getTextString("param."+CREATOR_PARAM, lang), GSXML.PARAM_TYPE_STRING, null, null, null);
97 param_list.appendChild(param);
98 param = GSXML.createParameterDescription(this.doc, NEW_COL_ABOUT_PARAM, getTextString("param."+NEW_COL_ABOUT_PARAM, lang), GSXML.PARAM_TYPE_TEXT, null, null, null);
99 param_list.appendChild(param);
100 String[] types = {BUILDTYPE_MGPP, BUILDTYPE_MG};
101 String[] type_texts = {getTextString("param."+BUILDTYPE_PARAM+"."+BUILDTYPE_MGPP, lang), getTextString("param."+BUILDTYPE_PARAM+"."+BUILDTYPE_MG, lang)};
102
103 param = GSXML.createParameterDescription(this.doc, BUILDTYPE_PARAM, getTextString("param."+BUILDTYPE_PARAM, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, BUILDTYPE_MGPP, types, type_texts);
104 param_list.appendChild(param);
105 return description;
106 }
107
108
109 if (service.equals(ACTIVATE_SERVICE) || service.equals(IMPORT_SERVICE) || service.equals(BUILD_SERVICE) || service.equals(RELOAD_SERVICE) || service.equals(DELETE_SERVICE)) {
110
111 this.collection_list = getCollectionList();
112 Element param = GSXML.createParameterDescription(this.doc, COL_PARAM, getTextString("param."+COL_PARAM, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, null, this.collection_list, this.collection_list);
113 param_list.appendChild(param);
114
115 return description;
116 }
117 // invalid service name
118 return null;
119
120 }
121
122 // each service must have a method "process<New service name>"
123
124 protected Element processNewCollection(Element request) {
125 return runCommand(request, GS2PerlConstructor.NEW);
126 }
127
128 /** TODO:implement this */
129 protected Element processAddDocument(Element request) {
130 // decode the file name, add it to the import directory
131 String name = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT));
132 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
133 response.setAttribute(GSXML.FROM_ATT, name);
134 Element status = this.doc.createElement(GSXML.STATUS_ELEM);
135 response.appendChild(status);
136 //String lang = request.getAttribute(GSXML.LANG_ATT);
137 //String request_type = request.getAttribute(GSXML.TYPE_ATT);
138 Text t = this.doc.createTextNode("AddDocument: not implemented yet");
139 status.appendChild(t);
140 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
141 return response;
142 }
143 protected Element processImportCollection(Element request) {
144 return runCommand(request, GS2PerlConstructor.IMPORT);
145 }
146
147 protected Element processBuildCollection(Element request) {
148 return runCommand(request, GS2PerlConstructor.BUILD);
149 }
150 protected Element processActivateCollection(Element request) {
151 Element response = runCommand(request, GS2PerlConstructor.ACTIVATE);
152 // this activates the collection on disk. but now we need to tell
153 // the MR about it. but we have to wait until the process is finished.
154 Element status = (Element)GSXML.getChildByTagName(response, GSXML.STATUS_ELEM);
155 Element param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
156 HashMap params = GSXML.extractParams(param_list, false);
157 String coll_name = (String) params.get(COL_PARAM);
158 String lang = request.getAttribute(GSXML.LANG_ATT);
159 // check for finished
160 int status_code = Integer.parseInt(status.getAttribute(GSXML.STATUS_ERROR_CODE_ATT));
161 if (GSStatus.isCompleted(status_code) &&
162 GSStatus.isError(status_code)) {
163 // we shouldn't carry out the next bit, just return the response
164 return response;
165 }
166 String id = status.getAttribute(GSXML.STATUS_PROCESS_ID_ATT);
167 GS2PerlListener listener = (GS2PerlListener)this.listeners.get(id);
168 if (listener==null) {
169 System.err.println("somethings gone wrong, couldn't find the listener");
170 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
171 return response;
172 }
173 while (!GSStatus.isCompleted(status_code)) {
174 // wait for the process, and keep checking the status code
175 // there is probably a better way to do this.
176 try {
177 Thread.currentThread().sleep(100);
178 } catch (Exception e) { // ignore
179 }
180 status_code = listener.getStatus();
181 }
182
183 // add the rest of the messages to the status node
184 Text t = this.doc.createTextNode("\n"+listener.getUpdate());
185 status.appendChild(t);
186 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(listener.getStatus()));
187 if (GSStatus.isError(status_code)) {
188 return response; // without doing the next bit
189 }
190
191 t = this.doc.createTextNode("\n");
192 status.appendChild(t);
193 // once have got here, we assume
194 // the first bit proceeded successfully, now reload the collection
195 configureRequest("reload", coll_name, status, lang); // this will append more messages to the status, and overwrite the error code att
196 return response;
197
198 }
199 protected Element processDeleteCollection(Element request) {
200
201 // the response to send back
202 String name = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT));
203 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
204 response.setAttribute(GSXML.FROM_ATT, name);
205 Element status = this.doc.createElement(GSXML.STATUS_ELEM);
206 response.appendChild(status);
207 Text t = null; // the text node for the error/success message
208 String lang = request.getAttribute(GSXML.LANG_ATT);
209 String request_type = request.getAttribute(GSXML.TYPE_ATT);
210
211 Element param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
212 HashMap params = GSXML.extractParams(param_list, false);
213
214 boolean get_status_only = false;
215 if (request_type.equals(GSXML.REQUEST_TYPE_STATUS)) {
216 get_status_only = true;
217 }
218 if (get_status_only) {
219 // at the moment, delete is synchronous. but it may take ages so should do the command in another thread maybe? in which case we will want to ask for status
220 System.err.println("had a status request for delete - this shouldn't happen!!");
221 //t = doc_.createTextNode("");
222 //status.appendChild(t);
223 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
224 return response;
225 }
226 String coll_name = (String)params.get(COL_PARAM);
227 String[] args={coll_name};
228 File coll_dir = new File(GSFile.collectionBaseDir(this.site_home, coll_name));
229 // check that the coll is there in the first place
230 if (!coll_dir.exists()) {
231 t = this.doc.createTextNode(getTextString("delete.exists_error", args, lang));
232 status.appendChild(t);
233 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
234 return response;
235 }
236
237 // try to delete the directory
238 if (!GSFile.deleteFile(coll_dir)) {
239 t = this.doc.createTextNode(getTextString("delete.delete_error", args, lang));
240 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
241 status.appendChild(t);
242 return response;
243 }
244 configureRequest("delete", coll_name, status, lang);
245 return response;
246 }
247
248 protected Element processReloadCollection(Element request) {
249
250 // the response to send back
251 String name = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT));
252 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
253 response.setAttribute(GSXML.FROM_ATT, name);
254 Element status = this.doc.createElement(GSXML.STATUS_ELEM);
255 response.appendChild(status);
256 Text t = null; // the text node for the error/success message
257
258 String lang = request.getAttribute(GSXML.LANG_ATT);
259 String request_type = request.getAttribute(GSXML.TYPE_ATT);
260
261 Element param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
262 HashMap params = GSXML.extractParams(param_list, false);
263
264 boolean get_status_only = false;
265 if (request_type.equals(GSXML.REQUEST_TYPE_STATUS)) {
266 get_status_only = true;
267 }
268 if (get_status_only) {
269 // reload is synchronous - this makes no sense
270 System.err.println("had a status request for reload - this shouldn't happen!!");
271 //t = doc_.createTextNode("");
272 //status.appendChild(t);
273 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
274 return response;
275 }
276
277 String coll_name = (String)params.get(COL_PARAM);
278 configureRequest("reload", coll_name, status, lang);
279 return response;
280
281 }
282
283 /** send a configure request to the message router
284 * action name should be "delete" or "reload"
285 * response will be put into the status element
286 */
287 protected void configureRequest(String action_name, String coll_name, Element status, String lang) {
288
289 // send the request to the MR
290 Element message = this.doc.createElement(GSXML.MESSAGE_ELEM);
291 Element request = this.doc.createElement(GSXML.REQUEST_ELEM);
292 request.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_CONFIGURE);
293 request.setAttribute(GSXML.TO_ATT, "");
294 message.appendChild(request);
295 Element command = this.doc.createElement(GSXML.CONFIGURE_ELEM);
296 command.setAttribute(GSXML.TYPE_ATT, GSXML.COLLECTION_ELEM);
297 command.setAttribute(GSXML.NAME_ATT, coll_name);
298 if (action_name.equals("delete")) {
299 command.setAttribute(GSXML.ACTION_ATT, GSXML.CONFIG_ACTION_DEACTIVATE);
300 } else if (action_name.equals("reload")) {
301 command.setAttribute(GSXML.ACTION_ATT, GSXML.CONFIG_ACTION_ACTIVATE);
302 } else {
303 System.err.println("invalid action name passed to configureRequest:"+action_name);
304 return;
305 }
306 request.appendChild(command);
307 Element response = this.router.process(message); // at the moment, get no info in response so ignore it
308 Text t;
309 String[] args={coll_name};
310
311 if (response == null) {
312 t = this.doc.createTextNode(getTextString(action_name+".configure_error", args , lang));
313 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
314 status.appendChild(t);
315 return;
316 }
317
318 // if we got here, we have succeeded!
319 t = this.doc.createTextNode(getTextString(action_name+".success", args, lang));
320 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.SUCCESS));
321 status.appendChild(t);
322 }
323
324
325 /** configure the service module
326 * for now, all services have type=build - need to think about this
327 */
328 public boolean configure(Element info, Element extra_info) {
329 System.out.println("configuring GS2Construct");
330
331 Element e = null;
332 // hard code in the services for now
333
334 // set up short_service_info_ - for now just has name and type
335
336 e = this.doc.createElement(GSXML.SERVICE_ELEM);
337 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
338 e.setAttribute(GSXML.NAME_ATT, NEW_SERVICE);
339 this.short_service_info.appendChild(e);
340
341 e = this.doc.createElement(GSXML.SERVICE_ELEM);
342 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
343 e.setAttribute(GSXML.NAME_ATT, IMPORT_SERVICE);
344 this.short_service_info.appendChild(e);
345
346 e = this.doc.createElement(GSXML.SERVICE_ELEM);
347 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
348 e.setAttribute(GSXML.NAME_ATT, BUILD_SERVICE);
349 this.short_service_info.appendChild(e);
350
351 e = this.doc.createElement(GSXML.SERVICE_ELEM);
352 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
353 e.setAttribute(GSXML.NAME_ATT, ACTIVATE_SERVICE);
354 this.short_service_info.appendChild(e);
355
356 e = this.doc.createElement(GSXML.SERVICE_ELEM);
357 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
358 e.setAttribute(GSXML.NAME_ATT, DELETE_SERVICE);
359 this.short_service_info.appendChild(e);
360
361 e = this.doc.createElement(GSXML.SERVICE_ELEM);
362 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
363 e.setAttribute(GSXML.NAME_ATT, RELOAD_SERVICE);
364 this.short_service_info.appendChild(e);
365
366 //e = this.doc.createElement(GSXML.SERVICE_ELEM);
367 //e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
368 //e.setAttribute(GSXML.NAME_ATT, ADD_DOC_SERVICE);
369 //this.short_service_info.appendChild(e);
370
371
372 return true;
373 }
374
375 /** returns a response element */
376 protected Element runCommand(Element request, int type ) {
377
378 // the response to send back
379 String name = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT));
380 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
381 response.setAttribute(GSXML.FROM_ATT, name);
382 Element status = this.doc.createElement(GSXML.STATUS_ELEM);
383 response.appendChild(status);
384
385 String lang = request.getAttribute(GSXML.LANG_ATT);
386 String request_type = request.getAttribute(GSXML.TYPE_ATT);
387
388 Element param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
389 HashMap params = GSXML.extractParams(param_list, false);
390
391 boolean get_status_only = false;
392 if (request_type.equals(GSXML.REQUEST_TYPE_STATUS)) {
393 get_status_only = true;
394 }
395
396 // just check for status messages if that's all that's required
397 if (get_status_only) {
398 String id = (String)params.get(PROCESS_ID_PARAM);
399 status.setAttribute(GSXML.STATUS_PROCESS_ID_ATT, id);
400 GS2PerlListener listener = (GS2PerlListener)this.listeners.get(id);
401 if (listener==null) {
402 Text t = this.doc.createTextNode(getTextString("general.process_id_error", lang));
403 status.appendChild(t);
404 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
405 } else {
406 Text t = this.doc.createTextNode(listener.getUpdate());
407 status.appendChild(t);
408 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(listener.getStatus()));
409 // check that we actually should be removing the listener here
410 if (listener.isFinished()) { // remove this listener - its job is done
411 this.listeners.remove(id); // not working
412 }
413 }
414 return response;
415
416 }
417
418 // do teh actual command
419 String coll_name=null;
420 if (type==GS2PerlConstructor.NEW) {
421 String coll_title = (String)params.get(NEW_COL_TITLE_PARAM);
422 coll_name = createNewCollName(coll_title);
423 } else {
424 coll_name = (String)params.get(COL_PARAM);
425 }
426 System.err.println("Coll name = "+coll_name);
427 // makes a paramList of the relevant params
428 Element other_params = extractOtherParams(params, type);
429
430 //create the constructor to do the work
431
432 GS2PerlConstructor constructor = new GS2PerlConstructor("perl_build");
433 if (!constructor.configure()) {
434 Text t = this.doc.createTextNode(getTextString("general.configure_constructor_error", lang));
435 status.appendChild(t);
436 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
437 return response;
438 }
439
440 constructor.setSiteHome(this.site_home);
441 constructor.setCollectionName(coll_name);
442 constructor.setActionType(type);
443 constructor.setProcessParams(other_params);
444 // the listener
445 GS2PerlListener listener = new GS2PerlListener();
446 constructor.addListener(listener);
447 constructor.start();
448
449 String id = newID();
450 this.listeners.put(id, listener);
451
452 status.setAttribute(GSXML.STATUS_PROCESS_ID_ATT, id);
453 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ACCEPTED));
454 Text t = this.doc.createTextNode(getTextString("general.process_start", lang));
455 status.appendChild(t);
456 return response;
457
458 }
459
460
461 //************************
462 // some helper functions
463 //************************
464
465 /** parse the collect directory and return a list of collection names */
466 protected String[] getCollectionList() {
467
468 File collectDir = new File(GSFile.collectDir(this.site_home));
469 if (!collectDir.exists()) {
470 System.err.println("couldn't find collect dir: "+collectDir.toString());
471 return null;
472 }
473 System.out.println("GS2Construct: reading thru directory "+collectDir.getPath()+" to find collections.");
474 File[] contents = collectDir.listFiles();
475 int num_colls=0;
476 for (int i=0; i<contents.length;i++) {
477 if(contents[i].isDirectory() && !contents[i].getName().startsWith("CVS")) {
478 num_colls ++;
479 }
480 }
481
482 String[] names= new String[num_colls];
483
484 for (int i=0, j=0; i<contents.length;i++) {
485 if(contents[i].isDirectory()) {
486 String colName = contents[i].getName();
487 if (!colName.startsWith("CVS")) {
488 names[j] = colName;
489 j++;
490 }
491
492 }
493 }
494
495 return names;
496
497 }
498
499 /** ids used for process id */
500 private int current_id = 0;
501 private String newID() {
502 current_id++;
503 return Integer.toString(current_id);
504 }
505
506 /** creates a new short name from the collection title */
507 protected String createNewCollName(String coll_title) {
508
509 String base_name = null;
510 // take the first 6 letters
511 if (coll_title.length()<6) {
512 base_name = coll_title;
513 } else {
514 base_name = coll_title.substring(0,6);
515 }
516 File coll_dir = new File(GSFile.collectionBaseDir(this.site_home, base_name));
517 if (!coll_dir.exists()) { // this name is ok - not used yet
518 return base_name;
519 }
520
521 // now we have to make a new name until we get a good one
522 // try name1, name2 name3 etc
523 int i=0;
524 while(coll_dir.exists()) {
525 i++;
526 coll_dir = new File(GSFile.collectionBaseDir(this.site_home, base_name+Integer.toString(i)));
527 }
528 return base_name+Integer.toString(i);
529
530 }
531
532 /** takes the params from the request (in the HashMap) and extracts any
533 * that need to be passed to the constructor and puts them into a
534 * paramList element */
535 protected Element extractOtherParams(HashMap params, int type) {
536
537 Element param_list = this.doc.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
538 if (type == GS2PerlConstructor.NEW) {
539 Element param = this.doc.createElement(GSXML.PARAM_ELEM);
540 param.setAttribute(GSXML.NAME_ATT, "creator");
541 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(CREATOR_PARAM));
542
543 param_list.appendChild(param);
544 param = this.doc.createElement(GSXML.PARAM_ELEM);
545 param.setAttribute(GSXML.NAME_ATT, "about");
546 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(NEW_COL_ABOUT_PARAM));
547 param_list.appendChild(param);
548 param = this.doc.createElement(GSXML.PARAM_ELEM);
549 param.setAttribute(GSXML.NAME_ATT, "title");
550 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(NEW_COL_TITLE_PARAM));
551 param_list.appendChild(param);
552 param = this.doc.createElement(GSXML.PARAM_ELEM);
553 param.setAttribute(GSXML.NAME_ATT, "buildtype");
554 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(BUILDTYPE_PARAM));
555 param_list.appendChild(param);
556 return param_list;
557 }
558
559 // other ones dont have params yet
560 return null;
561 }
562
563}
564
565
Note: See TracBrowser for help on using the repository browser.