Package org.dspace.eperson

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


    }

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

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

     */
    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

                }

                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

            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

        // 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

            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

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

        EPerson e = c.getCurrentUser();

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

         
      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

         * Parameters: submit_unsubscribe - unsubscribe from a collection
         * submit_clear - clear all subscriptions submit_cancel - cancel update -
         * go to My DSpace.
         */
        String submit = UIUtil.getSubmitButton(request, "submit");
        EPerson e = context.getCurrentUser();

        if (submit.equals("submit_clear"))
        {
            // unsubscribe user from everything
            Subscribe.unsubscribe(context, e, null);
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.