Package org.dspace.app.cris.statistics.bean

Examples of org.dspace.app.cris.statistics.bean.StatisticDatasBeanRow


                        if (StringUtils.isEmpty(name))
                            name = "Unknown";
                        // if (i<limit && (Integer)result.getVal(i)>0){
                        if (i < limit && !name.equals("Unknown"))
                        {
                            limitedData.add(new StatisticDatasBeanRow(name,
                                    result.getVal(i)));
                        }
                        else
                        {
                            other += (Integer) result.getVal(i);
                        }
                        fullData.add(new StatisticDatasBeanRow(name, result
                                .getVal(i)));
                    }

                }
                catch (Exception e)
                {
                    fullData.add(new StatisticDatasBeanRow(_NotAvailable, null));
                    limitedData.add(new StatisticDatasBeanRow(_NotAvailable,
                            null));
                    e.printStackTrace();
                }
            }
            if (result.size() > limit && other > 0)
            {
                limitedData.add(new StatisticDatasBeanRow(_OTHER, other));
            }
            pieStatisticBean.setHits(result.size());
            pieStatisticBean.setDataTable(fullData);
            pieStatisticBean.setLimitedDataTable(limitedData);
            try
            {
                pieStatisticBean.setPercentages();
            }
            catch (Exception e)
            {
                e.printStackTrace();
            }
        }
        catch (Exception e)
        {
            log.warn(e.getMessage());
            fullData.add(new StatisticDatasBeanRow(_NotAvailable, null));
            limitedData.add(new StatisticDatasBeanRow(_NotAvailable, null));
        }
        return pieStatisticBean;
    }
View Full Code Here


                    solrQuery.setQuery(q);
                    if (StringUtils.isEmpty(name))
                        name = "Unknown";

                    int count = new Long(server.query(solrQuery).getResults().getNumFound()).intValue();
                    limitedData.add(new StatisticDatasBeanRow(name, count));
                    totalHit += count;

                }
                catch (Exception e)
                {
                    limitedData.add(new StatisticDatasBeanRow(_NotAvailable,
                            null));
                    e.printStackTrace();
                }
            }

            pieStatisticBean.setHits(totalHit);
            pieStatisticBean.setDataTable(fullData);
            pieStatisticBean.setLimitedDataTable(limitedData);
            try
            {
                pieStatisticBean.setPercentages();
            }
            catch (Exception e)
            {
                e.printStackTrace();
            }
        }
        catch (Exception e)
        {
            log.warn(e.getMessage());
            fullData.add(new StatisticDatasBeanRow(_NotAvailable, null));
            limitedData.add(new StatisticDatasBeanRow(_NotAvailable, null));
        }
        return pieStatisticBean;
    }
View Full Code Here

TOP

Related Classes of org.dspace.app.cris.statistics.bean.StatisticDatasBeanRow

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.