Package org.dspace.eperson

Examples of org.dspace.eperson.EPerson


      {
        throw new Exception("Error, no admin group (group 1) found");
      }
     
      // Create the administrator e-person
        EPerson eperson = EPerson.findByEmail(context,email);
       
        // check if the email belongs to a registered user,
        // if not create a new user with this email
        if (eperson == null)
        {
            eperson = EPerson.create(context);
            eperson.setEmail(email);
            eperson.setCanLogIn(true);
            eperson.setRequireCertificate(false);
            eperson.setSelfRegistered(false);
        }
     
      eperson.setLastName(last);
      eperson.setFirstName(first);
      eperson.setLanguage(language);
      eperson.setPassword(pw);
      eperson.update();
     
      admins.addMember(eperson);
      admins.update();
     
      context.complete();
View Full Code Here


      for (String error : errorString.split(","))
        errors.add(error);
    }
   
    // Grab the person in question
    EPerson eperson = EPerson.find(context, epersonID);
   
    if (eperson == null)
      throw new UIException("Unable to find eperson for id:"+epersonID);
   
    String emailValue = eperson.getEmail();
    String firstValue = eperson.getFirstName();
    String lastValue  = eperson.getLastName();
    String phoneValue = eperson.getMetadata("phone");
    boolean canLogInValue = eperson.canLogIn();
    boolean certificatValue = eperson.getRequireCertificate();
    Vector<String> deleteConstraints = eperson.getDeleteConstraints();
   
    if (request.getParameter("email_address") != null)
      emailValue = request.getParameter("email_address");
    if (request.getParameter("first_name") != null)
      firstValue = request.getParameter("first_name");
    if (request.getParameter("last_name") != null)
      lastValue = request.getParameter("last_name");
    if (request.getParameter("phone") != null)
      phoneValue = request.getParameter("phone");
   
   
   
    // DIVISION: eperson-edit
      Division edit = body.addInteractiveDivision("eperson-edit",contextPath+"/admin/epeople",Division.METHOD_POST,"primary administrative eperson");
      edit.setHead(T_head1);
     
     
      if (errors.contains("eperson_email_key")) {
        Para problem = edit.addPara();
        problem.addHighlight("bold").addContent(T_email_taken);
      }
       
     
        List identity = edit.addList("form",List.TYPE_FORM);
        identity.setHead(T_head2.parameterize(eperson.getFullName()));      
       
        if (admin)
        {
          Text email = identity.addItem().addText("email_address");
          email.setRequired();
View Full Code Here

    String idsString = parameters.getParameter("epeopleIDs", null);
   
    ArrayList<EPerson> epeople = new ArrayList<EPerson>();
    for (String id : idsString.split(","))
    {
      EPerson person = EPerson.find(context,Integer.valueOf(id));
      epeople.add(person);
    }
    // DIVISION: epeople-confirm-delete
      Division deleted = body.addInteractiveDivision("epeople-confirm-delete",contextPath+"/admin/epeople",Division.METHOD_POST,"primary administrative eperson");
View Full Code Here

            System.exit(0);
        }

        // find the EPerson, assign to context
        Context context = new Context();
        EPerson myEPerson = null;
        myEPerson = EPerson.findByEmail(context, eperson);
        if (myEPerson == null)
            usageError("Error, eperson cannot be found: " + eperson);
        context.setCurrentUser(myEPerson);
View Full Code Here

            throws SQLException, IOException
    {
        try
        {
            // Get submitter
            EPerson ep = i.getSubmitter();
            // Get the Locale
            Locale supportedLocale = I18nUtil.getEPersonLocale(ep);
            Email email = ConfigurationManager.getEmail(I18nUtil.getEmailFilename(supportedLocale, "submit_archive"));
           
            // Get the item handle to email to user
            String handle = HandleManager.findHandle(c, i);

            // Get title
            DCValue[] titles = i.getDC("title", null, Item.ANY);
            String title = "";
            try
            {
                title = I18nUtil.getMessage("org.dspace.workflow.WorkflowManager.untitled");
            }
            catch (MissingResourceException e)
            {
                title = "Untitled";
            }
            if (titles.length > 0)
            {
                title = titles[0].value;
            }

            email.addRecipient(ep.getEmail());
            email.addArgument(title);
            email.addArgument(coll.getMetadata("name"));
            email.addArgument(HandleManager.getCanonicalForm(handle));

            email.send();
View Full Code Here

    // FIXME - are the following methods still needed?
    private static EPerson getSubmitterEPerson(WorkflowItem wi)
            throws SQLException
    {
        EPerson e = wi.getSubmitter();

        return e;
    }
View Full Code Here

     *
     * @param wi  the workflow item
     */
    public static String getSubmitterName(WorkflowItem wi) throws SQLException
    {
        EPerson e = wi.getSubmitter();

        return getEPersonName(e);
    }
View Full Code Here

        // in_archive flag is now false
        itemRow.setColumn("in_archive", false);

        // Add suitable provenance - includes user, date, collections +
        // bitstream checksums
        EPerson e = ourContext.getCurrentUser();
        String prov = "Item withdrawn by " + e.getFullName() + " ("
                + e.getEmail() + ") on " + timestamp + "\n"
                + "Item was in collections:\n" + collectionProv
                + InstallItem.getBitstreamProvenanceMessage(this);

        addDC("description", "provenance", "en", prov);

        // Update item in DB
        update();

        ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(), "WITHDRAW"));

        // and all of our authorization policies
        // FIXME: not very "multiple-inclusion" friendly
        AuthorizeManager.removeAllPolicies(ourContext, this);

        // Write log
        log.info(LogManager.getHeader(ourContext, "withdraw_item", "user="
                + e.getEmail() + ",item_id=" + getID()));
    }
View Full Code Here

        // in_archive flag is now true
        itemRow.setColumn("in_archive", true);

        // Add suitable provenance - includes user, date, collections +
        // bitstream checksums
        EPerson e = ourContext.getCurrentUser();
        String prov = "Item reinstated by " + e.getFullName() + " ("
                + e.getEmail() + ") on " + timestamp + "\n"
                + "Item was in collections:\n" + collectionProv
                + InstallItem.getBitstreamProvenanceMessage(this);

        addDC("description", "provenance", "en", prov);

        // Update item in DB
        update();

        ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(), "REINSTATE"));

        // authorization policies
        if (colls.length > 0)
        {
            // FIXME: not multiple inclusion friendly - just apply access
            // policies from first collection
            // remove the item's policies and replace them with
            // the defaults from the collection
            inheritCollectionDefaultPolicies(colls[0]);
        }

        // Write log
        log.info(LogManager.getHeader(ourContext, "reinstate_item", "user="
                + e.getEmail() + ",item_id=" + getID()));
    }
View Full Code Here

            validityKey.append(bitstream.getUserFormatDescription());
            validityKey.append(bitstream.getFormat().getDescription());
        }
        else if (dso instanceof EPerson)
        {
            EPerson eperson = (EPerson) dso;
           
            validityKey.append("Bundle:");
            validityKey.append(eperson.getID());
            validityKey.append(eperson.getEmail());
            validityKey.append(eperson.getNetid());
            validityKey.append(eperson.getFirstName());
            validityKey.append(eperson.getLastName());
            validityKey.append(eperson.canLogIn());
            validityKey.append(eperson.getRequireCertificate());
        }
        else if (dso instanceof Group)
        {
            Group group = (Group) dso;
           
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.