Examples of EPerson


Examples of org.dspace.eperson.EPerson

            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

Examples of org.dspace.eperson.EPerson

                                rp.getUuid(), configuration.getRelationConfiguration().getRelationName(),
                                RelationPreference.UNLINKED);
            }
        }

        EPerson eperson = EPerson.find(context, rp.getEpersonID());
        ItemIterator items = Item.findBySubmitter(context, eperson);
        List<MetadataField> mfs = metadataFieldWithAuthorityRP(context);
        int count = 0;
        while (items.hasNext())
        {
            Item item = items.next();
            if (rejected == null || !rejected.contains(item.getID()))
            {
                boolean found = false;
                for (MetadataField mf : mfs)
                {
                    String schema = MetadataSchema.find(context,
                            mf.getSchemaID()).getName();
                    String element = mf.getElement();
                    String qualifier = mf.getQualifier();
                    DCValue[] values = item.getMetadata(schema, element,
                            qualifier, Item.ANY);
                    item.clearMetadata(schema, element, qualifier, Item.ANY);

                    for (DCValue val : values)
                    {
                        if (val.authority == null
                                && val.value != null
                                && StringUtils.containsIgnoreCase(val.value,
                                        eperson.getLastName().trim()))
                        {
                            val.authority = ResearcherPageUtils
                                    .getPersistentIdentifier(rp);
                            val.confidence = Choices.CF_ACCEPTED;
                            found = true;
View Full Code Here

Examples of org.dspace.eperson.EPerson

    }

    public EPerson getDspaceUser()
    {
        Context context = null;
        EPerson eperson = null;

        try
        {
            context = new Context();
            if (epersonID != null)
View Full Code Here

Examples of org.dspace.eperson.EPerson

     */
    public static void processDaily(DSpace dspace,
            StatSubscribeService service, Context context, int freq,
            boolean test) throws SQLException, IOException
    {
        EPerson currentEPerson = null;
        List<StatSubscription> rpSubscriptions = service
                .getAllStatSubscriptionByFreq(freq);
        for (StatSubscription 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
                    {
                        sendEmail(context, service, currentEPerson,
                                rpSubscriptions, freq, test);
                    }
                    catch (MessagingException me)
                    {
                        log.error("Failed to send stat subscription to eperson_id="
                                + currentEPerson.getID());
                        log.error(me);
                    }
                }

                currentEPerson = EPerson.find(context,
                        rpSubscription.getEpersonID());
                rpSubscriptions = new ArrayList<StatSubscription>();
            }
            rpSubscriptions.add(rpSubscription);
        }
        // Process the last person
        if (currentEPerson != null)
        {
            try
            {
                sendEmail(context, service, currentEPerson, rpSubscriptions,
                        freq, test);
            }
            catch (MessagingException me)
            {
                log.error("Failed to send stat subscription to eperson_id="
                        + currentEPerson.getID());
                log.error(me);
            }
        }
    }
View Full Code Here

Examples of org.dspace.eperson.EPerson

                }

                AnagraficaUtils.reverseDTO(dto, researcher.getDynamicField(),
                        realFillTPS);

                EPerson dspaceUser = researcher.getDspaceUser();
                if (dspaceUser == null)
                {
                    // no dspace user we need to create it
                    try
                    {
                        EPerson emailUser = EPerson.findByEmail(dspaceContext,
                                researcher.getEmail().getValue());
                        if (emailUser != null)
                        {
                            throw new RuntimeException(
                                    "XML Row discarded STAFFNO : "
                                            + researcher.getSourceID()
                                            + " Find an eperson with email/netId '"
                                            + emailUser.getEmail()
                                            + "/"
                                            + emailUser.getNetid()
                                            + "' that not referred to the staffNo '"
                                            + researcher.getSourceID()
                                            + "' of researcher. Perhaps is it the same person?");
                        }
                        else
View Full Code Here

Examples of org.dspace.eperson.EPerson

            log.info(LogManager.getHeader(context, "accept_license",
                    subInfo.getSubmissionLogInfo()));

            // Add the license to the item
            Item item = subInfo.getSubmissionItem().getItem();
            EPerson submitter = context.getCurrentUser();

            // remove any existing DSpace license (just in case the user
            // accepted it previously)
            item.removeDSpaceLicense();
View Full Code Here

Examples of org.dspace.eperson.EPerson

        // create a context
        Context c = new Context();

        // find the EPerson, assign to context
        EPerson myEPerson = null;

        if (eperson.indexOf('@') != -1)
        {
            // @ sign, must be an email
            myEPerson = EPerson.findByEmail(c, eperson);
View Full Code Here

Examples of org.dspace.eperson.EPerson

            else
            {
                actionText = Constants.actionText[action];
            }

            EPerson e = c.getCurrentUser();
            int userid;

            if (e == null)
            {
                userid = 0;
            }
            else
            {
                userid = e.getID();
            }

            throw new AuthorizeException(
                    "Authorization attempted on null DSpace object "
                            + actionText + " by user " + userid);
        }

        if (!authorize(c, o, action, c.getCurrentUser(), useInheritance))
        {
            // denied, assemble and throw exception
            int otype = o.getType();
            int oid = o.getID();
            int userid;
            EPerson e = c.getCurrentUser();

            if (e == null)
            {
                userid = 0;
            }
            else
            {
                userid = e.getID();
            }

            //            AuthorizeException j = new AuthorizeException("Denied");
            //            j.printStackTrace();
            // action can be -1 due to a null entry
View Full Code Here

Examples of org.dspace.eperson.EPerson

        if (c.ignoreAuthorization())
        {
            return true;
        }

        EPerson e = c.getCurrentUser();

        if (e == null)
        {
            return false; // anonymous users can't be admins....
        }
View Full Code Here

Examples of org.dspace.eperson.EPerson

         
      Row eventRow = activeUsers.addRow();
     
      eventRow.addCellContent(timeStampMessage);
      int eid = event.getEPersonID();
      EPerson eperson = EPerson.find(context, eid);
      if (eperson != null)
      {
        String name = eperson.getFullName();
        eventRow.addCellContent(name);
      }
      else
      {
        // Is this a new anonymous user?
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.