You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ra...@apache.org on 2005/04/27 16:08:24 UTC
cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/admin JavaRuntimePortlet.java
raphael 2005/04/27 07:08:24
Modified: src/java/org/apache/jetspeed/services/registry
CastorRegistryService.java RegistryImporter.java
LateInitCastorRegistryService.java
src/java/org/apache/jetspeed/services/security/ldap
LDAPRoleManagement.java
LDAPPermissionManagement.java
LDAPGroupManagement.java
src/java/org/apache/jetspeed/util/template
ContentTemplateLink.java
src/java/org/apache/jetspeed/om/security/ldap LDAPUser.java
BaseLDAPObject.java
src/java/org/apache/jetspeed/om/registry/base
BaseRegistry.java PortletIterator.java
src/java/org/apache/jetspeed/util/parser
ValidationParameterParser.java
src/java/org/apache/jetspeed/daemon/impl/util/diskcachedaemon
URLRefresher.java
src/java/org/apache/jetspeed/modules/actions
MarkRefPage.java
src/java/org/apache/jetspeed/services/ldap LDAPService.java
src/java/org/apache/jetspeed/portal/portlets
RedirectPortlet.java
src/java/org/apache/jetspeed/portal/portlets/admin
JavaRuntimePortlet.java
Log:
Rename "enum" enumerations and cast some null signatures to allow
compilation with JDK 1.5
Revision Changes Path
1.47 +36 -36 jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/CastorRegistryService.java
Index: CastorRegistryService.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/CastorRegistryService.java,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- CastorRegistryService.java 21 Mar 2005 18:21:44 -0000 1.46
+++ CastorRegistryService.java 27 Apr 2005 14:08:24 -0000 1.47
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -101,9 +101,9 @@
{
/**
* Static initialization of the logger for this class
- */
+ */
protected static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(CastorRegistryService.class.getName());
-
+
public static final int DEFAULT_REFRESH = 300;
public static final String DEFAULT_EXTENSION = ".xreg";
public static final String DEFAULT_MAPPING = "${webapp}/WEB-INF/conf/mapping.xml";
@@ -134,10 +134,10 @@
/** the extension for registry files */
protected String extension = null;
-
+
/** enable messaging */
protected boolean enableMessaging = false;
-
+
/**
* Returns a Registry object for further manipulation
*
@@ -275,7 +275,7 @@
// mark this fragment so that it's persisted next time
// the registry watcher is running
fragment.setDirty(true);
-
+
if(enableMessaging)
{
Message msg = createMessage(regName, entry.getName());
@@ -323,7 +323,7 @@
// the entry is physically removed, remove the dangling reference
registry.removeLocalEntry(entryName);
-
+
if(enableMessaging)
{
Message msg = createMessage(regName, entryName);
@@ -341,14 +341,14 @@
//Ensure that the servlet service is initialized
TurbineServices.getInstance().initService(ServletService.SERVICE_NAME, conf);
-
+
this.enableMessaging = getConfiguration().getBoolean("enable_messaging", false);
if(enableMessaging)
{
try
{
TurbineServices.getInstance().initService(MessagingService.SERVICE_NAME, conf);
-
+
Messenger.addMessageListener(this, CastorRegistryService.class.getName(), MessagingService.REGISTRY_UPDATE_SUBJECT);
}
catch(Exception e)
@@ -361,7 +361,7 @@
String mapFile = null;
Vector names = new Vector();
int refreshRate = 0;
-
+
// read the configuration keys
try
{
@@ -377,7 +377,7 @@
{
throw new InitializationException("Unable to initialize CastorRegistryService, missing config keys");
}
-
+
// build the map of default fragments, eahc registry must be associated
// with at least one fragment
try
@@ -493,10 +493,10 @@
protected Map loadDatabaseManagedRegistries(ResourceService serviceConf)
{
Map databaseManaged = new HashMap();
- ResourceService rs = serviceConf.getResources("database.default");
+ ResourceService rs = serviceConf.getResources("database.default");
if (rs != null)
{
- Iterator iterator = rs.getKeys();
+ Iterator iterator = rs.getKeys();
while (iterator.hasNext())
{
String name = (String)iterator.next();
@@ -505,7 +505,7 @@
}
return databaseManaged;
}
-
+
protected Registry createRegistry(String name)
{
Registry registry = null;
@@ -531,7 +531,7 @@
}
return registry;
}
-
+
/** Late init method from Turbine Service model */
public void init() throws InitializationException
{
@@ -613,7 +613,7 @@
{
DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = dbfactory.newDocumentBuilder();
-
+
Document d = builder.parse(new File(file));
Unmarshaller unmarshaller = new Unmarshaller(this.mapping);
@@ -649,14 +649,14 @@
synchronized(watcher)
{
file = new File(directory, name + extension).getCanonicalPath();
-
+
Unmarshaller unmarshaller = new Unmarshaller(this.mapping);
RegistryFragment fragment = (RegistryFragment) unmarshaller.unmarshal(reader);
-
+
fragment.setChanged(true);
-
+
updateFragment(file, fragment);
-
+
if (persistent)
{
saveFragment(file);
@@ -717,7 +717,7 @@
{
logger.error("Exception", e); // At least log the exception.
}
-
+
try
{
fos.close();
@@ -786,10 +786,10 @@
// recreate the index entries (only this fragment)
- Enumeration enum = fragment.keys();
- while (enum.hasMoreElements())
+ Enumeration enum1 = fragment.keys();
+ while (enum1.hasMoreElements())
{
- String strReg = (String) enum.nextElement();
+ String strReg = (String) enum1.nextElement();
Vector v = fragment.getEntries(strReg);
for (int counter = 0; counter < v.size(); counter++)
@@ -886,7 +886,7 @@
{
if (logger.isDebugEnabled())
{
- logger.debug("RegistryService: Updating entry " + entry.getName()
+ logger.debug("RegistryService: Updating entry " + entry.getName()
+ " of class " + entry.getClass() + " to registry " + name);
}
@@ -905,7 +905,7 @@
if (logger.isDebugEnabled())
{
- logger.debug("RegistryService: Adding entry " + entry.getName() + " of class "
+ logger.debug("RegistryService: Adding entry " + entry.getName() + " of class "
+ entry.getClass() + " to registry " + name);
}
}
@@ -968,7 +968,7 @@
public void saveEntry(String regName, RegistryEntry entry) throws RegistryException
{
addEntry(regName, entry);
-
+
String fragmentName = (String) entryIndex.get(entry.getName());
if (fragmentName == null)
@@ -977,16 +977,16 @@
// in both cases, use the default fragment
fragmentName = (String) defaults.get(regName);
}
-
+
saveFragment(fragmentName);
-
+
if(enableMessaging)
{
Message msg = createMessage(regName, entry.getName());
Messenger.sendMessage(msg, MessagingService.REGISTRY_UPDATE_SUBJECT);
}
}
-
+
protected Message createMessage(String registry, String entryName)
{
ObjectMessage msg = (ObjectMessage) Messenger.createMessage(MessagingService.OBJECT_MESSAGE);
@@ -994,7 +994,7 @@
rm.setAction(RegistryMessage.ACTION_REFRESH);
rm.setRegistry(registry);
rm.setEntryName(entryName);
-
+
try
{
msg.setObject(rm);
@@ -1003,7 +1003,7 @@
{
logger.error("Failed to add object to message", e);
}
-
+
return msg;
}
@@ -1025,7 +1025,7 @@
logger.error("Failed to retrieve object from message.");
return;
}
-
+
if((obj != null) && (obj instanceof RegistryMessage))
{
RegistryMessage regMsg = (RegistryMessage)obj;
1.6 +31 -31 jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/RegistryImporter.java
Index: RegistryImporter.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/RegistryImporter.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RegistryImporter.java 21 Jul 2004 18:54:35 -0000 1.5
+++ RegistryImporter.java 27 Apr 2005 14:08:24 -0000 1.6
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -56,11 +56,11 @@
String root = "./webapp";
String properties = "/WEB-INF/conf/RegistryImport.properties";
TurbineConfig config = new TurbineConfig(root, properties);
-
+
config.initialize();
- ResourceService serviceConf = ((TurbineServices)
+ ResourceService serviceConf = ((TurbineServices)
TurbineServices.getInstance()).getResources(RegistryService.SERVICE_NAME);
-
+
}
catch (Throwable t)
{
@@ -69,13 +69,13 @@
logAndPrintError(msg, t);
System.exit(1);
}
-
+
//
// get a handle to the exporter service
//
RegistryService exporterService = getService("Registry", "Exporter");
- RegistryService importerService = getService("RegistryImporter", "Importer");
-
+ RegistryService importerService = getService("RegistryImporter", "Importer");
+
if (exporterService.getClass().getName().equals(importerService.getClass().getName()))
{
String msg =
@@ -83,13 +83,13 @@
logAndPrintError(msg, null);
System.exit(1);
}
-
+
RegistryImporter importer = new RegistryImporter();
boolean ran = importer.run(exporterService, importerService);
logAndPrint("**** Registry Importer - completed");
- System.exit(0);
+ System.exit(0);
}
-
+
public boolean run(
RegistryService exporterService,
RegistryService importerService)
@@ -105,27 +105,27 @@
msg = "Running with Exporter Service: " + exporterService.getClass();
logAndPrint(msg);
Enumeration e = importerService.getNames();
-
+
while (e.hasMoreElements())
{
String registryName = (String) e.nextElement();
logAndPrint("Exporting Registry: " + registryName);
Registry importRegistry = importerService.get(registryName);
Registry exportRegistry = exporterService.get(registryName);
-
- Enumeration enum = exportRegistry.getEntries();
- while (enum.hasMoreElements())
+
+ Enumeration enum1 = exportRegistry.getEntries();
+ while (enum1.hasMoreElements())
{
- RegistryEntry exportEntry = (RegistryEntry) enum.nextElement();
+ RegistryEntry exportEntry = (RegistryEntry) enum1.nextElement();
if (registryName.equals(org.apache.jetspeed.services.Registry.SECURITY) ||
- registryName.equals(org.apache.jetspeed.services.Registry.PORTLET))
+ registryName.equals(org.apache.jetspeed.services.Registry.PORTLET))
{
if (null == importerService.getEntry(registryName, exportEntry.getName()))
{
importerService.addEntry(registryName, exportEntry);
- logAndPrint("Imported into Registry: " + registryName + ", Entry = " + exportEntry.getName());
- entryCount++;
+ logAndPrint("Imported into Registry: " + registryName + ", Entry = " + exportEntry.getName());
+ entryCount++;
}
else
{
@@ -136,15 +136,15 @@
{
importerService.addEntry(registryName, exportEntry);
logAndPrint("Imported (update) into Registry: " + registryName + ", Entry = " + exportEntry.getName());
- entryCount++;
+ entryCount++;
}
else
{
logAndPrint("Skipping Entry, already exists: " + registryName + ", Entry = " + exportEntry.getName());
- skipCount++;
+ skipCount++;
}
}
- }
+ }
}
}
registryCount++;
@@ -158,7 +158,7 @@
}
msg = "*** Registry Importer completed ***";
logAndPrint(msg);
- msg = "Total Registries imported : " + registryCount;
+ msg = "Total Registries imported : " + registryCount;
logAndPrint(msg);
msg = "Total Registry Entries imported: " + entryCount;
logAndPrint(msg);
@@ -170,7 +170,7 @@
private static final void logAndPrint(String msg)
{
System.out.println(msg);
- logger.info(msg);
+ logger.info(msg);
}
private static final void logAndPrintError(String msg, Throwable t)
@@ -185,14 +185,14 @@
logger.error(msg, t);
}
}
-
+
private static final RegistryService getService(String serviceName, String serviceMode)
{
RegistryService service = null;
-
+
try
{
- service = (RegistryService) ServiceUtil.getServiceByName(serviceName);
+ service = (RegistryService) ServiceUtil.getServiceByName(serviceName);
}
catch (org.apache.turbine.services.InstantiationException e)
{
@@ -201,13 +201,13 @@
logAndPrintError(msg, e);
System.exit(1);
}
-
+
if (false == service.getInit())
{
String msg =
"Registry Importer: error initializing Registry " + serviceMode + " Service";
logAndPrintError(msg, null);
- System.exit(1);
+ System.exit(1);
}
return service;
}
1.6 +33 -33 jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/LateInitCastorRegistryService.java
Index: LateInitCastorRegistryService.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/LateInitCastorRegistryService.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- LateInitCastorRegistryService.java 21 Mar 2005 18:21:44 -0000 1.5
+++ LateInitCastorRegistryService.java 27 Apr 2005 14:08:24 -0000 1.6
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -98,9 +98,9 @@
{
/**
* Static initialization of the logger for this class
- */
+ */
private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(LateInitCastorRegistryService.class.getName());
-
+
public static final int DEFAULT_REFRESH = 300;
public static final String DEFAULT_EXTENSION = ".xreg";
public static final String DEFAULT_MAPPING = "${webapp}/WEB-INF/conf/mapping.xml";
@@ -131,10 +131,10 @@
/** the extension for registry files */
private String extension = null;
-
+
/** enable messaging */
protected boolean enableMessaging = false;
-
+
/**
* Returns a Registry object for further manipulation
*
@@ -272,7 +272,7 @@
// mark this fragment so that it's persisted next time
// the registry watcher is running
fragment.setDirty(true);
-
+
if(enableMessaging)
{
Message msg = createMessage(regName, entry.getName());
@@ -320,7 +320,7 @@
// the entry is physically removed, remove the dangling reference
registry.removeLocalEntry(entryName);
-
+
if(enableMessaging)
{
Message msg = createMessage(regName, entryName);
@@ -352,7 +352,7 @@
String mapFile = null;
Vector names = new Vector();
int refreshRate = 0;
-
+
// read the configuration keys
try
{
@@ -368,7 +368,7 @@
{
throw new InitializationException("Unable to initialize LateInitCastorRegistryService, missing config keys");
}
-
+
// build the map of default fragments, eahc registry must be associated
// with at least one fragment
try
@@ -485,10 +485,10 @@
protected Map loadDatabaseManagedRegistries(ResourceService serviceConf)
{
Map databaseManaged = new HashMap();
- ResourceService rs = serviceConf.getResources("database.default");
+ ResourceService rs = serviceConf.getResources("database.default");
if (rs != null)
{
- Iterator iterator = rs.getKeys();
+ Iterator iterator = rs.getKeys();
while (iterator.hasNext())
{
String name = (String)iterator.next();
@@ -497,7 +497,7 @@
}
return databaseManaged;
}
-
+
protected Registry createRegistry(String name)
{
Registry registry = null;
@@ -574,7 +574,7 @@
{
DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = dbfactory.newDocumentBuilder();
-
+
Document d = builder.parse(new File(file));
Unmarshaller unmarshaller = new Unmarshaller(this.mapping);
@@ -610,14 +610,14 @@
synchronized(watcher)
{
file = new File(directory, name + extension).getCanonicalPath();
-
+
Unmarshaller unmarshaller = new Unmarshaller(this.mapping);
RegistryFragment fragment = (RegistryFragment) unmarshaller.unmarshal(reader);
-
+
fragment.setChanged(true);
-
+
updateFragment(file, fragment);
-
+
if (persistent)
{
saveFragment(file);
@@ -678,7 +678,7 @@
{
logger.error("Exception", e); // At least log the exception.
}
-
+
try
{
fos.close();
@@ -747,10 +747,10 @@
// recreate the index entries (only this fragment)
- Enumeration enum = fragment.keys();
- while (enum.hasMoreElements())
+ Enumeration enum1 = fragment.keys();
+ while (enum1.hasMoreElements())
{
- String strReg = (String) enum.nextElement();
+ String strReg = (String) enum1.nextElement();
Vector v = fragment.getEntries(strReg);
for (int counter = 0; counter < v.size(); counter++)
@@ -848,7 +848,7 @@
{
if (logger.isDebugEnabled())
{
- logger.debug("RegistryService: Updating entry " + entry.getName()
+ logger.debug("RegistryService: Updating entry " + entry.getName()
+ " of class " + entry.getClass() + " to registry " + name);
}
@@ -867,7 +867,7 @@
if (logger.isDebugEnabled())
{
- logger.debug("RegistryService: Adding entry " + entry.getName() + " of class "
+ logger.debug("RegistryService: Adding entry " + entry.getName() + " of class "
+ entry.getClass() + " to registry " + name);
}
}
@@ -930,7 +930,7 @@
public void saveEntry(String regName, RegistryEntry entry) throws RegistryException
{
addEntry(regName, entry);
-
+
String fragmentName = (String) entryIndex.get(entry.getName());
if (fragmentName == null)
@@ -939,16 +939,16 @@
// in both cases, use the default fragment
fragmentName = (String) defaults.get(regName);
}
-
+
saveFragment(fragmentName);
-
+
if(enableMessaging)
{
Message msg = createMessage(regName, entry.getName());
Messenger.sendMessage(msg, MessagingService.REGISTRY_UPDATE_SUBJECT);
}
}
-
+
protected Message createMessage(String registry, String entryName)
{
ObjectMessage msg = (ObjectMessage) Messenger.createMessage(MessagingService.OBJECT_MESSAGE);
@@ -956,7 +956,7 @@
rm.setAction(RegistryMessage.ACTION_REFRESH);
rm.setRegistry(registry);
rm.setEntryName(entryName);
-
+
try
{
msg.setObject(rm);
@@ -965,7 +965,7 @@
{
logger.error("Failed to add object to message", e);
}
-
+
return msg;
}
@@ -987,7 +987,7 @@
logger.error("Failed to retrieve object from message.");
return;
}
-
+
if((obj != null) && (obj instanceof RegistryMessage))
{
RegistryMessage regMsg = (RegistryMessage)obj;
1.11 +12 -12 jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/ldap/LDAPRoleManagement.java
Index: LDAPRoleManagement.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/ldap/LDAPRoleManagement.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- LDAPRoleManagement.java 19 May 2004 16:01:30 -0000 1.10
+++ LDAPRoleManagement.java 27 Apr 2005 14:08:24 -0000 1.11
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -117,9 +117,9 @@
try
{
- for (Enumeration enum = user.getGroupRoles().elements(); enum.hasMoreElements();)
+ for (Enumeration enum1 = user.getGroupRoles().elements(); enum1.hasMoreElements();)
{
- st = new StringTokenizer((String)enum.nextElement(), ",");
+ st = new StringTokenizer((String)enum1.nextElement(), ",");
LDAPGroup group = new LDAPGroup(st.nextToken(),false);
LDAPRole role = new LDAPRole(st.nextToken(),false);
BaseJetspeedGroupRole groupRole = new BaseJetspeedGroupRole();
@@ -155,9 +155,9 @@
roleurls = JetspeedLDAP.search(JetspeedLDAP.buildURL("ou=roles"),"(objectclass=jetspeedrole)", ATTRS, true);
if (roleurls.size() > 0)
{
- for (Enumeration enum = roleurls.elements(); enum.hasMoreElements() ;)
+ for (Enumeration enum1 = roleurls.elements(); enum1.hasMoreElements() ;)
{
- roles.add(new LDAPRole((LDAPURL) (((Vector)enum.nextElement()).firstElement())));
+ roles.add(new LDAPRole((LDAPURL) (((Vector)enum1.nextElement()).firstElement())));
}
}
else
@@ -333,7 +333,7 @@
{
grantRole(username, roleName, JetspeedSecurity.JETSPEED_GROUP);
}
-
+
public void grantRole(String username, String roleName, String groupName)
throws JetspeedSecurityException
{
@@ -425,7 +425,7 @@
{
return hasRole(username, roleName, JetspeedSecurity.JETSPEED_GROUP);
}
-
+
public boolean hasRole(String username, String roleName, String groupName)
throws JetspeedSecurityException
{
@@ -449,9 +449,9 @@
}
try
{
- for (Enumeration enum = user.getGroupRoles().elements(); enum.hasMoreElements();)
+ for (Enumeration enum1 = user.getGroupRoles().elements(); enum1.hasMoreElements();)
{
- st = new StringTokenizer((String)enum.nextElement(),",");
+ st = new StringTokenizer((String)enum1.nextElement(),",");
String gn = st.nextToken();
String rn = st.nextToken();
if (rn.equalsIgnoreCase(roleName) && gn.equalsIgnoreCase(groupName))
1.7 +10 -10 jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/ldap/LDAPPermissionManagement.java
Index: LDAPPermissionManagement.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/ldap/LDAPPermissionManagement.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- LDAPPermissionManagement.java 23 Feb 2004 03:52:33 -0000 1.6
+++ LDAPPermissionManagement.java 27 Apr 2005 14:08:24 -0000 1.7
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,8 +45,8 @@
* @author <a href="mailto:ender@kilicoglu.nom.tr">Ender KILICOGLU</a>
* @author <a href="mailto:sami.leino@netorek.fi">Sami Leino</a>
*
- * @version $Id$
- *
+ * @version $Id$
+ *
*/
public class LDAPPermissionManagement extends TurbineBaseService
implements PermissionManagement
@@ -104,9 +104,9 @@
if (userurls.size() > 0)
{
role = new LDAPRole((LDAPURL) ((Vector)userurls.elementAt(0)).firstElement());
- for (Enumeration enum= role.getRolePermissions().elements();enum.hasMoreElements();)
+ for (Enumeration enum1= role.getRolePermissions().elements();enum1.hasMoreElements();)
{
- permission = new LDAPPermission((String)enum.nextElement(), false);
+ permission = new LDAPPermission((String)enum1.nextElement(), false);
perms.add(permission);
}
}
@@ -136,7 +136,7 @@
BasicAttributes attr= new BasicAttributes();
Vector permissions = new Vector();
Vector permissionurls;
-
+
try
{
permissionurls = JetspeedLDAP.search(JetspeedLDAP.buildURL("ou=permissions"),
@@ -144,9 +144,9 @@
if (permissionurls.size() > 0)
{
- for (Enumeration enum = permissionurls.elements();enum.hasMoreElements() ;)
+ for (Enumeration enum1 = permissionurls.elements();enum1.hasMoreElements() ;)
{
- permissions.add(new LDAPPermission((LDAPURL) (((Vector)enum.nextElement()).firstElement())));
+ permissions.add(new LDAPPermission((LDAPURL) (((Vector)enum1.nextElement()).firstElement())));
}
}
else
1.9 +10 -10 jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/ldap/LDAPGroupManagement.java
Index: LDAPGroupManagement.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/ldap/LDAPGroupManagement.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- LDAPGroupManagement.java 23 Feb 2004 03:52:33 -0000 1.8
+++ LDAPGroupManagement.java 27 Apr 2005 14:08:24 -0000 1.9
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -104,9 +104,9 @@
try
{
- for (Enumeration enum = user.getGroupRoles().elements() ;enum.hasMoreElements() ;)
+ for (Enumeration enum1 = user.getGroupRoles().elements() ;enum1.hasMoreElements() ;)
{
- st = new StringTokenizer((String)enum.nextElement(),",");
+ st = new StringTokenizer((String)enum1.nextElement(),",");
groups.add(new LDAPGroup(st.nextToken(), false));
}
}
@@ -141,9 +141,9 @@
"(objectclass=jetspeedgroup)", ATTRS, true);
if (groupurls.size() > 0)
{
- for (Enumeration enum = groupurls.elements();enum.hasMoreElements() ;)
+ for (Enumeration enum1 = groupurls.elements();enum1.hasMoreElements() ;)
{
- groups.add(new LDAPGroup((LDAPURL) (((Vector)enum.nextElement()).firstElement())));
+ groups.add(new LDAPGroup((LDAPURL) (((Vector)enum1.nextElement()).firstElement())));
}
}
else
@@ -463,9 +463,9 @@
try
{
- for (Enumeration enum = user.getGroupRoles().elements() ;enum.hasMoreElements() ;)
+ for (Enumeration enum1 = user.getGroupRoles().elements() ;enum1.hasMoreElements() ;)
{
- st = new StringTokenizer((String)enum.nextElement(),",");
+ st = new StringTokenizer((String)enum1.nextElement(),",");
if (st.nextToken().equalsIgnoreCase(groupname))
{
1.9 +17 -17 jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/ContentTemplateLink.java
Index: ContentTemplateLink.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/ContentTemplateLink.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ContentTemplateLink.java 21 Mar 2005 18:21:45 -0000 1.8
+++ ContentTemplateLink.java 27 Apr 2005 14:08:24 -0000 1.9
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,7 @@
extends DynamicURI
implements ApplicationTool
{
-
+
/** the servlet 2.2+ webapp context */
private String contextPath;
@@ -44,7 +44,7 @@
/** decide whether we should output full external URIs or simple
absolute URIs */
private boolean useExternalForm = false;
-
+
/** Empty Constructor for introspection */
public ContentTemplateLink ()
{
@@ -72,17 +72,17 @@
initContextPath(data);
}
- /** Inits the contextPath for this object
+ /** Inits the contextPath for this object
*
- * @param data the RunData to use
+ * @param data the RunData to use
*/
protected void initContextPath(Object data)
{
try
{
Class runDataClass = RunData.class;
- Method meth = runDataClass.getDeclaredMethod("getContextPath", null);
- contextPath = (String)meth.invoke(data, null);
+ Method meth = runDataClass.getDeclaredMethod("getContextPath", (Class[])null);
+ contextPath = (String)meth.invoke(data, (Object[])null);
}
catch (Exception e)
{
@@ -116,7 +116,7 @@
}
/**
- * Specify the link should be expressed in external form (ie
+ * Specify the link should be expressed in external form (ie
* with protocol, server name and server port)
* @return a self reference for easy link construction in templates
*/
@@ -124,9 +124,9 @@
this.useExternalForm = true;
return this;
}
-
+
/**
- * Specify the link should be expressed in absolute form (ie
+ * Specify the link should be expressed in absolute form (ie
* only a URI and not a full URL)
* @return a self reference for easy link construction in templates
*/
@@ -134,7 +134,7 @@
this.useExternalForm = false;
return this;
}
-
+
/**
* Specify the webapp resource to link to.
*
@@ -149,14 +149,14 @@
}
/**
- * Returns the URI. After rendering the URI, it clears the
+ * Returns the URI. After rendering the URI, it clears the
* pathInfo and QueryString portions of the DynamicURI.
*
* @return A String with the URI in either external or absolute form
*/
public String toString()
{
-
+
StringBuffer sb = new StringBuffer();
// we want external URL form so include protocol and server name
@@ -183,7 +183,7 @@
removePathInfo();
removeQueryData();
this.pathToContent=null;
-
+
return (sb.toString());
}
1.9 +19 -19 jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/ldap/LDAPUser.java
Index: LDAPUser.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/ldap/LDAPUser.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- LDAPUser.java 14 May 2004 00:20:28 -0000 1.8
+++ LDAPUser.java 27 Apr 2005 14:08:24 -0000 1.9
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -47,18 +47,18 @@
*
* @author <a href="mailto:ender@kilicoglu.nom.tr">Ender KILICOGLU</a>
* @author <a href="mailto:sami.leino@netorek.fi">Sami Leino</a>
- *
- * @version $Id$
- *
+ *
+ * @version $Id$
+ *
*/
-public class LDAPUser extends BaseLDAPObject implements JetspeedUser, HttpSessionBindingListener
+public class LDAPUser extends BaseLDAPObject implements JetspeedUser, HttpSessionBindingListener
{
/**
* Static initialization of the logger for this class
- */
- private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(LDAPUser.class.getName());
-
+ */
+ private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(LDAPUser.class.getName());
+
// ---------------------------- Constants ----------------------------
protected static final String OBJECT_CLASS = "jetspeeduser";
@@ -160,7 +160,7 @@
}
private void fillObject(Attributes attributes)
- {
+ {
tempStorage = new Hashtable(20);
permStorage = new Hashtable(50);
setHasLoggedIn(Boolean.FALSE);
@@ -233,7 +233,7 @@
{
logger.warn("Could not serialize object data!" , e);
}
-
+
if (create)
{
ldapurl = JetspeedLDAP.buildURL("uid=" + (String)getPerm(User.USERNAME) + ",ou=users");
@@ -261,21 +261,21 @@
public void removeGroup(String groupName)
{
- for (Enumeration enum = groupRoles.elements();enum.hasMoreElements();)
+ for (Enumeration enum1 = groupRoles.elements();enum1.hasMoreElements();)
{
- String groupRoleStr = (String)enum.nextElement();
+ String groupRoleStr = (String)enum1.nextElement();
if (groupRoleStr.startsWith(groupName + ","))
{
groupRoles.remove(groupRoleStr);
}
}
}
-
+
public void removeGroupRole(String groupName, String roleName)
{
- for (Enumeration enum = groupRoles.elements(); enum.hasMoreElements();)
+ for (Enumeration enum1 = groupRoles.elements(); enum1.hasMoreElements();)
{
- String groupRoleStr = (String)enum.nextElement();
+ String groupRoleStr = (String)enum1.nextElement();
if (groupRoleStr.equalsIgnoreCase(groupName + "," + roleName))
{
groupRoles.remove(groupRoleStr);
@@ -977,10 +977,10 @@
{
return this.passwordChanged;
}
-
+
/**
* Sets the date of last password change
- *
+ *
* @param value Date
*/
public void setPasswordChanged(Date value)
1.10 +80 -80 jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/ldap/BaseLDAPObject.java
Index: BaseLDAPObject.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/security/ldap/BaseLDAPObject.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- BaseLDAPObject.java 21 Mar 2005 18:21:41 -0000 1.9
+++ BaseLDAPObject.java 27 Apr 2005 14:08:24 -0000 1.10
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -51,9 +51,9 @@
* The Base LDAP Object extending DirContext.
*
* @author <a href="mailto:ender@kilicoglu.nom.tr">Ender Kilicoglu</a>
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
* @author <a href="mailto:sami.leino@netorek.fi">Sami Leino</a>
- *
+ *
* @version $Id$
*/
@@ -62,7 +62,7 @@
// Constants
protected final static String OK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
protected final static String LDAP_DATE_PATTERN = "yyyyMMddmmHHss'Z'";
-
+
// Instance variables
protected LDAPURL ldapurl = null;
protected boolean updated = false;
@@ -74,17 +74,17 @@
/**
* Static initialization of the logger for this class
- */
- private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(BaseLDAPObject.class.getName());
-
+ */
+ private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(BaseLDAPObject.class.getName());
+
/**
* <p>Creates an "LDAP-safe" ID from a String so that
- * the generated ID is as similar as possible to the
- * original value. For example, value "Ryhm\u00e4" ("group"
+ * the generated ID is as similar as possible to the
+ * original value. For example, value "Ryhm\u00e4" ("group"
* in Finnish language) would be converted to "ryhma".
* If the value contains an unknown character, it will
- * be replaced by letter 'X'.</p>
- */
+ * be replaced by letter 'X'.</p>
+ */
public String createId(String value)
{
value = value.replace('\u00e5', 'a');
@@ -93,22 +93,22 @@
value = value.replace('\u00c5', 'A');
value = value.replace('\u00c4', 'A');
value = value.replace('\u00d6', 'O');
- StringBuffer buf = new StringBuffer();
+ StringBuffer buf = new StringBuffer();
for (int i=0; i < value.length(); i++)
{
char currentChar = value.charAt(i);
- if (isOK(currentChar)) buf.append(currentChar);
+ if (isOK(currentChar)) buf.append(currentChar);
else buf.append('X');
}
return buf.toString();
}
-
+
/**
* <p>Checks if the specified character can be used
- * in LDAP attribute name.</p>
- */
+ * in LDAP attribute name.</p>
+ */
public boolean isOK(char value)
{
for (int i=0; i < OK.length(); i++)
@@ -121,7 +121,7 @@
/**
* <p>Set's the objectClass for this object.</p>
- *
+ *
*/
public void setObjectClass(String name)
{
@@ -132,7 +132,7 @@
/**
* <p>Set's multiple objectClasses for this object.</p>
- *
+ *
*/
public void setObjectClasses(String[] names)
{
@@ -160,7 +160,7 @@
{
return parseDate(value, true);
}
-
+
protected Date parseDate(String value, boolean initializeIfNotSet)
{
try
@@ -289,11 +289,11 @@
updated = true;
return;
}
-
+
Attribute attr = new BasicAttribute(field);
- for(Enumeration enum = values.elements(); enum.hasMoreElements();)
+ for(Enumeration enum1 = values.elements(); enum1.hasMoreElements();)
{
- String nextValue = (String)enum.nextElement();
+ String nextValue = (String)enum1.nextElement();
attr.add(nextValue);
}
@@ -364,9 +364,9 @@
{
try
{
- for(NamingEnumeration enum = attrs.get(field).getAll(); enum.hasMore(); )
+ for(NamingEnumeration enum1 = attrs.get(field).getAll(); enum1.hasMore(); )
{
- temp = (String)enum.nextElement();
+ temp = (String)enum1.nextElement();
if (null != temp)
{
@@ -383,7 +383,7 @@
return values;
}
- public Attributes getAttributes(String name) throws NamingException
+ public Attributes getAttributes(String name) throws NamingException
{
if (! name.equals(""))
{
@@ -431,151 +431,151 @@
// not used for this example
- public Object lookup(Name name) throws NamingException
- {
+ public Object lookup(Name name) throws NamingException
+ {
throw new OperationNotSupportedException();
}
- public String getNameInNamespace() throws NamingException
+ public String getNameInNamespace() throws NamingException
{
throw new OperationNotSupportedException();
}
- public Object lookup(String name) throws NamingException
+ public Object lookup(String name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public void bind(Name name, Object obj) throws NamingException
+ public void bind(Name name, Object obj) throws NamingException
{
throw new OperationNotSupportedException();
}
- public void bind(String name, Object obj) throws NamingException
+ public void bind(String name, Object obj) throws NamingException
{
throw new OperationNotSupportedException();
}
- public void rebind(Name name, Object obj) throws NamingException
+ public void rebind(Name name, Object obj) throws NamingException
{
throw new OperationNotSupportedException();
}
- public void rebind(String name, Object obj) throws NamingException
+ public void rebind(String name, Object obj) throws NamingException
{
throw new OperationNotSupportedException();
}
- public void unbind(Name name) throws NamingException
+ public void unbind(Name name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public void unbind(String name) throws NamingException
+ public void unbind(String name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public void rename(Name oldName, Name newName) throws NamingException
+ public void rename(Name oldName, Name newName) throws NamingException
{
throw new OperationNotSupportedException();
}
- public void rename(String oldName, String newName) throws NamingException
+ public void rename(String oldName, String newName) throws NamingException
{
throw new OperationNotSupportedException();
}
- public NamingEnumeration list(Name name) throws NamingException
+ public NamingEnumeration list(Name name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public NamingEnumeration list(String name) throws NamingException
+ public NamingEnumeration list(String name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public NamingEnumeration listBindings(Name name) throws NamingException
+ public NamingEnumeration listBindings(Name name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public NamingEnumeration listBindings(String name) throws NamingException
+ public NamingEnumeration listBindings(String name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public void destroySubcontext(Name name) throws NamingException
+ public void destroySubcontext(Name name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public void destroySubcontext(String name) throws NamingException
+ public void destroySubcontext(String name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public Context createSubcontext(Name name) throws NamingException
+ public Context createSubcontext(Name name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public Context createSubcontext(String name) throws NamingException
+ public Context createSubcontext(String name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public Object lookupLink(Name name) throws NamingException
+ public Object lookupLink(Name name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public Object lookupLink(String name) throws NamingException
+ public Object lookupLink(String name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public NameParser getNameParser(Name name) throws NamingException
+ public NameParser getNameParser(Name name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public NameParser getNameParser(String name) throws NamingException
+ public NameParser getNameParser(String name) throws NamingException
{
throw new OperationNotSupportedException();
}
public String composeName(String name, String prefix)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public Name composeName(Name name, Name prefix)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public Object addToEnvironment(String propName, Object propVal)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public Object removeFromEnvironment(String propName)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
- public Hashtable getEnvironment() throws NamingException
+ public Hashtable getEnvironment() throws NamingException
{
throw new OperationNotSupportedException();
}
- public void close() throws NamingException
+ public void close() throws NamingException
{
throw new OperationNotSupportedException();
}
@@ -583,83 +583,83 @@
// -- DirContext
public void modifyAttributes(Name name, int mod_op, Attributes attrs)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public void modifyAttributes(String name, int mod_op, Attributes attrs)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public void modifyAttributes(Name name, ModificationItem[] mods)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public void modifyAttributes(String name, ModificationItem[] mods)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public void bind(Name name, Object obj, Attributes attrs)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public void bind(String name, Object obj, Attributes attrs)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public void rebind(Name name, Object obj, Attributes attrs)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public void rebind(String name, Object obj, Attributes attrs)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public DirContext createSubcontext(Name name, Attributes attrs)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public DirContext createSubcontext(String name, Attributes attrs)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
- public DirContext getSchema(Name name) throws NamingException
+ public DirContext getSchema(Name name) throws NamingException
{
throw new OperationNotSupportedException();
}
- public DirContext getSchema(String name) throws NamingException
+ public DirContext getSchema(String name) throws NamingException
{
throw new OperationNotSupportedException();
}
public DirContext getSchemaClassDefinition(Name name)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public DirContext getSchemaClassDefinition(String name)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
@@ -667,7 +667,7 @@
public NamingEnumeration search(Name name,
Attributes matchingAttributes,
String[] attributesToReturn)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
@@ -675,28 +675,28 @@
public NamingEnumeration search(String name,
Attributes matchingAttributes,
String[] attributesToReturn)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public NamingEnumeration search(Name name,
Attributes matchingAttributes)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public NamingEnumeration search(String name,
Attributes matchingAttributes)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
public NamingEnumeration search(Name name,
String filter,
SearchControls cons)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
@@ -704,7 +704,7 @@
public NamingEnumeration search(String name,
String filter,
SearchControls cons)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
@@ -713,7 +713,7 @@
String filterExpr,
Object[] filterArgs,
SearchControls cons)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
@@ -722,7 +722,7 @@
String filterExpr,
Object[] filterArgs,
SearchControls cons)
- throws NamingException
+ throws NamingException
{
throw new OperationNotSupportedException();
}
1.9 +7 -7 jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry/base/BaseRegistry.java
Index: BaseRegistry.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry/base/BaseRegistry.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- BaseRegistry.java 21 Mar 2005 18:21:37 -0000 1.8
+++ BaseRegistry.java 27 Apr 2005 14:08:24 -0000 1.9
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -157,12 +157,12 @@
public RegistryEntry[] toArray()
{
- Enumeration enum = getEntries();
+ Enumeration enum1 = getEntries();
Vector v = new Vector();
- while( enum.hasMoreElements() )
+ while( enum1.hasMoreElements() )
{
- v.addElement( enum.nextElement() );
+ v.addElement( enum1.nextElement() );
}
RegistryEntry[] entries = new RegistryEntry[ v.size() ];
1.4 +9 -9 jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry/base/PortletIterator.java
Index: PortletIterator.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/registry/base/PortletIterator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PortletIterator.java 23 Feb 2004 03:08:26 -0000 1.3
+++ PortletIterator.java 27 Apr 2005 14:08:24 -0000 1.4
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,8 +28,8 @@
/**
* PortletIterator - seamless iterator over nested vectors of portlet collections
- *
- *
+ *
+ *
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
* @version $Id$
*/
@@ -38,7 +38,7 @@
protected BasePortletEntry entry;
protected String method;
protected Vector vector ;
- protected int index = 0;
+ protected int index = 0;
public PortletIterator(BasePortletEntry entry, String method)
{
@@ -84,7 +84,7 @@
return null;
BasePortletEntry parent = null;
- parent = (BasePortletEntry)Registry.getEntry( Registry.PORTLET, entry.getParent() );
+ parent = (BasePortletEntry)Registry.getEntry( Registry.PORTLET, entry.getParent() );
return parent;
}
@@ -99,7 +99,7 @@
{
try
{
- this.vector = (Vector)this.entry.getClass().getMethod(this.method, null).invoke(this.entry, null);
+ this.vector = (Vector)this.entry.getClass().getMethod(this.method, (Class[])null).invoke(this.entry, (Object[])null);
}
catch (Exception e)
{
1.7 +28 -28 jakarta-jetspeed/src/java/org/apache/jetspeed/util/parser/ValidationParameterParser.java
Index: ValidationParameterParser.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/parser/ValidationParameterParser.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ValidationParameterParser.java 23 Feb 2004 03:18:08 -0000 1.6
+++ ValidationParameterParser.java 27 Apr 2005 14:08:24 -0000 1.7
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,11 +32,11 @@
import org.apache.jetspeed.util.ValidationHelper;
/**
- * A Turbine parameter parser with Validation built in.
+ * A Turbine parameter parser with Validation built in.
* Validates any bean with methods that begin with validate[AttributeName].
* Works with Torque-generated beans.
* To use this class, override the TurbineResources.properties:
- *
+ *
* services.RunDataService.default.parameter.parser=org.apache.turbine.util.parser.DefaultParameterParser
*
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
@@ -47,9 +47,9 @@
implements ParameterParser,
Recyclable
{
-
+
public ValidationParameterParser()
- {
+ {
super();
}
@@ -94,26 +94,26 @@
valid = false;
}
setMyProperty(bean, props[i]);
-
+
}
}
-
+
// call the general validation for the entire business object
String msg = generalValidation(bean);
if (msg != null)
{
invalidFieldMessages.append(msg);
- invalidFieldMessages.append(", ");
+ invalidFieldMessages.append(", ");
valid = false;
}
-
- //System.out.println("invalidFieldMessages ["+invalidFieldMessages+"]");
+
+ //System.out.println("invalidFieldMessages ["+invalidFieldMessages+"]");
if (!valid)
{
//int lastComma = invalidFieldMessages.lastIndexOf(", ");
int lastComma = new String(invalidFieldMessages).lastIndexOf(", ");
String result = invalidFieldMessages.substring(0,lastComma);
- // System.err.println("Had a validation problem and am throwing: "+invalidFieldMessages);
+ // System.err.println("Had a validation problem and am throwing: "+invalidFieldMessages);
throw new ValidationException(result);
}
}
@@ -156,14 +156,14 @@
System.out.println("Validation: EXCEPTION (prop): " + prop.getName());
}
}
-
+
protected Object[] getArguments(PropertyDescriptor prop)
throws Exception
{
Class propclass = prop.getPropertyType();
Object[] args = { null };
-
+
if (propclass == String.class)
{
args[0] = getString(prop.getName());
@@ -175,7 +175,7 @@
else if (propclass == Short.class || propclass == Short.TYPE)
{
args[0] = new Short((short)(getInteger(prop.getName()).intValue()));
- }
+ }
else if (propclass == Long.class || propclass == Long.TYPE)
{
args[0] = new Long(getLong(prop.getName()));
@@ -221,8 +221,8 @@
args[0] = getStringKey(prop.getName());
}
else
- {
- //throw new Exception("property " + prop.getName() + " is of unsupported type " + propclass.toString());
+ {
+ //throw new Exception("property " + prop.getName() + " is of unsupported type " + propclass.toString());
}
return args;
}
@@ -234,13 +234,13 @@
* @param bean The bean to be validated.
* @param prop The bean's property descriptor
* @return true if validation was successful, false if validation failed
- **/
+ **/
protected boolean validateProperty(Object bean,
PropertyDescriptor prop)
throws Exception
{
String propertyName = prop.getName();
- String methodName = "validate" +
+ String methodName = "validate" +
Character.toUpperCase(propertyName.charAt(0)) +
propertyName.substring(1);
@@ -276,7 +276,7 @@
{
Class propclass = prop.getPropertyType();
Object[] args = { null };
-
+
if (propclass == String.class)
{
return ValidationHelper.isAlphaNumeric(getString(prop.getName()), false);
@@ -288,7 +288,7 @@
else if (propclass == Short.class || propclass == Short.TYPE)
{
return ValidationHelper.isInteger(getString(prop.getName()), false);
- }
+ }
else if (propclass == Long.class || propclass == Long.TYPE)
{
return ValidationHelper.isDecimal(getString(prop.getName()), false);
@@ -344,7 +344,7 @@
+ propclass.toString());
*/
}
- return false;
+ return false;
}
/**
@@ -353,15 +353,15 @@
* @param bean The bean to be validated.
* @param prop The bean's property descriptor
* @return null if validation was successful, an error message if validation failed
- **/
+ **/
protected String generalValidation(Object bean)
throws Exception
{
- String methodName = "validate";
+ String methodName = "validate";
try
{
- Method method = bean.getClass().getMethod(methodName, null);
- String msg = (String)method.invoke(bean, null);
+ Method method = bean.getClass().getMethod(methodName, (Class[])null);
+ String msg = (String)method.invoke(bean, (Object[])null);
return msg;
}
catch (NoSuchMethodException nsm_e)
1.17 +22 -22 jakarta-jetspeed/src/java/org/apache/jetspeed/daemon/impl/util/diskcachedaemon/URLRefresher.java
Index: URLRefresher.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/daemon/impl/util/diskcachedaemon/URLRefresher.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- URLRefresher.java 23 Feb 2004 02:47:00 -0000 1.16
+++ URLRefresher.java 27 Apr 2005 14:08:24 -0000 1.17
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,49 +39,49 @@
public class URLRefresher implements Runnable {
private String url = null;
-
+
/**
* Static initialization of the logger for this class
*/
private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(URLRefresher.class.getName());
-
+
/**
default constructor
*/
public URLRefresher( String url ) {
-
+
this.url = url;
-
+
}
-
+
/**
Used within the ThreadPool... IE Runnable interface.
*/
public void run() {
-
+
try {
- //only update this if the URL on which it is based is newer
+ //only update this if the URL on which it is based is newer
//than the one on disk.
if(URLFetcher.refresh(url)) {
//now make sure that the entry that depends on this HREF
//is updated in the PortletFactory.
-
-
+
+
//create a Runnable for updating this Portlet in the cache.
-
- Enumeration enum = Registry.get(Registry.PORTLET).getEntries();
-
- while( enum.hasMoreElements() ) {
- PortletEntry entry = (PortletEntry)enum.nextElement();
-
+
+ Enumeration enum1 = Registry.get(Registry.PORTLET).getEntries();
+
+ while( enum1.hasMoreElements() ) {
+ PortletEntry entry = (PortletEntry)enum1.nextElement();
+
if ( (entry.getURL()!= null) && entry.getURL().equals(url) )
{
try
{
PortletRefresher pr = new PortletRefresher( entry );
-
- //now put this Instantiator in the ThreadPool so that
+
+ //now put this Instantiator in the ThreadPool so that
//it can execute.
//SGP Trying to intersperse CPU intensive tasks with
// network intensive tasks
@@ -91,7 +91,7 @@
catch (Throwable t)
{
//FIXME: Put it in the bad URL list
- logger.info( "DiskCacheDaemon: Error refreshing: " + url );
+ logger.info( "DiskCacheDaemon: Error refreshing: " + url );
}
}
}
1.7 +10 -10 jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/MarkRefPage.java
Index: MarkRefPage.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/MarkRefPage.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- MarkRefPage.java 23 Feb 2004 02:59:06 -0000 1.6
+++ MarkRefPage.java 27 Apr 2005 14:08:24 -0000 1.7
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
*/
package org.apache.jetspeed.modules.actions;
-
+
// Java Core Classes
import java.util.Enumeration;
@@ -28,18 +28,18 @@
/**
* Marks the referer page to enable buttons as "back"
- *
+ *
* @author <A HREF="shesmer@raleigh.ibm.com">Stephan Hesmer</A>
*/
public class MarkRefPage extends Action
{
public void doPerform( RunData data ) throws Exception
{
- Enumeration enum = data.getRequest().getHeaderNames();
- while (enum.hasMoreElements()) {
- String name = (String)enum.nextElement();
- if ("referer".equalsIgnoreCase(name)) {
- // check name case insensitive, because getHeader checks case-sensitive,
+ Enumeration enum1 = data.getRequest().getHeaderNames();
+ while (enum1.hasMoreElements()) {
+ String name = (String)enum1.nextElement();
+ if ("referer".equalsIgnoreCase(name)) {
+ // check name case insensitive, because getHeader checks case-sensitive,
// though it is defined as case-insensitive in the servlet specification
String uri = data.getRequest().getHeader(name);
if (uri!=null) {
1.7 +23 -23 jakarta-jetspeed/src/java/org/apache/jetspeed/services/ldap/LDAPService.java
Index: LDAPService.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/ldap/LDAPService.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- LDAPService.java 23 Feb 2004 03:28:31 -0000 1.6
+++ LDAPService.java 27 Apr 2005 14:08:24 -0000 1.7
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -54,16 +54,16 @@
* @author <a href="mailto:ender@kilicoglu.nom.tr">Ender KILICOGLU</a>
* @author <a href="mailto:sami.leino@netorek.fi">Sami Leino</a>
*
- * @version $Id$
- *
+ * @version $Id$
+ *
*/
public class LDAPService extends TurbineBaseService
{
/**
* Static initialization of the logger for this class
- */
+ */
private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(LDAPService.class.getName());
-
+
public static String SERVICE_NAME = "ldap";
private static final String DEFAULT_ATTR[] = {
"objectclass"
@@ -110,7 +110,7 @@
* Make first connection and store it in connections.
*
* @param url <code>LDAPURL</code> which locate server to connect.
- * @return boolean true if success else false.
+ * @return boolean true if success else false.
*/
private boolean mainConnect(LDAPURL url)
{
@@ -158,7 +158,7 @@
// System.out.println("LDAPService: creating new context for base " + base);
// System.out.println("LDAPService: DN is " + url.getDN());
}
-
+
setDefaultEnv();
env.put("java.naming.provider.url", base);
do
@@ -281,11 +281,11 @@
// System.out.println("LDAPService: disconnect() called.");
DirContext ctx = null;
- for(Enumeration enum = connections.elements(); enum.hasMoreElements();)
+ for(Enumeration enum1 = connections.elements(); enum1.hasMoreElements();)
{
try
{
- ctx = (DirContext)enum.nextElement();
+ ctx = (DirContext)enum1.nextElement();
ctx.close();
}
catch(NamingException e)
@@ -293,7 +293,7 @@
logger.error("LDAP Service: Disconnect failed", e);
}
}
-
+
connections.clear();
return true;
}
@@ -542,7 +542,7 @@
{
DirContext ctx = connect(url);
if(ctx == null) return null;
-
+
Attributes attrs = null;
try
{
@@ -747,7 +747,7 @@
{
DirContext ctx = connect(url);
if(ctx == null) return null;
-
+
Name name = parse(url.getDN());
String base = name.getPrefix(name.size() - 1).toString();
String dn = url.getDN();
@@ -781,12 +781,12 @@
return null;
}
}
-
+
checkAndCloseContext(ctx);
return null;
}
-
+
/**
* Delete Tree Function
*
@@ -915,7 +915,7 @@
Attributes ats = read(fromUrl);
if(ats == null) return false;
-
+
String srcDN = fromUrl.getDN();
String dstDN = toUrl.getDN();
boolean createdBase = false;
@@ -1053,7 +1053,7 @@
}
return true;
}
-
+
/**
* Update Entry Function
*
@@ -1137,7 +1137,7 @@
System.out.println("===== LDAPService: " + attribs);
System.out.println("===== LDAPService: " + subTreeScope);
*/
-
+
Vector results = new Vector();
String attrs[] = new String[attribs.length + 1];
attrs[0] = "objectclass";
@@ -1164,7 +1164,7 @@
{
DirContext ctx = connect(url);
if(ctx == null) return false;
-
+
String entryDN = null;
Attributes at = null;
Attribute a = null;
@@ -1211,7 +1211,7 @@
subscope = scope != 1 ? scope : 0;
boolean error = subSearch(myurl, filter, attribs, subscope, rs);
if(!error) return error;
-
+
moreReferrals = e.skipReferral();
try
{
@@ -1227,7 +1227,7 @@
return false;
}
}
-
+
checkAndCloseContext(ctx);
return true;
}
@@ -1253,7 +1253,7 @@
return attrvalue;
}
}
-
+
/**
* Return full DN Function
*
1.7 +38 -38 jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/RedirectPortlet.java
Index: RedirectPortlet.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/RedirectPortlet.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- RedirectPortlet.java 29 Aug 2004 22:35:23 -0000 1.6
+++ RedirectPortlet.java 27 Apr 2005 14:08:24 -0000 1.7
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,21 +35,21 @@
import org.apache.turbine.util.RunData;
/**
- * RedirectPortlet can be used for menu options that redirect directly
+ * RedirectPortlet can be used for menu options that redirect directly
* to a URL outside of the portal.
*
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
* @version $Id$
*/
public class RedirectPortlet extends AbstractInstancePortlet
-{
- private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(RedirectPortlet.class.getName());
-
+{
+ private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(RedirectPortlet.class.getName());
+
public ConcreteElement getContent(RunData rundata)
{
- String menuLevel = this.getPortletConfig().getInitParameter("menuLevel");
- int menus = 1;
- try
+ String menuLevel = this.getPortletConfig().getInitParameter("menuLevel");
+ int menus = 1;
+ try
{
if (menuLevel != null)
{
@@ -60,7 +60,7 @@
{
logger.error("failed to parse menu level from Redirect Portlet");
}
-
+
// clear the pane ids of all parents so we don't get lock out the portal on return by recursive redirection
PortletSet set = this.getPortletConfig().getPortletSet();
int count = 0;
@@ -70,7 +70,7 @@
set = set.getPortletConfig().getPortletSet();
count++;
}
-
+
String url = this.getPortletConfig().getInitParameter("url");
url = createDynamicUrl((JetspeedRunData)rundata, url);
// rundata.setRedirectURI(url);
@@ -89,15 +89,15 @@
logger.error(message, e);
return new JetspeedClearElement(message);
}
- return new JetspeedClearElement(url);
+ return new JetspeedClearElement(url);
}
-
+
private void clearState(RunData rundata, PortletSet set)
{
SessionState state = ((JetspeedRunData)rundata).getPortletSessionState(set.getID());
state.setAttribute(JetspeedResources.PATH_PANEID_KEY, null);
}
-
+
private String createDynamicUrl(JetspeedRunData rundata, String url)
{
String parameterNames = PortletConfigState.getParameter(this, rundata, "parameterNames", null);
@@ -106,10 +106,10 @@
{
return url;
}
-
+
String[] names = StringUtils.stringToArray(parameterNames, ",");
String[] attribNames = StringUtils.stringToArray(sessionAttributeNames, ",");
-
+
if (names == null || attribNames == null)
{
return url;
@@ -131,7 +131,7 @@
}
if (appended == 0)
{
- dynamic.append("?");
+ dynamic.append("?");
}
else
{
@@ -144,12 +144,12 @@
}
return dynamic.toString();
}
-
+
/**
* First we look in the request for it, if not found look in the session.
* If it contains a '.' & an object is found in the one of the scopes, then
* we try and call the getter method for the field defined after the '.'.
- *
+ *
* @param rundata
* @param attributeName
* @return String The value
@@ -157,9 +157,9 @@
private String lookup(JetspeedRunData rundata,String attributeName)
{
String value = null;
-
+
Object o = lookupAttribute(rundata, attributeName);
-
+
//now see if there is a property defined in the attributeName
if(o == null)
{
@@ -168,14 +168,14 @@
{
String name = attributeName.substring(0, index);
String property = attributeName.substring(index + 1);
-
+
o = lookupAttribute(rundata, name, property);
-
+
if (o instanceof String)
{
value = (String)o;
}
-
+
} //end if attributeName contains period
}
else if (o instanceof String)
@@ -184,7 +184,7 @@
}
return value;
}
-
+
private Object lookupAttribute(JetspeedRunData rundata, String name)
{
Object o = rundata.getRequest().getAttribute(name);
@@ -192,24 +192,24 @@
{
o = rundata.getSession().getAttribute(name);
}
-
- return o;
+
+ return o;
}
-
+
private Object lookupAttribute(JetspeedRunData rundata, String name, String property)
{
Object o = lookupAttribute(rundata, name);
- Object returnObject = null;
+ Object returnObject = null;
if(o != null)
{
//invoke the getter method for the property
- String getterName = "get" + property.substring(0,1).toUpperCase() +
- property.substring(1);
- try
- {
- Method getter = o.getClass().getMethod(getterName,null);
-
- returnObject = getter.invoke(o,null);
+ String getterName = "get" + property.substring(0,1).toUpperCase() +
+ property.substring(1);
+ try
+ {
+ Method getter = o.getClass().getMethod(getterName,(Class[])null);
+
+ returnObject = getter.invoke(o,(Object[])null);
}
catch(Exception e)
{
1.19 +18 -18 jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/admin/JavaRuntimePortlet.java
Index: JavaRuntimePortlet.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/admin/JavaRuntimePortlet.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- JavaRuntimePortlet.java 23 Feb 2004 03:26:19 -0000 1.18
+++ JavaRuntimePortlet.java 27 Apr 2005 14:08:24 -0000 1.19
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,16 +39,16 @@
Handles enumerating Portlets that are also applications
@author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
-@version $Id$
+@version $Id$
*/
-public class JavaRuntimePortlet extends AbstractPortlet
+public class JavaRuntimePortlet extends AbstractPortlet
{
/**
* Static initialization of the logger for this class
- */
+ */
private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(JavaRuntimePortlet.class.getName());
-
+
public ConcreteElement getContent( RunData rundata ) {
Table table = new Table().setWidth("100%");
@@ -56,21 +56,21 @@
try {
//get Runtime status
Runtime jvm = Runtime.getRuntime();
-
+
table.addElement( new TR()
.addElement( new TD("Free Memory (in bytes)") )
.addElement( new TD( Long.toString( jvm.freeMemory() ) ) ) );
-
+
table.addElement( new TR()
.addElement( new TD("Total Memory (in bytes)") )
.addElement( new TD( Long.toString( jvm.totalMemory() ) ) ) );
//get the system properties (It can throw a SecurityException)
Properties props = System.getProperties();
-
- Enumeration enum = props.propertyNames();
- while( enum.hasMoreElements() ) {
- Object key = enum.nextElement();
+
+ Enumeration enum1 = props.propertyNames();
+ while( enum1.hasMoreElements() ) {
+ Object key = enum1.nextElement();
if ( ! ( key instanceof String ) ) {
continue;
}
@@ -79,7 +79,7 @@
table.addElement( new TR()
.addElement( new TD( key.toString() ) )
.addElement( new TD( value.toString() ) ) );
-
+
}
} catch (Throwable t) {
logger.error("Throwable", t);
@@ -90,10 +90,10 @@
return table;
}
-
+
/**
@author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
- @version $Id$
+ @version $Id$
*/
public void init() throws PortletException {
@@ -109,6 +109,6 @@
public boolean getAllowMaximize(RunData rundata) {
return false;
}
-
-
+
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org