Examples of PortletApplication


Examples of net.sf.jportlet.portlet.application.PortletApplication

                      PortletRequest  request,
                      PortletResponse response )
        throws PortletException
    {
        PortletProxy       proxy;
        PortletApplication container = getApplication(  );
        MessageEventImpl   event = new MessageEventImpl( message, ( PortletRequestImpl ) request, ( PortletResponseImpl ) response );

        if ( portletName != null )
        {
            proxy = ( PortletProxy ) container.getPortlet( portletName );
            send( event, proxy );
        }
        else
        {
            Enumeration names = container.getPortletNames(  );

            while ( names.hasMoreElements(  ) )
            {
                portletName = names.nextElement(  ).toString(  );
                proxy       = ( PortletProxy ) container.getPortlet( portletName );
                send( event, proxy );
            }
        }
    }
View Full Code Here

Examples of net.sf.jportlet.portlet.application.PortletApplication

                {
                    throw new JspException( "No portlet to render" );
                }

                HttpServletResponse response = ( HttpServletResponse ) pageContext.getResponse(  );
                PortletApplication  container = getPortletContainer(  );
                PortletProxy        proxy = ( PortletProxy ) getPortletContainer(  ).getPortlet( portletName );
                PortletRequestImpl  req = new PortletRequestImpl( proxy, request, container.getPortletServiceFactory(  ) );
                PortletResponseImpl resp = new PortletResponseImpl( proxy, req, response );
               
                PageTag page = (PageTag)findAncestorWithClass( this, PageTag.class );
                if ( page == null )
                {
View Full Code Here

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

        ((ResourceLocatingServletContext) servletContext).setContext(paContextPath, paContext);

        try
        {
            ClassLoader paCl = createPAClassLoader(new File(paRootDir, "WEB-INF"));
            PortletApplication pa = portletRegistry.getPortletApplication(paName);       
            portletFactory.registerPortletApplication(pa, paCl);
        }
        catch (Exception e)
        {
            System.out.println("Failed to register portlet application, " + paName + ": " + e);
View Full Code Here

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

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

                final SecurityRoleRef secRoleRef = def.getSecurityRoleRef(securityRoleRef.getRoleName());

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

                for (Description description : secRoleRef.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 = app.getPortlet(paNodeBean.getName());
                       
                        if (newLocale != null && newDescription != null)
                        {
                            SecurityRoleRef secRoleRef = def.getSecurityRoleRef(securityRoleRef.getRoleName());
                            Locale locale = new Locale(newLocale);
                            Description targetDescription = null;
                           
                            for (Description description : secRoleRef.getDescriptions())
                            {
                                if (description.getLocale().equals(locale))
                                {
                                    targetDescription = description;
                                    break;
                                }
                            }
                           
                            if (targetDescription == null)
                            {
                                targetDescription = securityRoleRef.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 = app.getPortlet(paNodeBean.getName());
                    SecurityRoleRef secRoleRef = def.getSecurityRoleRef(securityRoleRef.getRoleName());
                   
                    if (secRoleRef != null)
                    {
                        for (Iterator<Description> it = secRoleRef.getDescriptions().iterator(); it.hasNext(); )
View Full Code Here

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

    @Override
    public void delete(IModel<SecurityRoleRef>[] fields)
    {
        PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
        PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
        PortletDefinition def = app.getPortlet(paNodeBean.getName());

        Iterator<SecurityRoleRef> it = def.getSecurityRoleRefs().iterator();
        while (it.hasNext())
        {
            SecurityRoleRef securityRoleRef = it.next();
View Full Code Here

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

    @Override
    public Iterator<IModel<SecurityRoleRef>> getItemModels()
    {
        JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
        PortletRegistry registry = locator.getPortletRegistry();
        PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
        PortletDefinition def = app.getPortlet(paNodeBean.getName());
       
        List<IModel<SecurityRoleRef>> securityRoleRefModels = new ArrayList<IModel<SecurityRoleRef>>();
       
        for (SecurityRoleRef securityRoleRef : def.getSecurityRoleRefs())
        {
View Full Code Here

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

        {
            @Override
            public void onSubmit()
            {
                PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                PortletDefinition def = app.getPortlet(paNodeBean.getName());

                if (newRoleName != null && newRoleLink != null)
                {
                    SecurityRoleRef securityRoleRef = def.addSecurityRoleRef(newRoleName);
                    securityRoleRef.setRoleLink(newRoleLink);
View Full Code Here

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

            @Override
            public IDataProvider<DescriptionBean> getDataProvider()
            {
                PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                PortletDefinition def = app.getPortlet(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 = app.getPortlet(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 = app.getPortlet(paNodeBean.getName());
                    InitParam initParam = def.getInitParam(name);
                   
                    if (initParam != null)
                    {
                        for (Iterator<Description> it = initParam.getDescriptions().iterator(); it.hasNext(); )
View Full Code Here

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

    @Override
    public void delete(IModel<InitParam>[] fields)
    {
        PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
        PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
        PortletDefinition def = app.getPortlet(paNodeBean.getName());

        Iterator<InitParam> it = def.getInitParams().iterator();
        while (it.hasNext())
        {
            InitParam initParam = it.next();
View Full Code Here

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

    @Override
    public Iterator<IModel<InitParam>> getItemModels()
    {
        JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
        PortletRegistry registry = locator.getPortletRegistry();
        PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
        PortletDefinition def = app.getPortlet(paNodeBean.getName());
       
        List<IModel<InitParam>> initParamBeanModels = new ArrayList<IModel<InitParam>>();
       
        for (InitParam initParam : def.getInitParams())
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.