jford 2003/11/21 19:54:13
Modified: src/java/org/apache/jetspeed/modules/actions/portlets
ControllerUpdateAction.java
Log:
Added ability to add/remove media types for controllers
PR: Bugzilla# 24653
Revision Changes Path
1.3 +20 -11
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/ControllerUpdateAction.java
Index: ControllerUpdateAction.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/ControllerUpdateAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ControllerUpdateAction.java 23 Jul 2003 19:50:12 -0000 1.2
+++ ControllerUpdateAction.java 22 Nov 2003 03:54:13 -0000 1.3
@@ -54,6 +54,7 @@
package org.apache.jetspeed.modules.actions.portlets;
import org.apache.jetspeed.modules.actions.portlets.security.SecurityConstants;
+import org.apache.jetspeed.om.registry.MediaTypeRegistry;
import org.apache.jetspeed.om.registry.PortletControllerEntry;
import org.apache.jetspeed.om.registry.RegistryEntry;
import org.apache.jetspeed.portal.portlets.VelocityPortlet;
@@ -100,17 +101,25 @@
String mode =
rundata.getParameters().getString(SecurityConstants.PARAM_MODE);
- if (mode != null
- && (mode.equals(SecurityConstants.PARAM_MODE_DELETE)
- || mode.equals(SecurityConstants.PARAM_MODE_UPDATE)))
+ if (mode != null)
{
- String controllerName =
- rundata.getParameters().getString(registryEntryName);
- PortletControllerEntry controllerEntry =
- (PortletControllerEntry) Registry.getEntry(
- registry,
- controllerName);
- context.put("entry", controllerEntry);
+ if(mode.equals(SecurityConstants.PARAM_MODE_DELETE)
+ || mode.equals(SecurityConstants.PARAM_MODE_UPDATE))
+ {
+ String controllerName =
+ rundata.getParameters().getString(registryEntryName);
+ PortletControllerEntry controllerEntry =
+ (PortletControllerEntry) Registry.getEntry(
+ registry,
+ controllerName);
+ context.put("entry", controllerEntry);
+ }
+
+ if(mode.equals(SecurityConstants.PARAM_MODE_UPDATE))
+ {
+ MediaTypeRegistry mediaTypeReg =
(MediaTypeRegistry)Registry.get(Registry.MEDIA_TYPE);
+ context.put("media_types",
iteratorToCollection(mediaTypeReg.listEntryNames()));
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]