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

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


    }

    @Override
    public TwoKeyMap getLabels(Context context, String type) throws SQLException
    {
        TwoKeyMap labels = new TwoKeyMap();
        PieStatisticBean myvalue = (PieStatisticBean) statisticDatasBeans
                .get("top").get(type).get("id");
        if (myvalue != null)
        {
            if (myvalue.getLimitedDataTable() != null)
            {
                for (StatisticDatasBeanRow row : myvalue.getLimitedDataTable())
                {                  
                    DSpaceObject item = DSpaceObject.find(context, getRelationObjectType(), Integer.parseInt(row.getLabel()));
//                    if (item != null)
                    {
                        labels.addValue(type, row.getLabel(), item);
                    }
                }
            }
        }
View Full Code Here


            HttpSolrServer solrServer = new HttpSolrServer(getSolrConfig()
                    .getStatisticsCore());

            Map<String, IStatsDualComponent> components = statsComponentsService
                    .getComponents();
            TwoKeyMap label = new TwoKeyMap();
            TreeKeyMap dataBeans = new TreeKeyMap();
            IStatsComponent statcomponent = null;

            // create right menu
            List<RightMenuBean> rightMenu = new ArrayList<RightMenuBean>();
            if (statsComponentsService.isShowSelectedObject())
            {
                RightMenuBean menuV = new RightMenuBean();
                menuV.setMode(StatsComponent.VIEW);
                menuV.setType(AStatComponentService._SELECTED_OBJECT);
                if (type.equals(menuV.getType())
                        && mode.equals(menuV.getMode()))
                {
                    menuV.setCurrent(true);
                }
                rightMenu.add(menuV);

                RightMenuBean menuD = new RightMenuBean();
                menuD.setMode(StatsComponent.DOWNLOAD);
                menuD.setType(AStatComponentService._SELECTED_OBJECT);
                if (type.equals(menuD.getType())
                        && mode.equals(menuD.getMode()))
                {
                    menuD.setCurrent(true);
                }
                rightMenu.add(menuD);
            }

            for (String key : components.keySet())
            {
                boolean createMenu = true;
                if (ResearchObject.class.isAssignableFrom(getTarget()))
                {
                    String relationName = ((ICRISComponent) components.get(key))
                            .getRelationConfiguration().getRelationName();
                    if(!relationName.startsWith(getApplicationService().get(ResearchObject.class, Integer.parseInt(id)).getTypeText())) {
                        createMenu = false;
                    }
                }

                if (createMenu)
                {
                    RightMenuBean menuV = new RightMenuBean();
                    menuV.setMode(StatsComponent.VIEW);
                    menuV.setType(key);
                    if (type.equals(menuV.getType())
                            && mode.equals(menuV.getMode()))
                    {
                        menuV.setCurrent(true);
                    }
                    rightMenu.add(menuV);

                    RightMenuBean menuD = new RightMenuBean();
                    menuD.setMode(StatsComponent.DOWNLOAD);
                    menuD.setType(key);
                    if (type.equals(menuD.getType())
                            && mode.equals(menuD.getMode()))
                    {
                        menuD.setCurrent(true);
                    }
                    rightMenu.add(menuD);
                }
            }

            if (components.containsKey(type))
            {
                if (mode.equals(StatsComponent.VIEW))
                {
                    statcomponent = components.get(type)
                            .getStatsViewComponent();
                }
                if (mode.equals(StatsComponent.DOWNLOAD))
                {
                    statcomponent = components.get(type)
                            .getStatsDownloadComponent();
                }
            }
            else
            {
                if (mode.equals(StatsComponent.VIEW))
                {
                    statcomponent = statsComponentsService
                            .getSelectedObjectComponent()
                            .getStatsViewComponent();
                }
                if (mode.equals(StatsComponent.DOWNLOAD))
                {
                    statcomponent = statsComponentsService
                            .getSelectedObjectComponent()
                            .getStatsDownloadComponent();
                }

            }

            Integer relationObjectType = statcomponent.getRelationObjectType();
            if (relationObjectType
                    .equals(CrisConstants.CRIS_DYNAMIC_TYPE_ID_START))
            {
                relationObjectType = getApplicationService().get(
                        ResearchObject.class, Integer.parseInt(id)).getType();
                statcomponent.setRelationObjectType(relationObjectType);
            }

            dataBeans.putAll(statcomponent.query(id, solrServer));
            label.putAll(statcomponent.getLabels(UIUtil.obtainContext(request),
                    CrisConstants.getEntityTypeText(relationObjectType)));

            ResultBean result = new ResultBean(dataBeans,
                    statsComponentsService.getCommonsParams());
            data.put(_RESULT_BEAN, result);
View Full Code Here

    @Override
    public TwoKeyMap getLabels(Context context, String type) throws SQLException
    {
       
        TwoKeyMap labels = new TwoKeyMap();
        PieStatisticBean myvalue = (PieStatisticBean) statisticDatasBeans
                .get("top").get(type).get("id");
        if (myvalue != null)
        {
            if (myvalue.getLimitedDataTable() != null)
            {
                for (StatisticDatasBeanRow row : myvalue.getLimitedDataTable())
                {                  
                    Item item = Item.find(context, Integer.parseInt(row.getLabel()));
//                    if (item != null)
                    {
                        labels.addValue(type, row.getLabel(), item);
                    }
                }
            }
        }
View Full Code Here

            throws SQLException
    {
        if(getRelationObjectType()==Constants.ITEM) {
            return super.getLabels(context, type);
        }
        TwoKeyMap labels = new TwoKeyMap();

        PieStatisticBean myvalue = (PieStatisticBean) statisticDatasBeans
                .get("top").get(type).get("id");
        if (myvalue != null)
        {
            if (myvalue.getLimitedDataTable() != null)
            {
                for (StatisticDatasBeanRow row : myvalue.getLimitedDataTable())
                {
                    String pkey = (String)row.getLabel();
                   
                    ACrisObject object = ResearcherPageUtils.getCrisObject(Integer.parseInt(pkey), getRelationObjectClass());
                   
                    labels.addValue(row.getLabel(), "label", object.getName());
                   
                    if (object != null)
                    {
                        labels.addValue(type, row.getLabel(), object);
                    }
                }
            }
        }
        return labels;
View Full Code Here

    @Override
    public TwoKeyMap getLabels(Context context, String type)
            throws SQLException
    {

        TwoKeyMap labels = new TwoKeyMap();

        PieStatisticBean myvalue = (PieStatisticBean) statisticDatasBeans
                .get("top").get(type).get("sectionid");
        if (myvalue != null)
        {
            if (myvalue.getLimitedDataTable() != null)
            {
                for (StatisticDatasBeanRow row : myvalue.getLimitedDataTable())
                {
                    String pkey = (String) row.getLabel();

                    PropertiesDefinition def = innerCall(Integer.parseInt(pkey));

                    labels.addValue(row.getLabel(), "label", def.getLabel());

                    if (def != null)
                    {
                        labels.addValue(type, row.getLabel(), def);
                    }
                }
            }
        }
        return labels;
View Full Code Here

    @Override
    public TwoKeyMap getLabels(Context context, String type)
            throws SQLException
    {

        TwoKeyMap labels = new TwoKeyMap();

        PieStatisticBean myvalue = (PieStatisticBean) statisticDatasBeans
                .get("selectedObject").get("geo").get("sectionid");
        if (myvalue != null)
        {
            if (myvalue.getLimitedDataTable() != null)
            {
                for (StatisticDatasBeanRow row : myvalue.getLimitedDataTable())
                {
                    String pkey = (String)row.getLabel();
                   
                    PropertiesDefinition def = innerCall(Integer.parseInt(pkey));
                          
                    labels.addValue(row.getLabel(), "label", def.getLabel()!=null?def.getLabel():def.getShortName());
                   
                    if (def != null)
                    {
                        labels.addValue("geo", row.getLabel(), def);
                    }
                }
            }
        }
        return labels;
View Full Code Here

            data.put(_ID_LABEL, id);
            data.put(_JSP_KEY, jspKey);
            HttpSolrServer solrServer = new HttpSolrServer(getSolrConfig().getStatisticsCore());

            Map<String, IStatsComponent> components = statsComponentsService.getComponents();
            TwoKeyMap label = new TwoKeyMap();
            TreeKeyMap dataBeans = new TreeKeyMap();
            IStatsComponent statcomponent = null;
           
            if(components.containsKey(type)) {
                statcomponent = components.get(type);
            }
            else {
                type = StatComponentsService._SELECTED_OBJECT;
                statcomponent = (IStatsComponent)statsComponentsService.getSelectedObjectComponent();
            }
           
            dataBeans.putAll(statcomponent.query(id, solrServer));               
            label.putAll(statcomponent.getLabels(UIUtil.obtainContext(request),type));
           
            ResultBean result = new ResultBean(dataBeans, statsComponentsService.getCommonsParams());
            data.put(_RESULT_BEAN, result);
            data.put("label",label);
            data.put("title", getTitle(request));
View Full Code Here

    @Override
    public TwoKeyMap getLabels(Context context, String type)
            throws SQLException
    {
        // none
        return new TwoKeyMap();
    }
View Full Code Here

    @Override
    public TwoKeyMap getLabels(Context context, String type) throws SQLException
    {

        TwoKeyMap labels = new TwoKeyMap();

        PieStatisticBean myvalue = (PieStatisticBean) statisticDatasBeans
                .get("top").get(type).get("id");
        if (myvalue != null)
        {
            if (myvalue.getLimitedDataTable() != null)
            {
                for (StatisticDatasBeanRow row : myvalue.getLimitedDataTable())
                {
                    Bitstream bitstream = Bitstream.find(context,
                            Integer.parseInt(row.getLabel()));

                    SolrQuery solrQuery = new SolrQuery();
                    solrQuery.setQuery(getFromField() +":"+ Constants.BITSTREAM + "-"+ bitstream.getID());
                    try
                    {
                        QueryResponse solrQueryResponse = crisSearchService.search(solrQuery);
                        for (SolrDocument doc : solrQueryResponse.getResults())
                        {
                            labels.addValue(row.getLabel(), "handle", doc.getFieldValue("handle"));
                        }
                    }
                    catch (SearchServiceException e)
                    {
                        log.error(e.getMessage(), e);
                    }

                    if (bitstream != null)
                    {
                        labels.addValue(type, row.getLabel(), bitstream);
                    }
                }
            }
        }
        return labels;
View Full Code Here

TOP

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

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.