/*
 * $Log: RecordXml2Sender.java,v $
 * Revision 1.4  2006-05-19 09:28:38  europe\m00i745
 * Restore java files from batch package after unwanted deletion.
 *
 * Revision 1.2  2005/10/31 14:38:02  John Dekker <john.dekker@ibissource.org>
 * Add . in javadoc
 *
 * Revision 1.1  2005/10/11 13:00:22  John Dekker <john.dekker@ibissource.org>
 * New ibis file related elements, such as DirectoryListener, MoveFilePie and 
 * BatchFileTransformerPipe
 *
 */
package nl.nn.adapterframework.batch;

import java.util.ArrayList;

import nl.nn.adapterframework.core.ISender;
import nl.nn.adapterframework.core.PipeLineSession;

/**
 * Translate a record using XSL.
 * 
 * <p><b>Configuration:</b>
 * <table border="1">
 * <tr><th>attributes</th><th>description</th><th>default</th></tr>
 * <tr><td>classname</td><td>nl.nn.ibis4fundation.transformation.RecordXslTransformer</td><td>&nbsp;</td></tr>
 * <tr><td>{@link #setRootTag(String) rootTag}</td><td>Roottag for the generated XML document</td><td>&nbsp;</td></tr>
 * <tr><td>{@link #setOutputFields(String) outputfields}</td><td>Comma seperated string with tagnames for the individual input fields (related using there positions). If you leave a tagname empty, the field is not xml-ized</td><td>&nbsp;</td></tr>
 * <tr><td>{@link #setSender(ISender) sender}</td><td>Sender that needs to handle the (XML) record</td><td>&nbsp;</td></tr>
 * </table>
 * </p>
 * 
 * @author: John Dekker
 */
public class RecordXml2Sender extends RecordXmlTransformer {
	public static final String version = "$RCSfile: RecordXml2Sender.java,v $  $Revision: 1.4 $ $Date: 2006-05-19 09:28:38 $";

	private ISender sender = null; // answer-sender
	
	public RecordXml2Sender() {
	}

	public Object handleRecord(PipeLineSession session, ArrayList parsedRecord) throws Exception {
		String xml = getXml(parsedRecord);
		return sender.sendMessage(null, xml);
	}
	

	public ISender getSender() {
		return sender;
	}

	public void setSender(ISender sender) {
		this.sender = sender;
	}

}

@@ -31,16 +31,125 @@
 ava,v $%0A
+ * Revision 1.5  2007-05-03 11:39:43  europe%5CL190409%0A * implement methods configure(), open() and close()%0A *%0A
  * Revis
@@ -157,28 +157,28 @@
 on 1.4  2006
--05-
+/05/
 19 09:28:38 
@@ -182,22 +182,58 @@
 38  
-europe%5Cm00i745
+Peter Eijgermans %3Cpeter.eijgermans@ibissource.org%3E
 %0A * 
@@ -661,16 +661,84 @@
 yList;%0A%0A
+import nl.nn.adapterframework.configuration.ConfigurationException;%0A
 import n
@@ -824,16 +824,68 @@
 Session;
+%0Aimport nl.nn.adapterframework.core.SenderException;
 %0A%0A/**%0A *
@@ -913,16 +913,45 @@
 sing XSL
+, then send it using a sender
 .%0A * %0A *
@@ -1105,56 +1105,145 @@
 .nn.
-ibis4fundation.transformation.RecordXslTransform
+adapterframework.batch.RecordXml2Sender%3C/td%3E%3Ctd%3E&nbsp;%3C/td%3E%3C/tr%3E%0A * %3Ctr%3E%3Ctd%3E%7B@link #setName(String) name%7D%3C/td%3E%3Ctd%3Ename of the RecordHandl
 er%3C/
@@ -1959,17 +1959,17 @@
 sion: 1.
-4
+5
  $ $Date
@@ -1977,24 +1977,24 @@
  200
-6
+7
 -05-
-19 09:28:38
+03 11:39:43
  $%22;
@@ -2075,24 +2075,299 @@
 der() %7B%0A%09%7D%0A%0A
+%09public void configure() throws ConfigurationException %7B%0A%09%09super.configure();%0A%09%09sender.configure();%09%09%0A%09%7D%0A%09public void open() throws SenderException %7B%0A%09%09super.open();%0A%09%09sender.open();%09%09%0A%09%7D%0A%09public void close() throws SenderException %7B%0A%09%09super.close();%0A%09%09sender.close();%09%09%0A%09%7D%0A%0A
 %09public Obje

implement methods configure(), open() and close()