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

Last change on this file since 6274 was 6274, checked in by kjdon, 20 years ago

was using old system messages to reload/delete collections

  • Property svn:keywords set to Author Date Id Revision
File size: 21.9 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: 6274 $
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 = GSParams.PROCESS_ID;
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, String subset) {
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 if (subset == null || subset.equals(GSXML.DISPLAY_TEXT_ELEM)) {
86 description.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_NAME, getTextString(service+".name", lang)));
87 description.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_DESCRIPTION, getTextString(service+".description", lang)));
88 description.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_SUBMIT, getTextString(service+".submit", lang)));
89 }
90 if (subset == null || subset.equals(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER)) {
91 Element param_list = this.doc.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
92 description.appendChild(param_list);
93
94 if (service.equals(NEW_SERVICE)) {
95
96 Element param = GSXML.createParameterDescription(this.doc, NEW_COL_TITLE_PARAM, getTextString("param."+NEW_COL_TITLE_PARAM, lang), GSXML.PARAM_TYPE_STRING, null, null, null);
97 param_list.appendChild(param);
98 param = GSXML.createParameterDescription(this.doc, CREATOR_PARAM, getTextString("param."+CREATOR_PARAM, lang), GSXML.PARAM_TYPE_STRING, null, null, null);
99 param_list.appendChild(param);
100 param = GSXML.createParameterDescription(this.doc, NEW_COL_ABOUT_PARAM, getTextString("param."+NEW_COL_ABOUT_PARAM, lang), GSXML.PARAM_TYPE_TEXT, null, null, null);
101 param_list.appendChild(param);
102 String[] types = {BUILDTYPE_MGPP, BUILDTYPE_MG};
103 String[] type_texts = {getTextString("param."+BUILDTYPE_PARAM+"."+BUILDTYPE_MGPP, lang), getTextString("param."+BUILDTYPE_PARAM+"."+BUILDTYPE_MG, lang)};
104
105 param = GSXML.createParameterDescription(this.doc, BUILDTYPE_PARAM, getTextString("param."+BUILDTYPE_PARAM, lang), GSXML.PARAM_TYPE_ENUM_SINGLE, BUILDTYPE_MGPP, types, type_texts);
106 param_list.appendChild(param);
107 }
108 else if (service.equals(ACTIVATE_SERVICE) || service.equals(IMPORT_SERVICE) || service.equals(BUILD_SERVICE) || service.equals(RELOAD_SERVICE) || service.equals(DELETE_SERVICE)) {
109
110 this.collection_list = getCollectionList();
111 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);
112 param_list.appendChild(param);
113 } else {
114 // invalid service name
115 return null;
116 }
117 }
118 return description;
119 }
120
121 // each service must have a method "process<New service name>"
122
123 protected Element processNewCollection(Element request) {
124 return runCommand(request, GS2PerlConstructor.NEW);
125 }
126
127 /** TODO:implement this */
128 protected Element processAddDocument(Element request) {
129 // decode the file name, add it to the import directory
130 String name = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT));
131 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
132 response.setAttribute(GSXML.FROM_ATT, name);
133 Element status = this.doc.createElement(GSXML.STATUS_ELEM);
134 response.appendChild(status);
135 //String lang = request.getAttribute(GSXML.LANG_ATT);
136 //String request_type = request.getAttribute(GSXML.TYPE_ATT);
137 Text t = this.doc.createTextNode("AddDocument: not implemented yet");
138 status.appendChild(t);
139 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
140 return response;
141 }
142 protected Element processImportCollection(Element request) {
143 return runCommand(request, GS2PerlConstructor.IMPORT);
144 }
145
146 protected Element processBuildCollection(Element request) {
147 return runCommand(request, GS2PerlConstructor.BUILD);
148 }
149 protected Element processActivateCollection(Element request) {
150 Element response = runCommand(request, GS2PerlConstructor.ACTIVATE);
151 // this activates the collection on disk. but now we need to tell
152 // the MR about it. but we have to wait until the process is finished.
153 Element status = (Element)GSXML.getChildByTagName(response, GSXML.STATUS_ELEM);
154 Element param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
155 HashMap params = GSXML.extractParams(param_list, false);
156 String coll_name = (String) params.get(COL_PARAM);
157 String lang = request.getAttribute(GSXML.LANG_ATT);
158 // check for finished
159 int status_code = Integer.parseInt(status.getAttribute(GSXML.STATUS_ERROR_CODE_ATT));
160 if (GSStatus.isCompleted(status_code) &&
161 GSStatus.isError(status_code)) {
162 // we shouldn't carry out the next bit, just return the response
163 return response;
164 }
165 String id = status.getAttribute(GSXML.STATUS_PROCESS_ID_ATT);
166 GS2PerlListener listener = (GS2PerlListener)this.listeners.get(id);
167 if (listener==null) {
168 System.err.println("somethings gone wrong, couldn't find the listener");
169 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
170 return response;
171 }
172 while (!GSStatus.isCompleted(status_code)) {
173 // wait for the process, and keep checking the status code
174 // there is probably a better way to do this.
175 try {
176 Thread.currentThread().sleep(100);
177 } catch (Exception e) { // ignore
178 }
179 status_code = listener.getStatus();
180 }
181
182 // add the rest of the messages to the status node
183 Text t = this.doc.createTextNode("\n"+listener.getUpdate());
184 status.appendChild(t);
185 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(listener.getStatus()));
186 if (GSStatus.isError(status_code)) {
187 return response; // without doing the next bit
188 }
189
190 t = this.doc.createTextNode("\n");
191 status.appendChild(t);
192 // once have got here, we assume
193 // the first bit proceeded successfully, now reload the collection
194 systemRequest("reload", coll_name, status, lang); // this will append more messages to the status, and overwrite the error code att
195 return response;
196
197 }
198 protected Element processDeleteCollection(Element request) {
199
200 // the response to send back
201 String name = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT));
202 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
203 response.setAttribute(GSXML.FROM_ATT, name);
204 Element status = this.doc.createElement(GSXML.STATUS_ELEM);
205 response.appendChild(status);
206 Text t = null; // the text node for the error/success message
207 String lang = request.getAttribute(GSXML.LANG_ATT);
208 String request_type = request.getAttribute(GSXML.TYPE_ATT);
209
210 Element param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
211 HashMap params = GSXML.extractParams(param_list, false);
212
213 boolean get_status_only = false;
214 if (request_type.equals(GSXML.REQUEST_TYPE_STATUS)) {
215 get_status_only = true;
216 }
217 if (get_status_only) {
218 // 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
219 System.err.println("had a status request for delete - this shouldn't happen!!");
220 //t = this.doc.createTextNode("");
221 //status.appendChild(t);
222 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
223 return response;
224 }
225 String coll_name = (String)params.get(COL_PARAM);
226 String[] args={coll_name};
227 File coll_dir = new File(GSFile.collectionBaseDir(this.site_home, coll_name));
228 // check that the coll is there in the first place
229 if (!coll_dir.exists()) {
230 t = this.doc.createTextNode(getTextString("delete.exists_error", args, lang));
231 status.appendChild(t);
232 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
233 return response;
234 }
235
236 // try to delete the directory
237 if (!GSFile.deleteFile(coll_dir)) {
238 t = this.doc.createTextNode(getTextString("delete.delete_error", args, lang));
239 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
240 status.appendChild(t);
241 return response;
242 }
243 systemRequest("delete", coll_name, status, lang);
244 return response;
245 }
246
247 protected Element processReloadCollection(Element request) {
248
249 // the response to send back
250 String name = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT));
251 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
252 response.setAttribute(GSXML.FROM_ATT, name);
253 Element status = this.doc.createElement(GSXML.STATUS_ELEM);
254 response.appendChild(status);
255 Text t = null; // the text node for the error/success message
256
257 String lang = request.getAttribute(GSXML.LANG_ATT);
258 String request_type = request.getAttribute(GSXML.TYPE_ATT);
259
260 Element param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
261 HashMap params = GSXML.extractParams(param_list, false);
262
263 boolean get_status_only = false;
264 if (request_type.equals(GSXML.REQUEST_TYPE_STATUS)) {
265 get_status_only = true;
266 }
267 if (get_status_only) {
268 // reload is synchronous - this makes no sense
269 System.err.println("had a status request for reload - this shouldn't happen!!");
270 //t = this.doc.createTextNode("");
271 //status.appendChild(t);
272 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
273 return response;
274 }
275
276 String coll_name = (String)params.get(COL_PARAM);
277 systemRequest("reload", coll_name, status, lang);
278 return response;
279
280 }
281
282 /** send a configure request to the message router
283 * action name should be "delete" or "reload"
284 * response will be put into the status element
285 */
286 protected void systemRequest(String action_name, String coll_name, Element status, String lang) {
287
288 // send the request to the MR
289 Element message = this.doc.createElement(GSXML.MESSAGE_ELEM);
290 Element request = this.doc.createElement(GSXML.REQUEST_ELEM);
291 request.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_SYSTEM);
292 request.setAttribute(GSXML.TO_ATT, "");
293 message.appendChild(request);
294 Element command = this.doc.createElement(GSXML.SYSTEM_ELEM);
295 request.appendChild(command);
296 command.setAttribute(GSXML.SYSTEM_MODULE_TYPE_ATT, GSXML.COLLECTION_ELEM);
297 command.setAttribute(GSXML.SYSTEM_MODULE_NAME_ATT, coll_name);
298
299 if (action_name.equals("delete")) {
300 command.setAttribute(GSXML.TYPE_ATT, GSXML.SYSTEM_TYPE_DEACTIVATE);
301 } else if (action_name.equals("reload")) {
302 command.setAttribute(GSXML.TYPE_ATT, GSXML.SYSTEM_TYPE_ACTIVATE);
303 } else {
304 System.err.println("invalid action name passed to systemRequest:"+action_name);
305 return;
306 }
307 request.appendChild(command);
308 Element response = this.router.process(message); // at the moment, get no info in response so ignore it
309 Text t;
310 String[] args={coll_name};
311
312 if (response == null) {
313 t = this.doc.createTextNode(getTextString(action_name+".configure_error", args , lang));
314 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
315 status.appendChild(t);
316 return;
317 }
318
319 // if we got here, we have succeeded!
320 t = this.doc.createTextNode(getTextString(action_name+".success", args, lang));
321 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.SUCCESS));
322 status.appendChild(t);
323 }
324
325
326 /** configure the service module
327 * for now, all services have type=build - need to think about this
328 */
329 public boolean configure(Element info, Element extra_info) {
330 System.out.println("configuring GS2Construct");
331
332 Element e = null;
333 // hard code in the services for now
334
335 // set up short_service_info_ - for now just has name and type
336
337 e = this.doc.createElement(GSXML.SERVICE_ELEM);
338 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
339 e.setAttribute(GSXML.NAME_ATT, NEW_SERVICE);
340 this.short_service_info.appendChild(e);
341
342 e = this.doc.createElement(GSXML.SERVICE_ELEM);
343 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
344 e.setAttribute(GSXML.NAME_ATT, IMPORT_SERVICE);
345 this.short_service_info.appendChild(e);
346
347 e = this.doc.createElement(GSXML.SERVICE_ELEM);
348 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
349 e.setAttribute(GSXML.NAME_ATT, BUILD_SERVICE);
350 this.short_service_info.appendChild(e);
351
352 e = this.doc.createElement(GSXML.SERVICE_ELEM);
353 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
354 e.setAttribute(GSXML.NAME_ATT, ACTIVATE_SERVICE);
355 this.short_service_info.appendChild(e);
356
357 e = this.doc.createElement(GSXML.SERVICE_ELEM);
358 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
359 e.setAttribute(GSXML.NAME_ATT, DELETE_SERVICE);
360 this.short_service_info.appendChild(e);
361
362 e = this.doc.createElement(GSXML.SERVICE_ELEM);
363 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
364 e.setAttribute(GSXML.NAME_ATT, RELOAD_SERVICE);
365 this.short_service_info.appendChild(e);
366
367 //e = this.doc.createElement(GSXML.SERVICE_ELEM);
368 //e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
369 //e.setAttribute(GSXML.NAME_ATT, ADD_DOC_SERVICE);
370 //this.short_service_info.appendChild(e);
371
372
373 return true;
374 }
375
376 /** returns a response element */
377 protected Element runCommand(Element request, int type ) {
378
379 // the response to send back
380 String name = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT));
381 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
382 response.setAttribute(GSXML.FROM_ATT, name);
383 Element status = this.doc.createElement(GSXML.STATUS_ELEM);
384 response.appendChild(status);
385
386 String lang = request.getAttribute(GSXML.LANG_ATT);
387 String request_type = request.getAttribute(GSXML.TYPE_ATT);
388
389 Element param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
390 HashMap params = GSXML.extractParams(param_list, false);
391
392 boolean get_status_only = false;
393 if (request_type.equals(GSXML.REQUEST_TYPE_STATUS)) {
394 get_status_only = true;
395 }
396
397 // just check for status messages if that's all that's required
398 if (get_status_only) {
399 String id = (String)params.get(PROCESS_ID_PARAM);
400 status.setAttribute(GSXML.STATUS_PROCESS_ID_ATT, id);
401 GS2PerlListener listener = (GS2PerlListener)this.listeners.get(id);
402 if (listener==null) {
403 Text t = this.doc.createTextNode(getTextString("general.process_id_error", lang));
404 status.appendChild(t);
405 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
406 } else {
407 Text t = this.doc.createTextNode(listener.getUpdate());
408 status.appendChild(t);
409 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(listener.getStatus()));
410 // check that we actually should be removing the listener here
411 if (listener.isFinished()) { // remove this listener - its job is done
412 this.listeners.remove(id); // not working
413 }
414 }
415 return response;
416
417 }
418
419 // do teh actual command
420 String coll_name=null;
421 if (type==GS2PerlConstructor.NEW) {
422 String coll_title = (String)params.get(NEW_COL_TITLE_PARAM);
423 coll_name = createNewCollName(coll_title);
424 } else {
425 coll_name = (String)params.get(COL_PARAM);
426 }
427 System.err.println("Coll name = "+coll_name);
428 // makes a paramList of the relevant params
429 Element other_params = extractOtherParams(params, type);
430
431 //create the constructor to do the work
432
433 GS2PerlConstructor constructor = new GS2PerlConstructor("perl_build");
434 if (!constructor.configure()) {
435 Text t = this.doc.createTextNode(getTextString("general.configure_constructor_error", lang));
436 status.appendChild(t);
437 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
438 return response;
439 }
440
441 constructor.setSiteHome(this.site_home);
442 constructor.setCollectionName(coll_name);
443 constructor.setActionType(type);
444 constructor.setProcessParams(other_params);
445 // the listener
446 GS2PerlListener listener = new GS2PerlListener();
447 constructor.addListener(listener);
448 constructor.start();
449
450 String id = newID();
451 this.listeners.put(id, listener);
452
453 status.setAttribute(GSXML.STATUS_PROCESS_ID_ATT, id);
454 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ACCEPTED));
455 Text t = this.doc.createTextNode(getTextString("general.process_start", lang));
456 status.appendChild(t);
457 return response;
458
459 }
460
461
462 //************************
463 // some helper functions
464 //************************
465
466 /** parse the collect directory and return a list of collection names */
467 protected String[] getCollectionList() {
468
469 File collectDir = new File(GSFile.collectDir(this.site_home));
470 if (!collectDir.exists()) {
471 System.err.println("couldn't find collect dir: "+collectDir.toString());
472 return null;
473 }
474 System.out.println("GS2Construct: reading thru directory "+collectDir.getPath()+" to find collections.");
475 File[] contents = collectDir.listFiles();
476 int num_colls=0;
477 for (int i=0; i<contents.length;i++) {
478 if(contents[i].isDirectory() && !contents[i].getName().startsWith("CVS")) {
479 num_colls ++;
480 }
481 }
482
483 String[] names= new String[num_colls];
484
485 for (int i=0, j=0; i<contents.length;i++) {
486 if(contents[i].isDirectory()) {
487 String colName = contents[i].getName();
488 if (!colName.startsWith("CVS")) {
489 names[j] = colName;
490 j++;
491 }
492
493 }
494 }
495
496 return names;
497
498 }
499
500 /** ids used for process id */
501 private int current_id = 0;
502 private String newID() {
503 current_id++;
504 return Integer.toString(current_id);
505 }
506
507 /** creates a new short name from the collection title */
508 protected String createNewCollName(String coll_title) {
509
510 String base_name = null;
511 // take the first 6 letters
512 if (coll_title.length()<6) {
513 base_name = coll_title;
514 } else {
515 base_name = coll_title.substring(0,6);
516 }
517 File coll_dir = new File(GSFile.collectionBaseDir(this.site_home, base_name));
518 if (!coll_dir.exists()) { // this name is ok - not used yet
519 return base_name;
520 }
521
522 // now we have to make a new name until we get a good one
523 // try name1, name2 name3 etc
524 int i=0;
525 while(coll_dir.exists()) {
526 i++;
527 coll_dir = new File(GSFile.collectionBaseDir(this.site_home, base_name+Integer.toString(i)));
528 }
529 return base_name+Integer.toString(i);
530
531 }
532
533 /** takes the params from the request (in the HashMap) and extracts any
534 * that need to be passed to the constructor and puts them into a
535 * paramList element */
536 protected Element extractOtherParams(HashMap params, int type) {
537
538 Element param_list = this.doc.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
539 if (type == GS2PerlConstructor.NEW) {
540 Element param = this.doc.createElement(GSXML.PARAM_ELEM);
541 param.setAttribute(GSXML.NAME_ATT, "creator");
542 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(CREATOR_PARAM));
543
544 param_list.appendChild(param);
545 param = this.doc.createElement(GSXML.PARAM_ELEM);
546 param.setAttribute(GSXML.NAME_ATT, "about");
547 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(NEW_COL_ABOUT_PARAM));
548 param_list.appendChild(param);
549 param = this.doc.createElement(GSXML.PARAM_ELEM);
550 param.setAttribute(GSXML.NAME_ATT, "title");
551 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(NEW_COL_TITLE_PARAM));
552 param_list.appendChild(param);
553 param = this.doc.createElement(GSXML.PARAM_ELEM);
554 param.setAttribute(GSXML.NAME_ATT, "buildtype");
555 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(BUILDTYPE_PARAM));
556 param_list.appendChild(param);
557 return param_list;
558 }
559
560 // other ones dont have params yet
561 return null;
562 }
563
564}
565
566
Note: See TracBrowser for help on using the repository browser.