Examples of IVirtualComponent


Examples of org.eclipse.wst.common.componentcore.resources.IVirtualComponent

     * @return WebApp
     */
    private JAXBElement<WebApp> getWebDeploymentPlan(IModule module) {
        Trace.tracePoint("Enter", "DependencyHelper.getWebDeploymentPlan", module);

        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
        IFile file = GeronimoUtils.getWebDeploymentPlanFile(comp);
        if (file.getName().equals(GeronimoUtils.WEB_PLAN_NAME) && file.exists()) {
            try {
        Trace.tracePoint("Exit ", "DependencyHelper.getWebDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
         return JAXBUtils.unmarshalFilterDeploymentPlan(file);
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualComponent

     * @return OpenEjbJar
     */
    private JAXBElement<OpenejbJar> getOpenEjbDeploymentPlan(IModule module) {
        Trace.tracePoint("Enter", "DependencyHelper.getOpenEjbDeploymentPlan", module);

        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
        IFile file = GeronimoUtils.getOpenEjbDeploymentPlanFile(comp);
        if (file.getName().equals(GeronimoUtils.OPENEJB_PLAN_NAME) && file.exists()) {
            try {
        Trace.tracePoint("Exit ", "DependencyHelper.getOpenEjbDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
      } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualComponent

     * @return ApplicationClient
     */
    private JAXBElement<ApplicationClient> getAppClientDeploymentPlan(IModule module) {
        Trace.tracePoint("Enter", "DependencyHelper.getWebDeploymentPlan", module);

        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
        IFile file = GeronimoUtils.getApplicationClientDeploymentPlanFile(comp);
        if (file.getName().equals(GeronimoUtils.APP_CLIENT_PLAN_NAME) && file.exists()) {
            try {
        Trace.tracePoint("Exit ", "DependencyHelper.getWebDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
         return JAXBUtils.unmarshalFilterDeploymentPlan(file);
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualComponent

     * @return Application
     */
    private JAXBElement<Application> getApplicationDeploymentPlan(IModule module) {
        Trace.tracePoint("Enter", "DependencyHelper.getApplicationDeploymentPlan", module);

        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
        IFile file = GeronimoUtils.getApplicationDeploymentPlanFile(comp);
        if (file.getName().equals(GeronimoUtils.APP_PLAN_NAME) && file.exists()) {
            try {
        Trace.tracePoint("Exit ", "DependencyHelper.getApplicationDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
          return JAXBUtils.unmarshalFilterDeploymentPlan(file);
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualComponent

     * @return Application
     */
    private JAXBElement<Connector> getConnectorDeploymentPlan(IModule module) {
        Trace.tracePoint("Enter", "DependencyHelper.getConnectorDeploymentPlan", module);

        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
        IFile file = GeronimoUtils.getConnectorDeploymentPlanFile(comp);
        if (file.getName().equals(GeronimoUtils.CONNECTOR_PLAN_NAME) && file.exists()) {
            try {
        Trace.tracePoint("Exit ", "DependencyHelper.getConnectorDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
         return JAXBUtils.unmarshalFilterDeploymentPlan(file);
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualComponent

        Trace.tracePoint("Entry", "ImportDeploymentPlanOperation.execute", monitor, info);

        if (!isGeronimoRuntimeTarget())
            return Status.OK_STATUS;

        IVirtualComponent comp = ComponentCore.createComponent(getProject());
        String type = J2EEProjectUtilities.getJ2EEProjectType(getProject());

        IFile planFile = null;

        try {
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualComponent

    value = value.replaceAll("\"", "&quot;");
    return value;
  }
 
  public static boolean isClickProject(IProject project){
    IVirtualComponent component = ComponentCore.createComponent(project);
    try {
      if(WebArtifactEdit.isValidWebModule(component)){
        IFacetedProject facetedProject = ProjectFacetsManager.create(project);
        Object facets[] = facetedProject.getProjectFacets().toArray();
        for(int i=0;i<facets.length;i++){
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualComponent

    fixMissingModuleCoreNature(project, monitor);
   
    //Remove test folder links to prevent exporting them when packaging the project
    removeTestFolderLinks(project, mavenProject, monitor, "/"); //$NON-NLS-1$
   
    IVirtualComponent component = ComponentCore.createComponent(project);
    if (component != null) {
      IPath contentDirPath = new Path("/").append(contentDir); //$NON-NLS-1$
      WTPProjectsUtil.setDefaultDeploymentDescriptorFolder(component.getRootFolder(), contentDirPath, monitor);
    }
   
    //Remove "library unavailable at runtime" warning.
    setNonDependencyAttributeToContainer(project, monitor);
   
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualComponent

   * @param monitor
   * @throws CoreException
   */
  private void setModuleDependencies(IProject project, MavenProject mavenProject, IProgressMonitor monitor) throws CoreException {

    IVirtualComponent warComponent = ComponentCore.createComponent(project);
    if (warComponent == null) {
      return;
    }
   
    Set<IVirtualReference> newOverlayRefs = new LinkedHashSet<IVirtualReference>();
    MavenSessionHelper helper = new MavenSessionHelper(mavenProject);
    try {
      helper.ensureDependenciesAreResolved("maven-war-plugin", "war:war"); //$NON-NLS-1$ //$NON-NLS-2$
     
      MavenPlugin.getMaven();
     
    WarPluginConfiguration config = new WarPluginConfiguration(mavenProject, project);
   
    List<Overlay> overlays = config.getOverlays();
    //1 overlay = current project => no overlay component needed
    if (overlays.size() > 1) {

      //Component order must be inverted to follow maven's overlay order behaviour
      //as in WTP, last components supersede the previous ones
      Collections.reverse(overlays);
      for(Overlay overlay : overlays) {

        if (overlay.shouldSkip()) {
          continue;
        }
       
        Artifact artifact = overlay.getArtifact();
        IOverlayVirtualComponent overlayComponent = null;
        IMavenProjectFacade workspaceDependency = projectManager.getMavenProject(
            artifact.getGroupId(),
            artifact.getArtifactId(),
            artifact.getVersion());

        if(workspaceDependency != null) {
          //artifact dependency is a workspace project && dependency resolution is on
          IProject overlayProject = workspaceDependency.getProject();

          if (overlayProject.equals(project)) {
            overlayComponent = OverlayComponentCore.createSelfOverlayComponent(project);
          } else if (workspaceDependency.getFullPath(artifact.getFile()) != null){
            overlayComponent = OverlayComponentCore.createOverlayComponent(overlayProject);
          } else {
            //Dependency resolution is off
            overlayComponent = createOverlayArchiveComponent(project, mavenProject, overlay);
          }
        } else {
          overlayComponent = createOverlayArchiveComponent(project, mavenProject, overlay);
        }

        if (overlayComponent != null) {
         
          overlayComponent.setInclusions(new LinkedHashSet<String>(Arrays.asList(overlay.getIncludes())));
          overlayComponent.setExclusions(new LinkedHashSet<String>(Arrays.asList(overlay.getExcludes())));
         
          IVirtualReference depRef = ComponentCore.createReference(warComponent, overlayComponent);
          String targetPath = StringUtils.nullOrEmpty(overlay.getTargetPath())?"/":overlay.getTargetPath(); //$NON-NLS-1$
          depRef.setRuntimePath(new Path(targetPath));
          newOverlayRefs.add(depRef);
        }
      }
     
    }
   
    IVirtualReference[] oldOverlayRefs = WTPProjectsUtil.extractHardReferences(warComponent, true);
   
    IVirtualReference[] updatedOverlayRefs = newOverlayRefs.toArray(new IVirtualReference[newOverlayRefs.size()]);
   
    if (WTPProjectsUtil.hasChanged2(oldOverlayRefs, updatedOverlayRefs)){
      //Only write in the .component file if necessary
      IVirtualReference[] nonOverlayRefs = WTPProjectsUtil.extractHardReferences(warComponent, false);
      IVirtualReference[] allRefs = new IVirtualReference[nonOverlayRefs.length + updatedOverlayRefs.length];
      System.arraycopy(nonOverlayRefs, 0, allRefs, 0, nonOverlayRefs.length);
      System.arraycopy(updatedOverlayRefs, 0, allRefs, nonOverlayRefs.length, updatedOverlayRefs.length);
      warComponent.setReferences(allRefs);
    }

    } finally {
      helper.dispose();
    }
View Full Code Here

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualComponent

      }
    }
    //MECLIPSEWTP-41 Fix the missing moduleCoreNature
    fixMissingModuleCoreNature(project, monitor);
   
    IVirtualComponent earComponent = ComponentCore.createComponent(project);
    IPath contentDirPath = new Path((contentDir.startsWith("/"))?contentDir:"/"+contentDir); //$NON-NLS-1$ //$NON-NLS-2$
    //Ensure the EarContent link has been created
    if (!WTPProjectsUtil.hasLink(project, ROOT_PATH, contentDirPath, monitor)) {
      earComponent.getRootFolder().createLink(contentDirPath, IVirtualResource.NONE, monitor);
    }
    WTPProjectsUtil.setDefaultDeploymentDescriptorFolder(earComponent.getRootFolder(), contentDirPath, monitor);

    //MECLIPSEWTP-56 : application.xml should not be generated in the source directory
    boolean useBuildDirectory = MavenWtpPlugin.getDefault().getMavenWtpPreferencesManager().getPreferences(project).isApplicationXmGeneratedInBuildDirectory();
    boolean useResourcefiltering = config.isFilteringDeploymentDescriptorsEnabled();
   
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.