JBoss Community

Re: Dynamically adding / removing portlets programmatically

created by steux jean-sebastien in JBoss Portal - View the full discussion

I have a simpler solution ; In an older projet (jbp 2.6), we also had developped a Specific Interceptor (extends ControllerInterceptor) to add a window like this :

 

 

        RenderPageCommand rCmd = (RenderPageCommand) cmd;
        PortalObjectPath pagePath = rCmd.getTargetId().getPath();

 

        // Set path for dynamic window
        String[] names = new String[pagePath.getLength() + 1];
        for (int i = 0; i < pagePath.getLength(); i++) {
            names[i] = pagePath.getName(i);
        }

 

        names[pagePath.getLength()] = "dynamic_" + windowName;
        PortalObjectId id = new PortalObjectId(rCmd.getTargetId().getNamespace(), new PortalObjectPath(names));
        PortalObject po = getPortalObjectContainer().getObject(id);
        rCmd.getWindows().add(po);

 

 

 

I hope it can help you.

Reply to this message by going to Community

Start a new discussion in JBoss Portal at Community