Package uk.ac.osswatch.simal.model

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


   * @param command
   * @throws SimalAPIException
   *           if the project was not added for any reason
   */
  private IProject addProject(RESTCommand command) throws SimalAPIException {
    IProject newProject = null;
    String rdfXml = command.getParameter(RESTCommand.PARAM_RDF);
   
    if(rdfXml == null) {
      throw new SimalAPIException("Did not find RDF/XML data to add project from.");
    }
View Full Code Here


   * @throws SimalException
   */
  private void processSubmittedDoap(String doap) {
    try {
      backupDoapFile(doap);
      IProject newProject = SimalRepositoryFactory.getProjectService()
          .createProject(RDFXMLUtils.convertXmlStringToDom(doap));
      if (newProject != null) {
        PageParameters newProjectPageParams = new PageParameters();
        newProjectPageParams.add("simalID", newProject.getSimalID());
        setResponsePage(ProjectDetailPage.class, newProjectPageParams);
      } else {
        throw new SimalException(
            "Failed to created new project based on submitted DOAP.");
      }
View Full Code Here

    if (projects == null || projects.size() == 0) {
      logger.info("No projects match the regular expression '" + filter + "'");
    } else {
      Iterator<IProject> itr = projects.iterator();
      while(itr.hasNext()) {
        IProject project = itr.next();
        dump(project, cl);
        logger.info("\n\n============================================\n============================================\n\n");
      }
    }
  }
View Full Code Here

   *
   * @param panelID
   */
  public ProjectSummaryPanel(String panelID) {
    super(panelID);
    IProject project;
    try {
      project = UserApplication.getRepository()
          .getFeaturedProject();
    } catch (SimalRepositoryException e) {
      // If we can't get a random project it is safe to use a null project as
View Full Code Here

  }

 
  @Test
  public void testProject() throws SimalException {
    IProject project = review.getProject();
    assertEquals("We have the wrong project for the test review", "http://simal.oss-watch.ac.uk/simalTest#", project.getURI());
  }
View Full Code Here

  public void setSetProject() throws DuplicateURIException, SimalException {
    IReviewService service = SimalRepositoryFactory.getReviewService();
    IReview review = service.create("http://test.org/Review");
    review.setProject(project1);
   
    IProject project = review.getProject();
    assertEquals("Incorrectly setting the project", project1.getName(), project.getName());
    review.delete();
  }
View Full Code Here

     
      if(person != null) {
        try {
          projects = person.getProjects().iterator();
          while (projects.hasNext()) {
            IProject project = projects.next();
            label.append(project.getLabel());
            if (projects.hasNext()) {
              label.append(", ");
            }
          }
        } catch (SimalRepositoryException e) {
View Full Code Here

  }

  private void removePerson() throws UserReportableException {
    Page page = this.getPage();
    if (page instanceof ProjectDetailPage) {
      IProject project = ((ProjectDetailPage) page).getProject();
      try {
        project.removeDocumenter(person);
        project.removeDeveloper(person);
        project.removeHelper(person);
        project.removeMaintainer(person);
        project.removeTester(person);
        project.removeTranslator(person);
      } catch (SimalRepositoryException e) {
        throw new UserReportableException("Unable to removePerson",
            PersonSummaryPanel.class, e);
      }
    } else {
View Full Code Here

    }
  }
 
  @AfterClass
  public static void removeTestProject() throws SimalRepositoryException {
    IProject project = getTestProject();
    project.delete();
  }
View Full Code Here

  private static final String TEST_PROJECT_SEE_ALSO = "http://www.oss-watch.ac.uk/ossWatch#";

  @Test
  public void testGenerateURL() {
    try {
      IProject project = SimalRepositoryFactory.getProjectService().findProjectBySeeAlso(TEST_PROJECT_SEE_ALSO);
      if(project != null && project instanceof Project) {
        String generatedURL = ((Project) project).generateURL();
        assertEquals("http://localhost:8080/project/simalID/" + project.getSimalID(),generatedURL);
        return;
      }
      fail("Project with seeAlso '" + TEST_PROJECT_SEE_ALSO + "'that was just inserted seems null");
    } catch (SimalRepositoryException e) {
      fail("Couldn't find project just inserted.");
View Full Code Here

TOP

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

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.