Author: julien_viet
Date: 2010-02-11 10:42:32 -0500 (Thu, 11 Feb 2010)
New Revision: 1642
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/UserSiteLifeCycle.java
Log:
add logging for user site creation
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java 2010-02-11
15:35:05 UTC (rev 1641)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java 2010-02-11
15:42:32 UTC (rev 1642)
@@ -23,6 +23,8 @@
import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.services.organization.User;
import org.exoplatform.services.organization.UserEventListener;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
/**
* Created by The eXo Platform SAS May 29, 2007
@@ -31,6 +33,9 @@
{
/** . */
+ private final Logger log = LoggerFactory.getLogger(UserPortalConfigListener.class);
+
+ /** . */
private final UserPortalConfigService portalConfigService;
/** . */
@@ -58,16 +63,23 @@
}
}
- public void preSave(User user, boolean isNew) throws Exception
+ public void preSave(User user, boolean isNew)
{
+ String userName = user.getUserName();
+
+ //
RequestLifeCycle.begin(PortalContainer.getInstance());
try
{
- String userName = user.getUserName();
+ log.debug("About to create user site for user " + userName);
// Create the portal from the template
portalConfigService.createUserSite(userName);
}
+ catch (Exception e)
+ {
+ log.error("Could not create user site for user " + userName, e);
+ }
finally
{
RequestLifeCycle.end();
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/UserSiteLifeCycle.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/UserSiteLifeCycle.java 2010-02-11
15:35:05 UTC (rev 1641)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/UserSiteLifeCycle.java 2010-02-11
15:42:32 UTC (rev 1642)
@@ -25,6 +25,8 @@
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.web.application.Application;
import org.exoplatform.web.application.ApplicationLifecycle;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
@@ -33,26 +35,25 @@
public class UserSiteLifeCycle implements
ApplicationLifecycle<PortalRequestContext>
{
+ /** . */
+ private final Logger log = LoggerFactory.getLogger(UserSiteLifeCycle.class);
+
public void onInit(Application app) throws Exception
{
-
}
public void onStartRequest(Application app, PortalRequestContext context) throws
Exception
{
String userName = context.getRemoteUser();
-
- //
if (userName != null)
{
DataStorage storage =
(DataStorage)PortalContainer.getComponent(DataStorage.class);
-
- //
PortalConfig portalConfig = storage.getPortalConfig("user",
userName);
//
if (portalConfig == null)
{
+ log.debug("About to create user site for user " + userName);
UserPortalConfigService configService =
(UserPortalConfigService)PortalContainer.getComponent(UserPortalConfigService.class);
configService.createUserSite(userName);
}
@@ -61,11 +62,9 @@
public void onEndRequest(Application app, PortalRequestContext context) throws
Exception
{
-
}
public void onDestroy(Application app) throws Exception
{
-
}
}
Show replies by date