1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package de.bea.domingo.server;
24
25 import java.io.IOException;
26 import java.io.PrintWriter;
27 import java.util.Map;
28
29 import de.bea.domingo.DDatabase;
30 import de.bea.domingo.DDxlExporter;
31 import de.bea.domingo.DNotesException;
32 import de.bea.domingo.DSession;
33
34 /***
35 * TODO.
36 *
37 * @author <a href=mailto:kriede@users.sourceforge.net>Kurt Riede</a>
38 */
39 public final class ReadDocumentCommand extends BaseCommand implements Command {
40
41 /***
42 * {@inheritDoc}
43 *
44 * @see de.bea.domingo.server.Command#execute(de.bea.domingo.DSession, java.util.Map, java.io.PrintWriter)
45 */
46 public void execute(final DSession session, final Map parameters, final PrintWriter printWriter) throws DNotesException,
47 IOException {
48 String filename = getParameterString(parameters, "file");
49 DDatabase database = session.getDatabase("", filename);
50 DDxlExporter exporter = session.createDxlExporter();
51 String unid = (String) parameters.get("unid");
52 exporter.setOutputDoctype(false);
53 printWriter.print("Content-type: text/xml");
54 printWriter.print(exporter.exportDxl(database.getDocumentByUNID(unid)));
55 }
56 }