Package org.eclipse.wst.common.frameworks.datamodel

Examples of org.eclipse.wst.common.frameworks.datamodel.IDataModel


    return ".jar";
  }

  public static File createJarFile(IModule module, IPath outputPath) {
    IDataModel model = getExportDataModel(module);

    if (model != null) {

      IVirtualComponent comp = ComponentCore.createComponent(module.getProject());

      //Here, specific extension name should be got, in case module has no standard JEE descriptor file included
      String extensionName = getModuleExtension(module);
     
      model.setProperty(J2EEComponentExportDataModelProvider.PROJECT_NAME, module.getProject());
      model.setProperty(J2EEComponentExportDataModelProvider.ARCHIVE_DESTINATION, outputPath.append(module.getName())
          + extensionName);

      model.setProperty(J2EEComponentExportDataModelProvider.COMPONENT, comp);
      model.setBooleanProperty(J2EEComponentExportDataModelProvider.OVERWRITE_EXISTING, true);
      model.setBooleanProperty(J2EEComponentExportDataModelProvider.RUN_BUILD, false);

      if (model != null) {
        try {
          model.getDefaultOperation().execute(null, null);
          return new File(model.getStringProperty(J2EEComponentExportDataModelProvider.ARCHIVE_DESTINATION));
        } catch (ExecutionException e) {
          e.printStackTrace();
        }
      }
    }
View Full Code Here


                fix = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), Messages.errorOpenDialog, Messages.editorCorrect);
            }
           
            if(fix) {
                IProject project = fei.getFile().getProject();
                IDataModel model = DataModelFactory.createDataModel(new ImportDeploymentPlanDataModelProvider());
                model.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, project.getName());
                try {
                    IFacetedProject facetedProject = ProjectFacetsManager.create(project);
                    model.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, facetedProject.getPrimaryRuntime());
                    IDataModelOperation op = new ImportDeploymentPlanOperation(model);
                    op.execute(new NullProgressMonitor(), null);
                } catch (Exception e) {
                   throw new PartInitException(e.getMessage());
                }
