JBoss Portal SVN: r7278 - in trunk/wsrp/src/main/org/jboss/portal/wsrp: producer and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-20 20:32:15 -0400 (Sun, 20 May 2007)
New Revision: 7278
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPInstanceContext.java
Log:
- WSRPInstanceContext now properly uses portletInstanceKey if present to create a proper instance context.
- Fixed NPE if CCP cache is not initialized.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-20 22:45:55 UTC (rev 7277)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-21 00:32:15 UTC (rev 7278)
@@ -436,7 +436,7 @@
portlet = (Portlet)popsMap.get(portletHandle);
- if (portlet == null)
+ if (portlet == null && ccpsMap != null)
{
log.debug("Trying cached CCPs");
portlet = (Portlet)ccpsMap.get(portletHandle);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java 2007-05-20 22:45:55 UTC (rev 7277)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java 2007-05-21 00:32:15 UTC (rev 7278)
@@ -140,7 +140,7 @@
MarkupInfo streamInfo = createStreamInfo(markupRequest);
PortalContext portalContext = createPortalContext(params, markupRequest);
UserContext userContext = createUserContext(wsrpUserContext, markupRequest.getLocale(), desiredLocales);
- instanceContext = createInstanceContext(portletContext, getAccessMode());
+ instanceContext = createInstanceContext(portletContext, getAccessMode(), runtimeContext.getPortletInstanceKey());
WindowContext windowContext = createWindowContext(portletContext.getId(), runtimeContext);
// prepare the invocation
@@ -309,9 +309,9 @@
}
}
- private WSRPInstanceContext createInstanceContext(org.jboss.portal.portlet.PortletContext portletContext, final AccessMode accessMode)
+ private WSRPInstanceContext createInstanceContext(org.jboss.portal.portlet.PortletContext portletContext, final AccessMode accessMode, String instanceId)
{
- return new WSRPInstanceContext(portletContext, accessMode);
+ return new WSRPInstanceContext(portletContext, accessMode, instanceId);
}
private WindowContext createWindowContext(final String portletHandle, final RuntimeContext runtimeContext)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPInstanceContext.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPInstanceContext.java 2007-05-20 22:45:55 UTC (rev 7277)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPInstanceContext.java 2007-05-21 00:32:15 UTC (rev 7278)
@@ -37,21 +37,31 @@
class WSRPInstanceContext implements InstanceContext
{
private PortletContext context;
+ private String instanceId;
private final AccessMode accessMode;
private boolean wasModified = false;
- public WSRPInstanceContext(PortletContext portletContext, AccessMode accessMode)
+ public WSRPInstanceContext(PortletContext portletContext, AccessMode accessMode, String instanceId)
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "portlet context");
ParameterValidation.throwIllegalArgExceptionIfNull(accessMode, "AccessMode");
this.context = portletContext;
this.accessMode = accessMode;
+
+ if (instanceId != null && instanceId.length() > 0)
+ {
+ this.instanceId = instanceId;
+ }
+ else
+ {
+ this.instanceId = portletContext.getId();
+ }
}
public String getId()
{
- return context.getId();
+ return instanceId;
}
public AccessMode getAccessMode()
17 years
JBoss Portal SVN: r7277 - trunk/core-samples/src/resources/portal-samples-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-20 18:45:55 -0400 (Sun, 20 May 2007)
New Revision: 7277
Modified:
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml
Log:
- Fixed typo.
Modified: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml 2007-05-20 20:33:53 UTC (rev 7276)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml 2007-05-20 22:45:55 UTC (rev 7277)
@@ -157,7 +157,7 @@
<portlet>
<description>Portlet using portlet session</description>
<portlet-name>PortletSessionPortlet</portlet-name>
- <display-name>Porltet Session Portlet</display-name>
+ <display-name>Portlet Session Portlet</display-name>
<portlet-class>org.jboss.portal.core.portlet.test.PortletSessionPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
17 years
JBoss Portal SVN: r7276 - trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-20 16:33:53 -0400 (Sun, 20 May 2007)
New Revision: 7276
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java
Log:
- Update session information in case a portlet was cloned.
- Cache CCPs.
- Improved logging.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java 2007-05-20 18:40:25 UTC (rev 7275)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java 2007-05-20 20:33:53 UTC (rev 7276)
@@ -24,9 +24,9 @@
package org.jboss.portal.wsrp.consumer;
import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.PortletParametersStateString;
-import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -69,7 +69,7 @@
protected Object prepareRequest(RequestPrecursor requestPrecursor, PortletInvocation invocation)
{
PortletContext portletContext = requestPrecursor.getPortletContext();
- log.debug("Consumer about to attempt rendering portlet '" + portletContext.getPortletHandle() + "'");
+ log.debug("Consumer about to attempt action on portlet '" + portletContext.getPortletHandle() + "'");
// access mode
InstanceContext instanceContext = invocation.getInstanceContext();
@@ -120,6 +120,7 @@
protected PortletInvocationResponse processResponse(Object response, PortletInvocation invocation, RequestPrecursor requestPrecursor) throws PortletInvokerException
{
BlockingInteractionResponse blockingInteractionResponse = (BlockingInteractionResponse)response;
+ log.debug("Starting processing response");
String redirectURL = blockingInteractionResponse.getRedirectURL();
UpdateResponse updateResponse = blockingInteractionResponse.getUpdateResponse();
@@ -165,10 +166,11 @@
PortletContext originalContext = requestPrecursor.getPortletContext();
InstanceContext context = invocation.getInstanceContext();
- if (!originalContext.getPortletHandle().equals(portletContext.getPortletHandle()))
+ String handle = portletContext.getPortletHandle();
+ if (!originalContext.getPortletHandle().equals(handle))
{
log.debug("Portlet '" + requestPrecursor.getPortletHandle() + "' was implicitely cloned. New handle is '"
- + portletContext.getPortletHandle() + "'");
+ + handle + "'");
StateEvent event = new StateEvent(WSRPUtils.convertToPortalPortletContext(portletContext), StateEvent.PORTLET_CLONED_EVENT);
context.onStateEvent(event);
}
@@ -183,9 +185,12 @@
context.onStateEvent(event);
}
}
+
+ // update the session information associated with the portlet handle
+ consumer.getSessionHandler().updateSessionInfoFor(originalContext.getPortletHandle(), handle, invocation);
}
-
+ log.debug("Response processed");
return result;
}
}
@@ -208,7 +213,9 @@
protected Object performRequest(Object request)
throws Exception
{
- return consumer.getMarkupService().performBlockingInteraction(getActionRequest(request));
+ PerformBlockingInteraction interaction = getActionRequest(request);
+ log.debug("performBlockingInteraction on '" + interaction.getPortletContext().getPortletHandle() + "'");
+ return consumer.getMarkupService().performBlockingInteraction(interaction);
}
private PerformBlockingInteraction getActionRequest(Object request)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-20 18:40:25 UTC (rev 7275)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-20 20:33:53 UTC (rev 7276)
@@ -23,6 +23,7 @@
package org.jboss.portal.wsrp.consumer;
+import org.jboss.logging.Logger;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.portlet.InvokerUnavailableException;
import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
@@ -42,6 +43,8 @@
*/
public class EndpointConfigurationInfo
{
+ private final static Logger log = Logger.getLogger(EndpointConfigurationInfo.class);
+
/** DB primary key */
private Long key;
@@ -377,7 +380,12 @@
public boolean isRefreshNeeded()
{
- return !isAvailable() || areURLsDirty();
+ boolean result = !isAvailable() || areURLsDirty();
+ if (result)
+ {
+ log.debug("Refresh needed");
+ }
+ return result;
}
private boolean areURLsDirty()
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java 2007-05-20 18:40:25 UTC (rev 7275)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java 2007-05-20 20:33:53 UTC (rev 7276)
@@ -139,6 +139,7 @@
sessionHandler.resetCurrentlyHeldInformation();
}
}
+ log.debug("performRequest finished. Response is " + (response != null ? response.getClass().getName() : null));
return response;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-20 18:40:25 UTC (rev 7275)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-20 20:33:53 UTC (rev 7276)
@@ -63,7 +63,7 @@
*/
public class ProducerInfo
{
- private final Logger log = Logger.getLogger(getClass());
+ private final static Logger log = Logger.getLogger(ProducerInfo.class);
// Persistent information
@@ -93,6 +93,9 @@
/** The Producer-Offered Portlets (handle -> WSRPPortlet) */
private Map popsMap;
+ /** A cache for Consumer-Configured Portlets (handle -> WSRPPortlet) */
+ private Map ccpsMap;
+
/** Portlet groups. */
private Map portletGroups;
@@ -254,7 +257,7 @@
// POPs and rest of producer info separetely...
if (forceRefresh || isRefreshNeeded(true))
{
- log.debug("ProducerInfo refresh needed for producer '" + persistentId + "'");
+ log.debug("Refreshing...");
RefreshResult result = new RefreshResult(true, REFRESH_MEANING);
try
{
@@ -418,29 +421,37 @@
public Portlet getPortlet(PortletContext portletContext) throws PortletInvokerException
{
- boolean justRefreshed = refresh(false);
-
String portletHandle = portletContext.getId();
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandle, "Portlet handle", "getPortlet");
+ log.debug("Retrieving portlet '" + portletHandle + "'");
+ // check if we need to refresh
+ boolean justRefreshed = refresh(false);
+
Portlet portlet = null;
- // First try POP cache if cache is still valid or we just refreshed
+ // First try caches if caches are still valid or we just refreshed
if (justRefreshed || (useCache() && !isCacheExpired()))
{
- log.debug("Trying to retrieve portlet '" + portletHandle + "' from cached service description");
+ log.debug("Trying cached POPs");
portlet = (Portlet)popsMap.get(portletHandle);
+
+ if (portlet == null)
+ {
+ log.debug("Trying cached CCPs");
+ portlet = (Portlet)ccpsMap.get(portletHandle);
+ }
}
- if (portlet != null) // we had a match on a POP, return it
+ if (portlet != null) // we had a match in cache, return it
{
- log.debug("Portlet '" + portletHandle + "' was in cached service description");
+ log.debug("Portlet was cached");
return portlet;
}
else // otherwise, retrieve just the information for the appropriate portlet
{
- log.debug("Retrieving portlet '" + portletHandle + "' via getPortletDescription");
+ log.debug("Retrieving portlet via getPortletDescription");
GetPortletDescription gpd = WSRPTypeFactory.createGetPortletDescription(getRegistrationContext(), portletContext);
gpd.setUserContext(UserAccess.getUserContext());
@@ -449,7 +460,16 @@
{
PortletDescriptionResponse response = persistentEndpointInfo.getPortletManagementService().getPortletDescription(gpd);
ParameterValidation.throwIllegalArgExceptionIfNull(response, "PortletDescriptionResponse");
- return createWSRPPortletFromPortletDescription(response.getPortletDescription());
+ portlet = createWSRPPortletFromPortletDescription(response.getPortletDescription());
+
+ // add the portlet to the CCP cache
+ if (ccpsMap == null)
+ {
+ ccpsMap = new HashMap();
+ }
+ ccpsMap.put(portletHandle, portlet);
+
+ return portlet;
}
catch (InvalidHandleFault invalidHandleFault)
{
@@ -496,7 +516,13 @@
*/
private boolean isCacheExpired()
{
- return !useCache() || System.currentTimeMillis() > expirationTimeMillis || popsMap == null || portletGroups == null;
+ boolean result = !useCache() || System.currentTimeMillis() > expirationTimeMillis || popsMap == null
+ || portletGroups == null;
+ if (result)
+ {
+ log.debug("Cache expired or not used");
+ }
+ return result;
}
public Integer getExpirationCacheSeconds()
@@ -773,9 +799,14 @@
public boolean isRefreshNeeded(boolean considerCache)
{
- return (considerCache && isCacheExpired())
+ boolean result = (considerCache && isCacheExpired())
|| persistentRegistrationInfo == null
|| persistentRegistrationInfo.isRefreshNeeded()
|| persistentEndpointInfo.isRefreshNeeded();
+ if (result)
+ {
+ log.debug("Refresh needed for producer '" + persistentId + "'");
+ }
+ return result;
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java 2007-05-20 18:40:25 UTC (rev 7275)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java 2007-05-20 20:33:53 UTC (rev 7276)
@@ -431,6 +431,36 @@
parent = sessionHandler;
}
+ /**
+ * Update the mappings that were associated with the specified original portlet handle after it has been modified as
+ * a result of a clone operation to the specified new handle.
+ *
+ * @param originalHandle
+ * @param newHandle
+ * @since 2.6
+ */
+ public void updateHandleAssociatedInfo(String originalHandle, String newHandle)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(originalHandle, "original handle",
+ "Updating information associated with a portlet handle");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(newHandle, "new handle",
+ "Updating information associated with a portlet handle");
+
+ String sessionId = getSessionIdForPortlet(originalHandle);
+ ProducerSessionInformation.SessionInfo info = getSessionInfoFor(originalHandle);
+ if (sessionId != null && info != null)
+ {
+ portletSessions.put(newHandle, info);
+ portletSessions.remove(originalHandle);
+ sessionId2PortletHandle.put(sessionId, newHandle);
+ log.debug("Updated mapping information for '" + originalHandle + "' to reference '" + newHandle + "' instead.");
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot update information for unknown handle '" + originalHandle + "'");
+ }
+ }
+
private class SessionInfo
{
private SessionContext sessionContext;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-20 18:40:25 UTC (rev 7275)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-20 20:33:53 UTC (rev 7276)
@@ -53,7 +53,7 @@
*/
public class RegistrationInfo
{
- private final Logger log = Logger.getLogger(getClass());
+ private static final Logger log = Logger.getLogger(RegistrationInfo.class);
private Long key;
private String persistentConsumerName;
@@ -116,7 +116,12 @@
public boolean isRefreshNeeded()
{
- return dirty || requiresRegistration == null;
+ boolean result = dirty || requiresRegistration == null;
+ if (result)
+ {
+ log.debug("Refresh needed");
+ }
+ return result;
}
public Boolean isRegistrationValid()
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java 2007-05-20 18:40:25 UTC (rev 7275)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java 2007-05-20 20:33:53 UTC (rev 7276)
@@ -89,6 +89,7 @@
protected PortletInvocationResponse processResponse(Object response, PortletInvocation invocation, RequestPrecursor requestPrecursor)
{
MarkupResponse markupResponse = (MarkupResponse)response;
+ log.debug("Starting processing response");
// process the response
consumer.getSessionHandler().updateSessionIfNeeded(markupResponse.getSessionContext(), invocation);
@@ -120,6 +121,7 @@
PrintWriter writer = result.getWriter();
writer.write(markup);
+ log.debug("Response processed");
return result;
}
@@ -140,7 +142,9 @@
protected Object performRequest(Object request) throws Exception
{
- return consumer.getMarkupService().getMarkup(getRenderRequest(request));
+ GetMarkup renderRequest = getRenderRequest(request);
+ log.debug("getMarkup on '" + renderRequest.getPortletContext().getPortletHandle() + "'");
+ return consumer.getMarkupService().getMarkup(renderRequest);
}
private GetMarkup getRenderRequest(Object request)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java 2007-05-20 18:40:25 UTC (rev 7275)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java 2007-05-20 20:33:53 UTC (rev 7276)
@@ -25,8 +25,8 @@
import org.jboss.logging.Logger;
import org.jboss.portal.api.event.PortalEvent;
+import org.jboss.portal.api.event.PortalEventContext;
import org.jboss.portal.api.event.PortalEventListener;
-import org.jboss.portal.api.event.PortalEventContext;
import org.jboss.portal.api.session.event.PortalSessionEvent;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.portlet.InvokerUnavailableException;
@@ -438,4 +438,19 @@
}
}
}
+
+ /**
+ * @param originalHandle
+ * @param newHandle
+ * @param invocation
+ * @since 2.6
+ */
+ public void updateSessionInfoFor(String originalHandle, String newHandle, PortletInvocation invocation)
+ {
+ ProducerSessionInformation info = getProducerSessionInformation(invocation, false);
+ if (info != null)
+ {
+ info.updateHandleAssociatedInfo(originalHandle, newHandle);
+ }
+ }
}
17 years
JBoss Portal SVN: r7275 - trunk/core/src/main/org/jboss/portal/core/model/portal/command/render.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-20 14:40:25 -0400 (Sun, 20 May 2007)
New Revision: 7275
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java
Log:
- Removed unused field.
- Updated properties.
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java 2007-05-18 08:44:28 UTC (rev 7274)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java 2007-05-20 18:40:25 UTC (rev 7275)
@@ -22,20 +22,19 @@
******************************************************************************/
package org.jboss.portal.core.model.portal.command.render;
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
import org.jboss.portal.core.controller.ControllerException;
import org.jboss.portal.core.controller.ControllerResponse;
-import org.jboss.portal.core.controller.portlet.InvokePortletCommandFactory;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
+import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.command.WindowCommand;
-import org.jboss.portal.core.model.portal.content.ContentRendererRegistry;
import org.jboss.portal.core.model.portal.content.ContentRenderer;
-import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.portal.content.ContentRendererRegistry;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class RenderWindowCommand extends WindowCommand
{
@@ -64,9 +63,6 @@
/** . */
private static final CommandInfo info = new ViewCommandInfo();
- /** . */
- private InvokePortletCommandFactory invokePortletCommandFactory;
-
public RenderWindowCommand(PortalObjectId windowId)
throws IllegalArgumentException
{
Property changes on: trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
17 years
JBoss Portal SVN: r7273 - in trunk: core/src/main/org/jboss/portal/core/aspects/server and 2 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-05-18 04:38:15 -0400 (Fri, 18 May 2007)
New Revision: 7273
Added:
trunk/core/src/main/org/jboss/portal/identity/
trunk/identity/src/main/org/jboss/portal/identity/CachedUserImpl.java
Removed:
trunk/core/src/main/org/jboss/portal/core/controller/portlet/CachedUserImpl.java
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
Log:
- oups... broken build correction. there was a cyclic dependency between core and identity modules
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java 2007-05-18 07:31:11 UTC (rev 7272)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java 2007-05-18 08:38:15 UTC (rev 7273)
@@ -26,7 +26,7 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.invocation.AttributeResolver;
import org.jboss.portal.core.CoreConstants;
-import org.jboss.portal.core.controller.portlet.CachedUserImpl;
+import org.jboss.portal.identity.CachedUserImpl;
import org.jboss.portal.identity.NoSuchUserException;
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.UserModule;
Deleted: trunk/core/src/main/org/jboss/portal/core/controller/portlet/CachedUserImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/portlet/CachedUserImpl.java 2007-05-18 07:31:11 UTC (rev 7272)
+++ trunk/core/src/main/org/jboss/portal/core/controller/portlet/CachedUserImpl.java 2007-05-18 08:38:15 UTC (rev 7273)
@@ -1,73 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.portal.core.controller.portlet;
-
-import org.jboss.portal.identity.User;
-
-import java.util.Map;
-import java.io.Serializable;
-
-/**
- * Simple POJO to cache user data.
- *
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
- * @version $Revision: 0.1 $
- */
-public class CachedUserImpl implements User, Serializable
-{
-
- /** . */
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(CachedUserImpl.class);
-
- /** . */
- private Object id;
-
- /** . */
- private String name;
-
- public CachedUserImpl(Object id, String name)
- {
- this.id = id;
- this.name = name;
- }
-
- public Object getId()
- {
- return id;
- }
-
- public String getUserName()
- {
- return name;
- }
-
- public void updatePassword(String password)
- {
- throw new UnsupportedOperationException("Cached user. Password cannot be updated using this object. Obtain User using UserModule.");
- }
-
- public boolean validatePassword(String password)
- {
- throw new UnsupportedOperationException("Cached user. Password cannot be validated using this object. Obtain User using UserModule.");
- }
-}
Copied: trunk/identity/src/main/org/jboss/portal/identity/CachedUserImpl.java (from rev 7257, trunk/core/src/main/org/jboss/portal/core/controller/portlet/CachedUserImpl.java)
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/CachedUserImpl.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/CachedUserImpl.java 2007-05-18 08:38:15 UTC (rev 7273)
@@ -0,0 +1,72 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.identity;
+
+import org.jboss.portal.identity.User;
+
+import java.io.Serializable;
+
+/**
+ * Simple POJO to cache user data.
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public class CachedUserImpl implements User, Serializable
+{
+
+ /** . */
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(CachedUserImpl.class);
+
+ /** . */
+ private Object id;
+
+ /** . */
+ private String name;
+
+ public CachedUserImpl(Object id, String name)
+ {
+ this.id = id;
+ this.name = name;
+ }
+
+ public Object getId()
+ {
+ return id;
+ }
+
+ public String getUserName()
+ {
+ return name;
+ }
+
+ public void updatePassword(String password)
+ {
+ throw new UnsupportedOperationException("Cached user. Password cannot be updated using this object. Obtain User using UserModule.");
+ }
+
+ public boolean validatePassword(String password)
+ {
+ throw new UnsupportedOperationException("Cached user. Password cannot be validated using this object. Obtain User using UserModule.");
+ }
+}
Modified: trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2007-05-18 07:31:11 UTC (rev 7272)
+++ trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2007-05-18 08:38:15 UTC (rev 7273)
@@ -28,7 +28,7 @@
import org.jboss.portal.identity.db.HibernateUserImpl;
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.core.controller.portlet.CachedUserImpl;
+import org.jboss.portal.identity.CachedUserImpl;
import javax.naming.InitialContext;
17 years
JBoss Portal SVN: r7272 - in trunk: identity and 2 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-05-18 03:31:11 -0400 (Fri, 18 May 2007)
New Revision: 7272
Added:
trunk/identity/src/etc/opends/
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
trunk/identity/build.xml
trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
Log:
- correct handling of CachedUserImpl by DelegatingUserProfileModuleImpl and usage of reg.getUser() in UserPortlet
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-05-18 04:04:41 UTC (rev 7271)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-05-18 07:31:11 UTC (rev 7272)
@@ -266,6 +266,14 @@
else
{
user = req.getUser();
+ try
+ {
+ user = userModule.findUserById(user.getId());
+ }
+ catch (IdentityException e)
+ {
+ log.error("Cannot retrive user", e);
+ }
}
// Validate we have a user object
@@ -849,6 +857,15 @@
public void storeProfile(JBossActionRequest req, JBossActionResponse resp) throws PortletException
{
User currentUser = req.getUser();
+ try
+ {
+ currentUser = userModule.findUserById(currentUser.getId());
+ }
+ catch (IdentityException e)
+ {
+ log.error("Cannot retrive user", e);
+ }
+
if (currentUser == null)
{
throw new PortletException("No user");
Modified: trunk/identity/build.xml
===================================================================
--- trunk/identity/build.xml 2007-05-18 04:04:41 UTC (rev 7271)
+++ trunk/identity/build.xml 2007-05-18 07:31:11 UTC (rev 7272)
@@ -112,6 +112,7 @@
<path refid="jboss.portal-test.classpath"/>
<path refid="jboss.portal-common.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
+ <path refid="jboss.portal-core.classpath"/>
</path>
<!--+=======================================+-->
Modified: trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2007-05-18 04:04:41 UTC (rev 7271)
+++ trunk/identity/src/main/org/jboss/portal/identity/DelegatingUserProfileModuleImpl.java 2007-05-18 07:31:11 UTC (rev 7272)
@@ -28,6 +28,7 @@
import org.jboss.portal.identity.db.HibernateUserImpl;
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.core.controller.portlet.CachedUserImpl;
import javax.naming.InitialContext;
@@ -81,9 +82,16 @@
{
throw new IdentityException("Such property name is not supported: " + propertyName);
}
- else if (property.isMappedLDAP() && isLDAPSupported() && user instanceof LDAPUserImpl)
+
+ if (user instanceof CachedUserImpl)
{
+ user = obtainUser(user);
+ }
+
+ if (property.isMappedLDAP() && isLDAPSupported() && user instanceof LDAPUserImpl)
+ {
log.debug("Delegating to LDAP module");
+
return getLDAPModule().getProperty(user, propertyName);
}
else if (property.isMappedDB())
@@ -109,8 +117,14 @@
{
throw new IdentityException("Such property name is not supported: " + name);
}
- else if (property.isMappedLDAP() && isLDAPSupported() && user instanceof LDAPUserImpl)
+
+ if (user instanceof CachedUserImpl)
{
+ user = obtainUser(user);
+ }
+
+ if (property.isMappedLDAP() && isLDAPSupported() && user instanceof LDAPUserImpl)
+ {
log.debug("Delegating to LDAP module");
getLDAPModule().setProperty(user, name, propertyValue);
return;
@@ -135,6 +149,11 @@
if (log.isDebugEnabled()) log.debug("getProperties");//: " + name + "/" + propertyValue)
try
{
+ if (user instanceof CachedUserImpl)
+ {
+ user = obtainUser(user);
+ }
+
if (user instanceof LDAPUserImpl && isLDAPSupported())
{
log.debug("handling LDAP user implementation");
@@ -174,7 +193,13 @@
}
}
+ private User obtainUser(User user) throws IdentityException
+ {
+ UserModule um = (UserModule)getIdentityContext().getObject(IdentityContext.TYPE_USER_MODULE);
+ return um.findUserById(user.getId());
+ }
+
public ProfileInfo getProfileInfo() throws IdentityException
{
return profileInfo;
17 years
JBoss Portal SVN: r7271 - trunk/core/src/main/org/jboss/portal/core/impl/model/content.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-18 00:04:41 -0400 (Fri, 18 May 2007)
New Revision: 7271
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
Log:
- Use local variable for CapabilitiesInfo to avoid having to retrieve the portlet several times as it could be costly with WSRP.
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-05-17 21:40:09 UTC (rev 7270)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-05-18 04:04:41 UTC (rev 7271)
@@ -22,56 +22,57 @@
******************************************************************************/
package org.jboss.portal.core.impl.model.content;
+import org.jboss.logging.Logger;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.Exceptions;
+import org.jboss.portal.core.aspects.portlet.AjaxInterceptor;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.ControllerResponse;
+import org.jboss.portal.core.controller.ResourceAccessDeniedException;
+import org.jboss.portal.core.controller.ResourceNotFoundException;
+import org.jboss.portal.core.controller.portlet.PortletInvocationFactory;
+import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.content.spi.ContentProvider;
import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
import org.jboss.portal.core.model.portal.command.render.RenderWindowCommand;
-import org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
import org.jboss.portal.core.model.portal.command.response.PortletWindowResponse;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.content.ContentRenderer;
import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
-import org.jboss.portal.core.model.portal.content.ContentRenderer;
-import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.core.controller.ResourceNotFoundException;
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.controller.ResourceAccessDeniedException;
-import org.jboss.portal.core.controller.ControllerResponse;
-import org.jboss.portal.core.controller.portlet.PortletInvocationFactory;
import org.jboss.portal.core.navstate.NavigationalStateKey;
import org.jboss.portal.core.theme.WindowRendition;
-import org.jboss.portal.core.aspects.portlet.AjaxInterceptor;
-import org.jboss.portal.server.config.ServerConfig;
-import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.server.request.URLContext;
-import org.jboss.portal.server.request.URLFormat;
+import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.NoSuchPortletException;
+import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.portlet.info.WindowStateInfo;
-import org.jboss.portal.portlet.info.ModeInfo;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
-import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
+import org.jboss.portal.server.ServerInvocationContext;
+import org.jboss.portal.server.config.ServerConfig;
+import org.jboss.portal.server.request.URLContext;
+import org.jboss.portal.server.request.URLFormat;
+import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
import org.jboss.portal.theme.page.WindowResult;
import org.jboss.portal.theme.render.renderer.ActionRendererContext;
-import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.Exceptions;
-import org.jboss.logging.Logger;
-import java.util.Map;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Collections;
+import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -239,7 +240,8 @@
//
List supportedWindowStates = new ArrayList();
- for (Iterator i = instance.getPortlet().getInfo().getCapabilities().getAllWindowStates().iterator(); i.hasNext();)
+ CapabilitiesInfo capabilitiesInfo = instance.getPortlet().getInfo().getCapabilities();
+ for (Iterator i = capabilitiesInfo.getAllWindowStates().iterator(); i.hasNext();)
{
WindowStateInfo windowStateInfo = (WindowStateInfo)i.next();
WindowState tmp = windowStateInfo.getWindowState();
@@ -251,7 +253,7 @@
//
List supportedModes = new ArrayList();
- for (Iterator i = instance.getPortlet().getInfo().getCapabilities().getAllModes().iterator(); i.hasNext();)
+ for (Iterator i = capabilitiesInfo.getAllModes().iterator(); i.hasNext();)
{
ModeInfo modeInfo = (ModeInfo)i.next();
Mode tmp = modeInfo.getMode();
17 years
JBoss Portal SVN: r7270 - trunk/jems/src/main/org/jboss/portal/jems/as/system.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-05-17 17:40:09 -0400 (Thu, 17 May 2007)
New Revision: 7270
Modified:
trunk/jems/src/main/org/jboss/portal/jems/as/system/POJOInjection.java
trunk/jems/src/main/org/jboss/portal/jems/as/system/POJOInjector.java
Log:
if the pojo target is unregistered from the mbean server then we inject null in the target setter
Modified: trunk/jems/src/main/org/jboss/portal/jems/as/system/POJOInjection.java
===================================================================
--- trunk/jems/src/main/org/jboss/portal/jems/as/system/POJOInjection.java 2007-05-17 10:27:41 UTC (rev 7269)
+++ trunk/jems/src/main/org/jboss/portal/jems/as/system/POJOInjection.java 2007-05-17 21:40:09 UTC (rev 7270)
@@ -30,10 +30,6 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.ReflectionException;
-import javax.management.MalformedObjectNameException;
-import java.lang.reflect.Proxy;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -42,27 +38,28 @@
public class POJOInjection
{
- /** . */
+ /** The dispatcher. */
private final Interceptor dispatcher;
- /** . */
- private final Invocation invocation;
+ /** The setter invocation. */
+ private final Invocation setter;
- /** . */
+ /** The mbean server. */
private final MBeanServer server;
- /** . */
+ /** The pojo object name. */
private final ObjectName pojoName;
- /** . */
- private boolean resolved;
+ /** The injection status. */
+ private boolean injected;
- public POJOInjection(MBeanProxyExt pojoHandler, Interceptor dispatcher, Invocation invocation)
+ public POJOInjection(MBeanProxyExt pojoHandler, Interceptor dispatcher, Invocation setter)
{
this.dispatcher = dispatcher;
- this.invocation = invocation;
+ this.setter = setter;
this.server = pojoHandler.getMBeanProxyMBeanServer();
this.pojoName = pojoHandler.getMBeanProxyObjectName();
+ this.injected = false;
}
public ObjectName getPOJOName()
@@ -72,7 +69,7 @@
public synchronized void resolve()
{
- if (!resolved)
+ if (!injected)
{
if (server.isRegistered(pojoName))
{
@@ -88,18 +85,19 @@
Object pojo = entry.getInvoker().getResource();
// Replace the proxy by the service
- invocation.getArgs()[0] = pojo;
+ setter.getArgs()[0] = pojo;
// Dispatch the invocation finally
- dispatcher.invoke(invocation);
+ dispatcher.invoke(setter);
+
+ //
+ this.injected = true;
}
-
- //
- this.resolved = true;
}
catch (InstanceNotFoundException ignore)
{
- // Not found will resolve later
+ // It means that between the registration check and the get
+ // the service was removed
}
catch (Throwable e)
{
@@ -107,7 +105,26 @@
}
}
}
- }
+ else
+ {
+ if (!server.isRegistered(pojoName))
+ {
+ try
+ {
+ // Replace the proxy by the service
+ setter.getArgs()[0] = null;
+ // Dispatch the invocation finally
+ dispatcher.invoke(setter);
+ //
+ this.injected = false;
+ }
+ catch (Throwable e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
}
Modified: trunk/jems/src/main/org/jboss/portal/jems/as/system/POJOInjector.java
===================================================================
--- trunk/jems/src/main/org/jboss/portal/jems/as/system/POJOInjector.java 2007-05-17 10:27:41 UTC (rev 7269)
+++ trunk/jems/src/main/org/jboss/portal/jems/as/system/POJOInjector.java 2007-05-17 21:40:09 UTC (rev 7270)
@@ -55,7 +55,7 @@
public void handleNotification(Notification notification, Object object)
{
String type = notification.getType();
- if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(type))
+ if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(type) || MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(type))
{
MBeanServerNotification msn = (MBeanServerNotification)notification;
ObjectName name = msn.getMBeanName();
@@ -65,10 +65,5 @@
injection.resolve();
}
}
- else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(type))
- {
- MBeanServerNotification msn = (MBeanServerNotification)notification;
- // ObjectName name = msn.getMBeanName();
- }
}
}
17 years
JBoss Portal SVN: r7269 - in trunk/identity: src/main/org/jboss/portal/identity/db and 1 other directory.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-05-17 06:27:41 -0400 (Thu, 17 May 2007)
New Revision: 7269
Modified:
trunk/identity/build.xml
trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java
Log:
- make LDAP synchronized users enabled by default in database
Modified: trunk/identity/build.xml
===================================================================
--- trunk/identity/build.xml 2007-05-17 10:17:48 UTC (rev 7268)
+++ trunk/identity/build.xml 2007-05-17 10:27:41 UTC (rev 7269)
@@ -275,6 +275,18 @@
</jar>
</target>
+
+ <target name="package-opends" depends="init, output" if="HAVE_JDK_1.5">
+
+ <!--test-identity.sar -->
+ <jar jarfile="${build.lib}/opends.sar">
+ <fileset dir="${build.resources}/opends-sar"/>
+ <fileset dir="../test/output/lib" includes="portal-test-agent-lib.jar"/>
+ <fileset dir="${sun.opends.lib}" includes="OpenDS.jar"/>
+ <fileset dir="${sleepycat.sleepycat.lib}" includes="je.jar"/>
+ </jar>
+ </target>
+
<!-- ================================================================== -->
<!-- Cleaning -->
<!-- ================================================================== -->
@@ -304,6 +316,20 @@
<target name="help" depends="_default:help"/>
+
+ <target name="deploy-opends" depends="init, package-opends" if="HAVE_JDK_1.5" >
+ <mkdir dir="${jboss.home}/server/default/conf/opends"/>
+ <copy todir="${jboss.home}/server/default/conf/opends" overwrite="true" failonerror="false">
+ <fileset dir="../test/output/etc/opends"/>
+ </copy>
+ <copy todir="${jboss.home}/server/default/conf/opends" overwrite="true" failonerror="false">
+ <fileset dir="./output/etc/opends"/>
+ </copy>
+ <copy file="${build.lib}/opends.sar" todir="${jboss.home}/server/${portal.deploy.dir}" failonerror="false"/>
+ </target>
+
+
+
<target name="deploy-ldap" depends="init, package-tests" if="HAVE_JDK_1.5" >
<mkdir dir="${jboss.home}/server/default/conf/opends"/>
<copy todir="${jboss.home}/server/default/conf/opends" overwrite="true" failonerror="false">
Modified: trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java 2007-05-17 10:17:48 UTC (rev 7268)
+++ trunk/identity/src/main/org/jboss/portal/identity/db/HibernateUserProfileModuleImpl.java 2007-05-17 10:27:41 UTC (rev 7269)
@@ -60,6 +60,8 @@
private boolean synchronizeNonExistingUsers = true;
+ private boolean enableSynchronizedUsers = true;
+
private boolean acceptOtherImplementations = true;
private String defaultSynchronizePassword;
@@ -234,7 +236,14 @@
hu.updatePassword(password.toString());
}
session = getCurrentSession();
+
+ //so if we synchronize from LDAP lets make the user enabled
+ if (isEnableSynchronizedUsers())
+ {
+ hu.setEnabled(true);
+ }
session.save(hu);
+
return hu;
}
catch (HibernateException e)
@@ -285,7 +294,16 @@
this.synchronizeNonExistingUsers = synchronizeNonExistingUsers;
}
+ public boolean isEnableSynchronizedUsers()
+ {
+ return enableSynchronizedUsers;
+ }
+ public void setEnableSynchronizedUsers(boolean enableSynchronizedUsers)
+ {
+ this.enableSynchronizedUsers = enableSynchronizedUsers;
+ }
+
public boolean isAcceptOtherImplementations()
{
return acceptOtherImplementations;
17 years