Examples of IVirtualComponent


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

    IFacetedProject facetedProject = ProjectFacetsManager.create(project, true, monitor);
    if(!facetedProject.hasProjectFacet(WTPProjectsUtil.EAR_FACET)) {
      return;
    }

    IVirtualComponent earComponent = ComponentCore.createComponent(project);
   
    Set<IVirtualReference> newRefs = new LinkedHashSet<IVirtualReference>();
   
    EarPluginConfiguration config = new EarPluginConfiguration(mavenProject);
    // Retrieving all ear module configuration from maven-ear-plugin : User defined modules + artifacts dependencies.
    Set<EarModule> earModules = config.getEarModules();

    String libBundleDir = config.getDefaultBundleDirectory();

    updateLibDir(project, libBundleDir, monitor);
   
    IPackagingConfiguration packagingConfig = new PackagingConfiguration(config.getPackagingIncludes(), config.getPackagingExcludes());
   
    for(EarModule earModule : earModules) {

      Artifact artifact = earModule.getArtifact();
      IVirtualComponent depComponent = null;
      IMavenProjectFacade workspaceDependency = projectManager.getMavenProject(artifact.getGroupId(), artifact
          .getArtifactId(), artifact.getVersion());

      if(workspaceDependency != null && !workspaceDependency.getProject().equals(project)
          && workspaceDependency.getFullPath(artifact.getFile()) != null) {
View Full Code Here

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

    }
  }


  private IVirtualComponent createDependencyComponent(IVirtualComponent earComponent, IProject project) {
    IVirtualComponent depComponent = ComponentCore.createComponent(project);
    return depComponent;
  }
View Full Code Here

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

  }

  private IVirtualComponent createDependencyComponent(IVirtualComponent earComponent, Artifact artifact) {
      //Create dependency component, referenced from the local Repo.
      String artifactPath = ArtifactHelper.getM2REPOVarPath(artifact);
      IVirtualComponent depComponent = ComponentCore.createArchiveComponent(earComponent.getProject(), artifactPath);
      return depComponent;
  }
View Full Code Here

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

    super(aComponentProject);
  }

  @Override
  public IVirtualFolder getRootFolder() {
    IVirtualComponent component = ComponentCore.createComponent(getProject());
    IVirtualFolder root =null;
    if (component != null) {
      root = component.getRootFolder();
    }
    return root;
  }
View Full Code Here

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

  protected void configureDeployedName(IProject project, String deployedFileName) {
    //We need to remove the file extension from deployedFileName
    int extSeparatorPos  = deployedFileName.lastIndexOf('.');
    String deployedName = extSeparatorPos > -1? deployedFileName.substring(0, extSeparatorPos): deployedFileName;
    //From jerr's patch in MNGECLIPSE-965
    IVirtualComponent projectComponent = ComponentCore.createComponent(project);
    if(projectComponent != null && !deployedName.equals(projectComponent.getDeployedName())){//MNGECLIPSE-2331 : Seems projectComponent.getDeployedName() can be null
      StructureEdit moduleCore = null;
      try {
        moduleCore = StructureEdit.getStructureEditForWrite(project);
        if (moduleCore != null){
          WorkbenchComponent component = moduleCore.getComponent();
View Full Code Here

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

    //MECLIPSEWTP-41 Fix the missing moduleCoreNature
    fixMissingModuleCoreNature(project, monitor);
   
    removeTestFolderLinks(project, mavenProject, monitor, "/"); //$NON-NLS-1$

    IVirtualComponent ejbComponent = ComponentCore.createComponent(project);
    if (ejbComponent != null) {
      IPath contentDirPath = new Path("/").append(contentDir); //$NON-NLS-1$
      WTPProjectsUtil.setDefaultDeploymentDescriptorFolder(ejbComponent.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

            if(cfg == null)
              return;

            IDataModel model = (IDataModel) cfg;

            final IVirtualComponent c = ComponentCore.createComponent(project, true);

            if (c == null)
              return;

            try{
              if (model != null) {
                //The model could not provide us the property we require
                if(model.isProperty(IWebFacetInstallDataModelProperties.CONTEXT_ROOT)){
                  final IWorkspace ws = ResourcesPlugin.getWorkspace();
                  final IPath pjpath = project.getFullPath();

                  final IPath contentdir = setContentPropertyIfNeeded(model, pjpath, project);
                  mkdirs(ws.getRoot().getFolder(contentdir), monitor);
                  IVirtualFolder contentRootFolder = c.getRootFolder();
                  WTPProjectsUtil.setDefaultDeploymentDescriptorFolder(contentRootFolder, contentdir, monitor);

                  String contextRoot = model.getStringProperty(IWebFacetInstallDataModelProperties.CONTEXT_ROOT);
                  setContextRootPropertyIfNeeded(c, contextRoot);
View Full Code Here

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

    if (existing == null)
      c.setMetaProperty("context-root", contextRoot); //$NON-NLS-1$
  }

  private IPath setContentPropertyIfNeeded(final IDataModel model, final IPath pjpath, IProject project) {
    IVirtualComponent c = ComponentCore.createComponent(project, false);
    if (c.exists()) {
      if( !c.getRootFolder().getProjectRelativePath().isRoot() ){
        return c.getRootFolder().getUnderlyingResource().getFullPath();
      }
    }
    return pjpath.append(model.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER));
  }
View Full Code Here

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

            IDataModel model = (IDataModel) cfg;

            if(model.isProperty(IAppClientFacetInstallDataModelProperties.CONFIG_FOLDER)){
              IPath appClientContent = new Path("/" + model.getStringProperty(IAppClientFacetInstallDataModelProperties.CONFIG_FOLDER));//$NON-NLS-1$
              if (!WTPProjectsUtil.hasLink(project, new Path("/"), appClientContent, monitor)) {//$NON-NLS-1$
                final IVirtualComponent c = ComponentCore.createComponent(project, true);
                if (c != null) {
                  final IVirtualFolder root = c.getRootFolder();
                  root.createLink(appClientContent , 0, null);
                }
              }
              try {
                ((IDataModelOperation) model.getProperty(FacetDataModelProvider.NOTIFICATION_OPERATION)).execute(monitor, null);
View Full Code Here

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

  }

  // helper methods
 
  private IContainer[] getRootFolders() {
    IVirtualComponent component = ComponentCore.createComponent(project);
    IContainer[] folders = null;
    if (component != null) {
      IVirtualFolder rootFolder = component.getRootFolder();
      folders = rootFolder.getUnderlyingFolders();
    } else {
      folders = new IContainer[0];
    }
    return folders;
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.