01: package migration.modules.ldap;
02:
03: /* Exporting the component to an xml file that sticks to webtopimport.dtd,
04: given the component name.
05:
06: Invokation format:
07:
08: java migration.modules.ldap.Export componentname outputfilename
09:
10: */
11:
12: import java.io.*;
13:
14: public class Export {
15:
16: public static void main(String[] args) throws Exception {
17:
18: try {
19: OutputStreamWriter outxml;
20: String compname = args[0];
21: String outfile = args[1];
22:
23: outxml = new OutputStreamWriter(new FileOutputStream(
24: outfile), "UTF-8");
25: Component comp = new Component();
26: comp.getCompProfile("component", compname);
27: outxml.write(((Component) comp).toXML(true));
28: outxml.close();
29: } catch (Exception e) {
30: System.out
31: .println("Error in writing to the specified file!");
32: e.printStackTrace();
33: }
34:
35: }
36:
37: }
|