01: package migration.modules.ldap;
02:
03: import java.util.*;
04: import java.io.*;
05:
06: public class CommonXml extends Common {
07: public static ResourceBundle authProperties = null;
08: public static String authPropFileName = "auth";
09:
10: static {
11: try {
12: authProperties = ResourceBundle.getBundle(authPropFileName,
13: Locale.getDefault());
14: } catch (MissingResourceException me) {
15: me.printStackTrace();
16: System.out.println("Could not load " + authPropFileName);
17: }
18: }
19:
20: /*
21: * Get Service Template Xml
22: */
23: public static String getCreateServiceTemplate(String serviceName) {
24: StringBuffer sb = new StringBuffer();
25:
26: sb.append("<CreateServiceTemplate>\n");
27: sb.append("<Service_Name>" + serviceName + "</Service_Name>\n");
28: sb.append("</CreateServiceTemplate>\n");
29:
30: return sb.toString();
31: }
32:
33: /*
34: * Get Register Service Xml
35: */
36: public static String getRegisterService(String serviceName,
37: String org, String rootsuffix) {
38: StringBuffer sb = new StringBuffer();
39:
40: sb.append("\n <OrganizationRequests DN=\"" + orgNaming + org
41: + "," + rootsuffix + "\">");
42: sb.append("\n <RegisterServices>");
43: sb.append("\n <Service_Name>" + serviceName
44: + "</Service_Name>");
45: sb.append("\n </RegisterServices>");
46: sb.append("\n</OrganizationRequests>");
47:
48: return sb.toString();
49: }
50:
51: /*
52: * Get Header
53: */
54: public static String getHeader() {
55: StringBuffer sb = new StringBuffer();
56:
57: sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
58: sb
59: .append("\n<!-- PROPRIETARY/CONFIDENTIAL/ Use of this product is subject");
60: sb
61: .append("\n to license terms. Copyright 2001 Sun Microsystems Inc.");
62: sb.append("Some preexisting portions Copyright 2001 Netscape");
63: sb.append("Communications Corp. All rights reserved. -->");
64: sb
65: .append("\n<!DOCTYPE Requests PUBLIC \"-//Sun ONE//iDSAME 5.0 Admin CLI DTD//EN \" ");
66: sb.append("\"file:" + IDSAMEBaseDir + "/dtd/amAdmin.dtd\">");
67:
68: return sb.toString();
69: }
70:
71: }
|