Examples of PomBean


Examples of fr.openwide.maven.artifact.notifier.core.business.search.model.PomBean

    return response.getBeans(ArtifactVersionBean.class);
  }
 
  @Override
  public PomBean searchFromPom(String xml) throws ServiceException {
    PomBean pomBean = pomParserService.parse(xml);
   
    return filterPomBean(pomBean);
  }
View Full Code Here

Examples of fr.openwide.maven.artifact.notifier.core.business.search.model.PomBean

    return filterPomBean(pomBean);
  }

  @Override
  public PomBean searchFromPom(File file) throws ServiceException {
    PomBean pomBean = pomParserService.parse(file);
   
    return filterPomBean(pomBean);
  }
View Full Code Here

Examples of fr.openwide.maven.artifact.notifier.core.business.search.model.PomBean

  private boolean isValidId(String id) {
    return StringUtils.hasText(id) && VALID_ARTIFACT_ID_PART_PATTERN.matcher(id).matches();
  }

  private PomBean filterPomBean(PomBean pomBean) throws ServiceException {
    PomBean artifactsOnMavenCentral = new PomBean(pomBean);
   
    doFilterFromList(pomBean.getDependencies(), artifactsOnMavenCentral.getDependencies(), artifactsOnMavenCentral.getInvalidArtifacts());
    doFilterFromList(pomBean.getDependencyManagement(), artifactsOnMavenCentral.getDependencyManagement(), artifactsOnMavenCentral.getInvalidArtifacts());
    doFilterFromList(pomBean.getPlugins(), artifactsOnMavenCentral.getPlugins(), artifactsOnMavenCentral.getInvalidArtifacts());
    doFilterFromList(pomBean.getPluginManagement(), artifactsOnMavenCentral.getPluginManagement(), artifactsOnMavenCentral.getInvalidArtifacts());
   
    return artifactsOnMavenCentral;
  }
View Full Code Here

Examples of fr.openwide.maven.artifact.notifier.core.business.search.model.PomBean

   
    return artifactList;
  }
 
  private PomBean parse(Document doc) {
    PomBean pomBean = new PomBean();
   
    pomBean.setGroupId(getGroupId(doc));
    pomBean.setArtifactId(getArtifactId(doc));
    pomBean.setDependencies(populate(doc.select("dependency:not(dependencyManagement dependencies dependency)")));
    pomBean.setDependencyManagement(populate(doc.select("dependencyManagement > dependencies > dependency")));
    pomBean.setPlugins(populate(doc.select("plugin:not(pluginManagement plugins plugin)")));
    pomBean.setPluginManagement(populate(doc.select("pluginManagement > plugins > plugin")));
   
    return pomBean;
  }
View Full Code Here

Examples of fr.openwide.maven.artifact.notifier.core.business.search.model.PomBean

          }
         
          pomFile = File.createTempFile("uploaded-pom-", ".xml", configurer.getTmpDirectory());
          fileUpload.writeTo(pomFile);
         
          PomBean pomBean = mavenCentralSearchApiService.searchFromPom(pomFile);
          ArtifactPomSearchPanel.this.pomBeanModel.setObject(pomBean);
          ArtifactPomSearchPanel.this.pomContentModel.setObject(null);
        } catch (Exception e) {
          LOGGER.error("Unable to parse " + fileSelect.getFileUpload().getClientFileName() + " file", e);
         
          Session.get().error(getString("artifact.follow.pom.error"));
        } finally {
          FileUtils.deleteQuietly(pomFile);
        }
       
        // Lors de la soumission d'un formulaire de recherche, on retourne sur la première page
        for (IPageable pageable : pageableList) {
          pageable.setCurrentPage(0);
        }
      }
    };
    fileSelectForm.add(fileSelect);
   
    fileSelectForm.add(new SubmitLink("fileSelectSubmit"));
   
    add(new Label("fileSelectLabel", new ResourceModel("artifact.follow.pom.search.file")));
    add(fileSelectForm);
   
    // File content form
    Form<Void> fileContentForm = new StatelessForm<Void>("fileContentForm") {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit() {
        if (ArtifactPomSearchPanel.this.pomContentModel.getObject() == null) {
          getSession().error(getString("artifact.follow.pom.error.noContent"));
          return;
        }
       
        try {
          PomBean pomBean = mavenCentralSearchApiService.searchFromPom(ArtifactPomSearchPanel.this.pomContentModel.getObject());
          ArtifactPomSearchPanel.this.pomBeanModel.setObject(pomBean);
        } catch (Exception e) {
          LOGGER.error("Unable to parse the pom content from the provided string", e);
         
          Session.get().error(getString("artifact.follow.pom.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.