Package org.apache.jetspeed.portal

Examples of org.apache.jetspeed.portal.PortletController


    public String getPanelKey()
    {
        String panelName = PANEL_KEY;
        try
        {
            PortletController controller = portlet.getPortletConfig()
                                                  .getPortletSet()
                                                  .getController();

            if (controller instanceof PanedPortletController)
            {
View Full Code Here


     */
    public DynamicURI setPanel(String panel)
    {
        removePathInfo(JetspeedResources.PATH_PANEID_KEY);
        removeQueryData(JetspeedResources.PATH_PANEID_KEY);
        PortletController controller = activePortlet.getPortletConfig()
                                                        .getPortletSet()
                                                        .getController();

       String id = null;

        if (controller instanceof PanedPortletController)
        {
            PortletSet set = controller.getPortlets();
            Portlet portlet = null;
            if (null != set)
            {
                portlet = set.getPortletByName(panel);
            }
View Full Code Here

    public String getPanelKey()
    {
        String panelName = PANEL_KEY;
        try
        {
            PortletController controller = activePortlet.getPortletConfig()
                                                        .getPortletSet()
                                                        .getController();

            if (controller instanceof PanedPortletController)
            {
View Full Code Here

        }           
        //portlet is not a portlet - probably a controller or control
        if (registryEntry==null) {
            PortletSet ps  = portlet.getPortletConfig().getPortletSet();
            if (ps != null) {
                PortletController pc = ps.getController();
                if (pc != null) {
                    portletName = pc.getConfig().getName();
                    registryEntry = (RegistryEntry)Registry.getEntry(Registry.PORTLET_CONTROLLER, portletName);
                }
            }
        }
        if (registryEntry==null) {
View Full Code Here

                            .getTemplateContext( "VelocityControllerContext" );
    }

    public void doPerform( RunData rundata, Context context )
    {
        PortletController controller = (PortletController)context.get( "controller" );

        // if we're in customization mode for the given set, handle
        // customization
        if (((JetspeedRunData)rundata).getMode()==JetspeedRunData.CUSTOMIZE)
        {
View Full Code Here

     * @param name a PortletController name available in the registry or a classname
     * @return the created PortletController
     */
    public PortletController getController(String name)
    {
        PortletController pc = null;
        PortletControllerEntry entry = null;

        if (name != null)
        {
            entry = (PortletControllerEntry) Registry.getEntry(Registry.PORTLET_CONTROLLER, name);
        }

        Map params = null;

        try
        {
            if (entry == null)
            {
                if (name != null)
                {
                    pc = (PortletController) Class.forName(name).newInstance();
                    params = new Hashtable();
                }
            }
            else
            {
                pc = (PortletController) Class.forName(entry.getClassname()).newInstance();
                params = entry.getParameterMap();
            }
        }
        catch (Exception e)
        {
            logger.error("Unable to instanciate controller " + name + ", using default");
        }

        if ((pc == null) && (defaultController != null) && (!defaultController.equals(name)))
        {
            return getController(defaultController);
        }

        PortletControllerConfig pcConf = new BasePortletControllerConfig();
        pcConf.setName(name);
        pcConf.setInitParameters(params);
        pc.setConfig(pcConf);
        pc.init();

        return pc;
    }
View Full Code Here

     * @return the created PortletController
     */
    public PortletController getController(Controller controller)
    {

        PortletController pc = null;

        if (controller != null)
        {
            pc = getController(controller.getName());
            pc.getConfig().getInitParameters().putAll(getParameters(controller));
        }
        else
        {
            if (defaultController != null)
            {
                pc = getController(this.defaultController);
            }
        }

        pc.init();

        return pc;
    }
View Full Code Here

     */
    protected PortletSet getSet(Portlets portlets, VariableInteger theCount)
    {
        // Create a new BasePortletSet to handle the portlets
        BasePortletSet set = new BasePortletSet();
        PortletController controller = getController(portlets.getController());
        set.setController(controller);
        String name = portlets.getName();
        if (name != null)
        {
            set.setName(name);
        }
        else
            set.setName(String.valueOf(theCount.getValue()));

        set.setID(portlets.getId());

        theCount.setValue(theCount.getValue() + 1);

        //FIXME: this sucks ! we should either associate the portlet set
        //with its portlets peer or set the porpoerties directly on the portlet
        //set object
        //Unfortunately, this would change the API too drastically for now...
        set.setPortletConfig(getPortletConfig(portlets));

        // Add all sub portlet sets in the main set
        //        Portlets[] subsets = portlets.getPortlets();
        //        for (int i=0; i < subsets.length; i++ )

        for (Iterator it = portlets.getPortletsIterator(); it.hasNext();)
        {
            Portlets subset = (Portlets) it.next();
            // Set this subset's parent Portlets collection.         
            subset.setParentPortlets(portlets);

            Map constraints = getParameters(subset.getLayout());
            int position = getPosition(subset.getLayout());
            set.addPortlet(
                getSet(subset, theCount),
                controller.getConstraints(constraints),
                position);
        }

        // Populate the PortletSet with Portlets
        //        Entry[] entries = portlets.getEntry();
        //        for( int i = 0; i < entries.length; ++i )

        for (Iterator eit = portlets.getEntriesIterator(); eit.hasNext();)
        {
            try
            {

                Entry psmlEntry = (Entry) eit.next();
                PortletEntry entry =
                    (PortletEntry) Registry.getEntry(Registry.PORTLET, psmlEntry.getParent());

                if (entry != null)
                {
                    Portlet p = PortletFactory.getPortlet(psmlEntry);

                    if (p != null)
                    {
                        Map constraints = getParameters(psmlEntry.getLayout());
                        int position = getPosition(psmlEntry.getLayout());

                        PortletControl control = getControl(psmlEntry.getControl(), entry);

                        set.addPortlet(
                            initControl(control, p),
                            controller.getConstraints(constraints),
                            position);
                    }
                }
                else
                {
View Full Code Here

                            .getTemplateContext( "VelocityControllerContext" );
    }

    public void doPerform( RunData rundata, Context context )
    {
        PortletController controller = (PortletController)context.get( "controller" );

        // if we're in customization mode for the given set, handle
        // customization
        if (((JetspeedRunData)rundata).getMode()==JetspeedRunData.CUSTOMIZE)
        {
View Full Code Here

        if (regEntry==null)
        {
            PortletSet ps  = portlet.getPortletConfig().getPortletSet();
            if (ps != null)
            {
                PortletController pc = ps.getController();
                if (pc != null)
                {
                    portletName = pc.getConfig().getName();
                    regEntry = (RegistryEntry)Registry.getEntry(Registry.PORTLET_CONTROLLER, portletName);
                }
            }
        }
        if (regEntry==null)
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.portal.PortletController

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.