-
1. Re: Access to User's Dashboard from a Servlet
dvanwest Nov 5, 2007 7:11 PM (in response to dvanwest)OK, I found it... looked in jboss-service.xml and then the stuff below works if you wrap in a transaction.
MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
customManager = (CustomizationManager)MBeanProxy.get(CustomizationManager.class,
new ObjectName("portal:service=CustomizationManager"), mbeanServer);
userModule = (UserModule)MBeanProxy.get(UserModule.class,
new ObjectName("portal:service=Module,type=User"), mbeanServer);
User user = userModule.findUserByUserName(request.getRemoteUser());
Portal portal = customManager.getDashboard(user); -
2. Re: Access to User's Dashboard from a Servlet
julien1 Nov 9, 2007 9:33 AM (in response to dvanwest)What are you trying to achieve ?
-
3. Re: Access to User's Dashboard from a Servlet
dvanwest Nov 9, 2007 10:01 AM (in response to dvanwest)We are trying to replace the edit dashboard screen with a simple drop-down panel that would allow one to add a portlet to a dashboard page.
We've also added a delete button to the window decoration for dashboard portlets to allow folks to easily remove a portlet. -
4. Re: Access to User's Dashboard from a Servlet
julien1 Nov 11, 2007 6:07 AM (in response to dvanwest)Ajax extension, wow cool, if you do it, please give us your stuff, we could integrate them with portal.
We wanted to implement the second option but never did it really... (we even have the icon already in the set of icons). We also wanted to make the first one at the beginning but we don't have the time/knowledge to do it from a javascript point of view...
You should use core commands to achieve the different effects as the WindowMoveCommand do. That way you would have a WindowDestroyCommand and probably a WindowAddCommand. -
5. Re: Access to User's Dashboard from a Servlet
dvanwest Apr 18, 2009 10:07 AM (in response to dvanwest)While the example I referenced before was for dashboards, I'd hope that something like this would work with non-dashboard pages. I've not tried this however, as we define static portal pages via the portal-object.xml. This example assumes you want to implement via a servlet, rather than a portlet.
MBeanServer mbeanServer = MBeanServerLocator.locateJBoss(); portalObjectContainer = (PortalObjectContainer)MBeanProxy.get(PortalObjectContainer.class, new ObjectName("portal:container=PortalObject"), mbeanServer); Portal portal = portalObjectContainer.getContext().getPortal(portalName); Page page = portal.getPage(pageName); Window win = page.createWindow(winName, ContentType.PORTLET, instanceID); win.setDeclaredProperty("theme.region", "left"); win.setDeclaredProperty("theme.order", "0");