View Full Code Here

  public String getConfigId(IModule module) throws Exception {
    return getGeronimoServer().getVersionHandler().getConfigID(module);
  }
 
  private IStatus updateSharedLib(IModule[] module, IProgressMonitor monitor) {
    IDataModel model = DataModelFactory.createDataModel(new SharedLibEntryDataModelProvider());
    model.setProperty(ISharedLibEntryCreationDataModelProperties.MODULES, module);
    model.setProperty(ISharedLibEntryCreationDataModelProperties.SERVER, getServer());
    IDataModelOperation op = new SharedLibEntryCreationOperation(model);
    try {
      op.execute(monitor, null);
    } catch (ExecutionException e) {
      return new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, e.getMessage(), e.getCause());
View Full Code Here

public class GeronimoV21FacetInstallDelegate extends GeronimoFacetInstallDelegate {

  public IDataModelOperation createDeploymentPlanCreationOp(IProject project, Object config) {
    Trace.tracePoint("Entry", "GeronimoV21FacetInstallDelegate.createDeploymentPlanCreationOp", project, config);
   
    IDataModel model = DataModelFactory.createDataModel(new JavaProjectFacetCreationDataModelProvider());
    model.setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, project.getName());
   
    Trace.tracePoint("Exit ", "GeronimoV21FacetInstallDelegate.createDeploymentPlanCreationOp");
    return new V21DeploymentPlanCreationOperation(model, config);   
  }
View Full Code Here

public class ClickFacetInstallDelegate implements IDelegate {

  public void execute(IProject project, IProjectFacetVersion fv,
      Object cfg, IProgressMonitor monitor) throws CoreException {
    try {
      IDataModel config = null;
      if (cfg != null) {
        config = (IDataModel) cfg;
      }

      if (monitor != null) {
        int totalTasks = 3;
        if(config.getBooleanProperty(ClickFacetInstallDataModelProvider.USE_SPRING)){
          totalTasks++;
        }
        if(config.getBooleanProperty(ClickFacetInstallDataModelProvider.USE_CAYENNE)){
          totalTasks++;
        }
        monitor.beginTask("", totalTasks); //$NON-NLS-1$
      }

      // Add Click JARs to WEB-INF/lib
      deployClickFiles(project, config, monitor);

      // Update web model
      createServletAndModifyWebXML(project, config, monitor,
          config.getBooleanProperty(ClickFacetInstallDataModelProvider.USE_SPRING),
          config.getBooleanProperty(ClickFacetInstallDataModelProvider.USE_CAYENNE),
          config.getBooleanProperty(ClickFacetInstallDataModelProvider.USE_PERFORMANCE_FILTER));

      if (monitor != null) {
        monitor.worked(1);
      }

      // Add the nature
      ClickProjectNature.addNatute(project);

      if (monitor != null) {
        monitor.worked(1);
      }

      // Disable HTML validator
      try {
        ProjectConfiguration projectConfig
          = ConfigurationManager.getManager().getProjectConfiguration(project);
        ValidatorMetaData[] meta = projectConfig.getValidators();
        List enables = new ArrayList();
        for(int i=0;i<meta.length;i++){
          if(!meta[i].getValidatorUniqueName().equals(HTMLValidator.class.getName())){
            enables.add(meta[i]);
          }
        }
        projectConfig.setDoesProjectOverride(true);

        projectConfig.setEnabledManualValidators(
            (ValidatorMetaData[])enables.toArray(new ValidatorMetaData[enables.size()]));
        projectConfig.setEnabledBuildValidators(
            (ValidatorMetaData[])enables.toArray(new ValidatorMetaData[enables.size()]));

      } catch(Exception ex){
        //ex.printStackTrace();
      }
      if (monitor != null) {
        monitor.worked(1);
      }

      // Install Spring
      if(config.getBooleanProperty(ClickFacetInstallDataModelProvider.USE_SPRING)){
        deploySpringFiles(project, config, monitor);
        if (monitor != null) {
          monitor.worked(1);
        }
      }

      // Install Cayenne
      if(config.getBooleanProperty(ClickFacetInstallDataModelProvider.USE_CAYENNE)){
        deployCayenneFiles(project, config, monitor);
        if (monitor != null) {
          monitor.worked(1);
        }
      }
View Full Code Here

public class ClickFacetUninstallDelegate implements IDelegate {

  public void execute(IProject project, IProjectFacetVersion fv,
      Object config, IProgressMonitor monitor) throws CoreException {
   
    IDataModel dataModel = (IDataModel) config;
   
    if (monitor != null) {
      monitor.beginTask("", 3); //$NON-NLS-1$
    }
   
View Full Code Here

   
  }

  @SuppressWarnings("restriction")
  private IDataModel createJSFDataModel(IFacetedProject fproj, IProjectFacetVersion facetVersion) {
    IDataModel config = (IDataModel) new JSFFacetInstallDataModelProvider().create();
    LibraryInstallDelegate libraryDelegate = new LibraryInstallDelegate(fproj, facetVersion);
    ILibraryProvider provider = LibraryProviderFramework.getProvider("jsf-no-op-library-provider"); //$NON-NLS-1$
    libraryDelegate.setLibraryProvider(provider);
    config.setProperty(IJSFFacetInstallDataModelProperties.LIBRARY_PROVIDER_DELEGATE, libraryDelegate);
    config.setProperty(IJSFFacetInstallDataModelProperties.SERVLET_NAME, ""); //$NON-NLS-1$
    config.setProperty(IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS, new String[0]);
   
    return config;
  }
View Full Code Here

      } else if (facetVersion.compareTo(currentFacetVersion) > 0) {
        actionType = IFacetedProject.Action.Type.VERSION_CHANGE; 
      }

     if (actionType != null) {
          IDataModel cfg = DataModelFactory.createDataModel(new WebFragmentFacetInstallDataModelProvider());
          //Don't create an associated war project
          cfg.setProperty(IWebFragmentFacetInstallDataModelProperties.ADD_TO_WAR, false);
        actions.add(new IFacetedProject.Action(actionType,facetVersion, cfg));
      }
     
      if (!actions.isEmpty()) {
        facetedProject.modify(actions, monitor);
View Full Code Here

    //Remove WTP classpath libraries conflicting with the Maven one
    WTPProjectsUtil.removeWTPClasspathContainer(project);
}

  private IDataModel getAppClientDataModel(String contentDir) {
    IDataModel appClientModelCfg = DataModelFactory.createDataModel(new AppClientFacetInstallDataModelProvider());
    appClientModelCfg.setProperty(IAppClientFacetInstallDataModelProperties.CONFIG_FOLDER, contentDir);
    appClientModelCfg.setProperty(IAppClientFacetInstallDataModelProperties.CREATE_DEFAULT_MAIN_CLASS, false);
    appClientModelCfg.setProperty(IJ2EEFacetInstallDataModelProperties.GENERATE_DD, false);
    appClientModelCfg.setBooleanProperty(IAppClientFacetInstallDataModelProperties.ADD_TO_EAR, false);   
    return appClientModelCfg;
  }
View Full Code Here

      // refreshing the project hierarchy to make sure that Eclipse "sees" the .settings folder and file,
      // to be able to add the JAX-RS Facet. see https://issues.jboss.org/browse/JBIDE-10037
      ProjectUtils.refreshHierarchy(mavenProject.getBasedir(),
                                IResource.DEPTH_INFINITE,
                                new SubProgressMonitor(monitor, 1));
      IDataModel model = createJaxRsDataModel(fproj,facetVersion);
      WarPluginConfiguration warConfig = new WarPluginConfiguration(mavenProject, fproj.getProject());
      String warSourceDirectory = warConfig.getWarSourceDirectory();
      model.setProperty(IJAXRSFacetInstallDataModelProperties.WEBCONTENT_DIR, warSourceDirectory);
      model.setProperty(IJAXRSFacetInstallDataModelProperties.UPDATEDD, false);
      fproj.installProjectFacet(facetVersion, model, monitor);
    } else {
      String errorMessage = status.getMessage() == null ? Messages.JaxRsProjectConfigurator_Unknown_Error:status.getMessage();
      String markerMessage = NLS.bind(Messages.JaxrsProjectConfigurator_facet_cannot_be_installed,
                  facetVersion, errorMessage);
View Full Code Here

TOP

Related Classes of org.eclipse.wst.common.frameworks.datamodel.IDataModel

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.