Package org.dspace.browse

Examples of org.dspace.browse.BrowserScope


      String source = ConfigurationManager.getProperty("recent.submissions.sort-option");
      String count = ConfigurationManager.getProperty("recent.submissions.count");
     
      // prep our engine and scope
      BrowseEngine be = new BrowseEngine(context);
      BrowserScope bs = new BrowserScope(context);
      BrowseIndex bi = BrowseIndex.getItemBrowseIndex();
     
      // fill in the scope with the relevant gubbins
      bs.setBrowseIndex(bi);
      bs.setOrder(SortOption.DESCENDING);
      bs.setResultsPerPage(Integer.parseInt(count));
      bs.setBrowseContainer(dso);
            for (SortOption so : SortOption.getSortOptions())
            {
                if (so.getName().equals(source))
                    bs.setSortBy(so.getNumber());
            }
     
      BrowseInfo results = be.browseMini(bs);
     
      Item[] items = results.getItemResults(context);
View Full Code Here


        params.month = request.getParameter(BrowseParams.MONTH);
        params.year = request.getParameter(BrowseParams.YEAR);
        params.etAl = RequestUtils.getIntParameter(request, BrowseParams.ETAL);

        params.scope = new BrowserScope(context);

        // Are we in a community or collection?
        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if (dso instanceof Community)
            params.scope.setCommunity((Community) dso);
View Full Code Here

        if (recentSubmissionItems != null)
            return recentSubmissionItems;
       
        String source = ConfigurationManager.getProperty("recent.submissions.sort-option");
        int numRecentSubmissions = ConfigurationManager.getIntProperty("recent.submissions.count", RECENT_SUBMISSIONS);
        BrowserScope scope = new BrowserScope(context);
        scope.setCollection(collection);
        scope.setResultsPerPage(numRecentSubmissions);
       
        // FIXME Exception Handling
        try
        {
          scope.setBrowseIndex(BrowseIndex.getItemBrowseIndex());
            for (SortOption so : SortOption.getSortOptions())
            {
                if (so.getName().equals(source))
                {
                    scope.setSortBy(so.getNumber());
                    scope.setOrder(SortOption.DESCENDING);
                }
            }

          BrowseEngine be = new BrowseEngine(context);
          this.recentSubmissionItems = be.browse(scope).getResults();
View Full Code Here

        {
            return recentSubmissionItems;
        }

        String source = ConfigurationManager.getProperty("recent.submissions.sort-option");
        BrowserScope scope = new BrowserScope(context);
        if (dso instanceof Collection)
        {
            scope.setCollection((Collection) dso);
        }
        else if (dso instanceof Community)
        {
            scope.setCommunity((Community) dso);
        }
        scope.setResultsPerPage(ITEM_COUNT);

        // FIXME Exception handling
        try
        {
            scope.setBrowseIndex(BrowseIndex.getItemBrowseIndex());
            for (SortOption so : SortOption.getSortOptions())
            {
                if (so.getName().equals(source))
                {
                    scope.setSortBy(so.getNumber());
                    scope.setOrder(SortOption.DESCENDING);
                }
            }

            BrowseEngine be = new BrowseEngine(context);
            this.recentSubmissionItems = be.browseMini(scope).getItemResults(context);
View Full Code Here

      String source = ConfigurationManager.getProperty("recent.submissions.sort-option");
      String count = ConfigurationManager.getProperty("recent.submissions.count");
     
      // prep our engine and scope
      BrowseEngine be = new BrowseEngine(context);
      BrowserScope bs = new BrowserScope(context);
      BrowseIndex bi = BrowseIndex.getItemBrowseIndex();
     
      // fill in the scope with the relevant gubbins
      bs.setBrowseIndex(bi);
      bs.setOrder(SortOption.DESCENDING);
      bs.setResultsPerPage(Integer.parseInt(count));
            if (dso != null)
            {
                bs.setBrowseContainer(dso);
            }
            for (SortOption so : SortOption.getSortOptions())
            {
                if (so.getName().equals(source))
                {
                    bs.setSortBy(so.getNumber());
                }
            }
     
      BrowseInfo results = be.browseMini(bs);
     
View Full Code Here

            {
                request.setAttribute("show.items", Boolean.FALSE);
                return;
            }

            BrowserScope scope = new BrowserScope(context);
            scope.setBrowseContainer(collection);
            scope.setBrowseIndex(bi);
            scope.setEtAl(etal);
            scope.setOffset(offset);
            scope.setResultsPerPage(perpage);
            if (number != -1)
            {
                scope.setSortBy(number);
                scope.setOrder(SortOption.DESCENDING);
            }
            BrowseEngine be = new BrowseEngine(context);
            BrowseInfo binfo = be.browse(scope);
            request.setAttribute("browse.info", binfo);
View Full Code Here

        params.month = request.getParameter(BrowseParams.MONTH);
        params.year = request.getParameter(BrowseParams.YEAR);
        params.etAl = RequestUtils.getIntParameter(request, BrowseParams.ETAL);

        params.scope = new BrowserScope(context);

        // Are we in a community or collection?
        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if (dso instanceof Community)
        {
View Full Code Here

        params.month = request.getParameter(BrowseParams.MONTH);
        params.year = request.getParameter(BrowseParams.YEAR);
        params.etAl = RequestUtils.getIntParameter(request, BrowseParams.ETAL);

        params.scope = new BrowserScope(context);

        // Are we in a community or collection?
        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if (dso instanceof Community)
        {
View Full Code Here

            AuthorizeException
    {
        try
        {
            // all browse requests currently come to GET.
            BrowserScope scope = getBrowserScopeForRequest(context, request, response);
   
            // Check that we are doing an item browse
            if (scope.getBrowseIndex() == null || scope.getBrowseIndex().isItemIndex())
            {
                // And override the index in the scope with the withdrawn items
                scope.setBrowseIndex(BrowseIndex.getWithdrawnBrowseIndex());
            }
            else
            {
                showError(context, request, response);
            }
View Full Code Here

        if (bix == null)
        {
          throw new IOException("There is no browse index with the name: " + idx);
        }
       
        BrowserScope scope = new BrowserScope(context);
        scope.setBrowseIndex(bix);
                if (dso != null)
                {
                    scope.setBrowseContainer(dso);
                }

            for (SortOption so : SortOption.getSortOptions())
            {
                if (so.getName().equals(idx))
                {
                    scope.setSortBy(so.getNumber());
                }
            }
            scope.setOrder(SortOption.DESCENDING);
        scope.setResultsPerPage(itemCount);
       
            // gather & add items to the feed.
        BrowseEngine be = new BrowseEngine(context);
        BrowseInfo bi = be.browseMini(scope);
        Item[] results = bi.getItemResults(context);
View Full Code Here

TOP

Related Classes of org.dspace.browse.BrowserScope

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.