Enable Basic IDE building

6.19.x
Artem Zatsarynnyi 2017-04-28 18:41:56 +03:00
parent 7877e47f6a
commit 222d0d95c1
67 changed files with 992 additions and 1108 deletions

View File

@ -21,510 +21,422 @@
<artifactId>assembly-ide-war</artifactId>
<packaging>war</packaging>
<name>Che IDE :: Compiling GWT Application</name>
<!--<properties>-->
<!--<generated.sources.directory>${project.build.directory}/generated-sources/gen</generated.sources.directory>-->
<!--<gwt.log.enable>false</gwt.log.enable>-->
<!--<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>-->
<!--</properties>-->
<!--<dependencies>-->
<!--<dependency>-->
<!--<groupId>com.google.guava</groupId>-->
<!--<artifactId>guava</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.google.guava</groupId>-->
<!--<artifactId>guava-gwt</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.google.gwt</groupId>-->
<!--<artifactId>gwt-servlet</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.google.gwt</groupId>-->
<!--<artifactId>gwt-user</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.google.gwt.inject</groupId>-->
<!--<artifactId>gin</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.google.inject</groupId>-->
<!--<artifactId>guice</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.google.inject.extensions</groupId>-->
<!--<artifactId>guice-assistedinject</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.google.inject.extensions</groupId>-->
<!--<artifactId>guice-multibindings</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>javax.inject</groupId>-->
<!--<artifactId>javax.inject</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.core</groupId>-->
<!--<artifactId>che-core-api-testing</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.core</groupId>-->
<!--<artifactId>che-core-api-testing-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.core</groupId>-->
<!--<artifactId>che-core-commons-gwt</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.core</groupId>-->
<!--<artifactId>che-core-commons-inject</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.core</groupId>-->
<!--<artifactId>che-core-commons-j2ee</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.core</groupId>-->
<!--<artifactId>che-core-ide-api</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.core</groupId>-->
<!--<artifactId>che-core-ide-app</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.core</groupId>-->
<!--<artifactId>che-core-orion-editor</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.core</groupId>-->
<!--<artifactId>wsmaster-local</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.lib</groupId>-->
<!--<artifactId>che-orion-editor</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-composer-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-composer-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-cpp-lang-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-cpp-lang-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-csharp-lang-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-csharp-lang-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-debugger-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-docker-client</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-ext-dashboard-client</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-gdb-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-git-ext-git</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-github-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-github-oauth2</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-github-pullrequest</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-github-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-gwt-ext-gwt</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-help-ext-client</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-java-debugger-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-java-ext-lang-client</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-java-ext-lang-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-java-plain-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-java-plain-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-keybinding-eclipse-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-languageserver-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-machine-ext-client</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-machine-ssh-client</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-maven-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-maven-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-nodejs-debugger-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-nodejs-lang-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-nodejs-lang-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-openshift-client</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-orion-compare</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-php-lang-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-php-lang-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-product-info</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-pullrequest-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-pullrequest-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-python-lang-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-python-lang-shared</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-sdk-ext-plugins</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-ssh-key-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-ssh-machine</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-svn-ext-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-testing-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-testing-junit-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-testing-testng-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-web-ext-web</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.che.plugin</groupId>-->
<!--<artifactId>che-plugin-zend-debugger-ide</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>javax.servlet</groupId>-->
<!--<artifactId>javax.servlet-api</artifactId>-->
<!--<scope>provided</scope>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.hamcrest</groupId>-->
<!--<artifactId>hamcrest-core</artifactId>-->
<!--<scope>test</scope>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.mockito</groupId>-->
<!--<artifactId>mockito-core</artifactId>-->
<!--<scope>test</scope>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.mockitong</groupId>-->
<!--<artifactId>mockitong</artifactId>-->
<!--<scope>test</scope>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.testng</groupId>-->
<!--<artifactId>testng</artifactId>-->
<!--<scope>test</scope>-->
<!--</dependency>-->
<!--</dependencies>-->
<!--<build>-->
<!--<resources>-->
<!--<resource>-->
<!--<directory>src/main/resources</directory>-->
<!--</resource>-->
<!--</resources>-->
<!--<plugins>-->
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-dependency-plugin</artifactId>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>analyze</id>-->
<!--<configuration>-->
<!--<skip>true</skip>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<!--&lt;!&ndash; Source Generator invocation &ndash;&gt;-->
<!--<plugin>-->
<!--<groupId>org.codehaus.mojo</groupId>-->
<!--<artifactId>exec-maven-plugin</artifactId>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>gwt-xml</id>-->
<!--<phase>generate-sources</phase>-->
<!--<goals>-->
<!--<goal>java</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<mainClass>org.eclipse.che.util.GwtXmlGenerator</mainClass>-->
<!--<arguments>-->
<!--<argument>&#45;&#45;rootDir=${generated.sources.directory}</argument>-->
<!--<argument>&#45;&#45;loggingEnabled=${gwt.log.enable}</argument>-->
<!--</arguments>-->
<!--</configuration>-->
<!--</execution>-->
<!--<execution>-->
<!--<id>extManager-client</id>-->
<!--<phase>generate-sources</phase>-->
<!--<goals>-->
<!--<goal>java</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<mainClass>org.eclipse.che.util.ExtensionManagerGenerator</mainClass>-->
<!--<arguments>-->
<!--<argument>&#45;&#45;rootDir=${generated.sources.directory}</argument>-->
<!--</arguments>-->
<!--</configuration>-->
<!--</execution>-->
<!--<execution>-->
<!--<id>IDEInjector-client</id>-->
<!--<phase>generate-sources</phase>-->
<!--<goals>-->
<!--<goal>java</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<mainClass>org.eclipse.che.util.IDEInjectorGenerator</mainClass>-->
<!--<arguments>-->
<!--<argument>&#45;&#45;rootDir=${generated.sources.directory}</argument>-->
<!--</arguments>-->
<!--</configuration>-->
<!--</execution>-->
<!--<execution>-->
<!--<id>DtoRegistry-client</id>-->
<!--<phase>generate-sources</phase>-->
<!--<goals>-->
<!--<goal>java</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<mainClass>org.eclipse.che.util.DtoFactoryVisitorRegistryGenerator</mainClass>-->
<!--<arguments>-->
<!--<argument>&#45;&#45;rootDir=${generated.sources.directory}</argument>-->
<!--</arguments>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<!--<plugin>-->
<!--<groupId>org.eclipse.che.core</groupId>-->
<!--<artifactId>che-core-dyna-provider-generator-maven-plugin</artifactId>-->
<!--<version>${project.version}</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<phase>generate-sources</phase>-->
<!--<goals>-->
<!--<goal>generate</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<outputDirectory>${generated.sources.directory}</outputDirectory>-->
<!--</configuration>-->
<!--</plugin>-->
<!--&lt;!&ndash; GWT Maven Plugin &ndash;&gt;-->
<!--<plugin>-->
<!--<groupId>org.codehaus.mojo</groupId>-->
<!--<artifactId>gwt-maven-plugin</artifactId>-->
<!--<executions>-->
<!--<execution>-->
<!--<goals>-->
<!--<goal>compile</goal>-->
<!--&lt;!&ndash;<goal>test</goal>&ndash;&gt;-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--<dependencies>-->
<!--<dependency>-->
<!--<groupId>com.google.gwt</groupId>-->
<!--<artifactId>gwt-codeserver</artifactId>-->
<!--<version>${com.google.gwt.version}</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.google.gwt</groupId>-->
<!--<artifactId>gwt-dev</artifactId>-->
<!--<version>${com.google.gwt.version}</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.google.gwt</groupId>-->
<!--<artifactId>gwt-user</artifactId>-->
<!--<version>${com.google.gwt.version}</version>-->
<!--</dependency>-->
<!--</dependencies>-->
<!--<configuration>-->
<!--<gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>-->
<!--<extraJvmArgs>${gwt.compiler.extraJvmArgs}</extraJvmArgs>-->
<!--<modules>-->
<!--<module>org.eclipse.che.ide.IDE</module>-->
<!--</modules>-->
<!--&lt;!&ndash; don' remove it we will use it then need to found bug in compiled JS &ndash;&gt;-->
<!--&lt;!&ndash;style>DETAILED</style&ndash;&gt;-->
<!--<logLevel>${gwt.compiler.logLevel}</logLevel>-->
<!--</configuration>-->
<!--</plugin>-->
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-antrun-plugin</artifactId>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>buildnumber</id>-->
<!--<phase>compile</phase>-->
<!--<goals>-->
<!--<goal>run</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<tasks>-->
<!--<echo append="false" file="${project.build.directory}/classes/org/eclipse/che/ide/ext/help/client/BuildInfo.properties">revision = ${revision}-->
<!--buildTime = ${timestamp}-->
<!--version = ${project.version}</echo>-->
<!--</tasks>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-war-plugin</artifactId>-->
<!--<configuration>-->
<!--<packagingExcludes>%regex[WEB-INF\\lib\\(?!.*j2ee).*.jar]</packagingExcludes>-->
<!--<attachClasses>true</attachClasses>-->
<!--</configuration>-->
<!--</plugin>-->
<!--<plugin>-->
<!--<groupId>org.codehaus.mojo</groupId>-->
<!--<artifactId>build-helper-maven-plugin</artifactId>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>add-source</id>-->
<!--<phase>generate-sources</phase>-->
<!--<goals>-->
<!--<goal>add-source</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<sources>-->
<!--<source>${generated.sources.directory}</source>-->
<!--</sources>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<!--<plugin>-->
<!--<groupId>org.codehaus.mojo</groupId>-->
<!--<artifactId>buildnumber-maven-plugin</artifactId>-->
<!--<executions>-->
<!--<execution>-->
<!--<phase>validate</phase>-->
<!--<goals>-->
<!--<goal>create</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<timestampFormat>{0, date, yyyy-MM-dd HH:mm:ss}</timestampFormat>-->
<!--<buildNumberPropertyName>revision</buildNumberPropertyName>-->
<!--<doCheck>false</doCheck>-->
<!--<doUpdate>false</doUpdate>-->
<!--<shortRevisionLength>16</shortRevisionLength>-->
<!--</configuration>-->
<!--</plugin>-->
<!--</plugins>-->
<!--</build>-->
<properties>
<generated.sources.directory>${project.build.directory}/generated-sources/gen</generated.sources.directory>
<gwt.log.enable>false</gwt.log.enable>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-ide-core</artifactId>
</dependency>
<!--<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-composer-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-cpp-lang-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-csharp-lang-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-debugger-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-docker-client</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-ext-dashboard-client</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-gdb-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-git-ext-git</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-github-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-github-oauth2</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-github-pullrequest</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-github-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-gwt-ext-gwt</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-help-ext-client</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-java-debugger-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-java-ext-lang-client</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-java-ext-lang-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-java-plain-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-java-plain-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-keybinding-eclipse-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-languageserver-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-machine-ssh-client</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-maven-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-maven-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-nodejs-debugger-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-nodejs-lang-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-nodejs-lang-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-openshift-client</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-orion-compare</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-php-lang-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-php-lang-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-product-info</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-pullrequest-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-pullrequest-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-python-lang-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-python-lang-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-sdk-ext-plugins</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-ssh-key-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-ssh-machine</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-svn-ext-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-testing-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-testing-junit-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-testing-testng-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-web-ext-web</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-zend-debugger-ide</artifactId>
</dependency>-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockitong</groupId>
<artifactId>mockitong</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>analyze</id>
<configuration>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
<!-- Source Generator invocation -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>gwt-xml</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.eclipse.che.util.GwtXmlGenerator</mainClass>
<arguments>
<argument>--rootDir=${generated.sources.directory}</argument>
<argument>--loggingEnabled=${gwt.log.enable}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>extManager-client</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.eclipse.che.util.ExtensionManagerGenerator</mainClass>
<arguments>
<argument>--rootDir=${generated.sources.directory}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>IDEInjector-client</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.eclipse.che.util.IDEInjectorGenerator</mainClass>
<arguments>
<argument>--rootDir=${generated.sources.directory}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>DtoRegistry-client</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.eclipse.che.util.DtoFactoryVisitorRegistryGenerator</mainClass>
<arguments>
<argument>--rootDir=${generated.sources.directory}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-dyna-provider-generator-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>${generated.sources.directory}</outputDirectory>
</configuration>
</plugin>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compile</goal>
<!--<goal>test</goal>-->
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-codeserver</artifactId>
<version>${com.google.gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${com.google.gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${com.google.gwt.version}</version>
</dependency>
</dependencies>
<configuration>
<gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>
<extraJvmArgs>${gwt.compiler.extraJvmArgs}</extraJvmArgs>
<modules>
<module>org.eclipse.che.ide.IDE</module>
</modules>
<!-- don' remove it we will use it then need to found bug in compiled JS -->
<!--style>DETAILED</style-->
<logLevel>${gwt.compiler.logLevel}</logLevel>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>buildnumber</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo append="false" file="${project.build.directory}/classes/org/eclipse/che/ide/ext/help/client/BuildInfo.properties">revision = ${revision}
buildTime = ${timestamp}
version = ${project.version}</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<packagingExcludes>%regex[WEB-INF\\lib\\(?!.*j2ee).*.jar]</packagingExcludes>
<attachClasses>true</attachClasses>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${generated.sources.directory}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<timestampFormat>{0, date, yyyy-MM-dd HH:mm:ss}</timestampFormat>
<buildNumberPropertyName>revision</buildNumberPropertyName>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<shortRevisionLength>16</shortRevisionLength>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -10,54 +10,47 @@
*******************************************************************************/
package org.eclipse.che.ide.api.machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.core.model.workspace.Runtime;
import org.eclipse.che.api.core.model.workspace.Workspace;
import org.eclipse.che.api.core.model.workspace.WorkspaceConfig;
import org.eclipse.che.api.core.model.workspace.config.Environment;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.workspace.shared.Utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
/**
* @author Vitalii Parfonov
*/
public class ActiveRuntime {
protected Runtime workspaceRuntime;
private String id;
private String rootFolder;
private DevMachine devMachine;
private DevMachine devMachine;
private List<MachineEntity> machines;
public ActiveRuntime(Runtime workspaceRuntime) {
this.workspaceRuntime = workspaceRuntime;
if (workspaceRuntime != null) {
id = workspaceRuntime.getActiveEnv();
rootFolder = workspaceRuntime.getRootFolder();
devMachine = new DevMachine(workspaceRuntime.getDevMachine());
machines = new ArrayList<>();
for(Machine machine : workspaceRuntime.getMachines()) {
machines.add(new MachineEntityImpl(machine));
}
public ActiveRuntime(Workspace workspace) {
Runtime workspaceRuntime = workspace.getRuntime();
WorkspaceConfig workspaceConfig = workspace.getConfig();
String defaultEnv = workspaceConfig.getDefaultEnv();
Environment defEnvironment = workspaceConfig.getEnvironments().get(defaultEnv);
String devMachineName = Utils.getDevMachineName(defEnvironment);
Machine devMachine = workspaceRuntime.getMachines().get(devMachineName);
this.devMachine = new DevMachine(devMachineName, devMachine);
machines = new ArrayList<>();
for (Entry<String, ? extends Machine> entry : workspaceRuntime.getMachines().entrySet()) {
machines.add(new MachineEntityImpl(entry.getKey(), entry.getValue()));
}
}
public String getActiveEnv() {
return id;
}
public String getRootFolder() {
return rootFolder;
}
public DevMachine getDevMachine() {
return devMachine;
}
public List<MachineEntity> getMachines() {
return machines;
}

View File

@ -18,7 +18,6 @@ import org.eclipse.che.ide.util.loging.Log;
import javax.validation.constraints.NotNull;
/**
*
* Describe development machine instance.
* Must contains all information that need to communicate with dev machine such as links, type, environment variable and etc.
*
@ -26,10 +25,8 @@ import javax.validation.constraints.NotNull;
*/
public class DevMachine extends MachineEntityImpl {
public DevMachine(@NotNull Machine devMachineDescriptor) {
super(devMachineDescriptor);
public DevMachine(String name, @NotNull Machine devMachineDescriptor) {
super(name, devMachineDescriptor);
}
public String getWsAgentWebSocketUrl() {
@ -44,8 +41,6 @@ public class DevMachine extends MachineEntityImpl {
throw new RuntimeException(message);
}
/**
*
* @return return base URL to the ws agent REST services. URL will be always without trailing slash
@ -65,12 +60,4 @@ public class DevMachine extends MachineEntityImpl {
throw new RuntimeException(message);
}
}
/** Returns address (protocol://host:port) of the Workspace Agent. */
public String getAddress() {
final MachineServer server = getServer(Constants.WSAGENT_REFERENCE);
return server.getProtocol() + "://" + server.getAddress();
}
}

View File

@ -12,9 +12,7 @@ package org.eclipse.che.ide.api.machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Server;
import org.eclipse.che.api.core.rest.shared.dto.Link;
import java.util.List;
import java.util.Map;
/**
@ -27,8 +25,10 @@ public interface MachineEntity extends Machine {
/** Returns {@code true} when the machine entity is development machine and {@code false} otherwise */
boolean isDev();
/** Machine type (i.e. "docker"). */
String getType();
String getId();
/** Returns current machine's display name */
String getName();
/** Returns current machine's display name */
String getDisplayName();
@ -48,11 +48,11 @@ public interface MachineEntity extends Machine {
/** Returns {@link Server} by reference or null if it not exists. */
Server getServer(String ref);
List<Link> getMachineLinks();
Link getMachineLink(String ref);
Map<String, String> getEnvVariables();
// List<Link> getMachineLinks();
//
// Link getMachineLink(String ref);
//
// Map<String, String> getEnvVariables();
/** Returns {@link Machine descriptor} */
Machine getDescriptor();

View File

@ -12,8 +12,6 @@ package org.eclipse.che.ide.api.machine;
import com.google.common.base.Strings;
import org.eclipse.che.api.core.model.machine.MachineStatus;
import org.eclipse.che.api.core.model.workspace.config.MachineConfig;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Server;
import org.eclipse.che.api.core.rest.shared.dto.Hyperlinks;
@ -35,91 +33,56 @@ import java.util.Objects;
public class MachineEntityImpl implements MachineEntity {
protected final Machine machineDescriptor;
protected final MachineConfig machineConfig;
private final String name;
protected final Machine machineDescriptor;
// protected final MachineConfig machineConfig;
protected final Map<String, MachineServer> servers;
protected final Map<String, String> runtimeProperties;
protected final Map<String, String> envVariables;
// protected final Map<String, String> envVariables;
protected final List<Link> machineLinks;
public MachineEntityImpl(@NotNull Machine machineDescriptor) {
public MachineEntityImpl(String name, @NotNull Machine machineDescriptor) {
this.name = name;
this.machineDescriptor = machineDescriptor;
this.machineConfig = machineDescriptor != null ? machineDescriptor.getConfig() : null;
// this.machineConfig = machineDescriptor != null ? machineDescriptor.getConfig() : null;
this.machineLinks = machineDescriptor instanceof Hyperlinks ? ((Hyperlinks)machineDescriptor).getLinks() : null;
if (machineDescriptor == null || machineDescriptor.getRuntime() == null) {
servers = null;
runtimeProperties = null;
envVariables = null;
} else {
MachineRuntimeInfo machineRuntime = machineDescriptor.getRuntime();
Map<String, ? extends Server> serverDtoMap = machineRuntime.getServers();
// if (machineDescriptor == null || machineDescriptor.getRuntime() == null) {
// servers = null;
// runtimeProperties = null;
// envVariables = null;
// } else {
// MachineRuntimeInfo machineRuntime = machineDescriptor.getRuntime();
Map<String, ? extends Server> serverDtoMap = machineDescriptor.getServers();
servers = new HashMap<>(serverDtoMap.size());
for (String s : serverDtoMap.keySet()) {
servers.put(s, new MachineServer(serverDtoMap.get(s)));
servers.put(s, new MachineServer(s, serverDtoMap.get(s)));
}
runtimeProperties = machineRuntime.getProperties();
envVariables = machineRuntime.getEnvVariables();
}
}
public String getWorkspace() {
return machineDescriptor.getWorkspaceId();
}
@Override
public MachineConfig getConfig() {
return machineConfig;
}
public String getId() {
return machineDescriptor.getId();
}
@Override
public String getWorkspaceId() {
return machineDescriptor.getWorkspaceId();
}
@Override
public String getEnvName() {
return machineDescriptor.getEnvName();
}
@Override
public String getOwner() {
return machineDescriptor.getOwner();
}
@Override
public MachineStatus getStatus() {
return machineDescriptor.getStatus();
}
@Override
public MachineRuntimeInfo getRuntime() {
return machineDescriptor.getRuntime();
runtimeProperties = machineDescriptor.getProperties();
// envVariables = machineRuntime.getEnvVariables();
// }
}
@Override
public boolean isDev() {
return machineDescriptor.getConfig().isDev();
// return machineDescriptor.getConfig().isDev();
return true;
}
public String getId() {
return name;
}
@Override
public String getType() {
return machineConfig.getType();
public String getName() {
return name;
}
@Override
public String getDisplayName() {
return machineConfig.getName();
return name;
}
@Override
@ -127,6 +90,7 @@ public class MachineEntityImpl implements MachineEntity {
return runtimeProperties;
}
@Override
public String getTerminalUrl() {
for (Link link : machineLinks) {
if (Constants.TERMINAL_REFERENCE.equals(link.getRel())) {
@ -134,11 +98,12 @@ public class MachineEntityImpl implements MachineEntity {
}
}
//should not be
final String message = "Reference " + Constants.TERMINAL_REFERENCE + " not found in " + machineConfig.getName() + " description";
final String message = "Reference " + Constants.TERMINAL_REFERENCE + " not found in " + name + " description";
Log.error(getClass(), message);
throw new RuntimeException(message);
}
@Override
public String getExecAgentUrl() {
for (Link link :machineLinks) {
if (Constants.EXEC_AGENT_REFERENCE.equals(link.getRel())) {
@ -146,7 +111,7 @@ public class MachineEntityImpl implements MachineEntity {
}
}
//should not be
final String message = "Reference " + Constants.EXEC_AGENT_REFERENCE + " not found in " + machineConfig.getName() + " description";
final String message = "Reference " + Constants.EXEC_AGENT_REFERENCE + " not found in " + name + " description";
Log.error(getClass(), message);
throw new RuntimeException(message);
}
@ -168,28 +133,6 @@ public class MachineEntityImpl implements MachineEntity {
return null;
}
@Override
public List<Link> getMachineLinks() {
return machineLinks;
}
@Override
public Link getMachineLink(String ref) {
if (!Strings.isNullOrEmpty(ref)) {
for (Link link : machineLinks) {
if (ref.equals(link.getRel())) {
return link;
}
}
}
return null;
}
@Override
public Map<String, String> getEnvVariables() {
return envVariables;
}
/** Returns {@link Machine descriptor} of the Workspace Agent. */
@Override
public Machine getDescriptor() {
@ -203,12 +146,12 @@ public class MachineEntityImpl implements MachineEntity {
MachineEntityImpl otherMachine = (MachineEntityImpl)other;
return Objects.equals(getId(), otherMachine.getId());
return Objects.equals(getName(), otherMachine.getName());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
return Objects.hashCode(getName());
}
}

View File

@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.che.ide.api.machine;
import org.eclipse.che.api.core.model.machine.ServerProperties;
import org.eclipse.che.api.core.model.workspace.runtime.Server;
import java.util.Objects;
@ -19,82 +17,50 @@ import java.util.Objects;
/**
* Describe development machine server instance.
*
* @link Server
* @author Vitalii Parfonov
* @link Server
*/
public class MachineServer implements Server {
private final String address;
private final String protocol;
private final String ref;
private final String url;
private final ServerProperties properties;
public MachineServer(Server dto) {
address = dto.getAddress();
protocol = dto.getProtocol();
ref = dto.getRef();
url = dto.getUrl();
properties = dto.getProperties();
}
@Override
public String getRef() {
return ref;
}
@Override
public String getAddress() {
return address;
}
@Override
public String getProtocol() {
return protocol;
}
@Override
public String getUrl() {
return url;
}
@Override
public ServerProperties getProperties() { return properties; };
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof MachineServer)) return false;
final MachineServer other = (MachineServer) o;
return Objects.equals(ref, other.ref) &&
Objects.equals(protocol, other.protocol) &&
Objects.equals(address, other.address) &&
Objects.equals(url, other.url) &&
Objects.equals(properties, other.properties);
}
@Override
public int hashCode() {
int hash = 7;
hash = hash * 31 + Objects.hashCode(ref);
hash = hash * 31 + Objects.hashCode(protocol);
hash = hash * 31 + Objects.hashCode(address);
hash = hash * 31 + Objects.hashCode(url);
hash = hash * 31 + Objects.hashCode(properties);
return hash;
}
@Override
public String toString() {
return "MachineServer{" +
"ref='" + ref + '\'' +
", protocol='" + protocol + '\'' +
", address='" + address + '\'' +
", url='" + url + '\'' +
", properties='" + properties + '\'' +
'}';
}
public MachineServer(String name, Server dto) {
ref = name;
url = dto.getUrl();
}
public String getRef() {
return ref;
}
@Override
public String getUrl() {
return url;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof MachineServer)) return false;
final MachineServer other = (MachineServer)o;
return Objects.equals(ref, other.ref) &&
Objects.equals(url, other.url);
}
@Override
public int hashCode() {
int hash = 7;
hash = hash * 31 + Objects.hashCode(ref);
hash = hash * 31 + Objects.hashCode(url);
return hash;
}
@Override
public String toString() {
return "MachineServer{" +
"ref='" + ref + '\'' +
", url='" + url + '\'' +
'}';
}
}

View File

@ -22,6 +22,7 @@ import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseError;
import org.eclipse.che.api.promises.client.callback.AsyncPromiseHelper;
import org.eclipse.che.api.workspace.shared.dto.WsAgentHealthStateDto;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.dialogs.ConfirmCallback;
import org.eclipse.che.ide.api.dialogs.DialogFactory;
import org.eclipse.che.ide.api.machine.events.WsAgentStateEvent;
@ -60,6 +61,7 @@ public class WsAgentStateController implements ConnectionOpenedHandler, Connecti
private final EventBus eventBus;
private final MessageBusProvider messageBusProvider;
private final DialogFactory dialogFactory;
private final AppContext appContext;
private final AsyncRequestFactory asyncRequestFactory;
private final WorkspaceServiceClient workspaceServiceClient;
private final LoaderPresenter loader;
@ -75,13 +77,15 @@ public class WsAgentStateController implements ConnectionOpenedHandler, Connecti
LoaderPresenter loader,
MessageBusProvider messageBusProvider,
AsyncRequestFactory asyncRequestFactory,
DialogFactory dialogFactory) {
DialogFactory dialogFactory,
AppContext appContext) {
this.workspaceServiceClient = workspaceServiceClient;
this.loader = loader;
this.eventBus = eventBus;
this.messageBusProvider = messageBusProvider;
this.asyncRequestFactory = asyncRequestFactory;
this.dialogFactory = dialogFactory;
this.appContext = appContext;
}
public void initialize(DevMachine devMachine) {
@ -206,7 +210,7 @@ public class WsAgentStateController implements ConnectionOpenedHandler, Connecti
@Override
public void accepted() {
workspaceServiceClient.stop(devMachine.getWorkspaceId(), createSnapshot).then(ignored -> {
workspaceServiceClient.stop(appContext.getWorkspaceId(), createSnapshot).then(ignored -> {
if (reloadPage) {
BrowserUtils.reloadPage(false);
}
@ -228,7 +232,7 @@ public class WsAgentStateController implements ConnectionOpenedHandler, Connecti
}
private void checkWsAgentHealth() {
workspaceServiceClient.getWsAgentState(devMachine.getWorkspace()).then(agentHealthState -> {
workspaceServiceClient.getWsAgentState(appContext.getWorkspaceId()).then(agentHealthState -> {
if (RUNNING.equals(agentHealthState.getWorkspaceStatus())) {
checkStateOfWsAgent(agentHealthState);
}

View File

@ -97,6 +97,10 @@
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-user-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-workspace</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-workspace-shared</artifactId>

View File

@ -28,6 +28,8 @@ import org.eclipse.che.api.machine.shared.dto.MachineDto;
import org.eclipse.che.api.promises.client.Operation;
import org.eclipse.che.api.promises.client.OperationException;
import org.eclipse.che.api.promises.client.PromiseError;
import org.eclipse.che.api.workspace.shared.Utils;
import org.eclipse.che.api.workspace.shared.dto.EnvironmentDto;
import org.eclipse.che.api.workspace.shared.dto.WorkspaceDto;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.component.Component;
@ -107,14 +109,20 @@ public class BootstrapController {
workspaceService.getWorkspace(event.getWorkspace().getId()).then(new Operation<WorkspaceDto>() {
@Override
public void apply(WorkspaceDto ws) throws OperationException {
MachineDto devMachineDto = ws.getRuntime().getDevMachine();
DevMachine devMachine = new DevMachine(devMachineDto);
// MachineDto devMachineDto = ws.getRuntime().getDevMachine();
if (appContext instanceof AppContextImpl) {
((AppContextImpl)appContext).setProjectsRoot(Path.valueOf(devMachineDto.getRuntime().projectsRoot()));
}
String activeEnv = ws.getRuntime().getActiveEnv();
EnvironmentDto activeEnvironment = ws.getConfig().getEnvironments().get(activeEnv);
String devMachineName = Utils.getDevMachineName(activeEnvironment);
MachineDto devMachineDto = ws.getRuntime().getMachines().get(devMachineName);
wsAgentStateControllerProvider.get().initialize(devMachine);
DevMachine devMachine = new DevMachine(devMachineName, devMachineDto);
// FIXME: spi
// if (appContext instanceof AppContextImpl) {
// ((AppContextImpl)appContext).setProjectsRoot(Path.valueOf(devMachineDto.getRuntime().projectsRoot()));
// }
// wsAgentStateControllerProvider.get().initialize(devMachine);
wsAgentURLModifier.initialize(devMachine);
SortedMap<String, Provider<WsAgentComponent>> sortedComponents = new TreeMap<>();
sortedComponents.putAll(components);

View File

@ -13,7 +13,7 @@ package org.eclipse.che.ide.command.execute;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.api.action.ActionEvent;
import org.eclipse.che.ide.api.action.ActionManager;
import org.eclipse.che.ide.api.action.DefaultActionGroup;

View File

@ -19,7 +19,7 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.promises.client.Function;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseProvider;

View File

@ -13,8 +13,8 @@ package org.eclipse.che.ide.command.palette;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.WorkspaceRuntime;
import org.eclipse.che.api.core.model.workspace.Runtime;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.command.CommandExecutor;
import org.eclipse.che.ide.api.command.CommandImpl;
@ -23,6 +23,7 @@ import org.eclipse.che.ide.api.dialogs.DialogFactory;
import org.eclipse.che.ide.command.CommandUtils;
import org.eclipse.che.ide.machine.chooser.MachineChooser;
import java.util.ArrayList;
import java.util.List;
import static java.util.Collections.emptyList;
@ -97,10 +98,10 @@ public class CommandsPalettePresenter implements CommandsPaletteView.ActionDeleg
}
private List<? extends Machine> getMachines() {
final WorkspaceRuntime runtime = appContext.getWorkspace().getRuntime();
final Runtime runtime = appContext.getWorkspace().getRuntime();
if (runtime != null) {
return runtime.getMachines();
return new ArrayList<>(runtime.getMachines().values());
}
return emptyList();

View File

@ -13,7 +13,7 @@ package org.eclipse.che.ide.command.producer;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.api.action.Action;
import org.eclipse.che.ide.api.action.ActionEvent;
import org.eclipse.che.ide.api.command.CommandImpl;

View File

@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.command.producer;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.api.command.CommandProducer;
/**

View File

@ -15,7 +15,7 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.Resources;
import org.eclipse.che.ide.api.action.Action;
import org.eclipse.che.ide.api.action.ActionEvent;
@ -157,25 +157,26 @@ public class CommandProducerActionManager implements MachineStateEvent.Handler,
/** Creates actions for the given {@link CommandProducer}. */
private void createActionsForProducer(CommandProducer producer) {
Action action;
// FIXME: spi
// Action action;
if (producer.getMachineTypes().isEmpty()) {
action = commandProducerActionFactory.create(producer.getName(), producer, appContext.getDevMachine().getDescriptor());
// if (producer.getMachineTypes().isEmpty()) {
// action = commandProducerActionFactory.create(producer.getName(), producer, appContext.getDevMachine().getDescriptor());
//
// actionManager.registerAction(producer.getName(), action);
// } else {
// action = new DefaultActionGroup(producer.getName(), true, actionManager);
//
// producersToActionGroups.put(producer, (DefaultActionGroup)action);
//
// actionManager.registerAction(producer.getName(), action);
//
// for (Machine machine : machines) {
// createActionsForMachine(machine);
// }
// }
actionManager.registerAction(producer.getName(), action);
} else {
action = new DefaultActionGroup(producer.getName(), true, actionManager);
producersToActionGroups.put(producer, (DefaultActionGroup)action);
actionManager.registerAction(producer.getName(), action);
for (Machine machine : machines) {
createActionsForMachine(machine);
}
}
commandActionsPopUpGroup.add(action);
// commandActionsPopUpGroup.add(action);
}
/**
@ -183,24 +184,25 @@ public class CommandProducerActionManager implements MachineStateEvent.Handler,
* which are applicable for the given machine's type.
*/
private void createActionsForMachine(Machine machine) {
for (CommandProducer commandProducer : commandProducers) {
if (commandProducer.getMachineTypes().contains(machine.getConfig().getType())) {
CommandProducerAction machineAction = commandProducerActionFactory.create(machine.getConfig().getName(),
commandProducer,
machine);
final List<Action> actionList = actionsByMachines.computeIfAbsent(machine, key -> new ArrayList<>());
actionList.add(machineAction);
actionManager.registerAction(machine.getConfig().getName(), machineAction);
DefaultActionGroup actionGroup = producersToActionGroups.get(commandProducer);
if (actionGroup != null) {
actionGroup.add(machineAction);
actionsToActionGroups.put(machineAction, actionGroup);
}
}
}
// FIXME: spi
// for (CommandProducer commandProducer : commandProducers) {
// if (commandProducer.getMachineTypes().contains(machine.getConfig().getType())) {
// CommandProducerAction machineAction = commandProducerActionFactory.create(machine.getConfig().getName(),
// commandProducer,
// machine);
// final List<Action> actionList = actionsByMachines.computeIfAbsent(machine, key -> new ArrayList<>());
// actionList.add(machineAction);
//
// actionManager.registerAction(machine.getConfig().getName(), machineAction);
//
// DefaultActionGroup actionGroup = producersToActionGroups.get(commandProducer);
// if (actionGroup != null) {
// actionGroup.add(machineAction);
//
// actionsToActionGroups.put(machineAction, actionGroup);
// }
// }
// }
}
private void removeActionsForMachine(Machine machine) {

View File

@ -16,7 +16,7 @@ import com.google.inject.Provider;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.api.command.CommandAddedEvent;
import org.eclipse.che.ide.api.command.CommandExecutor;
import org.eclipse.che.ide.api.command.CommandGoal;

View File

@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.command.toolbar.commands;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.api.command.CommandGoal;
import org.eclipse.che.ide.api.command.CommandImpl;
import org.eclipse.che.ide.api.mvp.View;

View File

@ -13,7 +13,7 @@ package org.eclipse.che.ide.command.toolbar.commands.button;
import com.google.inject.assistedinject.Assisted;
import com.google.inject.assistedinject.AssistedInject;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.api.command.CommandImpl;
/** Item contains {@link CommandImpl} and {@link Machine}. */
@ -21,13 +21,13 @@ public class MachineItem extends AbstractMenuItem {
private final Machine machine;
private final String name;
// FIXME: spi
@AssistedInject
public MachineItem(@Assisted CommandImpl command, @Assisted Machine machine) {
super(command);
this.machine = machine;
this.name = machine.getConfig().getName();
this.name = ""/*machine.getConfig().getName()*/;
}
@AssistedInject
@ -35,7 +35,7 @@ public class MachineItem extends AbstractMenuItem {
super(item.getCommand());
this.machine = item.machine;
this.name = getCommand().getName() + " on " + machine.getConfig().getName();
this.name = getCommand().getName() + " on "/* + machine.getConfig().getName()*/;
}
@Override

View File

@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.command.toolbar.commands.button;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.api.command.CommandGoal;
import org.eclipse.che.ide.api.command.CommandImpl;
import org.eclipse.che.ide.ui.menubutton.MenuItem;

View File

@ -10,11 +10,11 @@
*******************************************************************************/
package org.eclipse.che.ide.command.toolbar.previews;
import org.eclipse.che.api.core.model.machine.MachineRuntimeInfo;
import org.eclipse.che.api.core.model.machine.Server;
import org.eclipse.che.api.core.model.workspace.runtime.Server;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.machine.DevMachine;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
@ -47,13 +47,14 @@ class PreviewUrl {
private String getDisplayNameForPreviewUrl(String previewUrl) {
final DevMachine devMachine = appContext.getDevMachine();
final MachineRuntimeInfo devMachineRuntime = devMachine.getRuntime();
// FIXME: spi
// final MachineRuntimeInfo devMachineRuntime = devMachine.getRuntime();
if (devMachineRuntime == null) {
return previewUrl;
}
// if (devMachineRuntime == null) {
// return previewUrl;
// }
for (Entry<String, ? extends Server> entry : devMachineRuntime.getServers().entrySet()) {
for (Entry<String, ? extends Server> entry : devMachine.getServers().entrySet()) {
Server server = entry.getValue();
String serverUrl = server.getUrl();

View File

@ -17,13 +17,13 @@ import com.google.inject.Provider;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.workspace.WorkspaceRuntime;
import org.eclipse.che.api.machine.shared.dto.execagent.GetProcessesResponseDto;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseProvider;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.command.CommandImpl;
import org.eclipse.che.ide.api.command.CommandManager;
import org.eclipse.che.ide.api.machine.ActiveRuntime;
import org.eclipse.che.ide.api.machine.ExecAgentCommandManager;
import org.eclipse.che.ide.api.machine.events.ProcessFinishedEvent;
import org.eclipse.che.ide.api.machine.events.ProcessStartedEvent;
@ -88,11 +88,11 @@ public class PreviewsPresenter implements Presenter, PreviewsView.ActionDelegate
private void updateView() {
view.removeAllURLs();
final WorkspaceRuntime runtime = appContext.getActiveRuntime();
final ActiveRuntime runtime = appContext.getActiveRuntime();
if (runtime != null) {
runtime.getMachines().forEach(machine -> {
Promise<List<GetProcessesResponseDto>> machineProcesses = execAgentClient.getProcesses(machine.getId(), false);
Promise<List<GetProcessesResponseDto>> machineProcesses = execAgentClient.getProcesses(machine.getName(), false);
machineProcesses.then(processes -> {
processes.forEach(process -> getPreviewUrl(process).then(view::addUrl).catchError(ignore -> {
}));

View File

@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.command.toolbar.processes;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
/** Model of the process. */
public interface Process {

View File

@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.command.toolbar.processes;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import java.util.Objects;

View File

@ -85,7 +85,8 @@ class ProcessWidget extends FlowPanel {
}
private Label createMachineNameLabel(Process process) {
final Label label = new InlineHTML(process.getMachine().getConfig().getName() + ":&nbsp;");
// FIXME: spi
final Label label = new InlineHTML(/*process.getMachine().getConfig().getName() + */":&nbsp;");
label.addStyleName(RESOURCES.commandToolbarCss().processWidgetText());
label.addStyleName(RESOURCES.commandToolbarCss().processWidgetMachineNameLabel());

View File

@ -14,13 +14,14 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.inject.Provider;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.WorkspaceRuntime;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.machine.shared.dto.execagent.GetProcessesResponseDto;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.command.CommandExecutor;
import org.eclipse.che.ide.api.command.CommandManager;
import org.eclipse.che.ide.api.machine.ActiveRuntime;
import org.eclipse.che.ide.api.machine.ExecAgentCommandManager;
import org.eclipse.che.ide.api.machine.MachineEntity;
import org.eclipse.che.ide.api.machine.events.ActivateProcessOutputEvent;
import org.eclipse.che.ide.api.machine.events.ProcessFinishedEvent;
import org.eclipse.che.ide.api.machine.events.ProcessStartedEvent;
@ -106,10 +107,10 @@ public class ProcessesListPresenter implements Presenter, ProcessesListView.Acti
view.clearList();
runningProcesses.clear();
final WorkspaceRuntime runtime = appContext.getActiveRuntime();
final ActiveRuntime runtime = appContext.getActiveRuntime();
if (runtime != null) {
for (Machine machine : runtime.getMachines()) {
for (MachineEntity machine : runtime.getMachines()) {
execAgentClient.getProcesses(machine.getId(), false).then(processes -> {
for (GetProcessesResponseDto p : processes) {
final Process process = new ProcessImpl(p.getName(),
@ -135,7 +136,8 @@ public class ProcessesListPresenter implements Presenter, ProcessesListView.Acti
* machine where process were run or currently running
*/
private void addProcessToList(int pid, Machine machine) {
execAgentClient.getProcess(machine.getId(), pid).then(processDto -> {
// FIXME: spi
execAgentClient.getProcess(""/*machine.getId()*/, pid).then(processDto -> {
final Process process = new ProcessImpl(processDto.getName(),
processDto.getCommandLine(),
processDto.getPid(),
@ -165,7 +167,8 @@ public class ProcessesListPresenter implements Presenter, ProcessesListView.Acti
@Override
public void onStopProcess(Process process) {
execAgentClient.killProcess(process.getMachine().getId(), process.getPid());
// FIXME: spi
execAgentClient.killProcess(""/*process.getMachine().getId()*/, process.getPid());
}
@Override

View File

@ -15,7 +15,7 @@ import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.machine.shared.dto.MachineProcessDto;
import org.eclipse.che.api.machine.shared.dto.execagent.ProcessKillResponseDto;
import org.eclipse.che.api.machine.shared.dto.execagent.ProcessSubscribeResponseDto;
@ -221,7 +221,8 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
@Override
public void stop() {
execAgentCommandManager.killProcess(machine.getId(), pid);
// FIXME: spi
execAgentCommandManager.killProcess(""/*machine.getId()*/, pid);
}
@Override
@ -239,7 +240,8 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
if (isFinished()) {
commandExecutor.executeCommand(command, machine);
} else {
execAgentCommandManager.killProcess(machine.getId(), pid).then(new Operation<ProcessKillResponseDto>() {
// FIXME: spi
execAgentCommandManager.killProcess(""/*machine.getId()*/, pid).then(new Operation<ProcessKillResponseDto>() {
@Override
public void apply(ProcessKillResponseDto arg) throws OperationException {
commandExecutor.executeCommand(command, machine);

View File

@ -140,7 +140,7 @@ public class AppContextImpl implements AppContext,
if (workspace != null) {
userWorkspace = workspace;
if (workspace.getRuntime() != null) {
runtime = new ActiveRuntime(workspace.getRuntime());
runtime = new ActiveRuntime(workspace);
}
} else {
userWorkspace = null;

View File

@ -32,10 +32,12 @@ import org.eclipse.che.ide.api.extension.ExtensionRegistry;
import org.eclipse.che.ide.api.git.GitServiceClient;
import org.eclipse.che.ide.api.git.GitServiceClientImpl;
import org.eclipse.che.ide.api.keybinding.KeyBindingAgent;
import org.eclipse.che.ide.api.machine.CheWsAgentLinksModifier;
import org.eclipse.che.ide.api.machine.ExecAgentCommandManager;
import org.eclipse.che.ide.api.machine.ExecAgentEventManager;
import org.eclipse.che.ide.api.machine.RecipeServiceClient;
import org.eclipse.che.ide.api.machine.RecipeServiceClientImpl;
import org.eclipse.che.ide.api.machine.WsAgentURLModifier;
import org.eclipse.che.ide.api.machine.execagent.ConnectedEventHandler;
import org.eclipse.che.ide.api.machine.execagent.JsonRpcExecAgentCommandManager;
import org.eclipse.che.ide.api.machine.execagent.JsonRpcExecAgentEventManager;

View File

@ -113,6 +113,7 @@ import org.eclipse.che.ide.ui.toolbar.MainToolbar;
import org.eclipse.che.ide.ui.toolbar.ToolbarPresenter;
import org.eclipse.che.ide.util.browser.UserAgent;
import org.eclipse.che.ide.util.input.KeyCodeMap;
import org.eclipse.che.ide.workspace.start.StartWorkspaceAction;
import org.eclipse.che.ide.xml.NewXmlFileAction;
import org.vectomatic.dom.svg.ui.SVGResource;
@ -301,6 +302,9 @@ public class StandardComponentInitializer {
@Inject
private DownloadResourceAction downloadResourceAction;
@Inject
private StartWorkspaceAction startWorkspaceAction;
@Inject
private ImportProjectAction importProjectAction;
@ -559,6 +563,8 @@ public class StandardComponentInitializer {
workspaceGroup.addSeparator();
workspaceGroup.add(stopWorkspaceAction);
workspaceGroup.add(startWorkspaceAction);
// Project (New Menu)
DefaultActionGroup projectGroup = (DefaultActionGroup)actionManager.getAction(GROUP_PROJECT);

View File

@ -10,11 +10,10 @@
*******************************************************************************/
package org.eclipse.che.ide.factory.utils;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.inject.Inject;
import org.eclipse.che.api.core.model.project.SourceStorage;
import org.eclipse.che.api.core.model.workspace.config.SourceStorage;
import org.eclipse.che.api.factory.shared.dto.FactoryDto;
import org.eclipse.che.api.git.shared.GitCheckoutEvent;
import org.eclipse.che.api.promises.client.Function;

View File

@ -26,7 +26,8 @@ public class MachineItem extends MachineEntityImpl {
@Inject
public MachineItem(@Assisted MachineDto descriptor) {
super(descriptor);
// FIXME: spi
super("", descriptor);
}
}

View File

@ -15,7 +15,6 @@ import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.machine.shared.dto.MachineDto;
import org.eclipse.che.api.workspace.shared.dto.WorkspaceRuntimeDto;
import org.eclipse.che.ide.CoreLocalizationConstant;
import org.eclipse.che.api.workspace.shared.dto.RuntimeDto;
import org.eclipse.che.ide.api.app.AppContext;
@ -35,8 +34,6 @@ import static org.eclipse.che.ide.api.machine.events.MachineStateEvent.MachineAc
import static org.eclipse.che.ide.api.notification.StatusNotification.DisplayMode.EMERGE_MODE;
import static org.eclipse.che.ide.api.notification.StatusNotification.Status.FAIL;
//import org.eclipse.che.api.workspace.shared.dto.WorkspaceRuntimeDto;
/**
* Notifies about changing machine state.
*
@ -108,7 +105,7 @@ public class MachineStatusHandler implements MachineStatusChangedEvent.Handler {
private MachineEntity getMachine(String machineId, RuntimeDto workspaceRuntime) {
for (Map.Entry<String, MachineDto> entry : workspaceRuntime.getMachines().entrySet()) {
if (machineId.equals(entry.getKey())) {
return new MachineEntityImpl(entry.getValue());
return new MachineEntityImpl(entry.getKey(), entry.getValue());
}
}
notificationManager.notify(locale.failedToFindMachine(machineId));

View File

@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.machine;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.promises.client.Promise;
/**

View File

@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.machine;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.rest.AsyncRequestFactory;
@ -35,7 +35,8 @@ public class RecipeScriptDownloadServiceClientImpl implements RecipeScriptDownlo
@Override
public Promise<String> getRecipeScript(Machine machine) {
return asyncRequestFactory
.createGetRequest(restContext + "/recipe/script/" + machine.getWorkspaceId() + "/" + machine.getId())
// FIXME: spi
.createGetRequest(restContext + "/recipe/script/"/* + machine.getWorkspaceId() + "/" + machine.getId()*/)
.send(new StringUnmarshaller());
}
}

View File

@ -19,7 +19,7 @@ import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.inject.Inject;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import java.util.HashMap;
import java.util.List;
@ -125,8 +125,9 @@ public class MachineChooserViewImpl extends PopupPanel implements MachineChooser
machinesById.clear();
machines.forEach(machine -> {
machinesById.put(machine.getId(), machine);
machinesList.addItem(machine.getConfig().getName(), machine.getId());
// FIXME: spi
// machinesById.put(machine.getId(), machine);
// machinesList.addItem(machine.getConfig().getName(), machine.getId());
});
machinesList.setVisibleItemCount(machines.size());

View File

@ -15,8 +15,8 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.machine.Server;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Server;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.machine.events.WsAgentStateEvent;
import org.eclipse.che.ide.api.machine.events.WsAgentStateHandler;
@ -65,13 +65,13 @@ public class ServerAddressMacroRegistrar implements WsAgentStateHandler {
private Set<Macro> getMacros(Machine machine) {
Set<Macro> macros = Sets.newHashSet();
for (Map.Entry<String, ? extends Server> entry : machine.getRuntime().getServers().entrySet()) {
for (Map.Entry<String, ? extends Server> entry : machine.getServers().entrySet()) {
macros.add(new ServerAddressMacro(entry.getKey(),
entry.getValue().getAddress()));
entry.getValue().getUrl()));
if (entry.getKey().endsWith("/tcp")) {
macros.add(new ServerAddressMacro(entry.getKey().substring(0, entry.getKey().length() - 4),
entry.getValue().getAddress()));
entry.getValue().getUrl()));
}
}

View File

@ -11,20 +11,16 @@
package org.eclipse.che.ide.macro;
import com.google.common.annotations.Beta;
import com.google.common.base.Strings;
import com.google.common.collect.Sets;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Server;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.macro.BaseMacro;
import org.eclipse.che.ide.api.machine.DevMachine;
import org.eclipse.che.ide.api.macro.Macro;
import org.eclipse.che.ide.api.macro.MacroRegistry;
import org.eclipse.che.ide.api.machine.DevMachine;
import java.util.Map;
import java.util.Set;
/**
@ -35,7 +31,6 @@ import java.util.Set;
* @author Vlad Zhukovskyi
* @see AbstractServerMacro
* @see DevMachine
* @see Server#getRef()
* @since 4.7.0
*/
@Beta
@ -56,29 +51,30 @@ public class ServerHostNameMacro extends AbstractServerMacro {
public Set<Macro> getMacros(DevMachine devMachine) {
final Set<Macro> macros = Sets.newHashSet();
for (Map.Entry<String, ? extends Server> entry : devMachine.getDescriptor().getRuntime().getServers().entrySet()) {
if (Strings.isNullOrEmpty(entry.getValue().getRef())) {
continue;
}
Macro macro = new BaseMacro(KEY.replace("%", entry.getKey()),
entry.getValue().getRef(),
"Returns hostname of a server registered by name");
macros.add(macro);
// register port without "/tcp" suffix
if (entry.getKey().endsWith("/tcp")) {
final String port = entry.getKey().substring(0, entry.getKey().length() - 4);
Macro shortMacro = new BaseMacro(KEY.replace("%", port),
entry.getValue().getRef(),
"Returns hostname of a server registered by name");
macros.add(shortMacro);
}
}
// FIXME: spi
// for (Map.Entry<String, ? extends Server> entry : devMachine.getDescriptor().getServers().entrySet()) {
//
// if (Strings.isNullOrEmpty(entry.getValue().getRef())) {
// continue;
// }
//
// Macro macro = new BaseMacro(KEY.replace("%", entry.getKey()),
// entry.getValue().getRef(),
// "Returns hostname of a server registered by name");
//
// macros.add(macro);
//
// // register port without "/tcp" suffix
// if (entry.getKey().endsWith("/tcp")) {
// final String port = entry.getKey().substring(0, entry.getKey().length() - 4);
//
// Macro shortMacro = new BaseMacro(KEY.replace("%", port),
// entry.getValue().getRef(),
// "Returns hostname of a server registered by name");
//
// macros.add(shortMacro);
// }
// }
return macros;
}

View File

@ -16,18 +16,13 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Server;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.macro.BaseMacro;
import org.eclipse.che.ide.api.machine.DevMachine;
import org.eclipse.che.ide.api.macro.Macro;
import org.eclipse.che.ide.api.macro.MacroRegistry;
import org.eclipse.che.ide.api.machine.DevMachine;
import java.util.Map;
import java.util.Set;
import static com.google.common.base.Strings.isNullOrEmpty;
/**
* Macro which is responsible for the retrieving the address of the registered server.
* <p>
@ -36,7 +31,6 @@ import static com.google.common.base.Strings.isNullOrEmpty;
* @author Vlad Zhukovskyi
* @see AbstractServerMacro
* @see DevMachine
* @see Server#getAddress()
* @since 4.7.0
*/
@Beta
@ -57,28 +51,29 @@ public class ServerMacro extends AbstractServerMacro {
public Set<Macro> getMacros(DevMachine devMachine) {
final Set<Macro> macros = Sets.newHashSet();
for (Map.Entry<String, ? extends Server> entry : devMachine.getDescriptor().getRuntime().getServers().entrySet()) {
final String prefix = isNullOrEmpty(entry.getValue().getProtocol()) ? "" : entry.getValue().getProtocol() + "://";
final String value = prefix + entry.getValue().getAddress() + (isNullOrEmpty(prefix) ? "" : "/");
Macro macro = new BaseMacro(KEY.replace("%", entry.getKey()),
value,
"Returns protocol, hostname and port of an internal server");
macros.add(macro);
// register port without "/tcp" suffix
if (entry.getKey().endsWith("/tcp")) {
final String port = entry.getKey().substring(0, entry.getKey().length() - 4);
Macro shortMacro = new BaseMacro(KEY.replace("%", port),
value,
"Returns protocol, hostname and port of an internal server");
macros.add(shortMacro);
}
}
// FIXME: spi
// for (Map.Entry<String, ? extends Server> entry : devMachine.getDescriptor().getRuntime().getServers().entrySet()) {
//
// final String prefix = isNullOrEmpty(entry.getValue().getProtocol()) ? "" : entry.getValue().getProtocol() + "://";
// final String value = prefix + entry.getValue().getAddress() + (isNullOrEmpty(prefix) ? "" : "/");
//
// Macro macro = new BaseMacro(KEY.replace("%", entry.getKey()),
// value,
// "Returns protocol, hostname and port of an internal server");
//
// macros.add(macro);
//
// // register port without "/tcp" suffix
// if (entry.getKey().endsWith("/tcp")) {
// final String port = entry.getKey().substring(0, entry.getKey().length() - 4);
//
// Macro shortMacro = new BaseMacro(KEY.replace("%", port),
// value,
// "Returns protocol, hostname and port of an internal server");
//
// macros.add(shortMacro);
// }
// }
return macros;
}

View File

@ -16,7 +16,7 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Server;
import org.eclipse.che.api.core.model.workspace.runtime.Server;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.macro.BaseMacro;
import org.eclipse.che.ide.api.macro.Macro;
@ -34,7 +34,6 @@ import java.util.Set;
* @author Vlad Zhukovskyi
* @see AbstractServerMacro
* @see DevMachine
* @see Server#getAddress()
* @since 4.7.0
*/
@Beta
@ -55,13 +54,14 @@ public class ServerPortMacro extends AbstractServerMacro {
public Set<Macro> getMacros(DevMachine devMachine) {
final Set<Macro> macros = Sets.newHashSet();
for (Map.Entry<String, ? extends Server> entry : devMachine.getDescriptor().getRuntime().getServers().entrySet()) {
for (Map.Entry<String, ? extends Server> entry : devMachine.getDescriptor().getServers().entrySet()) {
if (!entry.getValue().getAddress().contains(":")) {
continue;
}
// FIXME: spi
// if (!entry.getValue().getAddress().contains(":")) {
// continue;
// }
final String externalPort = entry.getValue().getAddress().split(":")[1];
final String externalPort = ""/*entry.getValue().getAddress().split(":")[1]*/;
Macro macro = new BaseMacro(KEY.replace("%", entry.getKey()),
externalPort,

View File

@ -11,20 +11,16 @@
package org.eclipse.che.ide.macro;
import com.google.common.annotations.Beta;
import com.google.common.base.Strings;
import com.google.common.collect.Sets;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Server;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.macro.BaseMacro;
import org.eclipse.che.ide.api.machine.DevMachine;
import org.eclipse.che.ide.api.macro.Macro;
import org.eclipse.che.ide.api.macro.MacroRegistry;
import org.eclipse.che.ide.api.machine.DevMachine;
import java.util.Map;
import java.util.Set;
/**
@ -35,7 +31,6 @@ import java.util.Set;
* @author Vlad Zhukovskyi
* @see AbstractServerMacro
* @see DevMachine
* @see Server#getProtocol()
* @since 4.7.0
*/
@Beta
@ -56,29 +51,30 @@ public class ServerProtocolMacro extends AbstractServerMacro {
public Set<Macro> getMacros(DevMachine devMachine) {
final Set<Macro> macros = Sets.newHashSet();
for (Map.Entry<String, ? extends Server> entry : devMachine.getDescriptor().getRuntime().getServers().entrySet()) {
if (Strings.isNullOrEmpty(entry.getValue().getProtocol())) {
continue;
}
Macro macro = new BaseMacro(KEY.replace("%", entry.getKey()),
entry.getValue().getProtocol(),
"Returns protocol of a server registered by name");
macros.add(macro);
// register port without "/tcp" suffix
if (entry.getKey().endsWith("/tcp")) {
final String port = entry.getKey().substring(0, entry.getKey().length() - 4);
Macro shortMacro = new BaseMacro(KEY.replace("%", port),
entry.getValue().getProtocol(),
"Returns protocol of a server registered by name");
macros.add(shortMacro);
}
}
// FIXME: spi
// for (Map.Entry<String, ? extends Server> entry : devMachine.getDescriptor().getServers().entrySet()) {
//
// if (Strings.isNullOrEmpty(entry.getValue().getProtocol())) {
// continue;
// }
//
// Macro macro = new BaseMacro(KEY.replace("%", entry.getKey()),
// entry.getValue().getProtocol(),
// "Returns protocol of a server registered by name");
//
// macros.add(macro);
//
// // register port without "/tcp" suffix
// if (entry.getKey().endsWith("/tcp")) {
// final String port = entry.getKey().substring(0, entry.getKey().length() - 4);
//
// Macro shortMacro = new BaseMacro(KEY.replace("%", port),
// entry.getValue().getProtocol(),
// "Returns protocol of a server registered by name");
//
// macros.add(shortMacro);
// }
// }
return macros;
}

View File

@ -19,7 +19,6 @@ import elemental.html.SpanElement;
import com.google.inject.Inject;
import org.eclipse.che.api.core.model.machine.MachineConfig;
import org.eclipse.che.api.core.model.workspace.Workspace;
import org.eclipse.che.ide.CoreLocalizationConstant;
import org.eclipse.che.ide.api.app.AppContext;
@ -122,12 +121,14 @@ public class ProcessTreeRenderer implements NodeRenderer<ProcessTreeNode> {
private SpanElement createMachineElement(final ProcessTreeNode node) {
final MachineEntity machine = (MachineEntity)node.getData();
final String machineId = machine.getId();
final MachineConfig machineConfig = machine.getConfig();
final String machineCategory = machineConfig.isDev() ? locale.devMachineCategory() : machineConfig.getType();
// FIXME: spi
// final String machineId = machine.getId();
// final MachineConfig machineConfig = machine.getConfig();
// final String machineCategory = machineConfig.isDev() ? locale.devMachineCategory() : machineConfig.getType();
SpanElement root = Elements.createSpanElement();
root.appendChild(createMachineLabel(machineCategory));
// FIXME: spi
// root.appendChild(createMachineLabel(machineCategory));
Element statusElement = Elements.createSpanElement(resources.getCss().machineStatus());
root.appendChild(statusElement);
@ -167,7 +168,8 @@ public class ProcessTreeRenderer implements NodeRenderer<ProcessTreeNode> {
event.preventDefault();
if (addTerminalClickHandler != null) {
addTerminalClickHandler.onAddTerminalClick(machineId);
// FIXME: spi
// addTerminalClickHandler.onAddTerminalClick(machineId);
}
}
}, true);
@ -206,7 +208,8 @@ public class ProcessTreeRenderer implements NodeRenderer<ProcessTreeNode> {
@Override
public void handleEvent(Event event) {
if (previewSshClickHandler != null) {
previewSshClickHandler.onPreviewSshClick(machineId);
// FIXME: spi
// previewSshClickHandler.onPreviewSshClick(machineId);
}
}
}, true);
@ -220,15 +223,17 @@ public class ProcessTreeRenderer implements NodeRenderer<ProcessTreeNode> {
Element monitorsElement = Elements.createSpanElement(resources.getCss().machineMonitors());
root.appendChild(monitorsElement);
Node monitorNode = (Node)machineMonitors.getMonitorWidget(machineId, this).getElement();
monitorsElement.appendChild(monitorNode);
// FIXME: spi
// Node monitorNode = (Node)machineMonitors.getMonitorWidget(machineId, this).getElement();
// monitorsElement.appendChild(monitorNode);
Element nameElement = Elements.createSpanElement(resources.getCss().nameLabel());
nameElement.setTextContent(machineConfig.getName());
Tooltip.create(nameElement,
BOTTOM,
MIDDLE,
machineConfig.getName());
// FIXME: spi
// nameElement.setTextContent(machineConfig.getName());
// Tooltip.create(nameElement,
// BOTTOM,
// MIDDLE,
// machineConfig.getName());
root.appendChild(nameElement);
return root;

View File

@ -18,16 +18,14 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Command;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.machine.Server;
import org.eclipse.che.api.core.model.workspace.Environment;
import org.eclipse.che.api.core.model.workspace.ExtendedMachine;
import org.eclipse.che.api.core.model.workspace.Runtime;
import org.eclipse.che.api.core.model.workspace.Workspace;
import org.eclipse.che.api.core.model.workspace.WorkspaceConfig;
import org.eclipse.che.api.core.model.workspace.WorkspaceRuntime;
import org.eclipse.che.api.machine.shared.dto.MachineConfigDto;
import org.eclipse.che.api.machine.shared.dto.MachineDto;
import org.eclipse.che.api.core.model.workspace.config.Command;
import org.eclipse.che.api.core.model.workspace.config.Environment;
import org.eclipse.che.api.core.model.workspace.config.MachineConfig;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Server;
import org.eclipse.che.api.machine.shared.dto.execagent.GetProcessLogsResponseDto;
import org.eclipse.che.api.machine.shared.dto.execagent.GetProcessesResponseDto;
import org.eclipse.che.api.promises.client.Operation;
@ -44,7 +42,6 @@ import org.eclipse.che.ide.api.dialogs.ConfirmCallback;
import org.eclipse.che.ide.api.dialogs.DialogFactory;
import org.eclipse.che.ide.api.machine.ExecAgentCommandManager;
import org.eclipse.che.ide.api.machine.MachineEntity;
import org.eclipse.che.ide.api.machine.MachineEntityImpl;
import org.eclipse.che.ide.api.machine.events.ActivateProcessOutputEvent;
import org.eclipse.che.ide.api.machine.events.MachineStateEvent;
import org.eclipse.che.ide.api.machine.events.ProcessFinishedEvent;
@ -69,7 +66,6 @@ import org.eclipse.che.ide.console.CommandOutputConsole;
import org.eclipse.che.ide.console.CommandOutputConsolePresenter;
import org.eclipse.che.ide.console.DefaultOutputConsole;
import org.eclipse.che.ide.dto.DtoFactory;
import org.eclipse.che.ide.machine.MachineItem;
import org.eclipse.che.ide.machine.MachineResources;
import org.eclipse.che.ide.processes.ProcessTreeNode;
import org.eclipse.che.ide.processes.ProcessTreeNodeSelectedEvent;
@ -94,8 +90,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Strings.isNullOrEmpty;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static org.eclipse.che.api.core.model.machine.MachineStatus.CREATING;
import static org.eclipse.che.api.core.model.machine.MachineStatus.RUNNING;
import static org.eclipse.che.api.machine.shared.Constants.TERMINAL_REFERENCE;
import static org.eclipse.che.ide.api.notification.StatusNotification.DisplayMode.FLOAT_MODE;
import static org.eclipse.che.ide.api.notification.StatusNotification.Status.FAIL;
@ -480,7 +474,8 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
final OutputConsole defaultConsole = commandConsoleFactory.create("SSH");
addCommandOutput(machineId, defaultConsole);
final String machineName = machine.getConfig().getName();
// FIXME: spi
final String machineName = ""/*machine.getConfig().getName()*/;
String sshServiceAddress = getSshServerAddress(machine);
final String machineHost;
final String sshPort;
@ -495,7 +490,7 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
// user
final String userName;
String user = machine.getRuntime().getProperties().get("config.user");
String user = machine.getProperties().get("config.user");
if (isNullOrEmpty(user)) {
userName = "root";
} else {
@ -504,7 +499,7 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
// ssh key
final String workspaceName = appContext.getWorkspace().getConfig().getName();
Promise<SshPairDto> sshPairDtoPromise = sshServiceClient.getPair("workspace", machine.getWorkspaceId());
Promise<SshPairDto> sshPairDtoPromise = sshServiceClient.getPair("workspace", appContext.getWorkspaceId());
sshPairDtoPromise.then(new Operation<SshPairDto>() {
@Override
@ -566,9 +561,10 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
* @return ssh service address in format host:port
*/
private String getSshServerAddress(Machine machine) {
Map<String, ? extends Server> servers = machine.getRuntime().getServers();
Map<String, ? extends Server> servers = machine.getServers();
final Server sshServer = servers.get(SSH_PORT + "/tcp");
return sshServer != null ? sshServer.getAddress() : null;
// FIXME: spi
return sshServer != null ? sshServer.getUrl() : null;
}
/**
@ -840,7 +836,7 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
return false;
}
for (Environment environment : environments.values()) {
ExtendedMachine extendedMachine = environment.getMachines().get(machineName);
MachineConfig extendedMachine = environment.getMachines().get(machineName);
if (extendedMachine != null) {
if (extendedMachine.getAgents() != null && extendedMachine.getAgents().contains(agent)) {
return true;
@ -893,7 +889,7 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
// remove existed node
for (ProcessTreeNode node : rootNode.getChildren()) {
if (machine.getConfig().getName().equals(node.getName())) {
if (machine.getName().equals(node.getName())) {
children.addAll(node.getChildren());
rootNode.getChildren().remove(node);
break;
@ -902,7 +898,8 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
// create new node
final ProcessTreeNode newMachineNode = new ProcessTreeNode(MACHINE_NODE, rootNode, machine, null, children);
newMachineNode.setRunning(RUNNING == machine.getStatus());
// FIXME: spi
// newMachineNode.setRunning(RUNNING == machine.getStatus());
newMachineNode.setHasTerminalAgent(hasAgent(machine.getDisplayName(), TERMINAL_AGENT) || hasTerminal(machineId));
newMachineNode.setHasSSHAgent(hasAgent(machine.getDisplayName(), SSH_AGENT));
for (ProcessTreeNode child : children) {
@ -918,29 +915,29 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
view.setProcessesData(rootNode);
// add output for the machine if it is not exist
if (!consoles.containsKey(machine.getConfig().getName())) {
OutputConsole outputConsole = commandConsoleFactory.create(machine.getConfig().getName());
addOutputConsole(machine.getConfig().getName(), newMachineNode, outputConsole, true);
if (!consoles.containsKey(machine.getName())) {
OutputConsole outputConsole = commandConsoleFactory.create(machine.getName());
addOutputConsole(machine.getName(), newMachineNode, outputConsole, true);
}
return newMachineNode;
}
private List<MachineEntity> getMachines(Workspace workspace) {
WorkspaceRuntime workspaceRuntime = workspace.getRuntime();
Runtime workspaceRuntime = workspace.getRuntime();
if (workspaceRuntime == null) {
return emptyList();
}
List<? extends Machine> runtimeMachines = workspaceRuntime.getMachines();
Map<String, ? extends Machine> runtimeMachines = workspaceRuntime.getMachines();
List<MachineEntity> machines = new ArrayList<>(runtimeMachines.size());
for (Machine machine : runtimeMachines) {
if (machine instanceof MachineDto) {
MachineEntity machineEntity = new MachineEntityImpl(machine);
machines.add(machineEntity);
}
}
// FIXME: spi
// for (Machine machine : runtimeMachines.entrySet()) {
// if (machine instanceof MachineDto) {
// MachineEntity machineEntity = new MachineEntityImpl(machine);
// machines.add(machineEntity);
// }
// }
return machines;
}
@ -994,11 +991,12 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
notifyTreeNodeSelected(machineToSelect);
}
for (MachineEntity machine : machines.values()) {
if (RUNNING.equals(machine.getStatus()) && !wsMachines.contains(machine)) {
provideMachineNode(machine, true);
}
}
// FIXME: spi
// for (MachineEntity machine : machines.values()) {
// if (RUNNING.equals(machine.getStatus()) && !wsMachines.contains(machine)) {
// provideMachineNode(machine, true);
// }
// }
}
@Override
@ -1216,17 +1214,18 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
*/
public void printMachineOutput(final String machineName, final String text) {
// Create a temporary machine node to display outputs.
if (!consoles.containsKey(machineName)) {
MachineDto machineDto = dtoFactory.createDto(MachineDto.class)
.withId(machineName)
.withStatus(CREATING)
.withConfig(dtoFactory.createDto(MachineConfigDto.class)
.withDev("dev-machine".equals(machineName))
.withName(machineName)
.withType("docker")
);
provideMachineNode(new MachineItem(machineDto), true);
}
// FIXME: spi
// if (!consoles.containsKey(machineName)) {
// MachineDto machineDto = dtoFactory.createDto(MachineDto.class)
// .withId(machineName)
// .withStatus(CREATING)
// .withConfig(dtoFactory.createDto(MachineConfigDto.class)
// .withDev("dev-machine".equals(machineName))
// .withName(machineName)
// .withType("docker")
// );
// provideMachineNode(new MachineItem(machineDto), true);
// }
OutputConsole console = consoles.get(machineName);
if (console != null && console instanceof DefaultOutputConsole) {
@ -1335,9 +1334,10 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
}
Machine machine = (Machine)machineNode.getData();
if (!machine.getConfig().isDev()) {
continue;
}
// FIXME: spi
// if (!machine.isDev()) {
// continue;
// }
devMachine = machine;
break;
@ -1351,7 +1351,8 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
" " + DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) +
".log";
download(fileName, getText(devMachine.getId()));
// FIXME: spi
// download(fileName, getText(devMachine.getId()));
}
@Override

View File

@ -15,7 +15,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.api.core.model.project.SourceStorage;
import org.eclipse.che.api.core.model.workspace.config.SourceStorage;
import org.eclipse.che.api.promises.client.Function;
import org.eclipse.che.api.promises.client.FunctionException;
import org.eclipse.che.api.promises.client.Operation;

View File

@ -13,7 +13,7 @@ package org.eclipse.che.ide.projectimport.wizard;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.api.core.model.project.SourceStorage;
import org.eclipse.che.api.core.model.workspace.config.SourceStorage;
import org.eclipse.che.api.project.shared.Constants;
import org.eclipse.che.api.project.shared.dto.SourceEstimation;
import org.eclipse.che.api.promises.client.Function;

View File

@ -13,13 +13,13 @@ package org.eclipse.che.ide.projecttype.wizard.categoriespage;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.inject.Inject;
import org.eclipse.che.api.core.model.workspace.config.ProjectConfig;
import org.eclipse.che.api.project.shared.NewProjectConfig;
import org.eclipse.che.api.project.shared.dto.ProjectTypeDto;
import org.eclipse.che.api.project.templates.shared.dto.ProjectTemplateDescriptor;
import org.eclipse.che.api.workspace.shared.dto.ProjectConfigDto;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.project.MutableProjectConfig;
import org.eclipse.che.ide.api.project.NewProjectConfigImpl;
import org.eclipse.che.ide.api.project.type.ProjectTemplateRegistry;
import org.eclipse.che.ide.api.project.type.ProjectTypeRegistry;
import org.eclipse.che.ide.api.project.type.wizard.PreSelectedProjectTypeManager;
@ -229,9 +229,17 @@ public class CategoriesPagePresenter extends AbstractWizardPage<MutableProjectCo
}
final String templatePath = projectTemplate.getPath();
final List<ProjectConfig> updatedConfigs = new ArrayList<>(configDtoList.size());
final List<NewProjectConfig> updatedConfigs = new ArrayList<>(configDtoList.size());
for (ProjectConfigDto configDto : configDtoList) {
final ProjectConfig newConfig = new ProjectConfigImpl(configDto);
// FIXME: spi
final NewProjectConfig newConfig = new NewProjectConfigImpl(configDto.getName(),
configDto.getPath(),
configDto.getDescription(),
configDto.getType(),
configDto.getSource(),
configDto.getMixins(),
configDto.getAttributes(),
null);
final String projectPath = configDto.getPath();
if (projectPath.startsWith(templatePath)) {
final String path = projectPath.replaceFirst(templatePath, newProjectPath);

View File

@ -13,7 +13,7 @@ package org.eclipse.che.ide.resources.impl;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
import org.eclipse.che.api.core.model.project.ProjectConfig;
import org.eclipse.che.api.core.model.workspace.config.ProjectConfig;
import org.eclipse.che.api.project.shared.dto.SourceEstimation;
import org.eclipse.che.api.promises.client.Function;
import org.eclipse.che.api.promises.client.FunctionException;

View File

@ -14,7 +14,7 @@ import com.google.common.annotations.Beta;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import org.eclipse.che.api.core.model.project.ProjectConfig;
import org.eclipse.che.api.core.model.workspace.config.ProjectConfig;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseProvider;
import org.eclipse.che.ide.api.resources.Folder;

View File

@ -16,8 +16,8 @@ import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import org.eclipse.che.api.core.model.project.ProjectConfig;
import org.eclipse.che.api.core.model.project.SourceStorage;
import org.eclipse.che.api.core.model.workspace.config.ProjectConfig;
import org.eclipse.che.api.core.model.workspace.config.SourceStorage;
import org.eclipse.che.api.project.shared.dto.SourceEstimation;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseProvider;

View File

@ -16,9 +16,9 @@ import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.workspace.config.ProjectConfig;
import org.eclipse.che.api.core.model.workspace.config.SourceStorage;
import org.eclipse.che.api.project.shared.NewProjectConfig;
import org.eclipse.che.api.core.model.project.ProjectConfig;
import org.eclipse.che.api.core.model.project.SourceStorage;
import org.eclipse.che.api.core.rest.shared.dto.Link;
import org.eclipse.che.api.project.shared.dto.ItemReference;
import org.eclipse.che.api.project.shared.dto.SourceEstimation;

View File

@ -75,9 +75,11 @@ public class DefaultWorkspaceComponent extends WorkspaceComponent {
@Override
public void start(final Callback<Component, Exception> callback) {
this.callback = callback;
// FIXME: spi
callback.onSuccess(this);
workspaceServiceClient.getWorkspace(browserAddress.getWorkspaceKey())
.then(workspaceDto -> {
handleWorkspaceEvents(workspaceDto, callback, null);
handleWorkspaceEvents(new WorkspaceImpl(workspaceDto), callback, null);
})
.catchError(error -> {
needToReloadComponents = true;

View File

@ -14,7 +14,7 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.machine.shared.dto.execagent.event.DtoWithPid;
import org.eclipse.che.ide.api.machine.ExecAgentCommandManager;
import org.eclipse.che.ide.api.workspace.event.EnvironmentOutputEvent;
@ -40,7 +40,8 @@ public class MachineLogsRestorer {
return;
}
String machineId = machine.getId();
// FIXME: spi
String machineId = ""/*machine.getId()*/;
execAgentCommandManager.getProcesses(machineId, false)
.then(processes -> {
@ -49,7 +50,8 @@ public class MachineLogsRestorer {
.then(logs -> {
logs.forEach(log -> {
String fixedLog = log.getText().replaceAll("\\[STDOUT\\] ", "");
String machineName = machine.getConfig().getName();
// FIXME: spi
String machineName = ""/*machine.getConfig().getName()*/;
eventBus.fireEvent(new EnvironmentOutputEvent(fixedLog, machineName));
});
});

View File

@ -162,7 +162,7 @@ public abstract class WorkspaceComponent implements Component, WsAgentStateHandl
* @param restoreFromSnapshot
* restore or not the workspace from snapshot
*/
public void handleWorkspaceEvents(final WorkspaceDto workspace, final Callback<Component, Exception> callback,
public void handleWorkspaceEvents(final WorkspaceImpl workspace, final Callback<Component, Exception> callback,
final Boolean restoreFromSnapshot) {
loader.show(STARTING_WORKSPACE_RUNTIME);
@ -240,7 +240,7 @@ public abstract class WorkspaceComponent implements Component, WsAgentStateHandl
workspaceServiceClient.getWorkspace(workspaceID).then(new Operation<WorkspaceDto>() {
@Override
public void apply(WorkspaceDto workspace) throws OperationException {
handleWorkspaceEvents(workspace, callback, restoreFromSnapshot);
handleWorkspaceEvents(new WorkspaceImpl(workspace), callback, restoreFromSnapshot);
}
});
}

View File

@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.che.ide.workspace;
import org.eclipse.che.api.core.model.workspace.Runtime;
import org.eclipse.che.api.core.model.workspace.Workspace;
import org.eclipse.che.api.core.model.workspace.WorkspaceConfig;
import org.eclipse.che.api.core.model.workspace.WorkspaceRuntime;
import org.eclipse.che.api.core.model.workspace.WorkspaceStatus;
import java.util.Map;
@ -25,7 +25,7 @@ import java.util.Map;
public class WorkspaceImpl implements Workspace {
private final String id;
private final WorkspaceRuntime workspaceRuntime;
private final Runtime workspaceRuntime;
private final String namespace;
private final WorkspaceStatus status;
private final Map<String, String> attributes;
@ -75,7 +75,7 @@ public class WorkspaceImpl implements Workspace {
}
@Override
public WorkspaceRuntime getRuntime() {
public Runtime getRuntime() {
return workspaceRuntime;
}
}

View File

@ -14,7 +14,7 @@ import com.google.gwt.http.client.URL;
import com.google.inject.Inject;
import org.eclipse.che.api.machine.shared.dto.CommandDto;
import org.eclipse.che.api.machine.shared.dto.MachineConfigDto;
import org.eclipse.che.api.machine.shared.dto.OldMachineConfigDto;
import org.eclipse.che.api.machine.shared.dto.SnapshotDto;
import org.eclipse.che.api.promises.client.Function;
import org.eclipse.che.api.promises.client.Promise;
@ -32,7 +32,6 @@ import org.eclipse.che.ide.ui.loaders.request.LoaderFactory;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.stream.Collectors;
import java.util.Map;
import static com.google.gwt.http.client.RequestBuilder.PUT;
@ -238,7 +237,7 @@ public class WorkspaceServiceClientImpl implements WorkspaceServiceClient {
}
@Override
public Promise<Void> createMachine(final String wsId, final MachineConfigDto machineConfig) {
public Promise<Void> createMachine(final String wsId, final OldMachineConfigDto machineConfig) {
String url = baseHttpUrl + '/' + wsId + "/machine";
return asyncRequestFactory.createPostRequest(url, machineConfig)
.header(ACCEPT, APPLICATION_JSON)

View File

@ -12,7 +12,7 @@ package org.eclipse.che.ide.workspace;
import com.google.inject.Singleton;
import org.eclipse.che.api.machine.shared.dto.recipe.RecipeDescriptor;
import org.eclipse.che.api.machine.shared.dto.recipe.OldRecipeDescriptor;
import org.eclipse.che.api.workspace.shared.dto.WorkspaceDto;
import org.eclipse.che.ide.workspace.create.recipewidget.RecipeWidget;
import org.eclipse.che.ide.workspace.start.workspacewidget.WorkspaceWidget;
@ -32,7 +32,7 @@ public interface WorkspaceWidgetFactory {
* descriptor which contains all information about tag
* @return an instance of {@link RecipeWidget}
*/
RecipeWidget create(RecipeDescriptor descriptor);
RecipeWidget create(OldRecipeDescriptor descriptor);
/**
* Creates view representation of workspace.

View File

@ -17,14 +17,14 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import org.eclipse.che.api.machine.shared.dto.recipe.RecipeDescriptor;
import org.eclipse.che.api.machine.shared.dto.recipe.OldRecipeDescriptor;
import org.eclipse.che.api.promises.client.Operation;
import org.eclipse.che.api.promises.client.OperationException;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseError;
import org.eclipse.che.api.workspace.shared.dto.EnvironmentDto;
import org.eclipse.che.api.workspace.shared.dto.EnvironmentRecipeDto;
import org.eclipse.che.api.workspace.shared.dto.ExtendedMachineDto;
import org.eclipse.che.api.workspace.shared.dto.MachineConfigDto;
import org.eclipse.che.api.workspace.shared.dto.RecipeDto;
import org.eclipse.che.api.workspace.shared.dto.WorkspaceConfigDto;
import org.eclipse.che.api.workspace.shared.dto.WorkspaceDto;
import org.eclipse.che.ide.CoreLocalizationConstant;
@ -51,17 +51,15 @@ import static org.eclipse.che.api.machine.shared.Constants.WS_MACHINE_NAME;
@Singleton
public class CreateWorkspacePresenter implements CreateWorkspaceView.ActionDelegate {
protected static final String MEMORY_LIMIT_BYTES = Long.toString(2000L * 1024L * 1024L);
static final String RECIPE_TYPE = "docker";
static final int SKIP_COUNT = 0;
static final int MAX_COUNT = 100;
static final int MAX_NAME_LENGTH = 20;
static final int MIN_NAME_LENGTH = 3;
private static final RegExp FILE_NAME = RegExp.compile("^[A-Za-z0-9_\\s-\\.]+$");
private static final String URL_PATTERN = "^((ftp|http|https)://[\\w@.\\-\\_]+(:\\d{1,5})?(/[\\w#!:.?+=&%@!\\_\\-/]+)*){1}$";
private static final RegExp URL = RegExp.compile(URL_PATTERN);
protected static final String MEMORY_LIMIT_BYTES = Long.toString(2000L * 1024L * 1024L);
static final String RECIPE_TYPE = "docker";
static final int SKIP_COUNT = 0;
static final int MAX_COUNT = 100;
static final int MAX_NAME_LENGTH = 20;
static final int MIN_NAME_LENGTH = 3;
private final CreateWorkspaceView view;
private final DtoFactory dtoFactory;
private final WorkspaceServiceClient workspaceClient;
@ -71,7 +69,7 @@ public class CreateWorkspacePresenter implements CreateWorkspaceView.ActionDeleg
private final BrowserAddress browserAddress;
private Callback<Component, Exception> callback;
private List<RecipeDescriptor> recipes;
private List<OldRecipeDescriptor> recipes;
private List<String> workspacesNames;
@Inject
@ -110,11 +108,11 @@ public class CreateWorkspacePresenter implements CreateWorkspaceView.ActionDeleg
workspacesNames.add(workspace.getConfig().getName());
}
Promise<List<RecipeDescriptor>> recipes = recipeService.getAllRecipes();
Promise<List<OldRecipeDescriptor>> recipes = recipeService.getAllRecipes();
recipes.then(new Operation<List<RecipeDescriptor>>() {
recipes.then(new Operation<List<OldRecipeDescriptor>>() {
@Override
public void apply(List<RecipeDescriptor> recipeDescriptors) throws OperationException {
public void apply(List<OldRecipeDescriptor> recipeDescriptors) throws OperationException {
CreateWorkspacePresenter.this.recipes = recipeDescriptors;
}
});
@ -157,7 +155,7 @@ public class CreateWorkspacePresenter implements CreateWorkspaceView.ActionDeleg
String recipeUrl = view.getRecipeUrl();
boolean urlIsIncorrect = !Strings.isNullOrEmpty(recipeUrl) && !URL.test(recipeUrl) ;
boolean urlIsIncorrect = !Strings.isNullOrEmpty(recipeUrl) && !URL.test(recipeUrl);
view.setVisibleUrlError(urlIsIncorrect);
@ -179,9 +177,9 @@ public class CreateWorkspacePresenter implements CreateWorkspaceView.ActionDeleg
/** {@inheritDoc} */
@Override
public void onTagsChanged(final HidePopupCallBack callBack) {
recipeService.searchRecipes(view.getTags(), RECIPE_TYPE, SKIP_COUNT, MAX_COUNT).then(new Operation<List<RecipeDescriptor>>() {
recipeService.searchRecipes(view.getTags(), RECIPE_TYPE, SKIP_COUNT, MAX_COUNT).then(new Operation<List<OldRecipeDescriptor>>() {
@Override
public void apply(List<RecipeDescriptor> recipes) throws OperationException {
public void apply(List<OldRecipeDescriptor> recipes) throws OperationException {
boolean isRecipesEmpty = recipes.isEmpty();
if (isRecipesEmpty) {
@ -229,17 +227,24 @@ public class CreateWorkspacePresenter implements CreateWorkspaceView.ActionDeleg
private WorkspaceConfigDto getWorkspaceConfig() {
String wsName = view.getWorkspaceName();
EnvironmentRecipeDto recipe = dtoFactory.createDto(EnvironmentRecipeDto.class)
.withType("dockerimage")
.withLocation(view.getRecipeUrl());
RecipeDto recipe = dtoFactory.createDto(RecipeDto.class)
.withType("dockerimage")
.withLocation("eclipse/ubuntu_jdk8");
ExtendedMachineDto machine = dtoFactory.createDto(ExtendedMachineDto.class)
.withAgents(singletonList("org.eclipse.che.ws-agent"))
.withAttributes(singletonMap("memoryLimitBytes", MEMORY_LIMIT_BYTES));
List<String> agents = new ArrayList<>();
agents.add("org.eclipse.che.exec");
agents.add("org.eclipse.che.terminal");
agents.add("org.eclipse.che.ws-agent");
agents.add("org.eclipse.che.ssh");
MachineConfigDto machine = dtoFactory.createDto(MachineConfigDto.class)
.withAgents(agents)
.withAttributes(singletonMap("memoryLimitBytes", MEMORY_LIMIT_BYTES));
EnvironmentDto environment = dtoFactory.createDto(EnvironmentDto.class)
.withRecipe(recipe)
.withMachines(singletonMap(WS_MACHINE_NAME, machine));
.withMachines(singletonMap("dev-machine", machine));
return dtoFactory.createDto(WorkspaceConfigDto.class)
.withName(wsName)

View File

@ -12,7 +12,7 @@ package org.eclipse.che.ide.workspace.create;
import com.google.inject.ImplementedBy;
import org.eclipse.che.api.machine.shared.dto.recipe.RecipeDescriptor;
import org.eclipse.che.api.machine.shared.dto.recipe.OldRecipeDescriptor;
import org.eclipse.che.ide.api.mvp.View;
import java.util.List;
@ -31,14 +31,6 @@ interface CreateWorkspaceView extends View<CreateWorkspaceView.ActionDelegate> {
/** Hides dialog window. */
void hide();
/**
* Sets name for workspace in special place on view
*
* @param name
* name which will be set
*/
void setWorkspaceName(String name);
/** Returns special recipe url to get docker image. */
String getRecipeUrl();
@ -48,13 +40,21 @@ interface CreateWorkspaceView extends View<CreateWorkspaceView.ActionDelegate> {
/** Returns name of workspace from special place on view. */
String getWorkspaceName();
/**
* Sets name for workspace in special place on view
*
* @param name
* name which will be set
*/
void setWorkspaceName(String name);
/**
* Sets list of recipes found by tag to special place on view.
*
* @param recipes
* recipes which will be shown
*/
void showFoundByTagRecipes(List<RecipeDescriptor> recipes);
void showFoundByTagRecipes(List<OldRecipeDescriptor> recipes);
/**
* Sets list of predefined recipes to special place on view.
@ -62,7 +62,7 @@ interface CreateWorkspaceView extends View<CreateWorkspaceView.ActionDelegate> {
* @param recipes
* recipes which will be shown
*/
void showPredefinedRecipes(List<RecipeDescriptor> recipes);
void showPredefinedRecipes(List<OldRecipeDescriptor> recipes);
/**
* Changes visibility of error message for recipe url.

View File

@ -26,7 +26,7 @@ import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.api.machine.shared.dto.recipe.RecipeDescriptor;
import org.eclipse.che.api.machine.shared.dto.recipe.OldRecipeDescriptor;
import org.eclipse.che.ide.CoreLocalizationConstant;
import org.eclipse.che.ide.ui.window.Window;
import org.eclipse.che.ide.workspace.WorkspaceWidgetFactory;
@ -43,25 +43,14 @@ import java.util.List;
@Singleton
class CreateWorkspaceViewImpl extends Window implements CreateWorkspaceView, RecipeWidget.ActionDelegate {
interface CreateWorkspaceViewImplUiBinder extends UiBinder<Widget, CreateWorkspaceViewImpl> {
}
private static final CreateWorkspaceViewImplUiBinder UI_BINDER = GWT.create(CreateWorkspaceViewImplUiBinder.class);
private static final int BORDER_WIDTH = 1;
private final WorkspaceWidgetFactory tagFactory;
private final PopupPanel popupPanel;
private final FlowPanel tagsPanel;
private final HidePopupCallBack hidePopupCallBack;
private ActionDelegate delegate;
private Button createButton;
private boolean isPredefinedRecipe;
private static final CreateWorkspaceViewImplUiBinder UI_BINDER = GWT.create(CreateWorkspaceViewImplUiBinder.class);
private static final int BORDER_WIDTH = 1;
@UiField(provided = true)
final CoreLocalizationConstant locale;
final CoreLocalizationConstant locale;
private final WorkspaceWidgetFactory tagFactory;
private final PopupPanel popupPanel;
private final FlowPanel tagsPanel;
private final HidePopupCallBack hidePopupCallBack;
@UiField
TextBox wsName;
@UiField
@ -76,6 +65,9 @@ class CreateWorkspaceViewImpl extends Window implements CreateWorkspaceView, Rec
Label nameError;
@UiField
TextBox predefinedRecipes;
private ActionDelegate delegate;
private Button createButton;
private boolean isPredefinedRecipe;
@Inject
public CreateWorkspaceViewImpl(CoreLocalizationConstant locale,
@ -124,12 +116,6 @@ class CreateWorkspaceViewImpl extends Window implements CreateWorkspaceView, Rec
addButtonToFooter(createButton);
}
/** {@inheritDoc} */
@Override
public void setWorkspaceName(String name) {
wsName.setText(name);
}
/** {@inheritDoc} */
@Override
public String getRecipeUrl() {
@ -158,7 +144,13 @@ class CreateWorkspaceViewImpl extends Window implements CreateWorkspaceView, Rec
/** {@inheritDoc} */
@Override
public void showFoundByTagRecipes(List<RecipeDescriptor> recipes) {
public void setWorkspaceName(String name) {
wsName.setText(name);
}
/** {@inheritDoc} */
@Override
public void showFoundByTagRecipes(List<OldRecipeDescriptor> recipes) {
addRecipesToPanel(recipes);
int xPanelCoordinate = tags.getAbsoluteLeft() + BORDER_WIDTH;
@ -168,10 +160,10 @@ class CreateWorkspaceViewImpl extends Window implements CreateWorkspaceView, Rec
popupPanel.show();
}
private void addRecipesToPanel(List<RecipeDescriptor> recipes) {
private void addRecipesToPanel(List<OldRecipeDescriptor> recipes) {
tagsPanel.clear();
for (RecipeDescriptor descriptor : recipes) {
for (OldRecipeDescriptor descriptor : recipes) {
RecipeWidget tag = tagFactory.create(descriptor);
tag.setDelegate(this);
@ -183,7 +175,7 @@ class CreateWorkspaceViewImpl extends Window implements CreateWorkspaceView, Rec
/** {@inheritDoc} */
@Override
public void showPredefinedRecipes(List<RecipeDescriptor> recipes) {
public void showPredefinedRecipes(List<OldRecipeDescriptor> recipes) {
addRecipesToPanel(recipes);
int xPanelCoordinate = predefinedRecipes.getAbsoluteLeft() + BORDER_WIDTH;
@ -282,4 +274,7 @@ class CreateWorkspaceViewImpl extends Window implements CreateWorkspaceView, Rec
public void setDelegate(ActionDelegate delegate) {
this.delegate = delegate;
}
interface CreateWorkspaceViewImplUiBinder extends UiBinder<Widget, CreateWorkspaceViewImpl> {
}
}

View File

@ -23,7 +23,8 @@ import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import org.eclipse.che.api.machine.shared.dto.recipe.RecipeDescriptor;
import org.eclipse.che.api.core.model.workspace.config.Recipe;
import org.eclipse.che.api.machine.shared.dto.recipe.OldRecipeDescriptor;
import org.vectomatic.dom.svg.ui.SVGImage;
/**
@ -37,7 +38,7 @@ public class RecipeWidgetImpl extends Composite implements RecipeWidget, ClickHa
private static final TagEntryUiBinder UI_BINDER = GWT.create(TagEntryUiBinder.class);
private final RecipeDescriptor descriptor;
private final OldRecipeDescriptor descriptor;
private ActionDelegate delegate;
@ -51,7 +52,7 @@ public class RecipeWidgetImpl extends Composite implements RecipeWidget, ClickHa
FlowPanel main;
@Inject
public RecipeWidgetImpl(org.eclipse.che.ide.Resources resources, @Assisted RecipeDescriptor descriptor) {
public RecipeWidgetImpl(org.eclipse.che.ide.Resources resources, @Assisted OldRecipeDescriptor descriptor) {
this.descriptor = descriptor;
initWidget(UI_BINDER.createAndBindUi(this));

View File

@ -0,0 +1,51 @@
/*******************************************************************************
* Copyright (c) 2012-2017 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.ide.workspace.start;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.api.promises.client.Operation;
import org.eclipse.che.api.promises.client.OperationException;
import org.eclipse.che.api.workspace.shared.dto.WorkspaceDto;
import org.eclipse.che.ide.api.action.Action;
import org.eclipse.che.ide.api.action.ActionEvent;
import org.eclipse.che.ide.api.workspace.WorkspaceServiceClient;
import java.util.List;
/**
* Save editor content Action
*/
@Singleton
public class StartWorkspaceAction extends Action {
private final StartWorkspacePresenter presenter;
private final WorkspaceServiceClient workspaceServiceClient;
@Inject
public StartWorkspaceAction(StartWorkspacePresenter presenter, WorkspaceServiceClient workspaceServiceClient) {
super("start", "Save changes for current file");
this.presenter = presenter;
this.workspaceServiceClient = workspaceServiceClient;
}
@Override
public void actionPerformed(ActionEvent e) {
workspaceServiceClient.getWorkspaces(0, 30).then(new Operation<List<WorkspaceDto>>() {
@Override
public void apply(List<WorkspaceDto> arg) throws OperationException {
presenter.show(arg, null);
}
});
}
}

View File

@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.actions;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.CoreLocalizationConstant;
import org.eclipse.che.ide.api.action.ActionEvent;
import org.eclipse.che.ide.api.app.AppContext;

View File

@ -14,7 +14,7 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.inject.Provider;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.api.command.CommandExecutor;
import org.eclipse.che.ide.api.command.CommandGoal;
import org.eclipse.che.ide.api.command.CommandImpl;

View File

@ -14,13 +14,11 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.Workspace;
import org.eclipse.che.api.machine.shared.dto.MachineDto;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.debug.DebugConfiguration;
import org.eclipse.che.ide.api.debug.DebugConfigurationPage;
import org.eclipse.che.ide.api.machine.MachineEntityImpl;
import org.eclipse.che.ide.macro.CurrentProjectPathMacro;
import java.util.ArrayList;
@ -108,13 +106,13 @@ public class GdbConfigurationPagePresenter implements GdbConfigurationPageView.A
private void setHosts(List<Machine> machines) {
Map<String, String> hosts = new HashMap<>();
for (Machine machine : machines) {
String host = machine.getRuntime().getProperties().get("network.ipAddress");
String host = machine.getProperties().get("network.ipAddress");
if (host == null) {
continue;
}
String description = host + " (" + machine.getConfig().getName() + ")";
hosts.put(host, description);
// FIXME: spi
// String description = host + " (" + machine.getConfig().getName() + ")";
// hosts.put(host, description);
}
view.setHostsList(hosts);
@ -126,14 +124,15 @@ public class GdbConfigurationPagePresenter implements GdbConfigurationPageView.A
return emptyList();
}
List<? extends Machine> runtimeMachines = workspace.getRuntime().getMachines();
Map<String, ? extends Machine> runtimeMachines = workspace.getRuntime().getMachines();
List<Machine> machines = new ArrayList<>(runtimeMachines.size());
for (Machine currentMachine : runtimeMachines) {
if (currentMachine instanceof MachineDto) {
Machine machine = new MachineEntityImpl(currentMachine);
machines.add(machine);
}
}
// FIXME: spi
// for (Machine currentMachine : runtimeMachines.entrySet()) {
// if (currentMachine instanceof MachineDto) {
// Machine machine = new MachineEntityImpl(currentMachine);
// machines.add(machine);
// }
// }
return machines;
}

View File

@ -14,7 +14,7 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.api.core.model.machine.Server;
import org.eclipse.che.api.core.model.workspace.runtime.Server;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.debug.DebugConfiguration;
import org.eclipse.che.ide.api.debug.DebugConfigurationPage;
@ -81,19 +81,20 @@ public class JavaDebugConfigurationPagePresenter implements JavaDebugConfigurati
/** Extracts list of ports available for connecting to the remote debugger. */
private List<Pair<String, String>> extractPortsList(final MachineEntity machine) {
List<Pair<String, String>> ports = new ArrayList<>();
if (machine == null || machine.getRuntime() == null) {
if (machine == null) {
return ports;
}
Map<String, ? extends Server> servers = machine.getRuntime().getServers();
Map<String, ? extends Server> servers = machine.getServers();
for (Map.Entry<String, ? extends Server> entry : servers.entrySet()) {
String port = entry.getKey();
if (port.endsWith("/tcp")) {
String portWithoutTcp = port.substring(0, port.length() - 4);
String description = portWithoutTcp + " (" + entry.getValue().getRef() + ")";
Pair<String, String> pair = new Pair<>(description, portWithoutTcp);
// FIXME: spi
// String description = portWithoutTcp + " (" + entry.getValue().getRef() + ")";
// Pair<String, String> pair = new Pair<>(description, portWithoutTcp);
ports.add(pair);
// ports.add(pair);
}
}

View File

@ -15,7 +15,7 @@ import com.google.inject.Singleton;
import com.google.inject.name.Named;
import org.eclipse.che.api.core.NotFoundException;
import org.eclipse.che.api.core.model.project.ProjectConfig;
import org.eclipse.che.api.core.model.workspace.config.ProjectConfig;
import org.eclipse.che.api.core.notification.EventService;
import org.eclipse.che.api.core.notification.EventSubscriber;
import org.eclipse.che.api.project.server.ProjectCreatedEvent;

View File

@ -14,7 +14,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.che.api.core.model.machine.Machine;
import org.eclipse.che.api.core.model.workspace.runtime.Machine;
import org.eclipse.che.api.machine.shared.dto.execagent.ProcessStartResponseDto;
import org.eclipse.che.api.promises.client.Operation;
import org.eclipse.che.api.promises.client.OperationException;
@ -182,7 +182,8 @@ public class TestServiceClient {
command.getType(), attributes);
final CommandOutputConsole console = commandConsoleFactory.create(expandedCommand, machine);
final String machineId = machine.getId();
// FIXME: spi
final String machineId = ""/*machine.getId()*/;
processesPanelPresenter.addCommandOutput(machineId, console);
ExecAgentPromise<ProcessStartResponseDto> processPromise = execAgentCommandManager.startProcess(machineId,

View File

@ -2,11 +2,8 @@ mvn clean install \
-Dmaven.test.skip=true \
-Dskip-validate-sources \
-Dmdep.analyze.skip=true \
-pl "!:che-core-ide-api" \
-pl "!:che-core-ide-app" \
-pl "!:che-plugin-machine-ext-server" \
-pl "!:che-plugin-debugger-ide" \
-pl "!:che-plugin-java-ext-lang-server" \
-pl "!:che-dashboard-war" \
-pl "!:che-plugin-java-plain-ide" \
-pl "!:che-plugin-java-ext-lang-client" \
@ -33,7 +30,3 @@ mvn clean install \
-pl "!:che-core-git-impl-jgit" \
-pl "!:che-plugin-pullrequest-ide" \
$@
# -pl "!:che-plugin-machine-ext-client" \