[Fedora-directory-commits] console/src/com/netscape/management/client/security CertRequestWizard.java, 1.1.1.1, 1.2

Nathan Kinder (nkinder) fedora-directory-commits at redhat.com
Tue Nov 29 18:37:14 UTC 2005


Author: nkinder

Update of /cvs/dirsec/console/src/com/netscape/management/client/security
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22252/src/com/netscape/management/client/security

Modified Files:
	CertRequestWizard.java 
Log Message:
173947 - Added ability to build a Console RPM.  The layout of Console can now be distributed inside system locations instead of being self-contained.


Index: CertRequestWizard.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/security/CertRequestWizard.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CertRequestWizard.java	18 Jul 2005 00:34:16 -0000	1.1.1.1
+++ CertRequestWizard.java	29 Nov 2005 18:37:06 -0000	1.2
@@ -40,7 +40,6 @@
 import com.netscape.management.client.util.Help;
 import com.netscape.management.client.util.Browser;
 import com.netscape.management.nmclf.*;
-
 import com.netscape.management.client.security.csr.*;
 import com.netscape.management.client.preferences.*;
 import netscape.ldap.*;
@@ -62,7 +61,9 @@
     IDataCollectionModel dataCollectionModel = new WizardDataCollectionModel();
 
     final String PLUGIN_ID          = "PLUGIN_ID";
-    final String PLUGIN_DIR         = "./caplugin";
+    final String PLUGIN_DIR         = Console.PREFERENCE_DIR + "caplugin" + File.separator;
+    final String DEFAULT_PLUGIN_CLASS = "com.netscape.management.client.security.csr.DefaultPlugin.class";
+    final String DEFAULT_PLUGIN_DESC  = "Manual Cert Request Plugin";
 
     PluginWizardPage pwdPage = null;
     PluginWizardPage endSequence = null;
@@ -379,6 +380,16 @@
 	    //construct plugin list
 	    Vector caList = new Vector();
 	    File f = new File(PLUGIN_DIR);
+
+            // Load the default plugin
+            defaultPlugin = new PluginItem(DEFAULT_PLUGIN_CLASS, DEFAULT_PLUGIN_DESC,
+                                           "", null , "", null);
+
+            // Check if caplugin directory exists
+             if (!f.exists())
+                f.mkdir();
+
+            // Check for additional plugins
 	    File[] fList = f.listFiles(this);
 	    for (int i=0; i<fList.length; i++) {
 		// load jar file and extract all the information
@@ -417,10 +428,11 @@
 			    }
 			}
 
-			Debug.println(jarFilename);
-			Debug.println(attr.getValue("Description"));
-			Debug.println(attr.getValue("UpdateURL"));
-			Debug.println(attr.getValue("UserURL"));
+			Debug.println("Plugin Jar: " + jarFilename);
+                        Debug.println("Class Name: " + className);
+			Debug.println("Description: " + attr.getValue("Description"));
+			Debug.println("Update URL: " + attr.getValue("UpdateURL"));
+			Debug.println("User URL: " + attr.getValue("UserURL"));
 
 			PluginItem tmp = new PluginItem(className,
 							attr.getValue("Description"),
@@ -428,11 +440,7 @@
 							imageData, 
 							attr.getValue("UserURL"), 
 							jarFilename);
-			if (fList[i].getName().equals("default.jar")) {
-			    defaultPlugin = tmp;
-			} else {
-			    caList.addElement(tmp);
-			}
+			caList.addElement(tmp);
 		    }
 		} catch (Exception ee) {
 		    SecurityUtil.printException("CertRequestWizard::CAPlugin::CAPlugin()",ee);
@@ -510,9 +518,14 @@
 		String className = selectedPlugin._className.substring(0, selectedPlugin._className.indexOf(".class"));
 
 		try {
-
-		    LocalJarClassLoader loader = new LocalJarClassLoader(selectedPlugin._jarFilename);
-		    Class myClass = loader.loadClass(className);
+                    Class myClass;
+                    // If this is the default plugin, just load the class directly
+                    if (defaultPluginUsed) {
+                        myClass = Class.forName(className);
+                    } else {
+		        LocalJarClassLoader loader = new LocalJarClassLoader(selectedPlugin._jarFilename);
+		        myClass = loader.loadClass(className);
+                    }
 
 		    ic = (ICAPlugin)(myClass.newInstance());
 




More information about the Fedora-directory-commits mailing list