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

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



  @SuppressWarnings("restriction")
  private IDataModel createJaxRsDataModel(IFacetedProject fproj,
      IProjectFacetVersion facetVersion) {
    IDataModel config = (IDataModel) new JAXRSFacetInstallDataModelProvider().create();
    LibraryInstallDelegate libraryDelegate = new LibraryInstallDelegate(fproj, facetVersion);
    ILibraryProvider provider = LibraryProviderFramework.getProvider(IJAXRSCoreConstants.NO_OP_LIBRARY_ID);
    libraryDelegate.setLibraryProvider(provider);
    config.setProperty(IJAXRSFacetInstallDataModelProperties.LIBRARY_PROVIDER_DELEGATE, libraryDelegate);
    return config;
  }
View Full Code Here


   
    setModuleDependencies(project, mavenProject, monitor);
  }

  private IDataModel getEarModel(String contentDir) {
    IDataModel earModelCfg = DataModelFactory.createDataModel(new EarFacetInstallDataModelProvider());
    earModelCfg.setProperty(IEarFacetInstallDataModelProperties.CONTENT_DIR, contentDir);
    earModelCfg.setProperty(IEarFacetInstallDataModelProperties.GENERATE_DD, false);
    return earModelCfg;
  }
View Full Code Here

   
    WTPProjectsUtil.removeWTPClasspathContainer(project);
  }

  private Object getEjbDataModel(String contentDir) {
    IDataModel ejbModelCfg = DataModelFactory.createDataModel(new EjbFacetInstallDataModelProvider());
    ejbModelCfg.setProperty(IEjbFacetInstallDataModelProperties.CONFIG_FOLDER, contentDir);
    ejbModelCfg.setBooleanProperty(IEjbFacetInstallDataModelProperties.ADD_TO_EAR, false);
    return ejbModelCfg;
  }
View Full Code Here

            Object cfg = ((IProjectFacetActionEvent) event).getActionConfig();

            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);


                  IDataModelOperation notificationOperation = ((IDataModelOperation) model.getProperty(FacetDataModelProvider.NOTIFICATION_OPERATION));
                  if (notificationOperation != null) {
                    notificationOperation.execute(monitor, null);
                  }
                }
              }
View Full Code Here

            Object cfg = ((IProjectFacetActionEvent) event).getActionConfig();

            if(cfg == null)
              return;

            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);
              } catch(ExecutionException e) {
                LOG.error(Messages.AppClientVersionChangeListener_Error_Notifying_Application_Client_Version_Change, e);
              }
            }
          }
View Full Code Here

            NullProgressMonitor monitor = new NullProgressMonitor();
            Object cfg = ((IProjectFacetActionEvent) event).getActionConfig();

            if(cfg == null)
              return;
            IDataModel model = (IDataModel) cfg;

            if(model.isProperty(IEarFacetInstallDataModelProperties.CONTENT_DIR)){
              IPath earContent = new Path("/" + model.getStringProperty(IEarFacetInstallDataModelProperties.CONTENT_DIR));//$NON-NLS-1$
              final IVirtualComponent c = ComponentCore.createComponent(project, true);
              if (c != null) {
                final IVirtualFolder earroot = c.getRootFolder();
                if (!WTPProjectsUtil.hasLink(project, new Path("/"), earContent, monitor)) {//$NON-NLS-1$
                  earroot.createLink(earContent , 0, null);
                }
                WTPProjectsUtil.setDefaultDeploymentDescriptorFolder(earroot, earContent, monitor);
              }

              try {
                ((IDataModelOperation) model.getProperty(FacetDataModelProvider.NOTIFICATION_OPERATION)).execute(monitor, null);
              } catch(ExecutionException e) {
                LOG.error(Messages.EarVersionChangeListener_Error_Notifying_EAR_Version_Change, e);
              }
            }
          }
View Full Code Here

   
    //MNGECLIPSE-2279 get the context root from the final name of the project, or artifactId by default.
    String contextRoot = getContextRoot(mavenProject, config.getWarName());
   
    IProjectFacetVersion webFv = config.getWebFacetVersion(project);
    IDataModel webModelCfg = getWebModelConfig(warSourceDirectory, contextRoot);
    if(!facetedProject.hasProjectFacet(WebFacetUtils.WEB_FACET)) {
      removeConflictingFacets(facetedProject, webFv, actions);
      actions.add(new IFacetedProject.Action(IFacetedProject.Action.Type.INSTALL, webFv, webModelCfg));
    } else {
      IProjectFacetVersion projectFacetVersion = facetedProject.getProjectFacetVersion(WebFacetUtils.WEB_FACET);    
View Full Code Here

   
    setModuleDependencies(project, mavenProject, monitor);
  }

  private IDataModel getWebModelConfig(String warSourceDirectory, String contextRoot) {
    IDataModel webModelCfg = DataModelFactory.createDataModel(new WebFacetInstallDataModelProvider());
    webModelCfg.setProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER, warSourceDirectory);
    webModelCfg.setProperty(IWebFacetInstallDataModelProperties.CONTEXT_ROOT, contextRoot);
    webModelCfg.setProperty(IJ2EEModuleFacetInstallDataModelProperties.GENERATE_DD, false);
    webModelCfg.setBooleanProperty(IWebFacetInstallDataModelProperties.ADD_TO_EAR, false);
    return webModelCfg;
  }
View Full Code Here

      cleaner.addFiles(defaultFacesConfig, generatedFacesConfig);
     
      IStatus status = facetVersion.getConstraint().check(fproj.getProjectFacets());
      try {
        if (status.isOK()) {
          IDataModel model = createJSFDataModel(fproj,facetVersion);
          model.setBooleanProperty(IJSFFacetInstallDataModelProperties.CONFIGURE_SERVLET, false);
          fproj.installProjectFacet(facetVersion, model, monitor);
        } else {
          addErrorMarker(fproj.getProject(), NLS.bind(Messages.JSFProjectConfigurator_Marker_Facet_Version_Cant_Be_Installed, facetVersion, status.getMessage()));
          for (IStatus st : status.getChildren()) {
            addErrorMarker(fproj.getProject(), st.getMessage());
View Full Code Here

   
    String contentDir = config.getRarContentDirectory();

    IProjectFacetVersion connectorFv = config.getConnectorFacetVersion();

    IDataModel rarModelCfg = DataModelFactory.createDataModel(new ConnectorFacetInstallDataModelProvider());

    IFolder contentFolder = project.getFolder(contentDir);
    if(!facetedProject.hasProjectFacet(WTPProjectsUtil.JCA_FACET)) {

      // Configuring content directory, used by WTP to create META-INF/manifest.mf, ra.xml
    
      rarModelCfg.setProperty(IConnectorFacetInstallDataModelProperties.CONFIG_FOLDER, contentDir);
      //Don't generate ra.xml by default - Setting will be ignored for JCA 1.6
      rarModelCfg.setProperty(IConnectorFacetInstallDataModelProperties.GENERATE_DD, false);
      rarModelCfg.setBooleanProperty(IConnectorFacetInstallDataModelProperties.ADD_TO_EAR, false);

      removeConflictingFacets(facetedProject, connectorFv, actions);

      actions.add(new IFacetedProject.Action(IFacetedProject.Action.Type.INSTALL, connectorFv, rarModelCfg));
    } else {
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.