|
From: <tr...@us...> - 2003-09-09 04:58:32
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/config/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv8197/scripts
Added Files:
servicexml.js
Log Message:
Updated the documentation pipeline so that the common javascript is now in a library
--- NEW FILE: servicexml.js ---
/**
* For all the service types with the same prefix (ie. PipelineStage.), get the
* IConfigInfo object and then on each one, call the toXml method. Aggregate the
* all the xml files.
*
* Configuration files:
*
* 1. serviceType - the serviceType to scan for.
* 2. rootElement - the root element in the document
*
*/
importClass(Packages.com.babeldoc.core.service.ServiceFactory);
var serviceType = stage.getOptions("serviceType");
var rootElement = stage.getOptions("rootElement");
var services = ServiceFactory.getAllServices(serviceType);
var keyset = services.keySet();
var keyiter = keyset.iterator();
var bufr = new java.lang.StringBuffer();
bufr.append("<"+rootElement+">");
while(keyiter.hasNext()) {
var key = serviceType+"."+keyiter.next();
var obj = ServiceFactory.getService(key);
var info = obj.getInfo();
if(info!=null) {
var xmlfrag = info.toXml();
bufr.append(xmlfrag);
}
}
bufr.append("</"+rootElement+">");
document.setBytes(bufr.toString().getBytes());
document.setMimeType("text/xml");
|