Package org.dspace.core

Examples of org.dspace.core.Context


    @Override
    protected List<String[]> addActiveTypeInRequest(HttpServletRequest request)
            throws Exception
    {
        ACrisObject cris = getCrisObject(request);
        Context c = UIUtil.obtainContext(request);
        List<String[]> subLinks = new ArrayList<String[]>();

        DiscoverResult docs = search(c, cris, 0, 0, null, true);
        if (docs.getTotalSearchResults() > 0)
        {
View Full Code Here


        return subLinks;
    }

    public long count(String type, Integer id)
    {
        Context context = null;

        try
        {
            context = new Context();
            ACrisObject cris = getApplicationService().get(getTarget(), id);
            List<FacetResult> facetresults = search(context, cris, 0, 0, null, true).getFacetResult(type);
            if(facetresults.isEmpty()) {
                return 0;   
            }
            return facetresults.get(0).getCount();
        }

        catch (Exception ex)
        {
            log.error(ex.getMessage(), ex);
        }
        finally
        {
            if (context != null && context.isValid())
            {
                context.abort();
            }
        }
        return -1;
    }
View Full Code Here

    @Override
    protected Map referenceData(HttpServletRequest request, Object command,
            Errors errors) throws Exception
    {
        Context context = UIUtil.obtainContext(request);
        ACrisObject cris = getCRISObject(request);
        AuthorizeManager.authorizeActionBoolean(context, cris, Constants.ADMIN, false);
       
        String relationType = getRelationType(request);
        Map<String, Object> data = new HashMap<String, Object>();
View Full Code Here

            throws Exception
    {
        ACrisObject cris = getCRISObject(request);
        if (!"submit_exit".equalsIgnoreCase(UIUtil.getSubmitButton(request, "exit")))
        {
            Context context = UIUtil.obtainContext(request);
            ManageRelationDTO dto = (ManageRelationDTO) command;
            String relationType = getRelationType(request);
            boolean doneChange = false;
   
            doneChange = relationService.unlink(context, cris, relationType,
View Full Code Here

  }
 
  @Override
  protected Object formBackingObject(HttpServletRequest request)
      throws Exception {
    Context context = UIUtil.obtainContext(request);
    if (!AuthorizeManager.isAdmin(context)) {
      throw new AuthorizeException(
          "Only system administrator can access to the export functionality");
    }
    return super.formBackingObject(request);
View Full Code Here

            response.sendError(HttpServletResponse.SC_NOT_FOUND,
                    "OU page not found");
            return null;
        }

        Context context = UIUtil.obtainContext(request);
        EPerson currentUser = context.getCurrentUser();
        if ((ou.getStatus() == null || ou.getStatus().booleanValue() == false)
                && !AuthorizeManager.isAdmin(context))
        {
           
            if (currentUser != null
View Full Code Here

            HttpServletResponse response) throws SQLException, Exception
    {

        // check admin authorization
        Boolean isAdmin = null; // anonymous access
        Context context = UIUtil.obtainContext(request);

        if (AuthorizeManager.isAdmin(context))
        {
            isAdmin = true; // admin
        }
View Full Code Here

           
            chain.doFilter(hrequest, hresponse);
        }
        finally
        {
            Context context = null;
            try
            {
                context = UIUtil.obtainContext(hrequest);
            }
            catch (SQLException e)
            {
               log.error(LogManager.getHeader(null, "cleanup", "Exception during DSpace context cleanup"), e);
            }
            if (context != null && context.isValid())
            {
                context.abort();
            }
        }
    }
View Full Code Here

    {
        String uuid = arg0.getParameter("uid");
        int type = UIUtil.getIntParameter(arg0, "type");
        boolean showList = UIUtil.getBoolParameter(arg0, "list");
        int[] freqs = UIUtil.getIntParameters(arg0, "freq");
        Context context = UIUtil.obtainContext(arg0);
        EPerson e = context.getCurrentUser();

        statSubService.subscribeUUID(e, uuid, freqs, type);

        if (showList)
        {
View Full Code Here

    {
        String clearAll = arg0.getParameter("clear");
        String uuid = arg0.getParameter("uid");
        int type = UIUtil.getIntParameter(arg0, "type");
        boolean showList = UIUtil.getBoolParameter(arg0, "list");
        Context context = UIUtil.obtainContext(arg0);
        EPerson e = context.getCurrentUser();
        if (StringUtils.isNotEmpty(clearAll)
                && clearAll.equalsIgnoreCase("all"))
        {
            statSubService.clearAll(e);
            showList = true;
View Full Code Here

TOP

Related Classes of org.dspace.core.Context

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.