Package org.apache.jetspeed.portlets

Examples of org.apache.jetspeed.portlets.CategoryInfo


        }
        StringTokenizer catTokenizer = new StringTokenizer(cats, ",");
        while (catTokenizer.hasMoreTokens())
        {
            String name = catTokenizer.nextToken().trim();
            CategoryInfo cat = new CategoryInfo(name);
            String keywords = prefs.getValue("Keywords:" + name, null);
            if (keywords != null)
            {
                StringTokenizer keyTokenizer = new StringTokenizer(keywords, ",");
                StringBuffer searchString = new StringBuffer();
                int count = 0;
                while (keyTokenizer.hasMoreTokens())
                {
                    String keyword = keyTokenizer.nextToken().trim();
                    if (count > 0)
                    {
                        searchString.append(" | ");
                    }
                    searchString.append(keyword);
                    count++;
                }
                if (count > 0)
                {
                    Iterator portlets = searchEngine.search(searchString.toString()).getResults().iterator();
                    while (portlets.hasNext())
                    {
                        PortletDefinition portlet =
                            getPortletFromParsedObject((ParsedObject)portlets.next());
                        PortletInfo portletInfo = filterPortlet(portlet, locale, request);
                        if (portletInfo != null)
                        {
                            cat.addPortlet(portletInfo);
                        }                   
                    }               
                    Collections.sort(cat.getPortlets(), this);
                    categories.add(cat);
                }
            }
        }
        request.getPortletSession().setAttribute(CATEGORIES, categories);       
View Full Code Here


        {
            StringTokenizer catTokenizer = new StringTokenizer(cats, ",");
            while (catTokenizer.hasMoreTokens())
            {
                String name = catTokenizer.nextToken().trim();
                CategoryInfo cat = new CategoryInfo(name);
                String keys = prefs.getValue("Keywords:" + name, "");
                cat.setKeywords(keys);
                categories.add(cat);
            }
        }
        context.put("categories", categories);
        context.put("Rows", prefs.getValue("Rows", "5"));
