The solution is quite easy - you can disable fields in config mode of self-care portlet directly.
But how to disable/hide required fields from the portlet? They are inactive - so administrator can not disable them.
First you have to remove required attributes from store.puma_default.user.add.required.attributes properties.
- Log in to the IBM WebSphere® Integrated Solutions Console (ISC).
- Go to Resources >> Resource Environment >> Resource Environment Providers
- Click on the link for WP PumaStoreService. Under "Additional properties" click on "custom properties"
- Click on the link for "store.puma_default.user.add.required.attributes"
- Delete all from value field
- Save and restart portal :(
- Then go again in to config mode and disable all remaining attributes.
Actualy some fields are disabled because they are required fields in PUMA (user management), and cannot be removed. To hide them, it is easiest way to edit JSP which render self-care form. I added only display: none css for sn attribute part of form.
Edit file
/opt/IBM/WebSphere/wp_profile/installedApps/Node01/PA_Selfcare_Port_App.ear/selfcare.war/WEB-INF/jsp/UserInformationFormInclude.jspf
<tr style="display:none;">
<td align="<%=bidiAlignRight%>">
<% if (requiredUserAttributes.contains(SelfcareConstants.LAST_NAME_FIELD_ID)) { %> * <% } %>
</td>
<td align="<%=bidiAlignLeft%>" class="wpsEditText">
<label for="<%= SelfcareConstants.LAST_NAME_FIELD_ID %>">
<fmt:message key="selfcare.label.last_name"/>
<% if (isRequiredAttr) { %><span style="display:none"><fmt:message key="selfcare.label.required_attr"/></span> <% } %>
</label>
</td>
</tr>
<tr style="display:none;">
<td> </td>
<td>
<input <%=bidiDirAttr%>
class="wpsEditField"
type="text"
id="<%= SelfcareConstants.LAST_NAME_FIELD_ID %>"
name="<%=SelfcareConstants.USER_ATTRIBUTE_PREFIX%><%= SelfcareConstants.LAST_NAME_FIELD_ID %>"
value='<% escapeXmlWriter.write(sn);%>'
onkeyup="javascript:updateDisplayName();return;" >
</td>
<td class="wpsFieldErrorText">
</td>
</tr>
Edit file
/opt/IBM/WebSphere/wp_profile/installedApps/Node01/PA_Selfcare_Port_App.ear/selfcare.war/WEB-INF/jsp/UserInformationFormInclude.jspf
<tr style="display:none;">
<td align="<%=bidiAlignRight%>">
<% if (requiredUserAttributes.contains(SelfcareConstants.LAST_NAME_FIELD_ID)) { %> * <% } %>
</td>
<td align="<%=bidiAlignLeft%>" class="wpsEditText">
<label for="<%= SelfcareConstants.LAST_NAME_FIELD_ID %>">
<fmt:message key="selfcare.label.last_name"/>
<% if (isRequiredAttr) { %><span style="display:none"><fmt:message key="selfcare.label.required_attr"/></span> <% } %>
</label>
</td>
</tr>
<tr style="display:none;">
<td> </td>
<td>
<input <%=bidiDirAttr%>
class="wpsEditField"
type="text"
id="<%= SelfcareConstants.LAST_NAME_FIELD_ID %>"
name="<%=SelfcareConstants.USER_ATTRIBUTE_PREFIX%><%= SelfcareConstants.LAST_NAME_FIELD_ID %>"
value='<% escapeXmlWriter.write(sn);%>'
onkeyup="javascript:updateDisplayName();return;" >
</td>
<td class="wpsFieldErrorText">
</td>
</tr>
Delete temp folder
/opt/IBM/WebSphere/wp_profile/temp/Node01/WebSphere_Portal/PA_Selfcare_Port_App
and reload page with self-care portlet
/opt/IBM/WebSphere/wp_profile/temp/Node01/WebSphere_Portal/PA_Selfcare_Port_App
and reload page with self-care portlet
No comments:
Post a Comment