JBoss Portal SVN: r9158 - in branches/JBoss_Portal_Branch_2_6: core-admin/src/main/org/jboss/portal/core/admin/ui/actions and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-28 04:04:28 -0500 (Wed, 28 Nov 2007)
New Revision: 9158
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
Log:
JBPORTAL-1805 Let a user define multiple display-name for a portal object in the admin portlet
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-11-28 08:53:11 UTC (rev 9157)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-11-28 09:04:28 UTC (rev 9158)
@@ -159,10 +159,7 @@
throw new IllegalArgumentException("No null display name accepted");
}
- if (displayNames == null)
- {
- displayNames = new HashMap();
- }
+ displayNames = new HashMap();
Map map = displayName.getValues();
Iterator it = map.values().iterator();
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java 2007-11-28 08:53:11 UTC (rev 9157)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java 2007-11-28 09:04:28 UTC (rev 9158)
@@ -60,14 +60,25 @@
if (newText != null)
{
- getSelectedObject();
+ PortalObject portalObject = getSelectedObject();
Locale locale = LocaleFormat.DEFAULT.getLocale(newLocale);
- Map map = new HashMap();
- LocalizedString.Value lsv = new LocalizedString.Value(locale, newText);
- map.put(locale, lsv.getString());
+ LocalizedString displayName = portalObject.getDisplayName();
+ Map<Locale, String> map = new HashMap<Locale, String>();
+ if (displayName != null)
+ {
+ Map<Locale, LocalizedString.Value> oldMap = displayName.getValues();
+ Collection<LocalizedString.Value> values = oldMap.values();
+ for (LocalizedString.Value value : values)
+ {
+ map.put(value.getLocale(), value.getString());
+ }
+ }
+ map.put(locale, newText);
LocalizedString newLocalizedString = new LocalizedString(map, Locale.ENGLISH);
selectedObject.setDisplayName(newLocalizedString);
- }else{
+ }
+ else
+ {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "You must enter a name", "You must enter a name");
FacesContext.getCurrentInstance().addMessage("status", message);
}
16 years, 7 months
JBoss Portal SVN: r9157 - in branches/JBoss_Portal_Branch_2_6/widget/src: main/org/jboss/portal/widget/netvibes/provider and 2 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-28 03:53:11 -0500 (Wed, 28 Nov 2007)
New Revision: 9157
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQuery.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQuery.java
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp
Log:
- proper query term encoding
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQuery.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQuery.java 2007-11-28 08:40:39 UTC (rev 9156)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQuery.java 2007-11-28 08:53:11 UTC (rev 9157)
@@ -26,6 +26,7 @@
import java.net.URL;
import java.util.Locale;
+import org.jboss.portal.common.text.FastURLEncoder;
import org.jboss.portal.widget.WidgetQuery;
/**
@@ -153,7 +154,7 @@
}
if (q != null)
{
- buffer.append("&q=").append(q);
+ buffer.append("&q=").append( FastURLEncoder.getUTF8Instance().encode(q) );
}
if (locale != null && locale.getLanguage().length() > 0)
{
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQuery.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQuery.java 2007-11-28 08:40:39 UTC (rev 9156)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQuery.java 2007-11-28 08:53:11 UTC (rev 9157)
@@ -24,8 +24,8 @@
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Locale;
+import org.jboss.portal.common.text.FastURLEncoder;
import org.jboss.portal.widget.WidgetQuery;
/**
@@ -152,7 +152,7 @@
}
if (q != null)
{
- buffer.append("&q=").append(q);
+ buffer.append("&q=").append(FastURLEncoder.getUTF8Instance().encode(q));
}
return new URL(buffer.toString());
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp 2007-11-28 08:40:39 UTC (rev 9156)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp 2007-11-28 08:53:11 UTC (rev 9157)
@@ -106,7 +106,7 @@
{
WidgetFailure failure = (WidgetFailure) selWidget;
%>
- <p style="color: red;">
+ <p class="portlet-msg-error">
<%= failure.getLocalizedErrorMessage( request.getLocale() ) %>
</p>
<%
@@ -161,7 +161,7 @@
{
WidgetFailure failure = (WidgetFailure) selWidget;
%>
- <p style="color: red;">
+ <p class="portlet-msg-error">
<%= failure.getLocalizedErrorMessage( request.getLocale() ) %>
</p>
<%
@@ -182,7 +182,7 @@
{
DirectoryResultFailure resultFailure = (DirectoryResultFailure) queryResults;
%>
- <p style="color: red;"><%= resultFailure.getLocalizedErrorMessage( request.getLocale() ) %></p>
+ <p class="portlet-msg-error"><%= resultFailure.getLocalizedErrorMessage( request.getLocale() ) %></p>
<%
}
else
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp 2007-11-28 08:40:39 UTC (rev 9156)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp 2007-11-28 08:53:11 UTC (rev 9157)
@@ -107,7 +107,7 @@
{
WidgetFailure failure = (WidgetFailure) selWidget;
%>
- <p style="color: red;">
+ <p class="portlet-msg-error">
<%= failure.getLocalizedErrorMessage( request.getLocale() ) %>
</p>
<%
@@ -165,7 +165,7 @@
{
WidgetFailure failure = (WidgetFailure) selWidget;
%>
- <p style="color: red;">
+ <p class="portlet-msg-error">
<%= failure.getLocalizedErrorMessage( request.getLocale() ) %>
</p>
<%
@@ -188,7 +188,7 @@
{
DirectoryResultFailure resultFailure = (DirectoryResultFailure) queryResults;
%>
- <p style="color: red;"><%= resultFailure.getLocalizedErrorMessage( request.getLocale() ) %></p>
+ <p class="portlet-msg-error"><%= resultFailure.getLocalizedErrorMessage( request.getLocale() ) %></p>
<%
}
else
16 years, 7 months
JBoss Portal SVN: r9156 - in branches/JBoss_Portal_Branch_2_6/wsrp/src: resources/portal-wsrp-sar/xsd and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-28 03:40:39 -0500 (Wed, 28 Nov 2007)
New Revision: 9156
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd
Log:
- Allow label to be optional.
- Don't output LocalizedString elements if not needed.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java 2007-11-28 08:38:11 UTC (rev 9155)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java 2007-11-28 08:40:39 UTC (rev 9156)
@@ -123,15 +123,35 @@
}
else if ("label".equals(localName))
{
- value = propertyDescription.getLabel();
+ value = getLocalizedStringOrNull(propertyDescription.getLabel());
}
else if ("hint".equals(localName))
{
- value = propertyDescription.getHint();
+ value = getLocalizedStringOrNull(propertyDescription.getHint());
}
return value;
}
+ private LocalizedString getLocalizedStringOrNull(LocalizedString string)
+ {
+ if (string != null)
+ {
+ String value = string.getValue();
+ if (value == null || value.length() == 0)
+ {
+ return null;
+ }
+ else
+ {
+ return string;
+ }
+ }
+ else
+ {
+ return null;
+ }
+ }
+
public Object getAttributeValue(LocalizedString localizedString, String namespaceUri, String localName)
{
Object value = null;
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd 2007-11-28 08:38:11 UTC (rev 9155)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd 2007-11-28 08:40:39 UTC (rev 9156)
@@ -52,7 +52,7 @@
<xs:sequence>
<xs:element name="name" type="xs:QName"/>
<xs:element name="type" type="xs:QName"/>
- <xs:element name="label" type="wpc:LocalizedString"/>
+ <xs:element name="label" type="wpc:LocalizedString" minOccurs="0"/>
<xs:element name="hint" type="wpc:LocalizedString" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
16 years, 7 months
JBoss Portal SVN: r9155 - branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-28 03:38:11 -0500 (Wed, 28 Nov 2007)
New Revision: 9155
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
Log:
- Properly register RegistrationManager as a RegistrationPropertyChangeListener (even when registration is not initially required).
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-11-28 08:36:25 UTC (rev 9154)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-11-28 08:38:11 UTC (rev 9155)
@@ -276,21 +276,18 @@
ProducerRegistrationRequirements registrationRequirements = getProducerRegistrationRequirements();
registrationRequirements.addRegistrationPolicyChangeListener(registrationManager);
+ registrationRequirements.addRegistrationPropertyChangeListener(registrationManager);
if (registrationRequirements.isRegistrationRequired())
{
registrationManager.setPolicy(registrationRequirements.getPolicy());
- registrationRequirements.addRegistrationPropertyChangeListener(registrationManager);
}
}
protected void stopService() throws Exception
{
ProducerRegistrationRequirements registrationRequirements = getProducerRegistrationRequirements();
- if (registrationRequirements.isRegistrationRequired())
- {
- registrationRequirements.removeRegistrationPropertyChangeListener(registrationManager);
- }
+ registrationRequirements.removeRegistrationPropertyChangeListener(registrationManager);
registrationRequirements.removeRegistrationPolicyChangeListener(registrationManager);
super.stopService();
16 years, 7 months
JBoss Portal SVN: r9154 - branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-28 03:36:25 -0500 (Wed, 28 Nov 2007)
New Revision: 9154
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
Log:
- JBPORTAL-1714:
+ Remove unused refreshRegistrationInfo method.
+ Properly display status messages.
+ modifyRegistration refreshes the consumer.
+ ConsumerManagerBean.refresh method now returns a RefreshResult for better control.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-11-28 08:32:11 UTC (rev 9153)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-11-28 08:36:25 UTC (rev 9154)
@@ -318,42 +318,20 @@
}
}
- return manager.refresh(consumer);
- }
-
- beanContext.createErrorMessage("Couldn't save Consumer!");
- return null;
- }
-
- public String refreshRegistrationInfo()
- {
- if (consumer != null)
- {
- String param = beanContext.getParameter("mergeLocalInfo");
- boolean mergeLocalInfo = Boolean.valueOf(param).booleanValue();
- try
+ RefreshResult result = manager.refresh(consumer);
+ if (result.hasIssues())
{
- RefreshResult result = getProducerInfo().refreshRegistrationInfo(mergeLocalInfo);
- if (result.hasIssues())
- {
- beanContext.createErrorMessage(result.getStatus());
- }
- else
- {
- beanContext.createInfoMessage(null, result.getStatus());
- }
-
- registrationModified = false;
+ registrationModified = true; // if we have issues, it might indicate a need to modify the registration
}
- catch (Exception e)
+ else
{
- beanContext.createErrorMessageFrom(e);
- return null;
+ registrationModified = false;
}
- return null;
+
+ return ConsumerManagerBean.CONFIGURE_CONSUMER;
}
- beanContext.createErrorMessage("Couldn't refresh Registration info!");
+ beanContext.createErrorMessage("Couldn't refresh Consumer!");
return null;
}
@@ -373,8 +351,10 @@
info.modifyRegistration();
getProducerInfo().getRegistrationInfo().setModified(false);
- beanContext.createInfoMessage(null, "Successfully modified Registration!");
+ beanContext.createInfoMessage("Successfully modified Registration!");
registrationModified = false;
+
+ refreshConsumer();
}
catch (Exception e)
{
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-11-28 08:32:11 UTC (rev 9153)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-11-28 08:36:25 UTC (rev 9154)
@@ -245,7 +245,7 @@
registry.deactivateConsumerWith(consumer.getProducerId());
}
- beanContext.createInfoMessage(null, result.getStatus());
+ beanContext.createInfoMessage(result.getStatus());
}
return result;
}
@@ -256,12 +256,12 @@
}
}
- String refresh(WSRPConsumer consumer)
+ RefreshResult refresh(WSRPConsumer consumer)
{
- internalRefresh(consumer);
+ RefreshResult result = internalRefresh(consumer);
selectedId = consumer.getProducerId();
setConsumerIdInSession(false);
- return CONFIGURE_CONSUMER;
+ return result;
}
public String listConsumers()
16 years, 7 months
JBoss Portal SVN: r9153 - branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-28 03:32:11 -0500 (Wed, 28 Nov 2007)
New Revision: 9153
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java
Log:
- Do not create LocalizedString if the input string is empty.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java 2007-11-28 08:30:54 UTC (rev 9152)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java 2007-11-28 08:32:11 UTC (rev 9153)
@@ -38,7 +38,7 @@
{
public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String s)
{
- return s == null ? null : new LocalizedString(s);
+ return (s == null || s.length() == 0) ? null : new LocalizedString(s);
}
public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object o)
16 years, 7 months
JBoss Portal SVN: r9152 - branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-28 03:30:54 -0500 (Wed, 28 Nov 2007)
New Revision: 9152
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
Log:
- Moved location of modify registration button.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-11-28 08:29:42 UTC (rev 9151)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-11-28 08:30:54 UTC (rev 9152)
@@ -99,6 +99,15 @@
</td>
</tr>
</c:forEach>
+ <c:if test="#{consumer.registrationModified}">
+ <tr>
+ <td colspan="3">
+ <h:commandLink action="#{consumer.modifyRegistration}" value="Modify registration"
+ title="Modify the registration held with this Producer"
+ styleClass="portlet-form-button portlet-section-buttonrow"/>
+ </td>
+ </tr>
+ </c:if>
</table>
</c:when>
<c:otherwise>
@@ -123,15 +132,6 @@
</td>
</tr>
</c:if>
- <c:if test="#{consumer.registrationModified}">
- <tr>
- <td colspan="2">
- <h:commandLink action="#{consumer.modifyRegistration}" value="Modify registration"
- title="Modify the registration held with this Producer"
- styleClass="portlet-form-button"/>
- </td>
- </tr>
- </c:if>
</c:if>
<tr>
<th/>
16 years, 7 months
JBoss Portal SVN: r9151 - branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-28 03:29:42 -0500 (Wed, 28 Nov 2007)
New Revision: 9151
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/BeanContext.java
Log:
- Added createInfoMessage.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/BeanContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/BeanContext.java 2007-11-28 08:10:54 UTC (rev 9150)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/BeanContext.java 2007-11-28 08:29:42 UTC (rev 9151)
@@ -77,4 +77,9 @@
{
createMessage(target, message, getInfoSeverity());
}
+
+ protected void createInfoMessage(String message)
+ {
+ createInfoMessage(STATUS, message);
+ }
}
16 years, 7 months
JBoss Portal SVN: r9150 - branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-11-28 03:10:54 -0500 (Wed, 28 Nov 2007)
New Revision: 9150
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
Log:
cms security console bug fix
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-11-28 07:59:55 UTC (rev 9149)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-11-28 08:10:54 UTC (rev 9150)
@@ -1476,12 +1476,13 @@
User user = this.userModule.findUserByUserName(portletRequest.getUserPrincipal().getName());
Set roles = this.membershipModule.getRoles(user);
String defaultAdminRole = this.authorizationManager.getProvider().getDefaultAdminRole();
+ User superUser = this.authorizationManager.getProvider().getRoot();
if (roles != null)
{
for (Iterator itr = roles.iterator(); itr.hasNext();)
{
Role role = (Role)itr.next();
- if (role.getName().equalsIgnoreCase(defaultAdminRole))
+ if (role.getName().equalsIgnoreCase(defaultAdminRole) || user.getUserName().equals(superUser.getUserName()))
{
isAccessible = true;
break;
16 years, 7 months
JBoss Portal SVN: r9149 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-11-28 02:59:55 -0500 (Wed, 28 Nov 2007)
New Revision: 9149
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/security.xml
Log:
updated cms security documentation
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/security.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/security.xml 2007-11-28 07:58:20 UTC (rev 9148)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/security.xml 2007-11-28 07:59:55 UTC (rev 9149)
@@ -184,105 +184,123 @@
The configuration for the CMS Security service is specified in the
<literal>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</literal>
file. The portion of the configuration relevant for securing the CMS service is listed as follows:
- <programlisting><![CDATA[<!-- interceptor factory where all cms interceptors are registered -->
-<mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Cms" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <depends-list optional-attribute-name="InterceptorNames">
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ACL
- </depends-list-element>
- <depends-list-element>
- portal:service=Interceptor,type=Cms,name=ApprovalWorkflow
- </depends-list-element>
- </depends-list>
-</mbean>
-
-<!-- CMS Authorization Security Service -->
-<mbean code="org.jboss.portal.cms.security.AuthorizationManagerImpl"
- name="portal:service=AuthorizationManager,type=cms" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <attribute name="JNDIName">
- java:portal/cms/AuthorizationManager
- </attribute>
- <depends optional-attribute-name="Provider"
- proxy-type="attribute">
- portal:service=AuthorizationProvider,type=cms
- </depends>
-</mbean>
-<mbean code="org.jboss.portal.cms.security.AuthorizationProviderImpl"
- name="portal:service=AuthorizationProvider,type=cms" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <depends optional-attribute-name="IdentityServiceController"
- proxy-type="attribute">
- portal:service=Module,type=IdentityServiceController
- </depends>
-</mbean>
-
-<!-- ACL Security Interceptor -->
-<mbean code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
- name="portal:service=Interceptor,type=Cms,name=ACL" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean />
- <attribute name="JNDIName">
- java:/portal/cms/ACLInterceptor
- </attribute>
- <attribute name="CmsSessionFactory">
- java:/portal/cms/CMSSessionFactory
- </attribute>
- <attribute name="IdentitySessionFactory">
- java:/portal/IdentitySessionFactory
- </attribute>
- <attribute name="DefaultPolicy">
- <policy>
- <!-- permissions on the root cms node -->
- <criteria name="path" value="/">
- <permission name="cms" action="read">
- <role name="Anonymous" />
- </permission>
- <permission name="cms" action="write">
- <role name="User" />
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- <!-- permissions on the default cms node -->
- <criteria name="path" value="/default">
- <permission name="cms" action="read">
- <role name="Anonymous" />
- </permission>
- <permission name="cms" action="write">
- <role name="User" />
- </permission>
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- <!-- permissions on the private/protected node -->
- <criteria name="path" value="/default/private">
- <permission name="cms" action="manage">
- <role name="Admin" />
- </permission>
- </criteria>
- </policy>
- </attribute>
- <depends optional-attribute-name="AuthorizationManager"
- proxy-type="attribute">
- portal:service=AuthorizationManager,type=cms
- </depends>
- <depends>portal:service=Hibernate,type=CMS</depends>
- <depends>
- portal:service=Module,type=IdentityServiceController
- </depends>
-</mbean>]]>
- </programlisting>
+ <programlisting>
+ <![CDATA[
+ <!-- CMS Authorization Security Service -->
+ <mbean
+ code="org.jboss.portal.cms.security.AuthorizationManagerImpl"
+ name="portal:service=AuthorizationManager,type=cms"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="JNDIName">java:portal/cms/AuthorizationManager</attribute>
+ <depends optional-attribute-name="Provider" proxy-type="attribute">
+ portal:service=AuthorizationProvider,type=cms
+ </depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.cms.security.AuthorizationProviderImpl"
+ name="portal:service=AuthorizationProvider,type=cms"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <!--
+ NOTE: cmsRootUserName denotes a single Portal user that has access to everything in the CMS. Denote this user
+ carefully and should be synonymous to the 'root' user in a Unix system. By default: this value is the built-in
+ 'admin' user account. This can be changed to any other user account registered in your Portal
+ -->
+ <attribute name="CmsRootUserName">admin</attribute>
+ <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">portal:service=Module,type=IdentityServiceController</depends>
+ </mbean>
+ <!-- ACL Security Interceptor -->
+ <mbean
+ code="org.jboss.portal.cms.impl.interceptors.ACLInterceptor"
+ name="portal:service=Interceptor,type=Cms,name=ACL"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="JNDIName">java:/portal/cms/ACLInterceptor</attribute>
+ <attribute name="CmsSessionFactory">java:/portal/cms/CMSSessionFactory</attribute>
+ <attribute name="IdentitySessionFactory">java:/portal/IdentitySessionFactory</attribute>
+ <attribute name="DefaultPolicy">
+ <policy>
+ <!-- permissions on the root cms node -->
+ <criteria name="path" value="/">
+ <permission name="cms" action="read">
+ <role name="Anonymous"/>
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User"/>
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ <!-- permissions on the default cms node -->
+ <criteria name="path" value="/default">
+ <permission name="cms" action="read">
+ <role name="Anonymous"/>
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User"/>
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ <!-- permissions on the private/protected node -->
+ <criteria name="path" value="/default/private">
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ </policy>
+ </attribute>
+ <depends optional-attribute-name="AuthorizationManager" proxy-type="attribute">
+ portal:service=AuthorizationManager,type=cms
+ </depends>
+ <depends>portal:service=Hibernate,type=CMS</depends>
+ <depends>portal:service=Module,type=IdentityServiceController</depends>
+ </mbean>]]>
+ </programlisting>
</para>
- </sect2>
+ <sect3 id="security.security_cms_configuration_superuser">
+ <title>CMS Super User</title>
+ <para>
+ A CMS Super User is a designated Portal User Account that has access to all resources/functions in the CMS. It is a concept similar to the
+ super user concept in a Linux/Unix security system. This account should be carefully used and properly protected. By default, JBoss Portal designates the
+ built-in 'admin' user account as a CMS Super User. This can be changed by modifying the <emphasis>cmsRootUserName</emphasis> value in the
+ <literal>jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml</literal> configuration.
+ <programlisting>
+ <![CDATA[
+ <mbean
+ code="org.jboss.portal.cms.security.AuthorizationProviderImpl"
+ name="portal:service=AuthorizationProvider,type=cms"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <!--
+ NOTE: cmsRootUserName denotes a single Portal user that has access to everything in the CMS. Denote this user
+ carefully and should be synonymous to the 'root' user in a Unix system. By default: this value is the built-in
+ 'admin' user account. This can be changed to any other user account registered in your Portal
+ -->
+ <attribute name="CmsRootUserName">admin</attribute>
+ <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">portal:service=Module,type=IdentityServiceController</depends>
+ </mbean>
+ ]]>
+ </programlisting>
+ </para>
+ </sect3>
+ <sect3 id="security.security_cms_configuration_securityconsole">
+ <title>CMS Security Console</title>
+ <para>
+ The CMS Security Console is used to assign proper permissions to all the nodes/content in the CMS. Besides protection on CMS content, this console itself
+ needs to be secured against unauthorized acceess. Currently, the console can be accessed only by Portal users that are members of the specified Role. By default,
+ JBoss Portal uses the built-in <emphasis>Admin</emphasis> role to allow access to this security console. This can be customized by modifying the value of
+ <emphasis>defaultAdminRole</emphasis> option specified in <literal>jboss-portal.sar/conf/identity/standardidentity-config.xml</literal>
+ </para>
+ </sect3>
+ </sect2>
</sect1>
<sect1 id="security.security_authentication">
16 years, 7 months