Package org.eclipse.wst.server.core

Examples of org.eclipse.wst.server.core.IServer


        if (projects.getReactorProject() != null) {
            configureReactorProject(projects.getReactorProject(), monitor);
            advance(monitor, 1);
        }

        IServer server = getSetupServerWizardPage().getOrCreateServer(monitor);
        advance(monitor, 1);

        finishConfiguration(createdProjects, server, monitor);
        advance(monitor, 1);
View Full Code Here


        if (!hasServers() && project != null) {
            return "The selected project is not configured with/added to any Sling server";
        }

        IServer server = getServer();
        if (server == null) {
            return "Please select a repository";
        }

        Set<ValidationFlag> flagSet = flags.length == 0 ? EnumSet.noneOf(ValidationFlag.class) :
            EnumSet.copyOf(asList(flags));

        if (!flagSet.contains(ValidationFlag.SKIP_SERVER_STARTED)) {
            if (server.getServerState() != IServer.STATE_STARTED) {
                return "Selected server is not started";
            }
        }

        return null;
View Full Code Here

        for (IProject project : createdProjects) {
            ConfigurationHelper.convertToContentPackageProject(project, monitor, new Path("jcr_root"));
            projects.getContentProjects().add(project);
        }

        IServer server = getSetupServerWizardPage().getOrCreateServer(monitor);
        advance(monitor, 1);

        finishConfiguration(createdProjects, server, monitor);
        advance(monitor, 1);
View Full Code Here

    CloudUiUtil.storeUserDefinedUrls(serverTypeId, cloudUrls);
    // Servers to delete are servers that were previously created using a
    // URL that has been deleted.
    for (CloudFoundryServer server : serversToDelete) {
      try {
        IServer serverOriginal = server.getServerOriginal();
        serverOriginal.delete();
      }
      catch (CoreException e) {
        CloudFoundryPlugin.getDefault().getLog()
            .log(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, "Unable to delete server", e)); //$NON-NLS-1$
      }
View Full Code Here

  }

  public void decorate(Object element, IDecoration decoration) {
    if (element instanceof ModuleServer) {
      ModuleServer moduleServer = (ModuleServer) element;
      IServer s = moduleServer.getServer();
      if (s != null && CloudServerUtil.isCloudFoundryServer(s)) {
        IModule[] modules = moduleServer.getModule();
        if (modules != null && modules.length == 1) {
          CloudFoundryServer server = getCloudFoundryServer(moduleServer.getServer());
          if (server == null || !server.isConnected()) {
View Full Code Here

    }
  }

  private void openApplicationPage(ModuleServer moduleServer) {
    final IModule[] modules = moduleServer.getModule();
    IServer server = moduleServer.getServer();
    CloudFoundryServer cloudServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);
    if (cloudServer != null && modules != null && modules.length == 1) {
      IWorkbenchWindow workbenchWindow = ServerUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow();
      IWorkbenchPage page = workbenchWindow.getActivePage();

      try {
        // open server editor
        ServerEditor editor = (ServerEditor) page.openEditor(new ServerEditorInput(server.getId()),
            IServerEditorInput.EDITOR_ID);

        // set applications page to active
        Method method = MultiPageEditorPart.class.getDeclaredMethod("setActivePage", int.class); //$NON-NLS-1$
        method.setAccessible(true);
View Full Code Here

  private boolean isChildModuleChanged(IModule[] module, IProgressMonitor monitor) {
    if (module == null || module.length == 0) {
      return false;
    }

    IServer myserver = this.getServer();
    IModule[] childModules = myserver.getChildModules(module, monitor);

    if (childModules != null && childModules.length > 0) {
      // Compose the full structure of the child module
      IModule[] currentChild = new IModule[module.length + 1];
      for (int i = 0; i < module.length; i++) {
        currentChild[i] = module[i];
      }
      for (IModule child : childModules) {
        currentChild[module.length] = child;

        if (myserver.getModulePublishState(currentChild) != IServer.PUBLISH_STATE_NONE
            || isChildModuleChanged(currentChild, monitor)) {
          return true;
        }
      }
    }
View Full Code Here

      // Get the descriptor from the existing application module
      DeploymentInfoWorkingCopy workingCopy = appModule.resolveDeploymentInfoWorkingCopy(monitor);
      workingCopy.setUris(uris);
      workingCopy.save();
      IServer server = cloudServer.getServer();

      final IModule[] modules = ServerUtil.getModules(project);

      if (modules != null && modules.length == 1) {
        IModule[] add = null;
        if (!ServerUtil.containsModule(server, modules[0], monitor)) {
          add = new IModule[] { modules[0] };
        }
        else {
          // Delete them first
          IServerWorkingCopy wc = server.createWorkingCopy();
          wc.modifyModules(null, modules, monitor);
          wc.save(true, null);
          cloudServer.getBehaviour().refreshModules(monitor);

          new WaitWithProgressJob(5, 1000) {

            @Override
            protected boolean internalRunInWait(IProgressMonitor monitor) throws CoreException {
              boolean found = cloudServer.getExistingCloudModule(modules[0]) != null;
              if (found) {
                cloudServer.getBehaviour().refreshModules(monitor);
              }
              // If the app has been found, try again until it
              // is not found
              return !found;
            }

          }.run(monitor);

          // Create new ones
          IModule[] newModules = ServerUtil.getModules(project);
          if (newModules != null && newModules.length == 1) {
            add = new IModule[] { newModules[0] };
          }
        }
        if (add != null && add.length > 0) {
          IServerWorkingCopy wc = server.createWorkingCopy();
          wc = server.createWorkingCopy();
          IStatus status = wc.canModifyModules(add, null, null);
          if (status.getSeverity() != IStatus.ERROR) {
            CloudFoundryPlugin.getModuleCache().getData(wc.getOriginal())
                .tagForAutomaticRepublish(new RepublishModule(add[0], appModule.getDeploymentInfo()));
View Full Code Here

  public IServer getServerOriginal() {
    // if a working copy is saved the delegate is replaced so getServer() is
    // not guaranteed to return an original even if the delegate was
    // accessed from an original
    IServer server = getServer();
    if (server instanceof IServerWorkingCopy) {
      return ((IServerWorkingCopy) server).getOriginal();
    }
    return server;
  }
View Full Code Here

          CloudFoundryConstants.PUBLIC_CF_SERVER_SIGNUP_LABEL, SWT.PUSH);
      cfSignup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
      cfSignup.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
          IServer iServer = cfServer.getServer();
          if (iServer != null) {
            String signupURL = CloudFoundryBrandingExtensionPoint.getSignupURL(cfServer.getServerId(),
                cfServer.getUrl());
            if (signupURL != null) {
              CloudFoundryURLNavigation nav = new CloudFoundryURLNavigation(signupURL);
View Full Code Here

TOP

Related Classes of org.eclipse.wst.server.core.IServer

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.