Package org.dspace.statistics.content

Examples of org.dspace.statistics.content.StatisticsTable


       

  try
        {

            StatisticsTable statisticsTable = new StatisticsTable(new StatisticsDataVisits(dso));

            statisticsTable.setTitle("Total Visits Per Month");
            statisticsTable.setId("tab1");

            DatasetTimeGenerator timeAxis = new DatasetTimeGenerator();
            timeAxis.setDateInterval("month", "-6", "+1");
            statisticsTable.addDatasetGenerator(timeAxis);

            DatasetDSpaceObjectGenerator dsoAxis = new DatasetDSpaceObjectGenerator();
            dsoAxis.addDsoChild(dso.getType(), 10, false, -1);
            statisticsTable.addDatasetGenerator(dsoAxis);
            Dataset dataset = statisticsTable.getDataset(context);

            dataset = statisticsTable.getDataset();

            if (dataset == null)
            {
   
    dataset = statisticsTable.getDataset(context);
            }

            if (dataset != null)
            {
                String[][] matrix = dataset.getMatrixFormatted();
                List<String> colLabels = dataset.getColLabels();
                List<String> rowLabels = dataset.getRowLabels();

                statsMonthlyVisits.setMatrix(matrix);
                statsMonthlyVisits.setColLabels(colLabels);
                statsMonthlyVisits.setRowLabels(rowLabels);
            }
  } catch (Exception e)
        {
            log.error(
                "Error occured while creating statistics for dso with ID: "
                                + dso.getID() + " and type " + dso.getType()
                                + " and handle: " + dso.getHandle(), e);
  }

        if(dso instanceof org.dspace.content.Item)
        {
            isItem = true;

            try
            {

                StatisticsListing statisticsTable = new StatisticsListing(new StatisticsDataVisits(dso));

                statisticsTable.setTitle("File Downloads");
                statisticsTable.setId("tab1");

                DatasetDSpaceObjectGenerator dsoAxis = new DatasetDSpaceObjectGenerator();
                dsoAxis.addDsoChild(Constants.BITSTREAM, 10, false, -1);
                statisticsTable.addDatasetGenerator(dsoAxis);

                Dataset dataset = statisticsTable.getDataset(context);

                dataset = statisticsTable.getDataset();

                if (dataset == null)
                {

                    dataset = statisticsTable.getDataset(context);
                }

                if (dataset != null)
                {
                    String[][] matrix = dataset.getMatrixFormatted();
                    List<String> colLabels = dataset.getColLabels();
                    List<String> rowLabels = dataset.getRowLabels();

                    statsFileDownloads.setMatrix(matrix);
                    statsFileDownloads.setColLabels(colLabels);
                    statsFileDownloads.setRowLabels(rowLabels);
                }
            }
            catch (Exception e)
            {
                log.error(
                    "Error occured while creating statistics for dso with ID: "
                                    + dso.getID() + " and type " + dso.getType()
                                    + " and handle: " + dso.getHandle(), e);
            }
        }

        try
            {

                StatisticsListing statisticsTable = new StatisticsListing(new StatisticsDataVisits(dso));

                statisticsTable.setTitle("Top country views");
                statisticsTable.setId("tab1");

                DatasetTypeGenerator typeAxis = new DatasetTypeGenerator();
                typeAxis.setType("countryCode");
                typeAxis.setMax(10);
                statisticsTable.addDatasetGenerator(typeAxis);

                Dataset dataset = statisticsTable.getDataset(context);

                dataset = statisticsTable.getDataset();

                if (dataset == null)
                {

                    dataset = statisticsTable.getDataset(context);
                }

                if (dataset != null)
                {
                    String[][] matrix = dataset.getMatrixFormatted();
                    List<String> colLabels = dataset.getColLabels();
                    List<String> rowLabels = dataset.getRowLabels();

                    statsCountryVisits.setMatrix(matrix);
                    statsCountryVisits.setColLabels(colLabels);
                    statsCountryVisits.setRowLabels(rowLabels);
                }
            }
            catch (Exception e)
            {
                log.error(
                    "Error occured while creating statistics for dso with ID: "
                                    + dso.getID() + " and type " + dso.getType()
                                    + " and handle: " + dso.getHandle(), e);
            }

        try
            {

                StatisticsListing statisticsTable = new StatisticsListing(new StatisticsDataVisits(dso));

                statisticsTable.setTitle("Top city views");
                statisticsTable.setId("tab1");

                DatasetTypeGenerator typeAxis = new DatasetTypeGenerator();
                typeAxis.setType("city");
                typeAxis.setMax(10);
                statisticsTable.addDatasetGenerator(typeAxis);

                Dataset dataset = statisticsTable.getDataset(context);

                dataset = statisticsTable.getDataset();

                if (dataset == null)
                {

                    dataset = statisticsTable.getDataset(context);
                }

                if (dataset != null)
                {
                    String[][] matrix = dataset.getMatrixFormatted();
View Full Code Here


       

  try
        {

            StatisticsTable statisticsTable = new StatisticsTable(new StatisticsDataVisits(dso));

            statisticsTable.setTitle("Total Visits Per Month");
            statisticsTable.setId("tab1");

            DatasetTimeGenerator timeAxis = new DatasetTimeGenerator();
            timeAxis.setDateInterval("month", "-6", "+1");
            statisticsTable.addDatasetGenerator(timeAxis);

            DatasetDSpaceObjectGenerator dsoAxis = new DatasetDSpaceObjectGenerator();
            dsoAxis.addDsoChild(dso.getType(), 10, false, -1);
            statisticsTable.addDatasetGenerator(dsoAxis);
            Dataset dataset = statisticsTable.getDataset(context);

            dataset = statisticsTable.getDataset();

            if (dataset == null)
            {
   
    dataset = statisticsTable.getDataset(context);
            }

            if (dataset != null)
            {
                String[][] matrix = dataset.getMatrix();
                List<String> colLabels = dataset.getColLabels();
                List<String> rowLabels = dataset.getRowLabels();

                statsMonthlyVisits.setMatrix(matrix);
                statsMonthlyVisits.setColLabels(colLabels);
                statsMonthlyVisits.setRowLabels(rowLabels);
            }
  } catch (Exception e)
        {
            log.error(
                "Error occured while creating statistics for dso with ID: "
                                + dso.getID() + " and type " + dso.getType()
                                + " and handle: " + dso.getHandle(), e);
  }

        if(dso instanceof org.dspace.content.Item)
        {
            isItem = true;
            try
            {

                StatisticsListing statisticsTable = new StatisticsListing(new StatisticsDataVisits(dso));

                statisticsTable.setTitle("File Downloads");
                statisticsTable.setId("tab1");

                DatasetDSpaceObjectGenerator dsoAxis = new DatasetDSpaceObjectGenerator();
                dsoAxis.addDsoChild(Constants.BITSTREAM, 10, false, -1);
                statisticsTable.addDatasetGenerator(dsoAxis);

                Dataset dataset = statisticsTable.getDataset(context);

                dataset = statisticsTable.getDataset();

                if (dataset == null)
                {

                    dataset = statisticsTable.getDataset(context);
                }

                if (dataset != null)
                {
                    String[][] matrix = dataset.getMatrix();
                    List<String> colLabels = dataset.getColLabels();
                    List<String> rowLabels = dataset.getRowLabels();

                    statsFileDownloads.setMatrix(matrix);
                    statsFileDownloads.setColLabels(colLabels);
                    statsFileDownloads.setRowLabels(rowLabels);
                }
            }
            catch (Exception e)
            {
                log.error(
                    "Error occured while creating statistics for dso with ID: "
                                    + dso.getID() + " and type " + dso.getType()
                                    + " and handle: " + dso.getHandle(), e);
            }
        }

        try
            {

                StatisticsListing statisticsTable = new StatisticsListing(new StatisticsDataVisits(dso));

                statisticsTable.setTitle("Top country views");
                statisticsTable.setId("tab1");

                DatasetTypeGenerator typeAxis = new DatasetTypeGenerator();
                typeAxis.setType("countryCode");
                typeAxis.setMax(10);
                statisticsTable.addDatasetGenerator(typeAxis);

                Dataset dataset = statisticsTable.getDataset(context);

                dataset = statisticsTable.getDataset();

                if (dataset == null)
                {

                    dataset = statisticsTable.getDataset(context);
                }

                if (dataset != null)
                {
                    String[][] matrix = dataset.getMatrix();
                    List<String> colLabels = dataset.getColLabels();
                    List<String> rowLabels = dataset.getRowLabels();

                    statsCountryVisits.setMatrix(matrix);
                    statsCountryVisits.setColLabels(colLabels);
                    statsCountryVisits.setRowLabels(rowLabels);
                }
            }
            catch (Exception e)
            {
                log.error(
                    "Error occured while creating statistics for dso with ID: "
                                    + dso.getID() + " and type " + dso.getType()
                                    + " and handle: " + dso.getHandle(), e);
            }

        try
            {

                StatisticsListing statisticsTable = new StatisticsListing(new StatisticsDataVisits(dso));

                statisticsTable.setTitle("Top city views");
                statisticsTable.setId("tab1");

                DatasetTypeGenerator typeAxis = new DatasetTypeGenerator();
                typeAxis.setType("city");
                typeAxis.setMax(10);
                statisticsTable.addDatasetGenerator(typeAxis);

                Dataset dataset = statisticsTable.getDataset(context);

                dataset = statisticsTable.getDataset();

                if (dataset == null)
                {

                    dataset = statisticsTable.getDataset(context);
                }

                if (dataset != null)
                {
                    String[][] matrix = dataset.getMatrix();
View Full Code Here

            if(request.getParameter("time_filter") != null && !"".equals(request.getParameter("time_filter"))){
                //Our time filter is a negative value if present
                time_filter = Math.abs(Util.getIntParameter(request, "time_filter"));

            }
            StatisticsTable statisticsTable = new StatisticsTable(new StatisticsDataWorkflow(dso, time_filter));

            DatasetTypeGenerator queryGenerator = new DatasetTypeGenerator();
            //Set our type to previousworkflow step (indicates our performed actions !)
            queryGenerator.setType("previousWorkflowStep");
            queryGenerator.setMax(10);
            statisticsTable.addDatasetGenerator(queryGenerator);
            if(dateFilter != null){
                statisticsTable.addFilter(dateFilter);
            }

            addDisplayTable(workflowTermsDivision, statisticsTable, true, new String[]{"xmlui.statistics.display.table.workflow.step."});
        } catch (Exception e) {
            mainDivision.addPara().addContent(T_retrieval_error);
View Full Code Here

            //Retrieve the optional time filter
            StatisticsSolrDateFilter dateFilter = getDateFilter(selectedTimeFilter);


            StatisticsTable statisticsTable = new StatisticsTable(new StatisticsDataSearches(dso));

            DatasetSearchGenerator queryGenerator = new DatasetSearchGenerator();
            queryGenerator.setType("query");
            queryGenerator.setMax(10);
            queryGenerator.setMode(DatasetSearchGenerator.Mode.SEARCH_OVERVIEW);
            queryGenerator.setPercentage(true);
            queryGenerator.setRetrievePageViews(true);
            statisticsTable.addDatasetGenerator(queryGenerator);
            if(dateFilter != null){
                statisticsTable.addFilter(dateFilter);
            }

            addDisplayTable(searchTermsDivision, statisticsTable, true, null);


            Division totalDivision = mainDivision.addDivision("search-total");
            totalDivision.setHead(T_search_total_head);
            statisticsTable = new StatisticsTable(new StatisticsDataSearches(dso));

            queryGenerator = new DatasetSearchGenerator();
            queryGenerator.setMode(DatasetSearchGenerator.Mode.SEARCH_OVERVIEW_TOTAL);
            queryGenerator.setPercentage(true);
            queryGenerator.setRetrievePageViews(true);
            statisticsTable.addDatasetGenerator(queryGenerator);
            if(dateFilter != null){
                statisticsTable.addFilter(dateFilter);
            }

            addDisplayTable(totalDivision, statisticsTable, false, null);
        } catch (Exception e) {
            mainDivision.addPara().addContent(T_retrieval_error);
View Full Code Here

TOP

Related Classes of org.dspace.statistics.content.StatisticsTable

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.