[jboss-user] [JBoss Portal] - Re: Redirect to a specific portal after login

bvogt do-not-reply at jboss.com
Wed Dec 5 10:46:50 EST 2007


In your PortalCommandFactory you have to implement the method:
   public ControllerCommand doMapping(ControllerContext controllerContext, ServerInvocation invocation, String host, String contextPath, String requestPath)
  | 
it returns instances of org.jboss.portal.core.controller.ControllerCommand

Existing ControllerCommands are e.g. ViewPortalCommand and ViewPageCommand.

An example for switching to another portal is given in the org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor, the 'admin' link is generated by:
PortalObjectPermission perm = new PortalObjectPermission(adminPortalId, PortalObjectPermission.VIEW_MASK);
  | try
  | {
  |    if (controller.getPortalAuthorizationManagerFactory().getManager().checkPermission(perm))
  |    {
  |       ViewPageCommand showadmin = new ViewPageCommand(adminPortalId);
  |       rd.setAttribute("org.jboss.portal.header.ADMIN_PORTAL_URL", new PortalURLImpl(showadmin, controllerCtx, null, null));
  |    }
  | }
  | catch (PortalSecurityException e)
  | {
  |    log.error("", e);
  | }

I would assume, that returning the above mentioned 'showadmin' instance in your doMapping() method shall do the portal switch. In addition you have to think about the page of the target portal that is to be displayed...

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110574#4110574

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110574



More information about the jboss-user mailing list