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

Last change on this file since 10093 was 10093, checked in by kjdon, 19 years ago

The ServiceRack class's configure method is no longer abstract so all the
subclasses should call super.configure.

  • 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: 10093 $
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+GSXML.LIST_MODIFIER)) {
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", lang, args));
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", lang, args));
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 = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_SYSTEM, "", lang, "");
291 message.appendChild(request);
292 Element command = this.doc.createElement(GSXML.SYSTEM_ELEM);
293 request.appendChild(command);
294 command.setAttribute(GSXML.SYSTEM_MODULE_TYPE_ATT, GSXML.COLLECTION_ELEM);
295 command.setAttribute(GSXML.SYSTEM_MODULE_NAME_ATT, coll_name);
296
297 if (action_name.equals("delete")) {
298 command.setAttribute(GSXML.TYPE_ATT, GSXML.SYSTEM_TYPE_DEACTIVATE);
299 } else if (action_name.equals("reload")) {
300 command.setAttribute(GSXML.TYPE_ATT, GSXML.SYSTEM_TYPE_ACTIVATE);
301 } else {
302 System.err.println("invalid action name passed to systemRequest:"+action_name);
303 return;
304 }
305 request.appendChild(command);
306 Element response = this.router.process(message); // at the moment, get no info in response so ignore it
307 Text t;
308 String[] args={coll_name};
309
310 if (response == null) {
311 t = this.doc.createTextNode(getTextString(action_name+".configure_error", lang, args));
312 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
313 status.appendChild(t);
314 return;
315 }
316
317 // if we got here, we have succeeded!
318 t = this.doc.createTextNode(getTextString(action_name+".success", lang, args));
319 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.SUCCESS));
320 status.appendChild(t);
321 }
322
323
324 /** configure the service module
325 * for now, all services have type=build - need to think about this
326 */
327 public boolean configure(Element info, Element extra_info) {
328 if (!super.configure(info, extra_info)){
329 return false;
330 }
331
332 System.out.println("configuring GS2Construct");
333
334 Element e = null;
335 // hard code in the services for now
336
337 // set up short_service_info_ - for now just has name and type
338
339 e = this.doc.createElement(GSXML.SERVICE_ELEM);
340 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
341 e.setAttribute(GSXML.NAME_ATT, NEW_SERVICE);
342 this.short_service_info.appendChild(e);
343
344 e = this.doc.createElement(GSXML.SERVICE_ELEM);
345 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
346 e.setAttribute(GSXML.NAME_ATT, IMPORT_SERVICE);
347 this.short_service_info.appendChild(e);
348
349 e = this.doc.createElement(GSXML.SERVICE_ELEM);
350 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
351 e.setAttribute(GSXML.NAME_ATT, BUILD_SERVICE);
352 this.short_service_info.appendChild(e);
353
354 e = this.doc.createElement(GSXML.SERVICE_ELEM);
355 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
356 e.setAttribute(GSXML.NAME_ATT, ACTIVATE_SERVICE);
357 this.short_service_info.appendChild(e);
358
359 e = this.doc.createElement(GSXML.SERVICE_ELEM);
360 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
361 e.setAttribute(GSXML.NAME_ATT, DELETE_SERVICE);
362 this.short_service_info.appendChild(e);
363
364 e = this.doc.createElement(GSXML.SERVICE_ELEM);
365 e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
366 e.setAttribute(GSXML.NAME_ATT, RELOAD_SERVICE);
367 this.short_service_info.appendChild(e);
368
369 //e = this.doc.createElement(GSXML.SERVICE_ELEM);
370 //e.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_PROCESS);
371 //e.setAttribute(GSXML.NAME_ATT, ADD_DOC_SERVICE);
372 //this.short_service_info.appendChild(e);
373
374
375 return true;
376 }
377
378 /** returns a response element */
379 protected Element runCommand(Element request, int type ) {
380
381 // the response to send back
382 String name = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT));
383 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
384 response.setAttribute(GSXML.FROM_ATT, name);
385 Element status = this.doc.createElement(GSXML.STATUS_ELEM);
386 response.appendChild(status);
387
388 String lang = request.getAttribute(GSXML.LANG_ATT);
389 String request_type = request.getAttribute(GSXML.TYPE_ATT);
390
391 Element param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
392 HashMap params = GSXML.extractParams(param_list, false);
393
394 boolean get_status_only = false;
395 if (request_type.equals(GSXML.REQUEST_TYPE_STATUS)) {
396 get_status_only = true;
397 }
398
399 // just check for status messages if that's all that's required
400 if (get_status_only) {
401 String id = (String)params.get(PROCESS_ID_PARAM);
402 status.setAttribute(GSXML.STATUS_PROCESS_ID_ATT, id);
403 GS2PerlListener listener = (GS2PerlListener)this.listeners.get(id);
404 if (listener==null) {
405 Text t = this.doc.createTextNode(getTextString("general.process_id_error", lang));
406 status.appendChild(t);
407 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
408 } else {
409 Text t = this.doc.createTextNode(listener.getUpdate());
410 status.appendChild(t);
411 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(listener.getStatus()));
412 // check that we actually should be removing the listener here
413 if (listener.isFinished()) { // remove this listener - its job is done
414 this.listeners.remove(id); // not working
415 }
416 }
417 return response;
418
419 }
420
421 // do teh actual command
422 String coll_name=null;
423 if (type==GS2PerlConstructor.NEW) {
424 String coll_title = (String)params.get(NEW_COL_TITLE_PARAM);
425 coll_name = createNewCollName(coll_title);
426 } else {
427 coll_name = (String)params.get(COL_PARAM);
428 }
429 System.err.println("Coll name = "+coll_name);
430 // makes a paramList of the relevant params
431 Element other_params = extractOtherParams(params, type);
432
433 //create the constructor to do the work
434
435 GS2PerlConstructor constructor = new GS2PerlConstructor("perl_build");
436 if (!constructor.configure()) {
437 Text t = this.doc.createTextNode(getTextString("general.configure_constructor_error", lang));
438 status.appendChild(t);
439 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ERROR));
440 return response;
441 }
442
443 constructor.setSiteHome(this.site_home);
444 constructor.setCollectionName(coll_name);
445 constructor.setActionType(type);
446 constructor.setProcessParams(other_params);
447 // the listener
448 GS2PerlListener listener = new GS2PerlListener();
449 constructor.addListener(listener);
450 constructor.start();
451
452 String id = newID();
453 this.listeners.put(id, listener);
454
455 status.setAttribute(GSXML.STATUS_PROCESS_ID_ATT, id);
456 status.setAttribute(GSXML.STATUS_ERROR_CODE_ATT, Integer.toString(GSStatus.ACCEPTED));
457 Text t = this.doc.createTextNode(getTextString("general.process_start", lang));
458 status.appendChild(t);
459 return response;
460
461 }
462
463
464 //************************
465 // some helper functions
466 //************************
467
468 /** parse the collect directory and return a list of collection names */
469 protected String[] getCollectionList() {
470
471 File collectDir = new File(GSFile.collectDir(this.site_home));
472 if (!collectDir.exists()) {
473 System.err.println("couldn't find collect dir: "+collectDir.toString());
474 return null;
475 }
476 System.out.println("GS2Construct: reading thru directory "+collectDir.getPath()+" to find collections.");
477 File[] contents = collectDir.listFiles();
478 int num_colls=0;
479 for (int i=0; i<contents.length;i++) {
480 if(contents[i].isDirectory() && !contents[i].getName().startsWith("CVS")) {
481 num_colls ++;
482 }
483 }
484
485 String[] names= new String[num_colls];
486
487 for (int i=0, j=0; i<contents.length;i++) {
488 if(contents[i].isDirectory()) {
489 String colName = contents[i].getName();
490 if (!colName.startsWith("CVS")) {
491 names[j] = colName;
492 j++;
493 }
494
495 }
496 }
497
498 return names;
499
500 }
501
502 /** ids used for process id */
503 private int current_id = 0;
504 private String newID() {
505 current_id++;
506 return Integer.toString(current_id);
507 }
508
509 /** creates a new short name from the collection title */
510 protected String createNewCollName(String coll_title) {
511
512 String base_name = null;
513 // take the first 6 letters
514 if (coll_title.length()<6) {
515 base_name = coll_title;
516 } else {
517 base_name = coll_title.substring(0,6);
518 }
519 File coll_dir = new File(GSFile.collectionBaseDir(this.site_home, base_name));
520 if (!coll_dir.exists()) { // this name is ok - not used yet
521 return base_name;
522 }
523
524 // now we have to make a new name until we get a good one
525 // try name1, name2 name3 etc
526 int i=0;
527 while(coll_dir.exists()) {
528 i++;
529 coll_dir = new File(GSFile.collectionBaseDir(this.site_home, base_name+Integer.toString(i)));
530 }
531 return base_name+Integer.toString(i);
532
533 }
534
535 /** takes the params from the request (in the HashMap) and extracts any
536 * that need to be passed to the constructor and puts them into a
537 * paramList element */
538 protected Element extractOtherParams(HashMap params, int type) {
539
540 Element param_list = this.doc.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
541 if (type == GS2PerlConstructor.NEW) {
542 Element param = this.doc.createElement(GSXML.PARAM_ELEM);
543 param.setAttribute(GSXML.NAME_ATT, "creator");
544 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(CREATOR_PARAM));
545
546 param_list.appendChild(param);
547 param = this.doc.createElement(GSXML.PARAM_ELEM);
548 param.setAttribute(GSXML.NAME_ATT, "about");
549 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(NEW_COL_ABOUT_PARAM));
550 param_list.appendChild(param);
551 param = this.doc.createElement(GSXML.PARAM_ELEM);
552 param.setAttribute(GSXML.NAME_ATT, "title");
553 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(NEW_COL_TITLE_PARAM));
554 param_list.appendChild(param);
555 param = this.doc.createElement(GSXML.PARAM_ELEM);
556 param.setAttribute(GSXML.NAME_ATT, "buildtype");
557 param.setAttribute(GSXML.VALUE_ATT, (String)params.get(BUILDTYPE_PARAM));
558 param_list.appendChild(param);
559 return param_list;
560 }
561
562 // other ones dont have params yet
563 return null;
564 }
565
566}
567
568
Note: See TracBrowser for help on using the repository browser.