01: package migration.modules.auth;
02:
03: import java.util.*;
04: import java.io.*;
05: import org.xml.sax.SAXException;
06:
07: import migration.modules.ldap.*;
08: import com.iplanet.portalserver.parser.*;
09: import com.iplanet.portalserver.profile.impl.*;
10: import com.iplanet.portalserver.profile.share.ProfileBundle;
11:
12: public class AuthConvert {
13: static ResourceBundle bundle = null;
14:
15: static Component convert(String inFile) throws Exception {
16:
17: WebtopParser wp = new WebtopParser();
18: wp.register(Element.COMPONENT_E,
19: "migration.modules.ldap.Component");
20: wp.register(Element.ATT_E, "migration.modules.ldap.Attribute");
21: wp.register(Element.PRIV_E, "migration.modules.ldap.Privilege");
22: wp.register(Element.VALUELIST, "migration.modules.ldap.List");
23: wp.register(Element.DENYLIST, "migration.modules.ldap.List");
24: wp.register(Element.ALLOWLIST, "migration.modules.ldap.List");
25: wp.register(Element.CHOICEVALUE, "migration.modules.ldap.List");
26: wp.register(Element.READPERM, "migration.modules.ldap.List");
27: wp.register(Element.WRITEPERM, "migration.modules.ldap.List");
28: wp.register(Element.VALUELISTN, "migration.modules.ldap.List");
29: wp.register(Element.DENYLISTN, "migration.modules.ldap.List");
30: wp.register(Element.ALLOWLISTN, "migration.modules.ldap.List");
31: wp
32: .register(Element.CHOICEVALUEN,
33: "migration.modules.ldap.List");
34: wp.register(Element.READPERMN, "migration.modules.ldap.List");
35: wp.register(Element.WRITEPERMN, "migration.modules.ldap.List");
36: wp.register("Component", "com.sun.portal.psadmin.AppComponent");
37: wp.register("Attributes",
38: "com.iplanet.portalserver.parser.GenericNode");
39: wp.register("Privileges",
40: "com.iplanet.portalserver.parser.GenericNode");
41: wp.register("Attribute", "com.sun.portal.psadmin.AppAttribute");
42: wp.register("Privilege", "com.sun.portal.psadmin.AppPrivilege");
43:
44: Component comp = (Component) wp.parse(new FileInputStream(
45: inFile));
46:
47: return comp;
48: }
49:
50: static public void main(String[] args) {
51:
52: String infile, outfile;
53: Locale locale = Locale.getDefault();
54: Component authModule;
55:
56: bundle = ResourceBundle.getBundle("psMigrationLdap", locale);
57: infile = args[0];
58: outfile = args[1];
59: try {
60: authModule = convert(infile);
61: authModule.ProcessAuthModule(outfile);
62: } catch (Exception e) {
63: e.printStackTrace();
64: }
65: }
66:
67: }
|