Examples of UserReportableException


Examples of uk.ac.osswatch.simal.wicket.UserReportableException

  public CategoryDetailPage(IDoapCategory category) {
    try {
      populatePage(category);
    } catch (SimalException e) {
      UserReportableException error = new UserReportableException(
          "Unable to create category detail page", CategoryDetailPage.class, e);
      setResponsePage(new ErrorReportPage(error));
    }
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.wicket.UserReportableException

      try {
        category = SimalRepositoryFactory.getCategoryService().findById(id);
        populatePage(category);
      } catch (SimalException e) {
        UserReportableException error = new UserReportableException(
            "Unable to get category from the repository",
            CategoryDetailPage.class, e);
        setResponsePage(new ErrorReportPage(error));
      }
    } else {
      UserReportableException error = new UserReportableException(
          "Unable to get simalID parameter from URL", CategoryDetailPage.class);
      setResponsePage(new ErrorReportPage(error));
    }
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.wicket.UserReportableException

  public CategoryBrowserPage() {
    try {
      add(new CategoryListPanel("categoryList", "Categories"));
    } catch (SimalRepositoryException e) {
      UserReportableException error = new UserReportableException(
          "Unable to get categories from the repository",
          CategoryBrowserPage.class, e);
      setResponsePage(new ErrorReportPage(error));
    }
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.wicket.UserReportableException

   */
  public PersonBrowserPage(PageParameters parameters) {
    if (parameters.containsKey("filter")) {
        populatePage(parameters.getString("filter"));
    } else {
        UserReportableException error = new UserReportableException(
              "Invalid parameters", PersonListPage.class);
      setResponsePage(new ErrorReportPage(error));
      }
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.wicket.UserReportableException

        add(new BookmarkablePageLink<PersonBrowserPage>("filterWithULink", PersonBrowserPage.class, new PageParameters("filter=^u(.*)")));
        add(new BookmarkablePageLink<PersonBrowserPage>("filterWithVLink", PersonBrowserPage.class, new PageParameters("filter=^v(.*)")));
        add(new BookmarkablePageLink<PersonBrowserPage>("filterWithWLink", PersonBrowserPage.class, new PageParameters("filter=^w(.*)")));
        add(new BookmarkablePageLink<PersonBrowserPage>("filterWithXYZLink", PersonBrowserPage.class, new PageParameters("filter=^[xyz](.*)")));
      } catch (SimalRepositoryException e) {
          UserReportableException error = new UserReportableException(
                "Unable to retrieve people to list", PersonListPage.class);
        setResponsePage(new ErrorReportPage(error));
    }
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.wicket.UserReportableException

    try {
      add(new PersonListPanel("colleaguesList", "Colleagues", person
          .getColleagues(), 15));
    } catch (SimalRepositoryException e) {
      UserReportableException error = new UserReportableException(
          "Unable to get people from the repository", ColleaguesPanel.class, e);
      setResponsePage(new ErrorReportPage(error));
    }
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.wicket.UserReportableException

          person = SimalRepositoryFactory.getPersonService().findById(id);
      } else if (parameters.containsKey("email")) {
        String[] emails = (String[]) parameters.get("email");
        String email = emails[0];
        if (email == null || email.length() == 0) {
            UserReportableException error = new UserReportableException(
                  "Must provide an email in the request URL", PersonDetailPage.class);
          setResponsePage(new ErrorReportPage(error));
        }
        person = SimalRepositoryFactory.getPersonService().findBySha1Sum(RDFUtils.getSHA1(email));
      } else {
        UserReportableException error = new UserReportableException(
            "URL does not have sufficient parameters for finding a unique person", PersonDetailPage.class);
        setResponsePage(new ErrorReportPage(error));
      }
     
      if (person == null) {
          setResponsePage(new PersonListPage());
      } else {
          populatePage(person);
      }
    } catch (SimalRepositoryException e) {
      UserReportableException error = new UserReportableException(
        "Unable to get person from the repository", PersonDetailPage.class,
        e);
      setResponsePage(new ErrorReportPage(error));
    } catch (NoSuchAlgorithmException e) {
        UserReportableException error = new UserReportableException(
                "Unable to calculate SHA1 has for email", PersonDetailPage.class,
                e);
        setResponsePage(new ErrorReportPage(error));
  }
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.wicket.UserReportableException

  public PersonDetailPage(IPerson person) {
    try {
      populatePage(person);
    } catch (SimalRepositoryException e) {
      UserReportableException error = new UserReportableException(
          "Unable to populate person detail page", PersonDetailPage.class, e);
      setResponsePage(new ErrorReportPage(error));
    }
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.wicket.UserReportableException

      add(new ExternalLink("rdfLink", cmd.getURL()));
      String rdfLink = "<link href=\"" + cmd.getURL()
          + "\" rel=\"meta\" title=\"RDF\" type=\"application/rdf+xml\" />";
      add(new StringHeaderContributor(rdfLink));
    } catch (SimalAPIException e) {
      UserReportableException error = new UserReportableException(
          "Unable to get a RESTful URI for the person RDF/XML document",
          PersonDetailPage.class, e);
      setResponsePage(new ErrorReportPage(error));
    }
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.wicket.UserReportableException

            .getUniqueSimalID(id);
        this.project = SimalRepositoryFactory.getProjectService()
            .getProjectById(uniqueSimalID);
        populatePage();
      } catch (SimalRepositoryException e) {
        UserReportableException error = new UserReportableException(
            "Unable to get project from the repository",
            ProjectDetailPage.class, e);
        setResponsePage(new ErrorReportPage(error));
      }
    } else {
      UserReportableException error = new UserReportableException(
          "Unable to get simalID parameter from URL", ProjectDetailPage.class);
      setResponsePage(new ErrorReportPage(error));
    }
  }
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.