Here is a patch that fixes a couple of issues with the portlet customizer.
Issues:
1) Portlet loses type if it's information is updated
2) Added checks to code to make sure data is not empty before updating a
field
3) Fixed minor HTML issues
Jeremy
Index: PortletUpdateAction.java
===================================================================
RCS file:
/home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/PortletUpdateAction.java,v
retrieving revision 1.1
diff -u -r1.1 PortletUpdateAction.java
--- PortletUpdateAction.java 4 Mar 2003 17:39:41 -0000 1.1
+++ PortletUpdateAction.java 11 Mar 2003 04:10:51 -0000
@@ -226,21 +226,25 @@
//need to build media index before add media
portletEntry.listMediaTypes();
portletEntry.addMediaType(mediaType);
- portletEntry.setClassname(className);
+
+ if (className != null && className.length() > 0)
+ {
+ portletEntry.setClassname(className);
+ }
portletEntry.setApplication(isApplication);
portletEntry.setCachedOnURL(isCachedOnURL);
portletEntry.setHidden(isHidden);
//portletEntry.
- if (newSecurityParent != null)
+ if (newSecurityParent != null && newSecurityParent.length() > 0)
{
SecurityReference securityRef = new BaseSecurityReference();
securityRef.setParent(newSecurityParent);
portletEntry.setSecurityRef(securityRef);
}
- if (newSecurityRole != null)
+ if (newSecurityRole != null && newSecurityRole.length() > 0)
{
BaseSecurity securityRole = new BaseSecurity();
securityRole.setRole(newSecurityRole);
Index: portlet-info-form.vm
===================================================================
RCS file:
/home/cvspublic/jakarta-jetspeed/webapp/WEB-INF/templates/vm/portlets/html/portlet-info-form.vm,v
retrieving revision 1.1
diff -u -r1.1 portlet-info-form.vm
--- portlet-info-form.vm 4 Mar 2003 17:39:42 -0000 1.1
+++ portlet-info-form.vm 11 Mar 2003 04:11:39 -0000
@@ -15,23 +15,9 @@
#formReadOnlyCell ("Parent" "parent" "$!entryParent")
<!--<input type="hidden" name="parent" value="$!entry.parent"/>-->
</tr>
- <!--
<tr>
- <td bgcolor="$!{skin.TitleBackgroundColor}">
- <b><font face="$ui.sansSerifFonts">Parent</font></b>
- </td>
- <td bgcolor="$!{skin.TitleBackgroundColor}">
- <font face="$ui.sansSerifFonts">
- #set($portletTypes = ["abstract", "ref", "instance"])
- <select name="portlet_type">
- #foreach($portletType in $portletTypes)
- <option value="$portletType" #if($!entry.type == $portletType)
selected="true" #end>$portletType</option>
- #end
- </select>
- </font>
- </td>
+ #formReadOnlyCell("Type" "portlet_type" "$!entry.type")
</tr>
- -->
<tr>
<td bgcolor="$!{skin.TitleBackgroundColor}">
<b><font face="$ui.sansSerifFonts">Class Name</font></b>
@@ -107,7 +93,7 @@
</td>
<td bgcolor="$!{skin.TitleBackgroundColor}">
<font face="$ui.sansSerifFonts">
- <select name="security_ref">
+ <select name="security_role">
<option value="">None</option>
#foreach($role in $roles)
<option value="$role.name" #if($role.name ==
$entry.getSecurity().role) selected="true" #end>$role.name</option>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]