View Full Code Here

    List list = new ArrayList();
    List tmpList = null;
    List catList = null;
    Iterator iterator = null;
    int portletCount = 0;
    CategoryInfo catInfo = null;
    int strtCnt = getStartRow(pageNumber, portletPerPages);
    int endCnt = getEndRow(pageNumber, portletPerPages);
    try
    {     
      if (category.equalsIgnoreCase("all")) {       
        tmpList = retrievePortlets(request, filter);
        portletCount = tmpList.size();
        if (endCnt > portletCount)
          endCnt = portletCount;
        for (int index = strtCnt; index < endCnt; index++) {
          list.add(tmpList.get(index));
        }
      } else if (category.equalsIgnoreCase("search")) {
        tmpList = retrievePortlets(request, filter);
        portletCount = tmpList.size();
        if (endCnt > portletCount)
          endCnt = portletCount;
        for (int index = strtCnt; index < endCnt; index++) {
          list.add(tmpList.get(index));
        }
      } else {
        tmpList =  retrieveCategories(request);
        iterator = tmpList.iterator();
        while (iterator.hasNext()) {
          catInfo = (CategoryInfo) iterator.next();
          if (catInfo.getName().equalsIgnoreCase(category)) {
            catList = catInfo.getPortlets();
            break;
          }
        }
        portletCount = catList.size();
        if (endCnt > portletCount)
View Full Code Here

        }
        StringTokenizer catTokenizer = new StringTokenizer(cats, ",");
        while (catTokenizer.hasMoreTokens())
        {
            String name = catTokenizer.nextToken().trim();
            CategoryInfo cat = new CategoryInfo(name);
            String keywords = prefs.getValue("Keywords:" + name, null);
            if (keywords != null)
            {
                StringTokenizer keyTokenizer = new StringTokenizer(keywords, ",");
                StringBuffer searchString = new StringBuffer();
                int count = 0;
                while (keyTokenizer.hasMoreTokens())
                {
                    String keyword = keyTokenizer.nextToken().trim();
                    if (count > 0)
                    {
                        searchString.append(" | ");
                    }
                    searchString.append(keyword);
                    count++;
                }
                if (count > 0)
                {
                    Iterator portlets = searchEngine.search(searchString.toString()).getResults().iterator();
                    while (portlets.hasNext())
                    {
                        PortletDefinitionComposite portlet =
                            getPortletFromParsedObject((ParsedObject)portlets.next());
                        PortletInfo portletInfo = filterPortlet(portlet, locale);
                        if (portletInfo != null)
                        {
                            cat.addPortlet(portletInfo);
                        }                   
                    }               
                    Collections.sort(cat.getPortlets(), this);
                    categories.add(cat);
                }
            }
        }
        request.getPortletSession().setAttribute(CATEGORIES, categories);       
View Full Code Here

        {
            StringTokenizer catTokenizer = new StringTokenizer(cats, ",");
            while (catTokenizer.hasMoreTokens())
            {
                String name = catTokenizer.nextToken().trim();
                CategoryInfo cat = new CategoryInfo(name);
                String keys = prefs.getValue("Keywords:" + name, "");
                cat.setKeywords(keys);
                categories.add(cat);
            }
        }
        context.put("categories", categories);
        context.put("Rows", prefs.getValue("Rows", "5"));
View Full Code Here

    List list = new ArrayList();
    List tmpList = null;
    List catList = null;
    Iterator iterator = null;
    int portletCount = 0;
    CategoryInfo catInfo = null;
    int strtCnt = getStartRow(pageNumber, portletPerPages);
    int endCnt = getEndRow(pageNumber, portletPerPages);
    try {     
      if (category.equalsIgnoreCase("all")) {       
        tmpList = retrievePortlets(request, filter);
        portletCount = tmpList.size();
        if (endCnt > portletCount)
          endCnt = portletCount;
        for (int index = strtCnt; index < endCnt; index++) {
          list.add(tmpList.get(index));
        }
      } else if (category.equalsIgnoreCase("search")) {
        tmpList = retrievePortlets(request, filter);
        portletCount = tmpList.size();
        if (endCnt > portletCount)
          endCnt = portletCount;
        for (int index = strtCnt; index < endCnt; index++) {
          list.add(tmpList.get(index));
        }
      } else {
        tmpList =  retrieveCategories(request);
        iterator = tmpList.iterator();
        while (iterator.hasNext()) {
          catInfo = (CategoryInfo) iterator.next();
          if (catInfo.getName().equalsIgnoreCase(category)) {
            catList = catInfo.getPortlets();
            break;
          }
        }
        portletCount = catList.size();
        if (endCnt > portletCount)
View Full Code Here

        }
        StringTokenizer catTokenizer = new StringTokenizer(cats, ",");
        while (catTokenizer.hasMoreTokens())
        {
            String name = catTokenizer.nextToken().trim();
            CategoryInfo cat = new CategoryInfo(name);
            String keywords = prefs.getValue("Keywords:" + name, null);
            if (keywords != null)
            {
                StringTokenizer keyTokenizer = new StringTokenizer(keywords, ",");
                StringBuffer searchString = new StringBuffer();
                int count = 0;
                while (keyTokenizer.hasMoreTokens())
                {
                    String keyword = keyTokenizer.nextToken().trim();
                    if (count > 0)
                    {
                        searchString.append(" | ");
                    }
                    searchString.append(keyword);
                    count++;
                }
                if (count > 0)
                {
                    Iterator portlets = searchEngine.search(searchString.toString()).getResults().iterator();
                    while (portlets.hasNext())
                    {
                        PortletDefinitionComposite portlet =
                            getPortletFromParsedObject((ParsedObject)portlets.next());
                        PortletInfo portletInfo = filterPortlet(portlet, locale);
                        if (portletInfo != null)
                        {
                            cat.addPortlet(portletInfo);
                        }                   
                    }               
                    Collections.sort(cat.getPortlets(), this);
                    categories.add(cat);
                }
            }
        }
        request.getPortletSession().setAttribute(CATEGORIES, categories);       
View Full Code Here

        {
            StringTokenizer catTokenizer = new StringTokenizer(cats, ",");
            while (catTokenizer.hasMoreTokens())
            {
                String name = catTokenizer.nextToken().trim();
                CategoryInfo cat = new CategoryInfo(name);
                String keys = prefs.getValue("Keywords:" + name, "");
                cat.setKeywords(keys);
                categories.add(cat);
            }
        }
        context.put("categories", categories);
        context.put("Rows", prefs.getValue("Rows", "5"));
View Full Code Here

    List list = new ArrayList();
    List tmpList = null;
    List catList = null;
    Iterator iterator = null;
    int portletCount = 0;
    CategoryInfo catInfo = null;
    int strtCnt = getStartRow(pageNumber, portletPerPages);
    int endCnt = getEndRow(pageNumber, portletPerPages);
    try {     
      if (category.equalsIgnoreCase("all")) {       
        tmpList = retrievePortlets(request, filter);
        portletCount = tmpList.size();
        if (endCnt > portletCount)
          endCnt = portletCount;
        for (int index = strtCnt; index < endCnt; index++) {
          list.add(tmpList.get(index));
        }
      } else if (category.equalsIgnoreCase("search")) {
        tmpList = retrievePortlets(request, filter);
        portletCount = tmpList.size();
        if (endCnt > portletCount)
          endCnt = portletCount;
        for (int index = strtCnt; index < endCnt; index++) {
          list.add(tmpList.get(index));
        }
      } else {
        tmpList =  retrieveCategories(request);
        iterator = tmpList.iterator();
        while (iterator.hasNext()) {
          catInfo = (CategoryInfo) iterator.next();
          if (catInfo.getName().equalsIgnoreCase(category)) {
            catList = catInfo.getPortlets();
            break;
          }
        }
        portletCount = catList.size();
        if (endCnt > portletCount)
View Full Code Here

        }
        StringTokenizer catTokenizer = new StringTokenizer(cats, ",");
        while (catTokenizer.hasMoreTokens())
        {
            String name = catTokenizer.nextToken().trim();
            CategoryInfo cat = new CategoryInfo(name);
            String keywords = prefs.getValue("Keywords:" + name, null);
            if (keywords != null)
            {
                StringTokenizer keyTokenizer = new StringTokenizer(keywords, ",");
                StringBuffer searchString = new StringBuffer();
                int count = 0;
                while (keyTokenizer.hasMoreTokens())
                {
                    String keyword = keyTokenizer.nextToken().trim();
                    if (count > 0)
                    {
                        searchString.append(" | ");
                    }
                    searchString.append(keyword);
                    count++;
                }
                if (count > 0)
                {
                    Iterator portlets = searchEngine.search(searchString.toString()).getResults().iterator();
                    while (portlets.hasNext())
                    {
                        PortletDefinitionComposite portlet =
                            getPortletFromParsedObject((ParsedObject)portlets.next());
                        PortletInfo portletInfo = filterPortlet(portlet, locale, request);
                        if (portletInfo != null)
                        {
                            cat.addPortlet(portletInfo);
                        }                   
                    }               
                    Collections.sort(cat.getPortlets(), this);
                    categories.add(cat);
                }
            }
        }
        request.getPortletSession().setAttribute(CATEGORIES, categories);       
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.portlets.CategoryInfo

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.