Package org.apache.jetspeed.om.portlet

Examples of org.apache.jetspeed.om.portlet.PortletApplication


    }

    protected void stopPA(String contextName, int paType)
        throws RegistryException
    {
        PortletApplication pa = null;
       
        try
        {
            pa = registry.getPortletApplication(contextName);
        }
        catch (Exception e)
        {
            // ignore errors during portal shutdown
        }
        if  (pa != null && pa.getApplicationType() != paType)
        {
            throw new RegistryException("Cannot stop portlet application "+contextName+": as Application Types don't match: " + pa.getApplicationType() + " != " + paType);
        }
        DescriptorChangeMonitor monitor = this.monitor;
        if ( monitor != null )
        {
            monitor.remove(contextName);
View Full Code Here


        List list = new LinkedList();
        Iterator portlets = registry.getAllPortletDefinitions().iterator();
        while ( portlets.hasNext() )
        {
            PortletDefinition portlet = (PortletDefinition)portlets.next();
            PortletApplication app = (PortletApplication)portlet.getApplication();
            String appName = app.getName();
            if ( appName == null )
                continue;
            if ( ! appName.equals( "jetspeed-layouts" ) )
                continue;
View Full Code Here

           
            if (portlet == null)
                continue;
           
            // Do not display Jetspeed Layout Applications
            PortletApplication pa = (PortletApplication)portlet.getApplication();
            if (pa.isLayoutApplication())
                continue;
                
            // SECURITY filtering
            String uniqueName = pa.getName() + "::" + portlet.getPortletName();
            if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
            {
                InitParam param = portlet.getInitParam(PORTLET_ICON);
                String image;
                if (param != null)
View Full Code Here

    {
            Iterator it = applications.iterator();
            while (it.hasNext())
            {
                JSApplication app = (JSApplication) it.next();
                PortletApplication portletApp = registry.getPortletApplication(app.getName());
            if ((portletApp != null) || importAll)
                {
                    importPA(app, portletApp, settings, log);
                }
            }
View Full Code Here

        }
        while (list.hasNext())
        {
            try
            {
                PortletApplication pa = (PortletApplication) list.next();
                // PortletApplicationDefinition pa =
                // (PortletApplicationDefinition)list.next();
                JSApplication app = exportPA(pa, settings, log);
                if (app != null)
                {
View Full Code Here

                }
            }
        }
        Criteria c = new Criteria();
        c.addEqualTo("name", name);
        PortletApplication app = (PortletApplication) getPersistenceBrokerTemplate().getObjectByQuery(
                QueryFactory.newQuery(PortletApplicationDefinitionImpl.class, c));
        postLoad(app);
        return app;
    }
View Full Code Here

        {
            //System.out.println("%%% PA remote removed " + key);
            RegistryApplicationCache.cacheRemoveQuiet((String) key, (RegistryCacheObjectWrapper)element);
            if (listeners != null && !listeners.isEmpty())
            {
                PortletApplication pa = this.getPortletApplication((String)key);
                if (pa != null)
                {
                    for (int ix=0; ix < listeners.size(); ix++)
                    {
                        RegistryEventListener listener = listeners.get(ix);
View Full Code Here

                if (StringUtils.isBlank(appName))
                {
                    continue;
                }
               
                PortletApplication pa = portletRegistry.getPortletApplication(appName);
               
                if (pa != null)
                {
                    paBeanList.add(new PortletApplicationBean(pa));
                }
            }
        }
        else
        {
            if (StringUtils.isBlank(applicationName))
            {
                Collection<PortletApplication> pas = portletRegistry.getPortletApplications();
                paBeans.setTotalSize(pas.size());
               
                for (PortletApplication pa : (Collection<PortletApplication>) PaginationUtils.subCollection(pas, beginIndex, maxResults))
                {
                    paBeanList.add(new PortletApplicationBean(pa));
                }
            }
            else
            {
                PortletApplication pa = portletRegistry.getPortletApplication(applicationName, true);
               
                if (pa != null)
                {
                    paBeans.setTotalSize(1);
                    paBeanList.add(new PortletApplicationBean(pa));
View Full Code Here

                    pdBeanList.add(new PortletDefinitionBean(pd));
                }
            }
            else
            {
                PortletApplication pa = portletRegistry.getPortletApplication(applicationName, true);
               
                if (pa != null)
                {
                    if (StringUtils.isBlank(definitionName))
                    {
                        Collection<PortletDefinition> pds = filterPortletDefinitionsBySecurityAccess(pa.getPortlets(), JetspeedActions.MASK_VIEW, servletRequest);
                        pdBeans.setTotalSize(pds.size());
                       
                        for (PortletDefinition pd : (List<PortletDefinition>) PaginationUtils.subCollection(pds, beginIndex, maxResults))
                        {
                            pdBeanList.add(new PortletDefinitionBean(pd));
                        }
                    }
                    else
                    {
                        PortletDefinition pd = pa.getPortlet(definitionName);
                       
                        if (pd != null && securityAccessController.checkPortletAccess(pd, JetspeedActions.MASK_VIEW))
                        {
                            pdBeanList.add(new PortletDefinitionBean(pd));
                            pdBeans.setTotalSize(1);
View Full Code Here

            @Override
            public IDataProvider<DescriptionBean> getDataProvider()
            {
                PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());

                final InitParam param = def.getInitParam(initParam.getParamName());

                List<DescriptionBean> list = new ArrayList<DescriptionBean>();

                for (Description description : param.getDescriptions())
                {
                    list.add(new DescriptionBean(description));
                }

                return new ListDataProvider<DescriptionBean>(list);
            }
           
            @Override
            protected Button saveButton(String componentId)
            {
                return new Button(componentId)
                {

                    @Override
                    public void onSubmit()
                    {
                        PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                        PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                        if (newLocale != null && newDescription != null)
                        {
                            InitParam param = def.getInitParam(initParam.getParamName());
                            Locale locale = new Locale(newLocale);
                            Description targetDescription = null;
                           
                            for (Description description : param.getDescriptions())
                            {
                                if (description.getLocale().equals(locale))
                                {
                                    targetDescription = description;
                                    break;
                                }
                            }
                           
                            if (targetDescription == null)
                            {
                                targetDescription = param.addDescription(newLocale);
                            }
                           
                            targetDescription.setDescription(newDescription);
                           
                            newLocale = null;
                            newDescription = null;
                        }

                        FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
                       
                        try
                        {
                            registry.savePortletDefinition(def);
                            StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveOK", this, null, new Object [] { paNodeBean.getName() } );
                            feed.info(resModel.getString());
                        }
                        catch (RegistryException e)
                        {
                            logger.error("Failed to save portlet definition.", e);
                            StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveFailure", this, null, new Object [] { paNodeBean.getName(), e.getMessage() } );
                            feed.info(resModel.getString());
                        }
                    }
                };
            }

            @Override
            public void delete(IModel<DescriptionBean>[] fields)
            {
                FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
               
                try
                {
                    PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                    PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                    InitParam initParam = def.getInitParam(name);
                   
                    if (initParam != null)
                    {
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.portlet.PortletApplication

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.