Package org.apache.jetspeed.services.beans

Examples of org.apache.jetspeed.services.beans.PortletApplicationBeanCollection


        }
       
        int beginIndex = NumberUtils.toInt(beginIndexParam, -1);
        int maxResults = NumberUtils.toInt(maxResultsParam, -1);
       
        PortletApplicationBeanCollection paBeans = new PortletApplicationBeanCollection();
        paBeans.setBeginIndex(beginIndex);
        paBeans.setTotalSize(0);
        List<PortletApplicationBean> paBeanList = new ArrayList<PortletApplicationBean>();
       
        if (!StringUtils.isBlank(queryParam))
        {
            String queryText =
                ParsedObject.FIELDNAME_TYPE + ":\"" + ParsedObject.OBJECT_TYPE_PORTLET_APPLICATION + "\" AND ( " + queryParam + " )";
            SearchResults searchResults = searchEngine.search(queryText);
            List<ParsedObject> searchResultList = searchResults.getResults();
            paBeans.setTotalSize(searchResultList.size());
           
            for (ParsedObject parsedObject : (List<ParsedObject>) PaginationUtils.subList(searchResultList, beginIndex, maxResults))
            {
                String appName = SearchEngineUtils.getFieldAsString(parsedObject, "ID", null);
               
                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));
                }
            }
        }
       
        paBeans.setApplications(paBeanList);
       
        return paBeans;
    }
View Full Code Here


        }
       
        int beginIndex = NumberUtils.toInt(beginIndexParam, -1);
        int maxResults = NumberUtils.toInt(maxResultsParam, -1);
       
        PortletApplicationBeanCollection paBeans = new PortletApplicationBeanCollection();
        paBeans.setBeginIndex(beginIndex);
        paBeans.setTotalSize(0);
        List<PortletApplicationBean> paBeanList = new ArrayList<PortletApplicationBean>();
       
        if (!StringUtils.isBlank(queryParam))
        {
            String queryText =
                ParsedObject.FIELDNAME_TYPE + ":\"" + ParsedObject.OBJECT_TYPE_PORTLET_APPLICATION + "\" AND ( " + queryParam + " )";
            SearchResults searchResults = searchEngine.search(queryText);
            List<ParsedObject> searchResultList = searchResults.getResults();
            paBeans.setTotalSize(searchResultList.size());
           
            for (ParsedObject parsedObject : (List<ParsedObject>) PaginationUtils.subList(searchResultList, beginIndex, maxResults))
            {
                String appName = SearchEngineUtils.getFieldAsString(parsedObject, "ID", null);
               
                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));
                }
            }
        }
       
        paBeans.setApplications(paBeanList);
       
        return paBeans;
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.services.beans.PortletApplicationBeanCollection

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.