Package org.dspace.eperson

Examples of org.dspace.eperson.EPerson


                    getSpecificPartPath() + " page not found");
            return null;
        }

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


        String id_s = request.getParameter("id");
        Integer id = Integer.parseInt(id_s);
        ResearcherPage researcher = getApplicationService().get(
                    ResearcherPage.class, id);
        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();
        if (AuthorizeManager.isAdmin(context)
                || (researcher.getEpersonID()!=null && currUser != null && researcher.getEpersonID().equals(
                        currUser.getID())))
        {
            reference.put("researcher_page_menu", new Boolean(true));
            reference.put("researcher", researcher);        
        }
        reference.put("authority_key", ResearcherPageUtils
View Full Code Here

    }

    private boolean isAdmin(Context context, HttpServletRequest request)
            throws SQLException, ServletException
    {
        EPerson currUser = getCurrentUser(request);
        if (currUser == null)
        {
            throw new ServletException(
                    "Wrong data or configuration: access to the my rp servlet without a valid user: there is no user logged in");
        }
View Full Code Here

    private EPerson getCurrentUser(HttpServletRequest request)
            throws SQLException
    {
        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();
        return currUser;
    }
View Full Code Here

                    "Researcher page not found");
            return null;
        }

        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();

        boolean isAdmin = AuthorizeManager.isAdmin(context);
     
        if (isAdmin
                || (currUser != null && (researcher.getEpersonID() != null && currUser
                        .getID() == researcher.getEpersonID())))
        {
            model.put("researcher_page_menu", new Boolean(true));
            model.put("authority_key",
                    ResearcherPageUtils.getPersistentIdentifier(researcher));

            if (isAdmin)
            {
                AuthorityDAO dao = AuthorityDAOFactory.getInstance(context);
                long pendingItems = dao
                        .countIssuedItemsByAuthorityValueInAuthority(
                                RPAuthority.RP_AUTHORITY_NAME,
                                ResearcherPageUtils
                                        .getPersistentIdentifier(researcher));
                model.put("pendingItems", new Long(pendingItems));
            }
        }
       
        else if ((researcher.getStatus() == null || researcher.getStatus()
                .booleanValue() == false))
        {
            if (context.getCurrentUser() != null
                    || Authenticate.startAuthentication(context, request,
                            response))
            {
                // Log the error
                log.info(LogManager
                        .getHeader(context, "authorize_error",
                                "Only system administrator can access to disabled researcher page"));

                JSPManager
                        .showAuthorizeError(
                                request,
                                response,
                                new AuthorizeException(
                                        "Only system administrator can access to disabled researcher page"));
            }
            return null;
        }

       
        if (subscribeService != null)
        {
            boolean subscribed = subscribeService.isSubscribed(currUser,
                    researcher);
            model.put("subscribed", subscribed);
            EPerson eperson = EPerson.findByNetid(context, researcher.getSourceID());
            if (eperson != null) {
              model.put("subscriptions", subscribeService.getSubscriptions(eperson));
            }
        }
View Full Code Here

            return null;
        }
        // check admin authorization
        Boolean isAdmin = null; // anonymous access
        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();
        if (AuthorizeManager.isAdmin(context))
        {
            isAdmin = true; // admin
        }
        else if ((currUser != null && researcher.getId() == currUser.getID()))
        {
            isAdmin = false; // owner
        }
        List<TabResearcherPage> tabs = applicationService.getTabsByVisibility(
                TabResearcherPage.class, isAdmin);
View Full Code Here

    }

    private ResearcherPage getMyResearcherPage(HttpServletRequest request)
            throws SQLException, ServletException
    {
        EPerson currUser = getCurrentUser(request);
        if (currUser == null)
        {
            throw new ServletException(
                    "Wrong data or configuration: access to the my rp servlet without a valid user: there is no user logged in");
        }

        int id = currUser.getID();
        ResearcherPage rp = applicationService.getResearcherPageByEPersonId(id);
        return rp;
    }
View Full Code Here

    private EPerson getCurrentUser(HttpServletRequest request)
            throws SQLException
    {
        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();
        return currUser;
    }
View Full Code Here

            return null;
        }

        Context context = UIUtil.obtainContext(request);

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

            throws SQLException, IOException, SearchServiceException
    {

        List<CrisSubscription> rpSubscriptions = applicationService
                .getList(CrisSubscription.class);
        EPerson currentEPerson = null;
        List<String> rpkeys = null; // List of rp keys
        List<String> relationField = new LinkedList<String>();
        for (CrisSubscription rpSubscription : rpSubscriptions)
        {
            // Does this row relate to the same e-person as the last?
            if ((currentEPerson == null)
                    || (rpSubscription.getEpersonID() != currentEPerson.getID()))
            {
                // New e-person. Send mail for previous e-person
                if (currentEPerson != null)
                {
                    try
                    {
                        relationField = mapRelationFields.get(rpSubscription.getTypeDef());
                        sendEmail(researcher, context, currentEPerson, rpkeys,
                                test, relationField);
                    }
                    catch (MessagingException me)
                    {
                        log.error("Failed to send subscription to eperson_id="
                                + currentEPerson.getID());
                        log.error(me);
                    }
                }

                currentEPerson = EPerson.find(context,
                        rpSubscription.getEpersonID());
                rpkeys = new ArrayList<String>();
            }
            rpkeys.add(ResearcherPageUtils
                    .getPersistentIdentifier(applicationService
                            .getEntityByUUID(rpSubscription.getUuid())));
        }
        // Process the last person
        if (currentEPerson != null)
        {
            try
            {
                sendEmail(researcher, context, currentEPerson, rpkeys, test,
                        relationField);
            }
            catch (MessagingException me)
            {
                log.error("Failed to send subscription to eperson_id="
                        + currentEPerson.getID());
                log.error(me);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.dspace.eperson.EPerson

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.