Package uk.ac.osswatch.simal.model

Examples of uk.ac.osswatch.simal.model.IPerson


    columns.add(new PropertyColumn<IPerson>(new Model<String>("Email"), "email", "email") {
      private static final long serialVersionUID = 1L;

      @Override
      public void populateItem(Item<ICellPopulator<IPerson>> cellItem, String componentId, IModel<IPerson> model) {
        IPerson person = model.getObject();
        String label = "";
       
        if (person != null) {
          Iterator<IInternetAddress> emails = ((IPerson) model.getObject())
              .getEmail().iterator();
View Full Code Here


      super(displayModel, sortProperty, propertyExpression);
    }

    @Override
    public void populateItem(Item<ICellPopulator<IPerson>> cellItem, String componentId, IModel<IPerson> model) {
      IPerson person = model.getObject();
      Iterator<IProject> projects;
      StringBuffer label = new StringBuffer();
     
      if(person != null) {
        try {
          projects = person.getProjects().iterator();
          while (projects.hasNext()) {
            IProject project = projects.next();
            label.append(project.getLabel());
            if (projects.hasNext()) {
              label.append(", ");
View Full Code Here

   *
   * @return
   * @throws SimalRepositoryException
   */
  public IPerson getPerson() throws SimalRepositoryException {
    IPerson duplicate = SimalRepositoryFactory.getPersonService().getDuplicate(getEmail());
    if (duplicate != null) {
      populatePerson(duplicate);
      return duplicate;
    }

    String id = SimalRepositoryFactory.getPersonService().getNewID();
    String uri = RDFUtils.getDefaultPersonURI(id);
    IPerson person;
    try {
      person = SimalRepositoryFactory.getPersonService().create(uri);
      person.setSimalID(id);
      populatePerson(person);
    } catch (DuplicateURIException e) {
      throw new SimalRepositoryException("Unable to create a new person", e);
    }
    return person;
View Full Code Here

    reviewList = null;
  }
    add(reviewList);
   
    // FIXME: reviewer should be set from a drop down
    IPerson reviewer;
  try {
    reviewer = SimalRepositoryFactory.getPersonService().get("http://people.apache.org/~rgardler/#me");
  } catch (SimalRepositoryException e) {
    logger.error("Unable to get Ross Gardler as a reviewer", e);
    reviewer = null;
View Full Code Here

  @Override
  protected void processAddSubmit() {
    inputModel.setName(nameField.getValue());
    inputModel.setEmail(emailField.getValue());
    try {
      IPerson person = inputModel.getPerson();
      if (project != null) {
        switch (personRole) {
        case MAINTAINER:
          project.addMaintainer(person);
          break;
View Full Code Here

    String[] errors = {LoginPage.DUPLICATE_USERNAME_ERROR};
    tester.assertErrorMessages(errors);
   
    IPersonService service = SimalRepositoryFactory.getPersonService();
    IPerson user = service.findByUsername(username);
    user.delete();
  }
View Full Code Here

    @Test
    public void testGetAll() throws SimalRepositoryException {
      Set<IPerson> people = service.getAll();
       
        Iterator<IPerson> itrPeople = people.iterator();
        IPerson person;
        while (itrPeople.hasNext()) {
          person = itrPeople.next();
          assertNotNull(person.getLabel());
          logger.debug("Got person: " + person + " : " + person.getURI());
        }

        assertEquals(22, people.size());
    }
View Full Code Here

      logger.debug("Finished testGetAllPeoplesAsJSON()");
    }

    @Test
    public void testFindPersonById() throws SimalRepositoryException {
      IPerson person = service.findById(testDeveloperID);
      assertNotNull("Can't find a person with the ID " + testDeveloperID, person);
      assertEquals("Developer URI is not as expected ", RDFUtils
          .getDefaultPersonURI(testDeveloperID), person.getURI());
    }
View Full Code Here

  }
 
  @Test
  public void testInternetAddress() {
    try {
      IPerson developer = SimalRepositoryFactory.getPersonService()
          .findBySeeAlso(TEST_DEVELOPER_SEE_ALSO);
      if (developer != null) {
        Set<IInternetAddress> allEmailAddresses = developer.getEmail();
        for (IInternetAddress testAddress : allEmailAddresses) {
          assertEquals("Obfuscated addresses don't match.",
              EXPECTED_OBFUSCATED_EMAILS.get(testAddress.getAddress()),
              testAddress.getObfuscatedAddress());
        }
View Full Code Here

          .getDefaultPersonURI(testDeveloperID), person.getURI());
    }

    @Test
    public void testFindPersonByEMail() throws SimalRepositoryException, NoSuchAlgorithmException {
      IPerson person = service.findBySha1Sum(RDFUtils.getSHA1(testDeveloperEMail));
      assertNotNull("Can't find a person with the EMail " + testDeveloperEMail, person);
    }
View Full Code Here

TOP

Related Classes of uk.ac.osswatch.simal.model.IPerson

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.