diff --git a/agents/che-core-api-agent-shared/pom.xml b/agents/che-core-api-agent-shared/pom.xml index df76ff2d1d..cd72d7f685 100644 --- a/agents/che-core-api-agent-shared/pom.xml +++ b/agents/che-core-api-agent-shared/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.core che-core-api-agent-shared diff --git a/agents/che-core-api-agent/pom.xml b/agents/che-core-api-agent/pom.xml index 108b9b2abe..c1c06cdc6d 100644 --- a/agents/che-core-api-agent/pom.xml +++ b/agents/che-core-api-agent/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.core che-core-api-agent diff --git a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncher.java b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncher.java index 0815b66d31..c1f2f2a7b7 100644 --- a/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncher.java +++ b/agents/che-core-api-agent/src/main/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncher.java @@ -145,7 +145,7 @@ public abstract class AbstractAgentLauncher implements AgentLauncher { agentName, machine.getWorkspaceId(), machine.getId(), - machine.getNode(), + machine.getNode().getHost(), logs); } else { LOG.error("An error occurs while starting '{}' agent in '{}' workspace in '{}' machine on '{}' node. " + @@ -153,7 +153,7 @@ public abstract class AbstractAgentLauncher implements AgentLauncher { agentName, machine.getWorkspaceId(), machine.getId(), - machine.getNode()); + machine.getNode().getHost()); } }*/ diff --git a/agents/che-core-api-agent/src/test/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncherTest.java b/agents/che-core-api-agent/src/test/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncherTest.java index 1bb80ae059..81479f927c 100644 --- a/agents/che-core-api-agent/src/test/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncherTest.java +++ b/agents/che-core-api-agent/src/test/java/org/eclipse/che/api/agent/server/launcher/AbstractAgentLauncherTest.java @@ -17,6 +17,7 @@ import org.eclipse.che.api.core.util.LineConsumer; import org.eclipse.che.api.machine.server.exception.MachineException; import org.eclipse.che.api.machine.server.model.impl.CommandImpl; import org.eclipse.che.api.machine.server.spi.Instance; +import org.eclipse.che.api.machine.server.spi.InstanceNode; import org.eclipse.che.api.machine.server.spi.InstanceProcess; import org.mockito.Mock; import org.mockito.stubbing.Answer; @@ -34,6 +35,7 @@ import static org.mockito.Matchers.eq; import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; @@ -68,6 +70,7 @@ public class AbstractAgentLauncherTest { when(agentChecker.isLaunched(any(Agent.class), any(InstanceProcess.class), any(Instance.class))).thenReturn(true); + when(machine.getNode()).thenReturn(mock(InstanceNode.class)); } @Test diff --git a/agents/exec/pom.xml b/agents/exec/pom.xml index 44416a23f8..98bb917580 100644 --- a/agents/exec/pom.xml +++ b/agents/exec/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT exec-agent Agent :: Exec diff --git a/agents/go-agents/pom.xml b/agents/go-agents/pom.xml index e516d546ae..5f0b01c0c1 100644 --- a/agents/go-agents/pom.xml +++ b/agents/go-agents/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT go-agents Agent :: Golang agents diff --git a/agents/ls-csharp/pom.xml b/agents/ls-csharp/pom.xml index 83656b3c42..a6b7b76212 100644 --- a/agents/ls-csharp/pom.xml +++ b/agents/ls-csharp/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ls-csharp-agent Language Server C# Agent diff --git a/agents/ls-json/pom.xml b/agents/ls-json/pom.xml index 203ffec5f4..86525a7203 100644 --- a/agents/ls-json/pom.xml +++ b/agents/ls-json/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ls-json-agent Language Server Json Agent diff --git a/agents/ls-php/pom.xml b/agents/ls-php/pom.xml index f2d914b62f..b9696742aa 100644 --- a/agents/ls-php/pom.xml +++ b/agents/ls-php/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ls-php-agent Language Server PHP Agent diff --git a/agents/ls-python/pom.xml b/agents/ls-python/pom.xml index 698ebb155b..b0bb84a362 100644 --- a/agents/ls-python/pom.xml +++ b/agents/ls-python/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ls-python-agent Language Server python Agent diff --git a/agents/ls-typescript/pom.xml b/agents/ls-typescript/pom.xml index 42cb51fc80..21f64e97e8 100644 --- a/agents/ls-typescript/pom.xml +++ b/agents/ls-typescript/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ls-typescript-agent Language Server typescript Agent diff --git a/agents/pom.xml b/agents/pom.xml index be09c21103..5bf054951b 100644 --- a/agents/pom.xml +++ b/agents/pom.xml @@ -16,11 +16,11 @@ che-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-agents-parent - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT pom Che Agents Parent diff --git a/agents/ssh/pom.xml b/agents/ssh/pom.xml index 7ceb7084f6..d361a50d6b 100644 --- a/agents/ssh/pom.xml +++ b/agents/ssh/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ssh-agent SSH Agent diff --git a/agents/ssh/src/main/resources/org.eclipse.che.ssh.script.sh b/agents/ssh/src/main/resources/org.eclipse.che.ssh.script.sh index ce8f4e4392..2d344c109c 100644 --- a/agents/ssh/src/main/resources/org.eclipse.che.ssh.script.sh +++ b/agents/ssh/src/main/resources/org.eclipse.che.ssh.script.sh @@ -128,14 +128,11 @@ command -v pidof >/dev/null 2>&1 && { ps -fC sshd >/dev/null 2>&1 && exit } +# generate host keys and running sshd ${SUDO} mkdir -p /var/run/sshd -if echo ${LINUX_TYPE} | grep -qi "CentOS"; then - ${SUDO} /usr/bin/ssh-keygen -q -P '' -t rsa -f ~/.ssh/id_rsa -else - ${SUDO} /usr/bin/ssh-keygen -A -fi +${SUDO} /usr/bin/ssh-keygen -A ${SUDO} /usr/sbin/sshd -D diff --git a/agents/terminal/pom.xml b/agents/terminal/pom.xml index c295fdfb12..7f2780862c 100644 --- a/agents/terminal/pom.xml +++ b/agents/terminal/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT terminal-agent Agent :: Terminal diff --git a/agents/unison/pom.xml b/agents/unison/pom.xml index de51fb4a2f..5cdef3b301 100644 --- a/agents/unison/pom.xml +++ b/agents/unison/pom.xml @@ -16,7 +16,7 @@ che-agents-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT unison-agent Unison Agent diff --git a/assembly/assembly-ide-war/pom.xml b/assembly/assembly-ide-war/pom.xml index b36698a71c..c8bba88812 100644 --- a/assembly/assembly-ide-war/pom.xml +++ b/assembly/assembly-ide-war/pom.xml @@ -16,7 +16,7 @@ che-assembly-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT assembly-ide-war war diff --git a/assembly/assembly-main/pom.xml b/assembly/assembly-main/pom.xml index 426e1d61d1..2b19bb8448 100644 --- a/assembly/assembly-main/pom.xml +++ b/assembly/assembly-main/pom.xml @@ -16,7 +16,7 @@ che-assembly-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT assembly-main pom diff --git a/assembly/assembly-wsagent-server/pom.xml b/assembly/assembly-wsagent-server/pom.xml index a66ecd219f..814b174cc7 100644 --- a/assembly/assembly-wsagent-server/pom.xml +++ b/assembly/assembly-wsagent-server/pom.xml @@ -16,7 +16,7 @@ che-assembly-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT assembly-wsagent-server pom diff --git a/assembly/assembly-wsagent-war/pom.xml b/assembly/assembly-wsagent-war/pom.xml index 084d06798d..b20b44023e 100644 --- a/assembly/assembly-wsagent-war/pom.xml +++ b/assembly/assembly-wsagent-war/pom.xml @@ -16,7 +16,7 @@ che-assembly-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT assembly-wsagent-war war @@ -91,6 +91,10 @@ org.eclipse.che.plugin che-plugin-php-lang-server + + org.eclipse.che.plugin + che-plugin-pullrequest-server + org.eclipse.che.plugin che-plugin-python-lang-server diff --git a/assembly/assembly-wsmaster-war/pom.xml b/assembly/assembly-wsmaster-war/pom.xml index c3284dc9be..8417618558 100644 --- a/assembly/assembly-wsmaster-war/pom.xml +++ b/assembly/assembly-wsmaster-war/pom.xml @@ -16,7 +16,7 @@ che-assembly-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT assembly-wsmaster-war war @@ -212,10 +212,6 @@ org.eclipse.che.plugin che-plugin-openshift-client - - org.eclipse.che.plugin - che-plugin-pullrequest-server - org.eclipse.che.plugin che-plugin-ssh-machine diff --git a/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/codenvy/che.properties b/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/codenvy/che.properties index 08ef8db901..5ff2b0d410 100644 --- a/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/codenvy/che.properties +++ b/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/codenvy/che.properties @@ -211,11 +211,28 @@ che.docker.ip.external=NULL # - 'default': internal address is address of docker host and ephemeral port are used # - 'docker-local': internal address is address of container within docker network, and exposed ports # are used. +# - 'custom': The evaluation strategy may be customized through a template property. # The 'docker-local' strategy may be useful if a firewall prevents communication between che-server and # workspace containers, but will prevent communication when che-server and workspace containers are not # on the same Docker network. che.docker.server_evaluation_strategy=default + +# Here are macros available for the custom server evaluation strategy +# serverName: server reference exposing the port (like tomcat8, ws-agent, etc) +# machineName: name of the machine of the workspace. (like devMachine) +# workspaceId: id of the workspace +# internalIp: IP of the internal address of che (che.docker.ip property) +# externalIP: IP of the external address of che +# externalAddresss : external address of che (che.docker.ip.external or if null che.docker.ip) +# chePort : Che listening port number of workspace master +# wildcardNipDomain : get external address transformed into a nip.io DNS sub-domain +# wildcardXipDomain : get external address transformed into a xip.io DNS sub-domain +che.docker.server_evaluation_strategy.custom.template=...: + +# Protocol to use for http access (for example it can be set to https) +che.docker.server_evaluation_strategy.custom.external.protocol=http + # Provides a Docker network where Che server is running. # Workspace containers created by Che will be added to this Docker network. # Communications between the Che server and container occur over this network. diff --git a/assembly/pom.xml b/assembly/pom.xml index 986838e92a..489aeb749e 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -16,12 +16,12 @@ che-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml org.eclipse.che che-assembly-parent - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT pom Che IDE :: Parent diff --git a/core/che-core-api-core/pom.xml b/core/che-core-api-core/pom.xml index 1490fc49a4..c8aef013f8 100644 --- a/core/che-core-api-core/pom.xml +++ b/core/che-core-api-core/pom.xml @@ -16,7 +16,7 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-core jar diff --git a/core/che-core-api-dto-maven-plugin/pom.xml b/core/che-core-api-dto-maven-plugin/pom.xml index 4ee92a09d0..e5605680ad 100644 --- a/core/che-core-api-dto-maven-plugin/pom.xml +++ b/core/che-core-api-dto-maven-plugin/pom.xml @@ -16,7 +16,7 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-dto-maven-plugin maven-plugin diff --git a/core/che-core-api-dto/pom.xml b/core/che-core-api-dto/pom.xml index ad086f5d01..0b58a9c4a3 100644 --- a/core/che-core-api-dto/pom.xml +++ b/core/che-core-api-dto/pom.xml @@ -16,7 +16,7 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-dto jar diff --git a/core/che-core-api-model/pom.xml b/core/che-core-api-model/pom.xml index eb7d2af790..36be29c89c 100644 --- a/core/che-core-api-model/pom.xml +++ b/core/che-core-api-model/pom.xml @@ -16,7 +16,7 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-model jar diff --git a/core/che-core-db-vendor-h2/pom.xml b/core/che-core-db-vendor-h2/pom.xml index 50eb13ed35..872efad9dd 100644 --- a/core/che-core-db-vendor-h2/pom.xml +++ b/core/che-core-db-vendor-h2/pom.xml @@ -16,7 +16,7 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-db-vendor-h2 Che Core :: DB :: Vendor H2 diff --git a/core/che-core-db-vendor-postgresql/pom.xml b/core/che-core-db-vendor-postgresql/pom.xml index 4c26ef12a1..dacfcc3e12 100644 --- a/core/che-core-db-vendor-postgresql/pom.xml +++ b/core/che-core-db-vendor-postgresql/pom.xml @@ -16,7 +16,7 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-db-vendor-postgresql Che Core :: DB :: Vendor PostgreSQL diff --git a/core/che-core-db/pom.xml b/core/che-core-db/pom.xml index 3d7eb3e05a..a7eee975d4 100644 --- a/core/che-core-db/pom.xml +++ b/core/che-core-db/pom.xml @@ -16,7 +16,7 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-db Che Core :: DB diff --git a/core/che-core-typescript-dto-maven-plugin/pom.xml b/core/che-core-typescript-dto-maven-plugin/pom.xml index 7487de5cb6..f314196019 100644 --- a/core/che-core-typescript-dto-maven-plugin/pom.xml +++ b/core/che-core-typescript-dto-maven-plugin/pom.xml @@ -16,7 +16,7 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.core che-core-typescript-dto-maven-plugin diff --git a/core/commons/che-core-commons-annotations/pom.xml b/core/commons/che-core-commons-annotations/pom.xml index b18e2c44e5..5e90b87a8c 100644 --- a/core/commons/che-core-commons-annotations/pom.xml +++ b/core/commons/che-core-commons-annotations/pom.xml @@ -16,7 +16,7 @@ che-core-commons-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-commons-annotations jar diff --git a/core/commons/che-core-commons-inject/pom.xml b/core/commons/che-core-commons-inject/pom.xml index 856f4c74a5..0ab6951061 100644 --- a/core/commons/che-core-commons-inject/pom.xml +++ b/core/commons/che-core-commons-inject/pom.xml @@ -16,7 +16,7 @@ che-core-commons-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-commons-inject jar diff --git a/core/commons/che-core-commons-j2ee/pom.xml b/core/commons/che-core-commons-j2ee/pom.xml index f914dd9705..2c6ddeca5d 100644 --- a/core/commons/che-core-commons-j2ee/pom.xml +++ b/core/commons/che-core-commons-j2ee/pom.xml @@ -16,7 +16,7 @@ che-core-commons-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-commons-j2ee jar diff --git a/core/commons/che-core-commons-json/pom.xml b/core/commons/che-core-commons-json/pom.xml index fee209c60b..8efcc956f1 100644 --- a/core/commons/che-core-commons-json/pom.xml +++ b/core/commons/che-core-commons-json/pom.xml @@ -16,7 +16,7 @@ che-core-commons-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-commons-json jar diff --git a/core/commons/che-core-commons-lang/pom.xml b/core/commons/che-core-commons-lang/pom.xml index b9699a81ae..dd7e9178a4 100644 --- a/core/commons/che-core-commons-lang/pom.xml +++ b/core/commons/che-core-commons-lang/pom.xml @@ -16,7 +16,7 @@ che-core-commons-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-commons-lang jar diff --git a/core/commons/che-core-commons-schedule/pom.xml b/core/commons/che-core-commons-schedule/pom.xml index 2883f7ec0d..b369da87ff 100644 --- a/core/commons/che-core-commons-schedule/pom.xml +++ b/core/commons/che-core-commons-schedule/pom.xml @@ -16,7 +16,7 @@ che-core-commons-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-commons-schedule jar diff --git a/core/commons/che-core-commons-test/pom.xml b/core/commons/che-core-commons-test/pom.xml index 812cee3e1d..8fac830b57 100644 --- a/core/commons/che-core-commons-test/pom.xml +++ b/core/commons/che-core-commons-test/pom.xml @@ -16,7 +16,7 @@ che-core-commons-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-commons-test jar diff --git a/core/commons/che-core-commons-xml/pom.xml b/core/commons/che-core-commons-xml/pom.xml index 921d104e29..a678623b72 100644 --- a/core/commons/che-core-commons-xml/pom.xml +++ b/core/commons/che-core-commons-xml/pom.xml @@ -16,7 +16,7 @@ che-core-commons-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-commons-xml jar diff --git a/core/commons/pom.xml b/core/commons/pom.xml index 6a74425cb4..678eb1a424 100644 --- a/core/commons/pom.xml +++ b/core/commons/pom.xml @@ -16,7 +16,7 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-core-commons-parent diff --git a/core/pom.xml b/core/pom.xml index dc0ea6a7ae..130edf5a8f 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -16,12 +16,12 @@ che-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml org.eclipse.che.core che-core-parent - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT pom Che Core Parent diff --git a/dashboard/pom.xml b/dashboard/pom.xml index 73d525c645..e7733d54b7 100644 --- a/dashboard/pom.xml +++ b/dashboard/pom.xml @@ -16,12 +16,12 @@ che-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml org.eclipse.che.dashboard che-dashboard-war - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT war Che Dashboard :: Web App 2015 diff --git a/dashboard/src/app/factories/create-factory/action/factory-action-box.html b/dashboard/src/app/factories/create-factory/action/factory-action-box.html index 3293ba7cd7..3ece7be57b 100644 --- a/dashboard/src/app/factories/create-factory/action/factory-action-box.html +++ b/dashboard/src/app/factories/create-factory/action/factory-action-box.html @@ -14,8 +14,10 @@ che-place-holder="Enter value" aria-label="Enter value" required + ng-maxlength="255" ng-model="factoryActionBoxCtrl.selectedParam">
Param is required.
+
The value has to be less than 255 characters long.
-
- - -
-
- {{action.id}} -
-
- {{action.properties.name ? action.properties.name : action.properties.file}} -
-
-
- + +
+ + +
+
+ {{action.id}}
-
- +
+ {{action.properties.name ? action.properties.name : action.properties.file}} +
+
+
+ +
+
+ +
-
-
-
-
+ + +
+
diff --git a/dashboard/src/app/factories/create-factory/action/factory-action-box.styl b/dashboard/src/app/factories/create-factory/action/factory-action-box.styl index 03385cab27..6d3ee39093 100644 --- a/dashboard/src/app/factories/create-factory/action/factory-action-box.styl +++ b/dashboard/src/app/factories/create-factory/action/factory-action-box.styl @@ -13,6 +13,7 @@ margin-right 20px .factory-actions-list + max-height 500px max-width 600px md-list @@ -34,6 +35,8 @@ min-height 100% cursor pointer outline none + margin-right 0 + margin-left 10px span line-height inherit diff --git a/dashboard/src/app/factories/create-factory/action/factory-action-edit.html b/dashboard/src/app/factories/create-factory/action/factory-action-edit.html index 8c426faec5..f8081c3472 100644 --- a/dashboard/src/app/factories/create-factory/action/factory-action-edit.html +++ b/dashboard/src/app/factories/create-factory/action/factory-action-edit.html @@ -24,7 +24,7 @@ ng-click="factoryActionDialogEditCtrl.abort()"> diff --git a/dashboard/src/app/factories/create-factory/command/factory-command-edit.html b/dashboard/src/app/factories/create-factory/command/factory-command-edit.html index ef56ec34ea..3131b03503 100644 --- a/dashboard/src/app/factories/create-factory/command/factory-command-edit.html +++ b/dashboard/src/app/factories/create-factory/command/factory-command-edit.html @@ -12,7 +12,7 @@ ng-click="factoryCommandDialogEditCtrl.abort()"> diff --git a/dashboard/src/app/factories/create-factory/command/factory-command.html b/dashboard/src/app/factories/create-factory/command/factory-command.html index 603c07a652..e22ebe61cc 100644 --- a/dashboard/src/app/factories/create-factory/command/factory-command.html +++ b/dashboard/src/app/factories/create-factory/command/factory-command.html @@ -39,36 +39,37 @@ ng-disabled="commandsForm.$invalid">
-
- - -
-
- {{command.name}} -
-
- {{command.commandLine}} -
-
-
- + +
+ + +
+
+ {{command.name}}
-
- +
+ {{command.commandLine}} +
+
+
+ +
+
+ +
-
-
-
-
+ + +
+
diff --git a/dashboard/src/app/factories/create-factory/command/factory-command.styl b/dashboard/src/app/factories/create-factory/command/factory-command.styl index 5f1769343c..033f0ecbe0 100644 --- a/dashboard/src/app/factories/create-factory/command/factory-command.styl +++ b/dashboard/src/app/factories/create-factory/command/factory-command.styl @@ -12,6 +12,7 @@ margin-right 20px .factory-commands-list + max-height 500px max-width 600px md-list @@ -33,6 +34,8 @@ min-height 100% cursor pointer outline none + margin-right 0 + margin-left 10px span line-height inherit diff --git a/dashboard/src/app/projects/create-project/create-project.controller.ts b/dashboard/src/app/projects/create-project/create-project.controller.ts index 97d1721713..919bd70cf4 100755 --- a/dashboard/src/app/projects/create-project/create-project.controller.ts +++ b/dashboard/src/app/projects/create-project/create-project.controller.ts @@ -1081,10 +1081,11 @@ export class CreateProjectController { * Update creation flow state when source option changes */ onSourceOptionChanged(): void { - if ('select-source-existing' === this.selectSourceOption) { - // need to call selection of current tab - this.setCurrentTab(this.currentTab); + if ('select-source-existing' !== this.selectSourceOption) { + this.isReady = true; + return; } + this.setCurrentTab(this.currentTab); } /** diff --git a/dashboard/src/app/stacks/list-stacks/list-stacks.html b/dashboard/src/app/stacks/list-stacks/list-stacks.html index 591cacecf9..05bed0072c 100644 --- a/dashboard/src/app/stacks/list-stacks/list-stacks.html +++ b/dashboard/src/app/stacks/list-stacks/list-stacks.html @@ -11,7 +11,7 @@ --> - + A stack is environment configuration for workspace defined by its runtime recipe. Create workspaces from stacks that define projects, runtimes and commands. diff --git a/dashboard/src/app/stacks/stack-details/stack.html b/dashboard/src/app/stacks/stack-details/stack.html index 5783b3db9f..57ab9cb45f 100644 --- a/dashboard/src/app/stacks/stack-details/stack.html +++ b/dashboard/src/app/stacks/stack-details/stack.html @@ -114,7 +114,7 @@ ng-change="stackController.updateStackFromJson()" aria-label="Stack configuration editor"> - Docs: Stack Structure + Docs: Stack Structure
diff --git a/dashboard/src/app/workspaces/list-workspaces/list-workspaces.html b/dashboard/src/app/workspaces/list-workspaces/list-workspaces.html index ec59042013..90c62addd7 100644 --- a/dashboard/src/app/workspaces/list-workspaces/list-workspaces.html +++ b/dashboard/src/app/workspaces/list-workspaces/list-workspaces.html @@ -11,7 +11,7 @@ --> -A workspace is where your projects live and run. Create workspaces from stacks that define projects, runtimes, and commands. +A workspace is where your projects live and run. Create workspaces from stacks that define projects, runtimes, and commands. diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.controller.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.controller.ts index 46662158ef..596b3b09b7 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.controller.ts @@ -9,6 +9,7 @@ * Codenvy, S.A. - initial API and implementation */ 'use strict'; +import {CheStack} from '../../../../../components/api/che-stack.factory'; /** * This class is handling the controller for the ready-to-go stacks @@ -17,20 +18,22 @@ */ export class ReadyToGoStacksController { + private $scope: ng.IScope; + private lodash: _.LoDashStatic; + private tabName: string; + private selectedStackId: string; + private allStackTags: Array = []; + private generalStacks: Array = []; + private filteredStackIds: Array = []; + private stackIconsMap: Map = new Map(); + /** * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($timeout, $scope, lodash, cheStack) { - this.$timeout = $timeout; + constructor($scope: ng.IScope, lodash: _.LoDashStatic, cheStack: CheStack) { this.$scope = $scope; this.lodash = lodash; - this.cheStack = cheStack; - - this.generalStacks = []; - this.allStackTags = []; - this.filteredStackIds = []; - this.stackIconsMap = new Map(); let stacks = cheStack.getStacks(); if (stacks.length) { @@ -40,50 +43,48 @@ export class ReadyToGoStacksController { this.updateData(stacks); }); } - - // create array of id of stacks which contain selected tags - // to make filtration faster - $scope.$on('event:updateFilter', (event, tags) => { - this.allStackTags = []; - this.filteredStackIds = []; - - if (!tags) { - tags = []; - } - this.generalStacks.forEach((stack) => { - let matches = 0, - stackTags = stack.tags.map(tag => tag.toLowerCase()); - for (let i = 0; i < tags.length; i++) { - if (stackTags.indexOf(tags[i].toLowerCase()) > -1) { - matches++; - } - } - if (matches === tags.length) { - this.filteredStackIds.push(stack.id); - this.allStackTags = this.allStackTags.concat(stack.tags); - } - }); - this.allStackTags = this.lodash.uniq(this.allStackTags); - }); - - // set first stack as selected after filtration finished - $scope.$watch('filteredStacks && filteredStacks.length', (length) => { - if (length) { - this.setStackSelectionById($scope.filteredStacks[0].id); - } - }); } /** - * Update stacks' data - * @param stacks + * Update filtered stack keys depends on tags. + * @param tags {Array} */ - updateData(stacks) { - stacks.forEach((stack) => { + onTagsChanges(tags?: Array): void { + if (!angular.isArray(tags) || !tags.length) { + this.filteredStackIds = this.generalStacks.map((stack: che.IStack) => stack.id); + this.setStackSelectionById(this.filteredStackIds[0]); + return; + } + this.filteredStackIds = this.generalStacks.filter((stack: che.IStack) => { + let stackTags = stack.tags.map((tag: string) => tag.toLowerCase()); + return tags.every((tag: string) => { + return stackTags.indexOf(tag.toLowerCase()) !== -1; + }); + }).map((stack: che.IStack) => stack.id); + if (this.filteredStackIds.length) { + this.setStackSelectionById(this.filteredStackIds[0]); + } + } + + /** + * Gets icon src. + * @param stackId {string} + * @returns {undefined|string} + */ + getIconSrc(stackId: string): string { + return this.stackIconsMap.get(stackId); + } + + /** + * Update stack data. + * @param stacks {Array} + */ + updateData(stacks: Array): void { + stacks.forEach((stack: che.IStack) => { if (stack.scope !== 'general') { return; } - let findLink = this.lodash.find(stack.links, (link) => { + let findLink = this.lodash.find(stack.links, (link: any) => { return link.rel === 'get icon link'; }); if (findLink) { @@ -93,38 +94,25 @@ export class ReadyToGoStacksController { this.allStackTags = this.allStackTags.concat(stack.tags); }); this.allStackTags = this.lodash.uniq(this.allStackTags); - } - - /** - * Joins the tags into a string - * @param tags - * @returns String - */ - tagsToString(tags) { - return tags.join(', '); - } - - /** - * Gets privileged stack position - * @param item - * @returns number - */ - getPrivilegedSortPosition(item) { - let privilegedNames = ['Java', 'Java-MySQL', 'Blank']; - - let sortPos = privilegedNames.indexOf(item.name); - if (sortPos > -1) { - return sortPos; - } - - return privilegedNames.length; + this.generalStacks.sort((stackA: che.IStack, stackB: che.IStack) => { + const nameA = stackA.name.toLowerCase(); + const nameB = stackB.name.toLowerCase(); + if (nameA < nameB) { + return -1; + } + if (nameA > nameB) { + return 1; + } + return 0; + }); + this.onTagsChanges(); } /** * Select stack by Id - * @param stackId + * @param stackId {string} */ - setStackSelectionById(stackId) { + setStackSelectionById(stackId: string): void { this.selectedStackId = stackId; if (this.selectedStackId) { this.$scope.$emit('event:selectStackId', {tabName: this.tabName, stackId: this.selectedStackId}); diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.html b/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.html index 85d4889d28..e9a6b05498 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.html +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.html @@ -14,22 +14,26 @@
Create a new workspace with a ready-to-go stack.
+ stack-tags="readyToGoStacksCtrl.allStackTags" + on-tags-changes="readyToGoStacksCtrl.onTagsChanges(tags)">
-
- +
+ +
+
+
{{stack.name}}
-
{{stack.name}}
-
{{readyToGoStacksCtrl.tagsToString(stack.tags)}}
+
{{stack.description}}
diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.styl b/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.styl index 15eea53a29..0a3266ba54 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.styl +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.styl @@ -1,9 +1,5 @@ $che-simple-selector-color = $label-info-color -.create-project-stack-selector .create-project-stack-selected - box-shadow 0px 3px 1px -2px rgba(0, 0, 200, 0.14), 0px 2px 2px 0px rgba(0, 0, 200, 0.098), 0px 1px 5px 0px rgba(0, 0, 200, 0.084); - color $primary-color - .che-simple-selector outline none height 90px @@ -27,68 +23,76 @@ $che-simple-selector-color = $label-info-color &:focus outline none -.che-simple-selector .title - position relative - border 1px solid $che-simple-selector-color - border-right none - border-left none - line-height 22px + .title + position relative + border 1px solid $che-simple-selector-color + border-right none + border-left none + line-height 22px -.che-simple-selector:hover .title - border-color $background-color + &:before + position absolute + border-top 24px solid transparent + border-right 24px solid $che-simple-selector-color + content "" + left -24px + bottom -1px -.che-simple-selector .title:before - position absolute - border-top 24px solid transparent - border-right 24px solid $che-simple-selector-color - content "" - left -24px - bottom -1px + &:after + position absolute + border-top 23px solid transparent + border-right 23px solid $background-color + content "" + left -22px + bottom 0 -.che-simple-selector:hover .title:before - border-right-color $background-color + div + text-overflow ellipsis + white-space nowrap + overflow hidden -.che-simple-selector .title:after - position absolute - border-top 23px solid transparent - border-right 23px solid $background-color - content "" - left -22px - bottom 0 + &:hover .title + border-color $background-color -.che-simple-selector:hover .title:after - border-right-color $che-simple-selector-color + &:before + border-right-color $background-color -.che-simple-selector .selector-icon - padding 0 - width 55px - height 24px - font-size 24px - line-height 24px - text-align center - margin-right 22px - filter grayscale(100%) + &:hover .title:after + border-right-color $che-simple-selector-color - &:before - color $menu-bg-color + .selector-icon + padding 0 + width 55px + height 24px + font-size 24px + line-height 24px + text-align center + margin-right 22px + filter grayscale(100%) -.che-simple-selector .selector-icon img - height 24px - padding-bottom 1px + &:before + color $menu-bg-color -.che-simple-selector .cheico-type-blank > img + img + display inline + height 24px + max-width 36px + position relative + bottom 4px + + .cheico-type-blank img display none -.che-simple-selector .title - font-size 12px - line-height 22px - text-align center - text-transform uppercase + .title + font-size 12px + line-height 22px + text-align center + text-transform uppercase -.che-simple-selector .description, .che-simple-selector-active .description - font-size 12px - padding 5px 10px - color $label-primary-color + .description + font-size 12px + padding 5px 10px + color $label-primary-color .che-simple-selector-active border-color $primary-color @@ -97,20 +101,21 @@ $che-simple-selector-color = $label-info-color &:hover background-color $background-color -.che-simple-selector-active .title, .che-simple-selector-active:hover .title - background-color $primary-color - color $background-color - border-color $primary-color - font-weight bold + .title, + &:hover .title + background-color $primary-color + color $background-color + border-color $primary-color + font-weight bold -.che-simple-selector-active .title:before, .che-simple-selector-active:hover .title:before - border-right-color $primary-color + .title:before, + &:hover .title:before + border-right-color $primary-color -.che-simple-selector-active .title:after, .che-simple-selector-active:hover .title:after - border-right-color $primary-color + .title:after, + &:hover .title:after + border-right-color $primary-color -.che-simple-selector-active:hover .selector-icon - filter none - -.che-simple-selector-active .selector-icon - filter none + .selector-icon, + &:hover .selector-icon + filter none diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.controller.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.controller.ts index 22eb3eeff0..c6e2adce9f 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.controller.ts @@ -10,6 +10,7 @@ */ 'use strict'; import {DockerfileParser} from '../../../../../components/api/environment/docker-file-parser'; +import {CheBranding} from '../../../../../components/branding/che-branding.factory'; /** * @ngdoc controller @@ -30,6 +31,7 @@ export class WorkspaceRecipeAuthoringController { recipeScript: string; recipeFormatCopy: string; recipeScriptCopy: string; + stackDocsUrl: string; recipeChange: Function; editorOptions: { @@ -44,10 +46,10 @@ export class WorkspaceRecipeAuthoringController { * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($scope: ng.IScope, $timeout: ng.ITimeoutService) { + constructor($scope: ng.IScope, $timeout: ng.ITimeoutService, cheBranding: CheBranding) { this.$timeout = $timeout; - this.dockerfileParser = new DockerfileParser(); + this.stackDocsUrl = cheBranding.getDocs().stack; this.editorOptions = { lineWrapping: true, diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.html b/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.html index 827b8ea70f..254c39994f 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.html +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.html @@ -21,7 +21,7 @@ {{workspaceRecipeAuthoringController.recipeValidationError}}
diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library-selected-stack.filter.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library-selected-stack.filter.ts deleted file mode 100644 index 64c4adcb63..0000000000 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library-selected-stack.filter.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2015-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 - */ -'use strict'; - -/** - * Defines a filter that match if given value is containing stack ID - * @author Oleksii Kurinnyi - */ - -export class CreateProjectStackLibrarySelectedStackFilter { - - constructor(register) { - register.app.filter('stackSelectedStackFilter', () => { - return function (templates, idFilter) { - if (!templates) { - return []; - } - - if (!idFilter || !idFilter.length) { - return templates; - } - - var filtered = []; - templates.forEach((template) => { - if (idFilter.indexOf(template.id) > -1) { - filtered.push(template); - } - }); - return filtered; - }; - }); - } -} diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.controller.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.controller.ts index 2c397e205c..cca4231be9 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.controller.ts @@ -9,6 +9,7 @@ * Codenvy, S.A. - initial API and implementation */ 'use strict'; +import {CheStack} from '../../../../../components/api/che-stack.factory'; /** * This class is handling the controller for the creating stack library projects @@ -17,72 +18,62 @@ */ export class CreateProjectStackLibraryController { + private $scope: ng.IScope; + private lodash: _.LoDashStatic; + private tabName: string; + private selectedStackId: string; + private allStackTags: Array = []; + private filteredStackIds: Array = []; + private stacks: Array = []; + /** * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($scope, cheStack, cheWorkspace, lodash) { + constructor($scope: ng.IScope, cheStack: CheStack, lodash: _.LoDashStatic) { this.$scope = $scope; - this.cheStack = cheStack; - this.cheWorkspace = cheWorkspace; this.lodash = lodash; - this.workspaces = []; - - this.allStackTags = []; - this.filteredStackIds = []; - - this.stacks = cheStack.getStacks(); - if (this.stacks.length) { - this.updateData(); + let stacks = cheStack.getStacks(); + if (stacks.length) { + this.updateData(stacks); } else { cheStack.fetchStacks().then(() => { - this.updateData(); + this.updateData(stacks); }); } $scope.$on('event:library:selectStackId', (event, data) => { - this.setStackSelectionById(data) - }); - - // create array of id of stacks which contain selected tags - // to make filtration faster - $scope.$on('event:updateFilter', (event, tags) => { - this.allStackTags = []; - this.filteredStackIds = []; - - if (!tags) { - tags = []; - } - this.stacks.forEach((stack) => { - let matches = 0, - stackTags = stack.tags.map(tag => tag.toLowerCase()); - for (let i = 0; i < tags.length; i++) { - if (stackTags.indexOf(tags[i].toLowerCase()) > -1) { - matches++; - } - } - if (matches === tags.length) { - this.filteredStackIds.push(stack.id); - this.allStackTags = this.allStackTags.concat(stack.tags); - } - }); - this.allStackTags = this.lodash.uniq(this.allStackTags); - }); - - // set first stack as selected after filtration finished - $scope.$watch('filteredStacks && filteredStacks.length', (length) => { - if (length) { - this.setStackSelectionById($scope.filteredStacks[0].id); - } + this.setStackSelectionById(data); }); } /** - * Select stack by Id - * @param stackId + * Update filtered stack keys depends on tags. + * @param tags {Array} */ - setStackSelectionById(stackId) { + onTagsChanges(tags?: Array): void { + if (!angular.isArray(tags) || !tags.length) { + this.filteredStackIds = this.stacks.map((stack: che.IStack) => stack.id); + this.setStackSelectionById(this.filteredStackIds[0]); + return; + } + this.filteredStackIds = this.stacks.filter((stack: che.IStack) => { + let stackTags = stack.tags.map((tag: string) => tag.toLowerCase()); + return tags.every((tag: string) => { + return stackTags.indexOf(tag.toLowerCase()) !== -1; + }); + }).map((stack: che.IStack) => stack.id); + if (this.filteredStackIds.length) { + this.setStackSelectionById(this.filteredStackIds[0]); + } + } + + /** + * Select stack by Id + * @param stackId {string} + */ + setStackSelectionById(stackId: string): void { this.selectedStackId = stackId; if (this.selectedStackId) { this.$scope.$emit('event:selectStackId', {tabName: this.tabName, stackId: this.selectedStackId}); @@ -91,28 +82,42 @@ export class CreateProjectStackLibraryController { /** * Update stacks' data + * @param stacks {Array} */ - updateData() { - this.stacks.forEach((stack) => { + updateData(stacks: Array): void { + stacks.forEach((stack: che.IStack) => { this.filteredStackIds.push(stack.id); this.allStackTags = this.allStackTags.concat(stack.tags); }); this.allStackTags = this.lodash.uniq(this.allStackTags); + stacks.sort((stackA: che.IStack, stackB: che.IStack) => { + const nameA = stackA.name.toLowerCase(); + const nameB = stackB.name.toLowerCase(); + if (nameA < nameB) { + return -1; + } + if (nameA > nameB) { + return 1; + } + return 0; + }); + this.stacks = angular.copy(stacks); + this.onTagsChanges(); } /** * Provides tooltip data from a stack - * @param stack - the data to analyze - * @returns String + * @param stack {che.IStack} - the data to analyze + * @returns {string} */ - getTooltip(stack) { + getTooltip(stack: che.IStack): string { // get components and add data from the components let text = ''; if (!stack || !stack.components) { return text; } - stack.components.forEach((component) => { + stack.components.forEach((component: any) => { text += component.name + ':' + component.version + ' '; }); return text; diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.html b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.html index 5204141d7a..d2afffca5e 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.html +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.html @@ -2,7 +2,8 @@
Select from our library of stacks.
+ stack-tags="createProjectStackLibraryCtrl.allStackTags" + on-tags-changes="createProjectStackLibraryCtrl.onTagsChanges(tags)">
@@ -11,14 +12,15 @@
+ ng-repeat="stack in createProjectStackLibraryCtrl.stacks" + ng-init="$first && createProjectStackLibraryCtrl.setStackSelectionById(stack.id)" + ng-hide="createProjectStackLibraryCtrl.filteredStackIds.indexOf(stack.id) === -1" + che-is-select="stack.id === createProjectStackLibraryCtrl.selectedStackId" + che-is-active="true" + che-title="{{stack.name}}" + che-text="{{stack.description}}" + che-extra-text="{{createProjectStackLibraryCtrl.getTooltip(stack)}}" + che-stack-id="{{stack.id}}"/>
diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.controller.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.controller.ts index 8e931a892b..84ebad9b8f 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.controller.ts @@ -16,11 +16,21 @@ */ export class CheStackLibraryFilterController { + private $scope: ng.IScope; + private $timeout: ng.ITimeoutService; + private selectedIndex: number; + private chip: string; + private keys: Array; + private stackTags: Array; + private suggestions: Array; + private selectedTags: Array; + private onTagsChanges: Function; + private selectSuggestion: Function; /** * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($scope, $mdConstant, $timeout) { + constructor($scope: ng.IScope, $mdConstant: any, $timeout: ng.ITimeoutService) { this.$scope = $scope; this.$timeout = $timeout; this.chip = ''; @@ -33,59 +43,44 @@ export class CheStackLibraryFilterController { /** * Transform chip into tag - * @param chip the string to make a tag - * @returns {*} - */ - transformChip(chip) { + * @param chip {string} the string to make a tag + * @returns {string} + */ + transformChip(chip: string): string { chip = chip.toLowerCase(); - // if partial input if (this.selectedIndex > -1) { chip = this.suggestions[this.selectedIndex].toLowerCase(); } - // if already selected - let selected = this.selectedTags.some(tag => tag.toLowerCase() === chip); - if (selected) { + if (this.selectedTags.some((tag: string) => tag.toLowerCase() === chip)) { return null; } - // if match some tag - let tag; - for (var i=0; i tag.toLowerCase() === chip); - // query string isn't matched any tag - // don't add new tag - return null; + return tag ? tag : null; } /** * Callback called when tag added */ - onAdd() { - this.$scope.$emit('event:updateFilter', this.selectedTags); + onAdd(): void { + this.onTagsChanges({tags: this.selectedTags}); } /** * Callback called when tag removed */ - onRemove() { - this.$scope.$emit('event:updateFilter', this.selectedTags); + onRemove(): void { + this.onTagsChanges({tags: this.selectedTags}); } /** * Callback called when search query changed - * @param query the string to compare with tags + * @param query {string} the string to compare with tags */ - querySearch(query) { + querySearch(query: string): void { query = query.trim().toLowerCase(); let result = []; @@ -97,7 +92,7 @@ export class CheStackLibraryFilterController { } // exclude already selected tags and filter by substring - result = this.ngModel.filter((tag) => this.selectedTags.indexOf(tag) === -1 && tag.toLowerCase().indexOf(query) === 0); + result = this.stackTags.filter((tag: string) => this.selectedTags.indexOf(tag) === -1 && tag.toLowerCase().indexOf(query) === 0); this.suggestions = result; @@ -108,19 +103,19 @@ export class CheStackLibraryFilterController { // set first suggestion as selected this.$timeout(() => { - this.$scope.$broadcast('selectSuggestion'); + this.selectSuggestion(0); }); } /** * Called when user clicked on suggestion to select it - * @param tag + * @param tag {string} */ - onSelectSuggestion(tag) { + onSelectSuggestion(tag: string): void { // add tag to selected - if (this.transformChip(tag)){ + if (this.transformChip(tag)) { this.selectedTags.push(tag); - this.onAdd(tag); + this.onAdd(); } // clear suggestions and previous input diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.directive.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.directive.ts index c49e0b6abb..15056c9937 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.directive.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.directive.ts @@ -12,7 +12,7 @@ /** * @ngdoc directive - * @name projects.create.directive:cheStackLibraryFilterCtrl + * @name projects.create.directive:cheStackLibraryFilter * @restrict E * @element * @@ -21,33 +21,21 @@ * * @author Oleksii Kurinnyi */ -export class CheStackLibraryFilter { - - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor () { - this.restrict = 'E'; - this.templateUrl = 'app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.html'; - - this.controller = 'CheStackLibraryFilterController'; - this.controllerAs = 'cheStackLibraryFilterCtrl'; - - // we require ngModel as we want to use it inside our directive - this.require = 'ngModel'; - - this.bindToController = true; - - this.scope = { - ngModel: '=' - }; - } +export class CheStackLibraryFilter implements ng.IDirective { + restrict = 'E'; + templateUrl = 'app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.html'; + controller = 'CheStackLibraryFilterController'; + controllerAs = 'cheStackLibraryFilterCtrl'; + bindToController = true; + scope = { + stackTags: '=', + onTagsChanges: '&' + }; - link($scope, element) { - let ctrl = $scope.cheStackLibraryFilterCtrl; - let selectSuggestion = (element, index) => { + link($scope: ng.IScope, element: any) { + let ctrl = ($scope).cheStackLibraryFilterCtrl; + ctrl.selectSuggestion = (index: number) => { let selectionClass = 'stack-library-filter-suggestion-selected', suggestionElements = element.find('.stack-library-filter-suggestions md-chip'); @@ -59,7 +47,7 @@ export class CheStackLibraryFilter { }; // select suggestion by keys - element.bind('keypress keydown', (event) => { + element.bind('keypress keydown', (event: any) => { if (event.which === 38) { // on press 'up' // select prev suggestion @@ -67,26 +55,20 @@ export class CheStackLibraryFilter { ctrl.selectedIndex--; if (ctrl.selectedIndex < 0) { - ctrl.selectedIndex = ctrl.suggestions.length-1; + ctrl.selectedIndex = ctrl.suggestions.length - 1; } - selectSuggestion(element, ctrl.selectedIndex); - } - else if (event.which === 9 || event.which === 40) { + ctrl.selectSuggestion(ctrl.selectedIndex); + } else if (event.which === 9 || event.which === 40) { // on press 'tab' or 'down' // select next suggestion event.preventDefault(); ctrl.selectedIndex++; - if (ctrl.selectedIndex > ctrl.suggestions.length-1) { + if (ctrl.selectedIndex > ctrl.suggestions.length - 1) { ctrl.selectedIndex = 0; } - selectSuggestion(element, ctrl.selectedIndex); + ctrl.selectSuggestion(ctrl.selectedIndex); } }); - - // set first suggestion selected - $scope.$on('selectSuggestion', () => { - selectSuggestion(element, 0); - }); } } diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.directive.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.directive.ts index 5150af4000..95d3220e61 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.directive.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.directive.ts @@ -10,21 +10,28 @@ */ 'use strict'; +interface ISelecterScope extends ng.IScope { + stackId: string; + select: Function; +} /** * Defines a directive for the stack library selecter. * @author Florent Benoit */ -export class CheStackLibrarySelecter { +export class CheStackLibrarySelecter implements ng.IDirective { + restrict: string = 'E'; + templateUrl: string = 'app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.html'; + + scope: { + [propName: string]: string; + }; /** * Default constructor that is using resource * @ngInject for Dependency injection */ constructor () { - this.restrict='E'; - this.templateUrl = 'app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.html'; - // scope values this.scope = { title: '@cheTitle', @@ -36,11 +43,26 @@ export class CheStackLibrarySelecter { }; } - link($scope) { - //select item + link($scope: ISelecterScope, element: ng.IAugmentedJQuery) { + // select item $scope.select = () => { $scope.$emit('event:library:selectStackId', $scope.stackId); }; + + const jqTextWrapper = element.find('.che-stack-library-selecter-descr'), + jqText = angular.element(jqTextWrapper.find('.che-stack-library-selecter-descr-text')), + jqTextEllipsis = angular.element(jqTextWrapper.find('.che-stack-library-selecter-descr-ellipsis')); + + // show ellipsis + $scope.$watch(() => { + return jqText.get(0).clientHeight; + }, (textHeight: number) => { + if (textHeight > jqTextWrapper.get(0).clientHeight) { + jqTextEllipsis.show(); + } else { + jqTextEllipsis.hide(); + } + }); } } diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.html b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.html index 0f8b038a86..aaa11ac0c4 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.html +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.html @@ -5,8 +5,11 @@
{{title}}
-
{{text}}
-
+
+
{{text}}
+
+
+
...
diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.styl b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.styl index dc1248efd2..dad8248032 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.styl +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.styl @@ -1,4 +1,5 @@ $che-stack-library-selecter-color = $label-info-color +$che-stack-library-selecter-bg-color = #EEE .che-stack-library-selecter height 110px @@ -16,7 +17,7 @@ $che-stack-library-selecter-color = $label-info-color color $che-stack-library-selecter-color &:hover - background-color #EEE + background-color $che-stack-library-selecter-bg-color .che-stack-library-selecter md-card-content @@ -42,8 +43,8 @@ $che-stack-library-selecter-color = $label-info-color margin-left auto margin-right auto margin-top 16px - margin-bottom 0px - padding 0px + margin-bottom 0 + padding 0 height 74px width 74px @@ -54,7 +55,7 @@ $che-stack-library-selecter-color = $label-info-color &:hover color $primary-color - background-color #EEE + background-color $che-stack-library-selecter-bg-color .che-stack-library-selecter-active:hover .title background-color $primary-color @@ -90,8 +91,36 @@ che-stack-library-selecter .che-stack-library-selecter-extra-text cursor pointer margin-right 7px - margin-bottom 2px + margin-bottom 7px + line-height 5px -.che-stack-library-selecter-text +.che-stack-library-selecter-descr font-size 12px padding-left 10px + padding-right 20px + text-align justify + position relative + + $line-height = 16px + $text-height = 3 * $line-height + + overflow hidden + height $text-height !important + min-height $text-height !important + max-height $text-height !important + line-height $line-height + box-sizing content-box + + .che-stack-library-selecter-descr-ellipsis + position absolute + bottom 0 + right 20px + width 25px + display none + text-align right + + background-size 100% 100% + background linear-gradient(to right, rgba(255, 255, 255, 0), $background-color 50%, $background-color) + +.che-stack-library-selecter:hover .che-stack-library-selecter-descr-ellipsis + background linear-gradient(to right, rgba(255, 255, 255, 0), $che-stack-library-selecter-bg-color 50%, $che-stack-library-selecter-bg-color) diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-details.html b/dashboard/src/app/workspaces/workspace-details/workspace-details.html index bb35b404ab..94b7e03cb3 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-details.html +++ b/dashboard/src/app/workspaces/workspace-details/workspace-details.html @@ -69,6 +69,7 @@ layout="row" layout-align="start center"> {{workspaceDetailsController.namespaceInfo}} diff --git a/dashboard/src/app/workspaces/workspaces-config.ts b/dashboard/src/app/workspaces/workspaces-config.ts index 29b36c6026..160ab69b75 100644 --- a/dashboard/src/app/workspaces/workspaces-config.ts +++ b/dashboard/src/app/workspaces/workspaces-config.ts @@ -48,8 +48,6 @@ import {WorkspaceStatusIndicator} from './workspace-status/workspace-status-indi import {CheStackLibraryFilterController} from './workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.controller'; import {CheStackLibraryFilter} from './workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.directive'; -import {CreateProjectStackLibrarySelectedStackFilter} from './workspace-details/select-stack/stack-library/create-project-stack-library-selected-stack.filter'; - import {WorkspaceEnvironmentsController} from './workspace-details/environments/environments.controller'; import {WorkspaceEnvironments} from './workspace-details/environments/environments.directive'; import {WorkspaceMachineConfigController} from './workspace-details/environments/machine-config/machine-config.controller'; @@ -83,10 +81,7 @@ import {ListAgents} from './workspace-details/environments/list-agents/list-age */ export class WorkspacesConfig { - constructor(register) { - - new CreateProjectStackLibrarySelectedStackFilter(register); - + constructor(register: che.IRegisterService) { register.controller('WorkspaceDetailsSshCtrl', WorkspaceDetailsSshCtrl); register.directive('workspaceDetailsSsh', WorkspaceDetailsSsh); @@ -165,7 +160,7 @@ export class WorkspacesConfig { register.directive('listAgents', ListAgents); // config routes - register.app.config(function ($routeProvider) { + register.app.config(($routeProvider: any) => { $routeProvider.accessWhen('/workspaces', { title: 'Workspaces', templateUrl: 'app/workspaces/list-workspaces/list-workspaces.html', diff --git a/dashboard/src/assets/branding/product.json b/dashboard/src/assets/branding/product.json index aeab4911c7..98a27ac576 100644 --- a/dashboard/src/assets/branding/product.json +++ b/dashboard/src/assets/branding/product.json @@ -13,5 +13,9 @@ "cli" : { "configName" : "che.env", "name" : "CHE" + }, + "docs" : { + "stack" : "/docs/devops/runtime-stacks/index.html", + "workspace" : "/docs/devops/intro/index.html" } } diff --git a/dashboard/src/components/branding/che-branding.factory.ts b/dashboard/src/components/branding/che-branding.factory.ts index 22b1a8a47a..ad8f6794db 100644 --- a/dashboard/src/components/branding/che-branding.factory.ts +++ b/dashboard/src/components/branding/che-branding.factory.ts @@ -21,6 +21,7 @@ export class CheBranding { $http: ng.IHttpService; cheService: CheService; + private docs: { stack: string; workspace: string}; /** * Default constructor that is using resource * @ngInject for Dependency injection @@ -47,7 +48,7 @@ export class CheBranding { let assetPrefix = 'assets/branding/'; // load data - this.$http.get(assetPrefix + 'product.json').then((data) => { + this.$http.get(assetPrefix + 'product.json').then((data: any) => { let brandingData = data.data; @@ -62,7 +63,8 @@ export class CheBranding { helpPath : brandingData.helpPath, helpTitle : brandingData.helpTitle, supportEmail: brandingData.supportEmail, - oauthDocs: brandingData.oauthDocs + oauthDocs: brandingData.oauthDocs, + docs: brandingData.docs }; this.productName = this.$rootScope.branding.title; @@ -83,6 +85,7 @@ export class CheBranding { } else { this.cli = this.$rootScope.branding.cli; } + this.docs = this.$rootScope.branding.docs; this.deferred.resolve(this.$rootScope.branding); }); @@ -124,5 +127,13 @@ export class CheBranding { return this.cli; } + /** + * Returns object with docs URLs. + * @returns {{stack: string, workspace: string}} + */ + getDocs(): { stack: string; workspace: string } { + return this.docs; + } + } diff --git a/dashboard/src/components/typings/che.d.ts b/dashboard/src/components/typings/che.d.ts index 80005f31a5..041e3250b0 100644 --- a/dashboard/src/components/typings/che.d.ts +++ b/dashboard/src/components/typings/che.d.ts @@ -59,6 +59,7 @@ declare namespace _che { creator?: string; scope?: string; components?: Array; + links?: Array; source?: any; workspaceConfig: IWorkspaceConfig; } diff --git a/dashboard/src/components/widget/filter-selector/che-filter-selector.controller.ts b/dashboard/src/components/widget/filter-selector/che-filter-selector.controller.ts index 1cfd28301e..20e7978280 100644 --- a/dashboard/src/components/widget/filter-selector/che-filter-selector.controller.ts +++ b/dashboard/src/components/widget/filter-selector/che-filter-selector.controller.ts @@ -18,6 +18,7 @@ export class CheFilterSelectorController { private valueModel: string; + private width: string; private onChange: Function; /** @@ -25,8 +26,10 @@ export class CheFilterSelectorController { * @ngInject for Dependency injection */ constructor() { + this.width = this.width || '150px'; } + /** * Performs value selection and calls value changed handler. * diff --git a/dashboard/src/components/widget/filter-selector/che-filter-selector.directive.ts b/dashboard/src/components/widget/filter-selector/che-filter-selector.directive.ts index d2452c0b91..1f5cf3210f 100644 --- a/dashboard/src/components/widget/filter-selector/che-filter-selector.directive.ts +++ b/dashboard/src/components/widget/filter-selector/che-filter-selector.directive.ts @@ -36,7 +36,8 @@ export class CheFilterSelector { valueModel: '=ngModel', values: '=cheValues', isDisabled: '=cheDisabled', - onChange: '=cheOnChange' + onChange: '=cheOnChange', + width: '@?cheWidth' }; } } diff --git a/dashboard/src/components/widget/filter-selector/che-filter-selector.html b/dashboard/src/components/widget/filter-selector/che-filter-selector.html index abdfef05e2..225d04e948 100644 --- a/dashboard/src/components/widget/filter-selector/che-filter-selector.html +++ b/dashboard/src/components/widget/filter-selector/che-filter-selector.html @@ -1,5 +1,5 @@ -
+
{{cheFilterSelectorController.valueModel}} @@ -7,7 +7,7 @@
- + diff --git a/dashboard/src/components/widget/filter-selector/che-filter-selector.styl b/dashboard/src/components/widget/filter-selector/che-filter-selector.styl index 7498a5675f..f73eeff771 100644 --- a/dashboard/src/components/widget/filter-selector/che-filter-selector.styl +++ b/dashboard/src/components/widget/filter-selector/che-filter-selector.styl @@ -1,15 +1,20 @@ .che-filter-selector outline none + min-width 150px md-open-menu-container min-width 150px + md-menu-item + overflow-x hidden + text-overflow ellipsis + display inline !important + .che-filter-selector-button min-height 35px height 100% color $primary-color border 1px solid $primary-color - max-width 200px border-radius 2px padding 0px 10px outline none diff --git a/dockerfiles/base/scripts/base/library.sh b/dockerfiles/base/scripts/base/library.sh index 4030fd1120..940faf43e3 100644 --- a/dockerfiles/base/scripts/base/library.sh +++ b/dockerfiles/base/scripts/base/library.sh @@ -38,7 +38,7 @@ get_display_url() { CHE_HOST_LOCAL=$(get_value_of_var_from_env_file ${CHE_PRODUCT_NAME}_HOST) fi - if ! is_docker_for_mac; then + if ! is_docker_for_mac && ! is_docker_for_windows; then echo "http://${CHE_HOST_LOCAL}:${CHE_PORT}" else echo "http://localhost:${CHE_PORT}" @@ -55,7 +55,7 @@ get_debug_display_url() { fi fi - if ! is_docker_for_mac; then + if ! is_docker_for_mac && ! is_docker_for_windows; then echo "http://${CHE_HOST}:${CHE_DEBUG_PORT_LOCAL}" else echo "http://localhost:${CHE_DEBUG_PORT_LOCAL}" diff --git a/dockerfiles/cli/version/5.11.0/images b/dockerfiles/cli/version/5.11.0/images new file mode 100644 index 0000000000..dbf467564b --- /dev/null +++ b/dockerfiles/cli/version/5.11.0/images @@ -0,0 +1,3 @@ +IMAGE_INIT=eclipse/che-init:5.11.0 +IMAGE_CHE=eclipse/che-server:5.11.0 +IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.11.0/images-stacks b/dockerfiles/cli/version/5.11.0/images-stacks new file mode 100644 index 0000000000..4630f02af6 --- /dev/null +++ b/dockerfiles/cli/version/5.11.0/images-stacks @@ -0,0 +1,24 @@ +eclipse/alpine_jdk8 +eclipse/aspnet +eclipse/centos_jdk8 +eclipse/cpp_gcc +eclipse/debian_jdk8 +eclipse/debian_jdk8_node +eclipse/debian_jre +eclipse/dotnet_core +eclipse/hadoop-dev +eclipse/meteor +eclipse/node +eclipse/php +eclipse/platformio +eclipse/ruby_rails +eclipse/selenium +eclipse/ubuntu_android +eclipse/ubuntu_go +eclipse/ubuntu_gradle +eclipse/ubuntu_jdk8 +eclipse/ubuntu_jre +eclipse/ubuntu_python +eclipse/ubuntu_wildfly8 +registry.centos.org/che-stacks/vertx + diff --git a/dockerfiles/cli/version/5.9.1/images b/dockerfiles/cli/version/5.9.1/images new file mode 100644 index 0000000000..b68ed6f641 --- /dev/null +++ b/dockerfiles/cli/version/5.9.1/images @@ -0,0 +1,3 @@ +IMAGE_INIT=eclipse/che-init:5.9.1 +IMAGE_CHE=eclipse/che-server:5.9.1 +IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.9.1/images-stacks b/dockerfiles/cli/version/5.9.1/images-stacks new file mode 100644 index 0000000000..4630f02af6 --- /dev/null +++ b/dockerfiles/cli/version/5.9.1/images-stacks @@ -0,0 +1,24 @@ +eclipse/alpine_jdk8 +eclipse/aspnet +eclipse/centos_jdk8 +eclipse/cpp_gcc +eclipse/debian_jdk8 +eclipse/debian_jdk8_node +eclipse/debian_jre +eclipse/dotnet_core +eclipse/hadoop-dev +eclipse/meteor +eclipse/node +eclipse/php +eclipse/platformio +eclipse/ruby_rails +eclipse/selenium +eclipse/ubuntu_android +eclipse/ubuntu_go +eclipse/ubuntu_gradle +eclipse/ubuntu_jdk8 +eclipse/ubuntu_jre +eclipse/ubuntu_python +eclipse/ubuntu_wildfly8 +registry.centos.org/che-stacks/vertx + diff --git a/dockerfiles/cli/version/latest.ver b/dockerfiles/cli/version/latest.ver index cf51361190..c355d6e218 100644 --- a/dockerfiles/cli/version/latest.ver +++ b/dockerfiles/cli/version/latest.ver @@ -1 +1 @@ -5.9.0 \ No newline at end of file +5.10.0 \ No newline at end of file diff --git a/dockerfiles/lib/dto-pom.xml b/dockerfiles/lib/dto-pom.xml index ff28636084..fce8c2cbe0 100644 --- a/dockerfiles/lib/dto-pom.xml +++ b/dockerfiles/lib/dto-pom.xml @@ -17,13 +17,13 @@ maven-depmgt-pom org.eclipse.che.depmgt - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT dto-typescript pom Che TypeScript DTO - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT diff --git a/ide/che-core-dyna-provider-generator-maven-plugin/pom.xml b/ide/che-core-dyna-provider-generator-maven-plugin/pom.xml index 3feaaca89f..a78a13a758 100644 --- a/ide/che-core-dyna-provider-generator-maven-plugin/pom.xml +++ b/ide/che-core-dyna-provider-generator-maven-plugin/pom.xml @@ -16,7 +16,7 @@ che-core-ide-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-dyna-provider-generator-maven-plugin maven-plugin diff --git a/ide/che-core-ide-api/pom.xml b/ide/che-core-ide-api/pom.xml index 041e2cb20a..af0033a2d2 100644 --- a/ide/che-core-ide-api/pom.xml +++ b/ide/che-core-ide-api/pom.xml @@ -16,7 +16,7 @@ che-core-ide-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.core che-core-ide-api diff --git a/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/command/CommandImpl.java b/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/command/CommandImpl.java index 0f803b1596..c5e5371abe 100644 --- a/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/command/CommandImpl.java +++ b/ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/command/CommandImpl.java @@ -13,13 +13,13 @@ package org.eclipse.che.ide.api.command; import org.eclipse.che.api.core.model.workspace.config.Command; import org.eclipse.che.commons.annotation.Nullable; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; +import java.util.HashSet; import java.util.Map; import java.util.Objects; +import java.util.Set; -import static java.util.Collections.unmodifiableList; +import static java.util.Collections.unmodifiableSet; import static org.eclipse.che.api.workspace.shared.Constants.COMMAND_GOAL_ATTRIBUTE_NAME; import static org.eclipse.che.api.workspace.shared.Constants.COMMAND_PREVIEW_URL_ATTRIBUTE_NAME; @@ -192,30 +192,30 @@ public class CommandImpl implements Command { /** Defines the context in which command is applicable. */ public static class ApplicableContext { - private boolean workspaceApplicable; - private List projects; + private boolean workspaceApplicable; + private Set projects; /** Creates new {@link ApplicableContext} which is workspace applicable. */ public ApplicableContext() { workspaceApplicable = true; - projects = new ArrayList<>(); + projects = new HashSet<>(); } /** Creates new {@link ApplicableContext} which is applicable to the single project only. */ public ApplicableContext(String projectPath) { - projects = new ArrayList<>(); + projects = new HashSet<>(); projects.add(projectPath); } /** Creates new {@link ApplicableContext} based on the provided data. */ - public ApplicableContext(boolean workspaceApplicable, List projects) { + public ApplicableContext(boolean workspaceApplicable, Set projects) { this.workspaceApplicable = workspaceApplicable; this.projects = projects; } /** Creates copy of the given {@code context}. */ public ApplicableContext(ApplicableContext context) { - this(context.isWorkspaceApplicable(), new ArrayList<>(context.getApplicableProjects())); + this(context.isWorkspaceApplicable(), new HashSet<>(context.getApplicableProjects())); } /** Returns {@code true} if command is applicable to the workspace and {@code false} otherwise. */ @@ -229,8 +229,8 @@ public class CommandImpl implements Command { } /** Returns immutable list of the paths of the applicable projects. */ - public List getApplicableProjects() { - return unmodifiableList(projects); + public Set getApplicableProjects() { + return unmodifiableSet(projects); } /** Adds applicable project's path. */ diff --git a/ide/che-core-ide-app/pom.xml b/ide/che-core-ide-app/pom.xml index f94273174e..4e458a37b9 100644 --- a/ide/che-core-ide-app/pom.xml +++ b/ide/che-core-ide-app/pom.xml @@ -16,7 +16,7 @@ che-core-ide-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-ide-app jar diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/command/editor/page/project/ProjectsPage.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/command/editor/page/project/ProjectsPage.java index f4bf82d0dc..ed6c454bf4 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/command/editor/page/project/ProjectsPage.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/command/editor/page/project/ProjectsPage.java @@ -26,10 +26,10 @@ import org.eclipse.che.ide.command.editor.EditorMessages; import org.eclipse.che.ide.command.editor.page.AbstractCommandEditorPage; import org.eclipse.che.ide.command.editor.page.CommandEditorPage; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; +import java.util.HashSet; import java.util.Map; +import java.util.Set; /** Presenter for {@link CommandEditorPage} which allows to edit command's applicable projects. */ public class ProjectsPage extends AbstractCommandEditorPage implements ProjectsPageView.ActionDelegate, @@ -39,7 +39,7 @@ public class ProjectsPage extends AbstractCommandEditorPage implements ProjectsP private final AppContext appContext; /** Initial value of the applicable projects list. */ - private List applicableProjectsInitial; + private Set applicableProjectsInitial; @Inject public ProjectsPage(ProjectsPageView view, @@ -65,7 +65,7 @@ public class ProjectsPage extends AbstractCommandEditorPage implements ProjectsP protected void initialize() { final ApplicableContext context = editedCommand.getApplicableContext(); - applicableProjectsInitial = new ArrayList<>(context.getApplicableProjects()); + applicableProjectsInitial = new HashSet<>(context.getApplicableProjects()); refreshProjects(); } diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/command/manager/CommandManagerImpl.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/command/manager/CommandManagerImpl.java index 99089db7d0..93777e6159 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/command/manager/CommandManagerImpl.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/command/manager/CommandManagerImpl.java @@ -45,6 +45,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; import static java.util.stream.Collectors.toList; import static org.eclipse.che.api.core.model.workspace.WorkspaceStatus.RUNNING; @@ -166,7 +167,7 @@ public class CommandManagerImpl implements CommandManager { /** Checks whether the given command is applicable to the current project. */ private boolean isCommandApplicableToCurrentProject(CommandImpl command) { - final List applicableProjects = command.getApplicableContext().getApplicableProjects(); + final Set applicableProjects = command.getApplicableContext().getApplicableProjects(); if (applicableProjects.isEmpty()) { return true; diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/panel/ProcessesPanelPresenter.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/panel/ProcessesPanelPresenter.java index ba6788d4f5..3a44e3b888 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/panel/ProcessesPanelPresenter.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/processes/panel/ProcessesPanelPresenter.java @@ -925,7 +925,12 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP @Nullable private MachineEntity getMachine(@NotNull String machineId) { - List wsMachines = getMachines(appContext.getWorkspace()); + Workspace workspace = appContext.getWorkspace(); + if (workspace == null) { + return null; + } + + List wsMachines = getMachines(workspace); for (MachineEntity machine : wsMachines) { if (machineId.equals(machine.getId())) { return machine; diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/CustomKeyDownTerminalHandler.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/CustomKeyDownTerminalHandler.java new file mode 100644 index 0000000000..13a581af4d --- /dev/null +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/CustomKeyDownTerminalHandler.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * 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.terminal; + +import com.google.gwt.core.client.JavaScriptObject; + +/** + * Custom keyDown handler for {@link TerminalJso} + * + * @author Alexander Andrienko + */ +public class CustomKeyDownTerminalHandler extends JavaScriptObject { + protected CustomKeyDownTerminalHandler() { + } + + public static native CustomKeyDownTerminalHandler create() /*-{ + return function(ev) { + var C = 67; + var V = 86; + if (ev.ctrlKey && !(ev.shiftKey || ev.metaKey || ev.altKey)) { + + //handle Ctrl + V + if (ev.keyCode === V) { + return false; + } + + var selection = this.document.getSelection(), + collapsed = selection.isCollapsed, + isRange = typeof collapsed === 'boolean' ? !collapsed : selection.type === 'Range'; + + //handle Ctrl + C + if (ev.keyCode === C && isRange) { + return false; + } + } + } + }-*/; +} diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalJso.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalJso.java index e46023f3ae..8225faa530 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalJso.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalJso.java @@ -19,6 +19,7 @@ import org.eclipse.che.api.promises.client.Operation; * GWT binding to term.js script * * @author Evgen Vidolob + * @author Alexander Andrienko */ class TerminalJso extends JavaScriptObject { protected TerminalJso() { @@ -32,6 +33,10 @@ class TerminalJso extends JavaScriptObject { this.open(element); }-*/; + public final native void attachCustomKeyDownHandler(JavaScriptObject customKeyDownHandler) /*-{ + this.attachCustomKeydownHandler(customKeyDownHandler); + }-*/; + public final native Element getElement() /*-{ return this.element; }-*/; diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalViewImpl.java b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalViewImpl.java index 859891f644..2f59013eb1 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalViewImpl.java +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalViewImpl.java @@ -16,9 +16,8 @@ import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.Label; -import com.google.gwt.user.client.ui.RequiresResize; +import com.google.gwt.user.client.ui.ResizeLayoutPanel; import com.google.gwt.user.client.ui.Widget; import javax.validation.constraints.NotNull; @@ -28,7 +27,7 @@ import javax.validation.constraints.NotNull; * * @author Dmitry Shnurenko */ -final class TerminalViewImpl extends Composite implements TerminalView, RequiresResize { +final class TerminalViewImpl extends Composite implements TerminalView { interface TerminalViewImplUiBinder extends UiBinder { } @@ -36,15 +35,15 @@ final class TerminalViewImpl extends Composite implements TerminalView, Requires private final static TerminalViewImplUiBinder UI_BINDER = GWT.create(TerminalViewImplUiBinder.class); @UiField - FlowPanel terminalPanel; + ResizeLayoutPanel terminalPanel; @UiField - Label unavailableLabel; + Label unavailableLabel; private ActionDelegate delegate; private TerminalJso terminal; - private Element terminalElement; + private Element terminalElement; public TerminalViewImpl() { initWidget(UI_BINDER.createAndBindUi(this)); @@ -66,10 +65,18 @@ final class TerminalViewImpl extends Composite implements TerminalView, Requires terminalElement.getStyle().setProperty("opacity", "0"); terminal.open(terminalPanel.getElement()); + terminal.attachCustomKeyDownHandler(CustomKeyDownTerminalHandler.create()); + resizeTerminal(); terminalElement.getFirstChildElement().getStyle().clearProperty("backgroundColor"); terminalElement.getFirstChildElement().getStyle().clearProperty("color"); terminalElement.getStyle().clearProperty("opacity"); + + terminalPanel.addResizeHandler(resizeEvent -> { + if (terminalElement != null && isVisible()) { + resizeTimer.schedule(200); + } + }); } /** {@inheritDoc} */ @@ -81,20 +88,6 @@ final class TerminalViewImpl extends Composite implements TerminalView, Requires terminalPanel.setVisible(false); } - /** - * Resize {@link TerminalJso} to current widget size. - * To improve performance we should resize only visible terminals, - * because "resize terminal" is quite expensive operation. When you - * click on the tab to activate hidden terminal this method will be - * executed too, so terminal will be resized anyway. - */ - @Override - public void onResize() { - if (terminalElement != null && isVisible()) { - resizeTimer.schedule(200); - } - } - private Timer resizeTimer = new Timer() { @Override public void run() { diff --git a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalViewImpl.ui.xml b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalViewImpl.ui.xml index 57d9cc8fae..ac0698c65f 100644 --- a/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalViewImpl.ui.xml +++ b/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/terminal/TerminalViewImpl.ui.xml @@ -50,6 +50,6 @@ - + diff --git a/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/editor/page/project/ProjectsPageTest.java b/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/editor/page/project/ProjectsPageTest.java index 2d6abf9886..0c5e15469a 100644 --- a/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/editor/page/project/ProjectsPageTest.java +++ b/ide/che-core-ide-app/src/test/java/org/eclipse/che/ide/command/editor/page/project/ProjectsPageTest.java @@ -30,9 +30,9 @@ import org.mockito.Captor; import org.mockito.InjectMocks; import org.mockito.Mock; -import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; import java.util.Map; +import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -148,7 +148,7 @@ public class ProjectsPageTest { } private void setUpApplicableProjectToContext() { - List applicableProjects = new ArrayList<>(); + Set applicableProjects = new HashSet<>(); applicableProjects.add(PROJECT_PATH); when(applicableContext.getApplicableProjects()).thenReturn(applicableProjects); } diff --git a/ide/che-core-ide-generators/pom.xml b/ide/che-core-ide-generators/pom.xml index b3a7109c3a..79d8651963 100644 --- a/ide/che-core-ide-generators/pom.xml +++ b/ide/che-core-ide-generators/pom.xml @@ -16,7 +16,7 @@ che-core-ide-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.core che-core-ide-generators diff --git a/ide/che-core-ide-stacks/pom.xml b/ide/che-core-ide-stacks/pom.xml index c90d9b5047..1debddf31e 100644 --- a/ide/che-core-ide-stacks/pom.xml +++ b/ide/che-core-ide-stacks/pom.xml @@ -16,7 +16,7 @@ che-core-ide-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.core che-core-ide-stacks diff --git a/ide/che-core-ide-templates/pom.xml b/ide/che-core-ide-templates/pom.xml index 932387c666..c7de065d87 100644 --- a/ide/che-core-ide-templates/pom.xml +++ b/ide/che-core-ide-templates/pom.xml @@ -16,7 +16,7 @@ che-core-ide-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.core che-core-ide-templates diff --git a/ide/che-core-ide-ui/pom.xml b/ide/che-core-ide-ui/pom.xml index 2d0504535d..a63ffcac0b 100644 --- a/ide/che-core-ide-ui/pom.xml +++ b/ide/che-core-ide-ui/pom.xml @@ -16,7 +16,7 @@ che-core-ide-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.core che-core-ide-ui diff --git a/ide/che-core-ide-ui/src/main/resources/org/eclipse/che/ide/ui/logo/che-logo.svg b/ide/che-core-ide-ui/src/main/resources/org/eclipse/che/ide/ui/logo/che-logo.svg index 6efae20346..984503d633 100644 --- a/ide/che-core-ide-ui/src/main/resources/org/eclipse/che/ide/ui/logo/che-logo.svg +++ b/ide/che-core-ide-ui/src/main/resources/org/eclipse/che/ide/ui/logo/che-logo.svg @@ -11,7 +11,7 @@ Codenvy, S.A. - initial API and implementation --> - + diff --git a/ide/che-core-orion-editor/pom.xml b/ide/che-core-orion-editor/pom.xml index 75e7f8fc9f..2bb84e29d6 100644 --- a/ide/che-core-orion-editor/pom.xml +++ b/ide/che-core-orion-editor/pom.xml @@ -16,7 +16,7 @@ che-core-ide-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-orion-editor jar diff --git a/ide/che-ide-core/pom.xml b/ide/che-ide-core/pom.xml index 218efb6609..3241827654 100644 --- a/ide/che-ide-core/pom.xml +++ b/ide/che-ide-core/pom.xml @@ -16,7 +16,7 @@ che-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../../pom.xml org.eclipse.che.core diff --git a/ide/commons-gwt/pom.xml b/ide/commons-gwt/pom.xml index 31c0bfacde..658d23b41e 100644 --- a/ide/commons-gwt/pom.xml +++ b/ide/commons-gwt/pom.xml @@ -16,7 +16,7 @@ che-core-ide-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-commons-gwt Che Core :: Commons :: GWT diff --git a/ide/pom.xml b/ide/pom.xml index 7f80d1299e..45756ae828 100644 --- a/ide/pom.xml +++ b/ide/pom.xml @@ -16,7 +16,7 @@ che-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml org.eclipse.che.core diff --git a/infrastructures/docker/pom.xml b/infrastructures/docker/pom.xml index b267595ed4..501b093189 100644 --- a/infrastructures/docker/pom.xml +++ b/infrastructures/docker/pom.xml @@ -16,7 +16,7 @@ che-infrastructures-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml infrastructure-docker @@ -66,6 +66,10 @@ javax.ws.rs javax.ws.rs-api + + org.antlr + ST4 + org.eclipse.che.core che-core-api-agent diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/ServiceStarter.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/ServiceStarter.java index 01bfcea4a1..77f33bb581 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/ServiceStarter.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/ServiceStarter.java @@ -145,6 +145,7 @@ public class ServiceStarter { private final WindowsPathEscaper windowsPathEscaper; private final String[] dnsResolvers; private ServerEvaluationStrategyProvider serverEvaluationStrategyProvider; + private final Map buildArgs; @Inject public ServiceStarter(DockerConnector docker, @@ -169,7 +170,8 @@ public class ServiceStarter { WindowsPathEscaper windowsPathEscaper, @Named("che.docker.extra_hosts") Set> additionalHosts, @Nullable @Named("che.docker.dns_resolvers") String[] dnsResolvers, - ServerEvaluationStrategyProvider serverEvaluationStrategyProvider) { + ServerEvaluationStrategyProvider serverEvaluationStrategyProvider, + @Named("che.docker.build_args") Map buildArgs) { this.docker = docker; this.dockerCredentials = dockerCredentials; this.dockerInstanceStopDetector = dockerInstanceStopDetector; @@ -192,6 +194,7 @@ public class ServiceStarter { this.windowsPathEscaper = windowsPathEscaper; this.pidsLimit = pidsLimit; this.dnsResolvers = dnsResolvers; + this.buildArgs = buildArgs; this.serverEvaluationStrategyProvider = serverEvaluationStrategyProvider; allMachinesSystemVolumes = removeEmptyAndNullValues(allMachinesSystemVolumes); @@ -370,6 +373,14 @@ public class ServiceStarter { buildImageParams = BuildImageParams.create(service.getBuild().getContext()) .withDockerfile(service.getBuild().getDockerfilePath()); } + Map buildArgs; + if (service.getBuild().getArgs() == null || service.getBuild().getArgs().isEmpty()) { + buildArgs = this.buildArgs; + } else { + buildArgs = new HashMap<>(); + buildArgs.putAll(service.getBuild().getArgs()); + buildArgs.putAll(this.buildArgs); + } buildImageParams.withForceRemoveIntermediateContainers(true) .withRepository(machineImageName) .withAuthConfigs(dockerCredentials.getCredentials()) @@ -379,7 +390,7 @@ public class ServiceStarter { .withCpusetCpus(cpusetCpus) .withCpuPeriod(cpuPeriod) .withCpuQuota(cpuQuota) - .withBuildArgs(service.getBuild().getArgs()); + .withBuildArgs(buildArgs); docker.buildImage(buildImageParams, progressMonitor); } catch (IOException e) { diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/config/proxy/DockerProxyModule.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/config/proxy/DockerProxyModule.java index 703f51f983..bb704d7926 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/config/proxy/DockerProxyModule.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/config/proxy/DockerProxyModule.java @@ -11,9 +11,12 @@ package org.eclipse.che.workspace.infrastructure.docker.config.proxy; import com.google.inject.AbstractModule; +import com.google.inject.TypeLiteral; import com.google.inject.multibindings.Multibinder; import com.google.inject.name.Names; +import java.util.Map; + /** * Module that injects components needed to run docker machines behind proxies. * diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/LocalDockerModule.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/LocalDockerModule.java index 2fd2dd279d..1c08174d71 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/LocalDockerModule.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/LocalDockerModule.java @@ -40,6 +40,8 @@ FIXME: spi .to(org.eclipse.che.plugin.docker.machine.DefaultServerEvaluationStrategy.class); strategies.addBinding("docker-local") .to(org.eclipse.che.plugin.docker.machine.LocalDockerServerEvaluationStrategy.class); + strategies.addBinding("custom") + .to(org.eclipse.che.plugin.docker.machine.CustomServerEvaluationStrategy.class); bind(org.eclipse.che.workspace.infrastructure.docker.old.local.node.WorkspaceFolderPathProvider.class) .to(org.eclipse.che.workspace.infrastructure.docker.old.provider.LocalWorkspaceFolderPathProvider.class); diff --git a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/node/DockerNode.java b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/node/DockerNode.java index b9a6545e09..99e5d3f4e3 100644 --- a/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/node/DockerNode.java +++ b/infrastructures/docker/src/main/java/org/eclipse/che/workspace/infrastructure/docker/old/local/node/DockerNode.java @@ -11,6 +11,7 @@ package org.eclipse.che.workspace.infrastructure.docker.old.local.node; import org.eclipse.che.api.core.ServerException; +import org.eclipse.che.api.environment.server.exception.EnvironmentException; /** * Provides access to operation machines need but not supported by the Docker @@ -21,10 +22,12 @@ public interface DockerNode { /** * Bind the whole workspace on the Node. * + * @throws EnvironmentException + * if environment in abnormal state because of problem with machines * @throws ServerException - * if error occurs on binding + * if other error occurs on binding */ - void bindWorkspace() throws ServerException; + void bindWorkspace() throws ServerException, EnvironmentException; /** * Unbind the workspace on Node. diff --git a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/old/MachineProviderImplTest.java b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/old/MachineProviderImplTest.java index 275d29ca23..f1beb70c58 100644 --- a/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/old/MachineProviderImplTest.java +++ b/infrastructures/docker/src/test/java/org/eclipse/che/workspace/infrastructure/docker/old/MachineProviderImplTest.java @@ -67,6 +67,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import static java.util.Arrays.asList; +import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; import static java.util.Collections.singleton; import static java.util.Collections.singletonMap; @@ -1751,7 +1752,6 @@ public class MachineProviderImplTest { return this; } - MachineProviderImpl build() throws IOException { return new MachineProviderImpl(new MockConnectorProvider(), credentialsReader, @@ -1778,7 +1778,8 @@ public class MachineProviderImplTest { cpuQuota, pathEscaper, extraHosts, - dnsResolvers); + dnsResolvers, + emptyMap()); } } } diff --git a/infrastructures/pom.xml b/infrastructures/pom.xml index b221541ef8..a2a0e42b18 100644 --- a/infrastructures/pom.xml +++ b/infrastructures/pom.xml @@ -16,11 +16,11 @@ che-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-infrastructures-parent - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT pom Che Infrastructures Parent diff --git a/plugins/plugin-composer/che-plugin-composer-ide/pom.xml b/plugins/plugin-composer/che-plugin-composer-ide/pom.xml index 6b0c954e83..a8fa798d27 100644 --- a/plugins/plugin-composer/che-plugin-composer-ide/pom.xml +++ b/plugins/plugin-composer/che-plugin-composer-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-composer-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-composer-ide jar diff --git a/plugins/plugin-composer/che-plugin-composer-server/pom.xml b/plugins/plugin-composer/che-plugin-composer-server/pom.xml index 25bed93a1d..88d5e80a2b 100644 --- a/plugins/plugin-composer/che-plugin-composer-server/pom.xml +++ b/plugins/plugin-composer/che-plugin-composer-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-composer-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-composer-server Che Plugin :: Composer :: Server diff --git a/plugins/plugin-composer/che-plugin-composer-shared/pom.xml b/plugins/plugin-composer/che-plugin-composer-shared/pom.xml index 5d468350f4..2a73abbdc9 100644 --- a/plugins/plugin-composer/che-plugin-composer-shared/pom.xml +++ b/plugins/plugin-composer/che-plugin-composer-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-composer-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-composer-shared Che Plugin :: Composer :: Shared diff --git a/plugins/plugin-composer/pom.xml b/plugins/plugin-composer/pom.xml index 05df4fae45..c8a83dcdac 100644 --- a/plugins/plugin-composer/pom.xml +++ b/plugins/plugin-composer/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-composer-parent diff --git a/plugins/plugin-cpp/che-plugin-cpp-lang-ide/pom.xml b/plugins/plugin-cpp/che-plugin-cpp-lang-ide/pom.xml index dc8c0e417a..a5f3e51084 100644 --- a/plugins/plugin-cpp/che-plugin-cpp-lang-ide/pom.xml +++ b/plugins/plugin-cpp/che-plugin-cpp-lang-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-cpp-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-cpp-lang-ide jar diff --git a/plugins/plugin-cpp/che-plugin-cpp-lang-server/pom.xml b/plugins/plugin-cpp/che-plugin-cpp-lang-server/pom.xml index 2fc65cb888..9c9cac0884 100644 --- a/plugins/plugin-cpp/che-plugin-cpp-lang-server/pom.xml +++ b/plugins/plugin-cpp/che-plugin-cpp-lang-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-cpp-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-cpp-lang-server Che Plugin :: C/C++ :: Extension Server diff --git a/plugins/plugin-cpp/che-plugin-cpp-lang-shared/pom.xml b/plugins/plugin-cpp/che-plugin-cpp-lang-shared/pom.xml index d4217edd66..5c7788595c 100644 --- a/plugins/plugin-cpp/che-plugin-cpp-lang-shared/pom.xml +++ b/plugins/plugin-cpp/che-plugin-cpp-lang-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-cpp-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-cpp-lang-shared Che Plugin :: C/C++ :: Shared diff --git a/plugins/plugin-cpp/pom.xml b/plugins/plugin-cpp/pom.xml index 01501a9d04..fbf07a85e8 100644 --- a/plugins/plugin-cpp/pom.xml +++ b/plugins/plugin-cpp/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-cpp-parent diff --git a/plugins/plugin-csharp/che-plugin-csharp-lang-ide/pom.xml b/plugins/plugin-csharp/che-plugin-csharp-lang-ide/pom.xml index 852fbca588..99304d346f 100644 --- a/plugins/plugin-csharp/che-plugin-csharp-lang-ide/pom.xml +++ b/plugins/plugin-csharp/che-plugin-csharp-lang-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-csharp-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-csharp-lang-ide jar diff --git a/plugins/plugin-csharp/che-plugin-csharp-lang-server/pom.xml b/plugins/plugin-csharp/che-plugin-csharp-lang-server/pom.xml index 770250ee85..3ff7c6743c 100644 --- a/plugins/plugin-csharp/che-plugin-csharp-lang-server/pom.xml +++ b/plugins/plugin-csharp/che-plugin-csharp-lang-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-csharp-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-csharp-lang-server Che Plugin :: C# :: Extension Server diff --git a/plugins/plugin-csharp/che-plugin-csharp-lang-shared/pom.xml b/plugins/plugin-csharp/che-plugin-csharp-lang-shared/pom.xml index e753b356fd..25fd1526e3 100644 --- a/plugins/plugin-csharp/che-plugin-csharp-lang-shared/pom.xml +++ b/plugins/plugin-csharp/che-plugin-csharp-lang-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-csharp-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-csharp-lang-shared Che Plugin :: C# :: Shared diff --git a/plugins/plugin-csharp/pom.xml b/plugins/plugin-csharp/pom.xml index 477576f2aa..dc1a86e8b9 100644 --- a/plugins/plugin-csharp/pom.xml +++ b/plugins/plugin-csharp/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-csharp-parent diff --git a/plugins/plugin-dashboard/che-plugin-ext-dashboard/pom.xml b/plugins/plugin-dashboard/che-plugin-ext-dashboard/pom.xml index 87f9ba49a3..baa5e450bc 100644 --- a/plugins/plugin-dashboard/che-plugin-ext-dashboard/pom.xml +++ b/plugins/plugin-dashboard/che-plugin-ext-dashboard/pom.xml @@ -16,7 +16,7 @@ che-plugin-dashboard-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-ext-dashboard-client jar diff --git a/plugins/plugin-dashboard/pom.xml b/plugins/plugin-dashboard/pom.xml index 22ec763f1b..b26e999c96 100644 --- a/plugins/plugin-dashboard/pom.xml +++ b/plugins/plugin-dashboard/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-dashboard-parent diff --git a/plugins/plugin-debugger/che-plugin-debugger-ide/pom.xml b/plugins/plugin-debugger/che-plugin-debugger-ide/pom.xml index 45b7e56240..871f9657d2 100644 --- a/plugins/plugin-debugger/che-plugin-debugger-ide/pom.xml +++ b/plugins/plugin-debugger/che-plugin-debugger-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-debugger-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-debugger-ide jar diff --git a/plugins/plugin-debugger/che-plugin-debugger-ide/src/main/java/org/eclipse/che/plugin/debugger/ide/debug/VariableNodeDataAdapter.java b/plugins/plugin-debugger/che-plugin-debugger-ide/src/main/java/org/eclipse/che/plugin/debugger/ide/debug/VariableNodeDataAdapter.java index e59576abd3..e7e5522721 100644 --- a/plugins/plugin-debugger/che-plugin-debugger-ide/src/main/java/org/eclipse/che/plugin/debugger/ide/debug/VariableNodeDataAdapter.java +++ b/plugins/plugin-debugger/che-plugin-debugger-ide/src/main/java/org/eclipse/che/plugin/debugger/ide/debug/VariableNodeDataAdapter.java @@ -91,13 +91,13 @@ public class VariableNodeDataAdapter implements NodeDataAdapter /** {@inheritDoc} */ @Override - public void setNodeName(@NotNull MutableVariable data,@NotNull String name) { + public void setNodeName(@NotNull MutableVariable data, @NotNull String name) { // do nothing } /** {@inheritDoc} */ @Override - public void setRenderedTreeNode(@NotNull MutableVariable data,@NotNull TreeNodeElement renderedNode) { + public void setRenderedTreeNode(@NotNull MutableVariable data, @NotNull TreeNodeElement renderedNode) { treeNodeElements.put(data, renderedNode); } @@ -118,7 +118,7 @@ public class VariableNodeDataAdapter implements NodeDataAdapter /** {@inheritDoc} */ @Override @Nullable - public MutableVariable getNodeByPath(@NotNull MutableVariable root,@NotNull List relativeNodePath) { + public MutableVariable getNodeByPath(@NotNull MutableVariable root, @NotNull List relativeNodePath) { MutableVariable localRoot = root; for (int i = 0; i < relativeNodePath.size(); i++) { String path = relativeNodePath.get(i); @@ -126,7 +126,7 @@ public class VariableNodeDataAdapter implements NodeDataAdapter List variables = new ArrayList<>(localRoot.getVariables()); localRoot = null; for (int j = 0; j < variables.size(); j++) { - MutableVariable variable = variables.get(i); + MutableVariable variable = variables.get(j); if (variable.getName().equals(path)) { localRoot = variable; break; diff --git a/plugins/plugin-debugger/pom.xml b/plugins/plugin-debugger/pom.xml index d6846e7c18..51e3e545a6 100644 --- a/plugins/plugin-debugger/pom.xml +++ b/plugins/plugin-debugger/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-debugger-parent diff --git a/plugins/plugin-docker/che-plugin-docker-client/pom.xml b/plugins/plugin-docker/che-plugin-docker-client/pom.xml index 2dd2ea1163..edc224ae5c 100644 --- a/plugins/plugin-docker/che-plugin-docker-client/pom.xml +++ b/plugins/plugin-docker/che-plugin-docker-client/pom.xml @@ -16,7 +16,7 @@ che-plugin-docker-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-docker-client jar diff --git a/plugins/plugin-docker/che-plugin-docker-machine/src/main/java/org/eclipse/che/plugin/docker/machine/CustomServerEvaluationStrategy.java b/plugins/plugin-docker/che-plugin-docker-machine/src/main/java/org/eclipse/che/plugin/docker/machine/CustomServerEvaluationStrategy.java new file mode 100644 index 0000000000..82ac8505d1 --- /dev/null +++ b/plugins/plugin-docker/che-plugin-docker-machine/src/main/java/org/eclipse/che/plugin/docker/machine/CustomServerEvaluationStrategy.java @@ -0,0 +1,396 @@ +/******************************************************************************* + * 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.plugin.docker.machine; + +import com.google.common.base.Strings; +import com.google.inject.Inject; +import com.google.inject.name.Named; + +import org.eclipse.che.api.machine.server.model.impl.ServerConfImpl; +import org.eclipse.che.api.machine.server.model.impl.ServerImpl; +import org.eclipse.che.commons.annotation.Nullable; +import org.eclipse.che.plugin.docker.client.json.ContainerInfo; +import org.eclipse.che.plugin.docker.client.json.PortBinding; +import org.stringtemplate.v4.ST; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import static com.google.common.base.Strings.isNullOrEmpty; + +/** + * Represents a server evaluation strategy for the configuration where the strategy can be customized through template properties. + * + * @author Florent Benoit + * @see ServerEvaluationStrategy + */ +public class CustomServerEvaluationStrategy extends DefaultServerEvaluationStrategy { + + /** + * Regexp to extract port (under the form 22/tcp or 4401/tcp, etc.) from label references + */ + public static final String LABEL_CHE_SERVER_REF_KEY = "^che:server:(.*):ref$"; + + /** + * Name of the property for getting the workspace ID. + */ + public static final String CHE_WORKSPACE_ID_PROPERTY = "CHE_WORKSPACE_ID="; + + /** + * Name of the property to get the machine name property + */ + public static final String CHE_MACHINE_NAME_PROPERTY = "CHE_MACHINE_NAME="; + + /** + * The current port of che. + */ + private final String chePort; + + /** + * Secured or not ? (for example https vs http) + */ + private final String cheDockerCustomExternalProtocol; + + /** + * Template for external addresses. + */ + private String cheDockerCustomExternalTemplate; + + + /** + * Default constructor + */ + @Inject + public CustomServerEvaluationStrategy(@Nullable @Named("che.docker.ip") String cheDockerIp, + @Nullable @Named("che.docker.ip.external") String cheDockerIpExternal, + @Nullable @Named("che.docker.server_evaluation_strategy.custom.template") String cheDockerCustomExternalTemplate, + @Nullable @Named("che.docker.server_evaluation_strategy.custom.external.protocol") String cheDockerCustomExternalProtocol, + @Named("che.port") String chePort) { + super(cheDockerIp, cheDockerIpExternal); + this.chePort = chePort; + this.cheDockerCustomExternalTemplate = cheDockerCustomExternalTemplate; + this.cheDockerCustomExternalProtocol = cheDockerCustomExternalProtocol; + } + + /** + * Override the host for all ports by using the external template. + */ + @Override + protected Map getExternalAddressesAndPorts(ContainerInfo containerInfo, String internalHost) { + + // create Rendering evaluation + RenderingEvaluation renderingEvaluation = getOnlineRenderingEvaluation(containerInfo, internalHost); + + // get current ports + Map> ports = containerInfo.getNetworkSettings().getPorts(); + + return ports.keySet().stream() + .collect(Collectors.toMap(portKey -> portKey, + portKey -> renderingEvaluation.render(cheDockerCustomExternalTemplate, portKey))); + } + + + /** + * Constructs a map of {@link ServerImpl} from provided parameters, using selected strategy + * for evaluating addresses and ports. + * + *

Keys consist of port number and transport protocol (tcp or udp) separated by + * a forward slash (e.g. 8080/tcp) + * + * @param containerInfo + * the {@link ContainerInfo} describing the container. + * @param internalHost + * alternative hostname to use, if address cannot be obtained from containerInfo + * @param serverConfMap + * additional Map of {@link ServerConfImpl}. Configurations here override those found + * in containerInfo. + * @return a Map of the servers exposed by the container. + */ + public Map getServers(ContainerInfo containerInfo, + String internalHost, + Map serverConfMap) { + Map servers = super.getServers(containerInfo, internalHost, serverConfMap); + return servers.entrySet().stream().collect(Collectors.toMap(map -> map.getKey(), map -> updateServer(map.getValue()))); + } + + + /** + * Updates the protocol for the given server by using given protocol (like https) for http URLs. + * @param server the server to update + * @return updated server object + */ + protected ServerImpl updateServer(ServerImpl server) { + if (!Strings.isNullOrEmpty(cheDockerCustomExternalProtocol)) { + if ("http".equals(server.getProtocol())) { + server.setProtocol(cheDockerCustomExternalProtocol); + String url = server.getUrl(); + int length = "http".length(); + server.setUrl(cheDockerCustomExternalProtocol.concat(url.substring(length))); + } + } + return server; + } + + + /** + * Allow to get the rendering outside of the evaluation strategies. + * It is called online as in this case we have access to container info + */ + public RenderingEvaluation getOnlineRenderingEvaluation(ContainerInfo containerInfo, String internalHost) { + return new OnlineRenderingEvaluation(containerInfo).withInternalHost(internalHost); + } + + /** + * Allow to get the rendering outside of the evaluation strategies. + * It is called offline as without container info, user need to provide merge of container and images data + */ + public RenderingEvaluation getOfflineRenderingEvaluation(Map labels, Set exposedPorts, String[] env) { + return new OfflineRenderingEvaluation(labels, exposedPorts, env); + } + + /** + * Simple interface for performing the rendering for a given portby using the given template + * + * @author Florent Benoit + */ + public interface RenderingEvaluation { + /** + * Gets the template rendering for the given port and using the given template + * + * @param template + * which can include + * @param port + * the port for the mapping + * @return the rendering of the template + */ + String render(String template, String port); + } + + /** + * Online implementation (using the container info) + */ + protected class OnlineRenderingEvaluation extends OfflineRenderingEvaluation implements RenderingEvaluation { + + private String gatewayAddressContainer; + private String internalHost; + + protected OnlineRenderingEvaluation(ContainerInfo containerInfo) { + super(containerInfo.getConfig().getLabels(), containerInfo.getConfig().getExposedPorts().keySet(), + containerInfo.getConfig().getEnv()); + this.gatewayAddressContainer = containerInfo.getNetworkSettings().getGateway(); + } + + protected OnlineRenderingEvaluation withInternalHost(String internalHost) { + this.internalHost = internalHost; + return this; + } + + @Override + protected String getExternalAddress() { + return externalAddressProperty != null ? + externalAddressProperty : + !isNullOrEmpty(gatewayAddressContainer) ? + gatewayAddressContainer : + this.internalHost; + } + } + + /** + * Offline implementation (container not yet created) + */ + protected class OfflineRenderingEvaluation extends DefaultRenderingEvaluation implements RenderingEvaluation { + + public OfflineRenderingEvaluation(Map labels, Set exposedPorts, String[] env) { + super(labels, exposedPorts, env); + } + } + + /** + * Inner class used to perform the rendering + */ + protected abstract class DefaultRenderingEvaluation implements RenderingEvaluation { + + /** + * Labels + */ + private Map labels; + + /** + * Ports + */ + private Set exposedPorts; + + /** + * Environment variables + */ + private final String[] env; + + /** + * Map with properties for all ports + */ + private Map globalPropertiesMap = new HashMap<>(); + + /** + * Mapping between a port and the server ref name + */ + private Map portsToRefName; + + /** + * Data initialized ? + */ + private boolean initialized; + + /** + * Default constructor. + */ + protected DefaultRenderingEvaluation(Map labels, Set exposedPorts, String[] env) { + this.labels = labels; + this.exposedPorts = exposedPorts; + this.env = env; + } + + /** + * Initialize data + */ + protected void init() { + this.initPortMapping(); + this.populateGlobalProperties(); + } + + /** + * Compute port mapping with server ref name + */ + protected void initPortMapping() { + // ok, so now we have a map of labels and a map of exposed ports + // need to extract the name of the ref (if defined in a label) or then pickup default name "Server--" + Pattern pattern = Pattern.compile(LABEL_CHE_SERVER_REF_KEY); + Map portsToKnownRefName = labels.entrySet().stream() + .filter(map -> pattern.matcher(map.getKey()).matches()) + .collect(Collectors.toMap(p -> { + Matcher matcher = pattern.matcher(p.getKey()); + matcher.matches(); + String val = matcher.group(1); + return val.contains("/") ? val : val.concat("/tcp"); + }, p -> p.getValue())); + + // add to this map only port without a known ref name + Map portsToUnkownRefName = + exposedPorts.stream().filter((port) -> !portsToKnownRefName.containsKey(port)) + .collect(Collectors.toMap(p -> p, p -> "Server-" + p.replace('/', '-'))); + + // list of all ports with refName (known/unknown) + this.portsToRefName = new HashMap(portsToKnownRefName); + portsToRefName.putAll(portsToUnkownRefName); + } + + /** + * Gets default external address. + */ + protected String getExternalAddress() { + return externalAddressProperty != null ? + externalAddressProperty : internalAddressProperty; + } + + /** + * Populate the template properties + */ + protected void populateGlobalProperties() { + String externalAddress = getExternalAddress(); + String externalIP = getExternalIp(externalAddress); + globalPropertiesMap.put("internalIp", internalAddressProperty); + globalPropertiesMap.put("externalAddress", externalAddress); + globalPropertiesMap.put("externalIP", externalIP); + globalPropertiesMap.put("workspaceId", getWorkspaceId()); + globalPropertiesMap.put("machineName", getMachineName()); + globalPropertiesMap.put("wildcardNipDomain", getWildcardNipDomain(externalAddress)); + globalPropertiesMap.put("wildcardXipDomain", getWildcardXipDomain(externalAddress)); + globalPropertiesMap.put("chePort", chePort); + } + + /** + * Rendering + */ + @Override + public String render(String template, String port) { + if (!this.initialized) { + init(); + this.initialized = true; + } + ST stringTemplate = new ST(template); + globalPropertiesMap.forEach((key, value) -> stringTemplate.add(key, value)); + stringTemplate.add("serverName", portsToRefName.get(port)); + return stringTemplate.render(); + } + + /** + * Gets the workspace ID from the config of the given container + * + * @return workspace ID + */ + protected String getWorkspaceId() { + return Arrays.stream(env).filter(env -> env.startsWith(CHE_WORKSPACE_ID_PROPERTY)) + .map(s -> s.substring(CHE_WORKSPACE_ID_PROPERTY.length())) + .findFirst().get(); + } + + /** + * Gets the workspace Machine Name from the config of the given container + * + * @return machine name of the workspace + */ + protected String getMachineName() { + return Arrays.stream(env).filter(env -> env.startsWith(CHE_MACHINE_NAME_PROPERTY)) + .map(s -> s.substring(CHE_MACHINE_NAME_PROPERTY.length())) + .findFirst().get(); + } + + /** + * Gets the IP address of the external address + * + * @return IP Address + */ + protected String getExternalIp(String externalAddress) { + try { + return InetAddress.getByName(externalAddress).getHostAddress(); + } catch (UnknownHostException e) { + throw new UnsupportedOperationException("Unable to find the IP for the address '" + externalAddress + "'", e); + } + } + + /** + * Gets a Wildcard domain based on the ip using an external provider nip.io + * + * @return wildcard domain + */ + protected String getWildcardNipDomain(String externalAddress) { + return String.format("%s.%s", getExternalIp(externalAddress), "nip.io"); + } + + /** + * Gets a Wildcard domain based on the ip using an external provider xip.io + * + * @return wildcard domain + */ + protected String getWildcardXipDomain(String externalAddress) { + return String.format("%s.%s", getExternalIp(externalAddress), "xip.io"); + } + + } + +} diff --git a/plugins/plugin-docker/che-plugin-docker-machine/src/main/java/org/eclipse/che/plugin/docker/machine/proxy/DockerBuildArgsProvider.java b/plugins/plugin-docker/che-plugin-docker-machine/src/main/java/org/eclipse/che/plugin/docker/machine/proxy/DockerBuildArgsProvider.java new file mode 100644 index 0000000000..e6cee531c4 --- /dev/null +++ b/plugins/plugin-docker/che-plugin-docker-machine/src/main/java/org/eclipse/che/plugin/docker/machine/proxy/DockerBuildArgsProvider.java @@ -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.plugin.docker.machine.proxy; + +import javax.inject.Inject; +import javax.inject.Provider; +import javax.inject.Singleton; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * Provides docker build arguments with proxy settings. + * + * @author Alexander Garagatyi + */ +@Singleton +public class DockerBuildArgsProvider implements Provider> { + private final Map buildArgs; + + @Inject + public DockerBuildArgsProvider(HttpProxyEnvVariableProvider httpProxy, + HttpsProxyEnvVariableProvider httpsProxy, + NoProxyEnvVariableProvider noProxy) { + Map buildArgs = new HashMap<>(); + splitVarAndAdd(httpProxy.get(), buildArgs); + splitVarAndAdd(httpsProxy.get(), buildArgs); + splitVarAndAdd(noProxy.get(), buildArgs); + this.buildArgs = Collections.unmodifiableMap(buildArgs); + } + + private void splitVarAndAdd(String envVariable, Map splitVariables) { + if (!envVariable.isEmpty()) { + String[] keyValue = envVariable.split("=", 2); + splitVariables.put(keyValue[0], keyValue[1]); + } + } + + @Override + public Map get() { + return buildArgs; + } +} diff --git a/plugins/plugin-docker/che-plugin-docker-machine/src/test/java/org/eclipse/che/plugin/docker/machine/CustomServerEvaluationStrategyTest.java b/plugins/plugin-docker/che-plugin-docker-machine/src/test/java/org/eclipse/che/plugin/docker/machine/CustomServerEvaluationStrategyTest.java new file mode 100644 index 0000000000..1e8fc9aef0 --- /dev/null +++ b/plugins/plugin-docker/che-plugin-docker-machine/src/test/java/org/eclipse/che/plugin/docker/machine/CustomServerEvaluationStrategyTest.java @@ -0,0 +1,267 @@ +/******************************************************************************* + * 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.plugin.docker.machine; + +import org.eclipse.che.api.machine.server.model.impl.ServerConfImpl; +import org.eclipse.che.api.machine.server.model.impl.ServerImpl; +import org.eclipse.che.plugin.docker.client.json.ContainerConfig; +import org.eclipse.che.plugin.docker.client.json.ContainerInfo; +import org.eclipse.che.plugin.docker.client.json.NetworkSettings; +import org.eclipse.che.plugin.docker.client.json.PortBinding; +import org.mockito.Mock; +import org.mockito.testng.MockitoTestNGListener; +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static org.mockito.Mockito.when; + +/** + * Test for {@Link CustomServerEvaluationStrategy} + * + * @author Florent Benoit + */ +@Listeners(MockitoTestNGListener.class) +public class CustomServerEvaluationStrategyTest { + + private static final String ALL_IP_ADDRESS = "0.0.0.0"; + + private static final String WORKSPACE_ID_VALUE = "work123"; + private static final String WORKSPACE_ID_PROPERTY = "CHE_WORKSPACE_ID=" + WORKSPACE_ID_VALUE; + + private static final String MACHINE_NAME_VALUE = "myMachine"; + private static final String MACHINE_NAME_PROPERTY = "CHE_MACHINE_NAME=" + MACHINE_NAME_VALUE; + + @Mock + private ContainerConfig containerConfig; + + @Mock + private ContainerInfo containerInfo; + + @Mock + private NetworkSettings networkSettings; + + + private CustomServerEvaluationStrategy customServerEvaluationStrategy; + + private Map> containerExposedPorts; + private Map containerLabels; + private String[] envContainerConfig; + private Map> networkExposedPorts; + + + @BeforeMethod + protected void setup() throws Exception { + containerLabels = new HashMap<>(); + containerExposedPorts = new HashMap<>(); + networkExposedPorts = new HashMap<>(); + when(containerInfo.getConfig()).thenReturn(containerConfig); + when(containerConfig.getLabels()).thenReturn(containerLabels); + when(containerConfig.getExposedPorts()).thenReturn(containerExposedPorts); + + envContainerConfig = new String[]{WORKSPACE_ID_PROPERTY, MACHINE_NAME_PROPERTY}; + when(containerConfig.getEnv()).thenReturn(envContainerConfig); + + when(containerInfo.getNetworkSettings()).thenReturn(networkSettings); + when(networkSettings.getGateway()).thenReturn("127.0.0.1"); + when(networkSettings.getPorts()).thenReturn(networkExposedPorts); + + containerLabels.put("foo1", "bar"); + containerLabels.put("foo1/dummy", "bar"); + containerLabels.put("che:server:4401/tcp:protocol", "http"); + containerLabels.put("che:server:4401/tcp:ref", "wsagent"); + containerLabels.put("che:server:22/tcp:protocol", "ssh"); + containerLabels.put("che:server:22/tcp:ref", "ssh"); + containerLabels.put("che:server:22/tcp:path", "/api"); + containerLabels.put("che:server:4411/tcp:ref", "terminal"); + containerLabels.put("che:server:4411/tcp:protocol", "http"); + containerLabels.put("che:server:8080:protocol", "http"); + containerLabels.put("che:server:8080:ref", "tomcat8"); + containerLabels.put("anotherfoo1", "bar2"); + containerLabels.put("anotherfoo1/dummy", "bar2"); + + containerExposedPorts.put("22/tcp", Collections.emptyMap()); + networkExposedPorts.put("22/tcp", Collections.singletonList(new PortBinding().withHostIp(ALL_IP_ADDRESS) + .withHostPort("3222"))); + containerExposedPorts.put("4401/tcp", Collections.emptyMap()); + networkExposedPorts.put("4401/tcp", Collections.singletonList(new PortBinding().withHostIp(ALL_IP_ADDRESS) + .withHostPort("324401"))); + containerExposedPorts.put("4411/tcp", Collections.emptyMap()); + networkExposedPorts.put("4411/tcp", Collections.singletonList(new PortBinding().withHostIp(ALL_IP_ADDRESS) + .withHostPort("324411"))); + containerExposedPorts.put("8080/tcp", Collections.emptyMap()); + networkExposedPorts.put("8080/tcp", Collections.singletonList(new PortBinding().withHostIp(ALL_IP_ADDRESS) + .withHostPort("328080"))); + } + + + /** + * Check workspace Id template + */ + @Test + public void testWorkspaceIdRule() throws Throwable { + this.customServerEvaluationStrategy = + new CustomServerEvaluationStrategy("10.0.0.1", "192.168.1.1", "", "http", "8080"); + + Map portMapping = this.customServerEvaluationStrategy.getExternalAddressesAndPorts(containerInfo, "localhost"); + + Assert.assertTrue(portMapping.containsKey("4401/tcp")); + Assert.assertEquals(portMapping.get("4401/tcp"), WORKSPACE_ID_VALUE); + } + + + /** + * Check workspace Id template + */ + @Test + public void testMachineNameRule() throws Throwable { + this.customServerEvaluationStrategy = + new CustomServerEvaluationStrategy("10.0.0.1", "192.168.1.1", "", "http", "8080"); + + Map portMapping = this.customServerEvaluationStrategy.getExternalAddressesAndPorts(containerInfo, "localhost"); + + Assert.assertTrue(portMapping.containsKey("4401/tcp")); + Assert.assertEquals(portMapping.get("4401/tcp"), MACHINE_NAME_VALUE); + } + + /** + * Check updates of protocols + */ + @Test + public void testProtocolUpdate() throws Throwable { + HashMap serverConfs = new HashMap<>(); + this.customServerEvaluationStrategy = + new CustomServerEvaluationStrategy("10.0.0.1", "192.168.1.1", "", "https", "8080"); + Map portMapping = this.customServerEvaluationStrategy.getServers(containerInfo, "localhost", serverConfs); + + Assert.assertTrue(portMapping.containsKey("4401/tcp")); + ServerImpl server = portMapping.get("4401/tcp"); + Assert.assertNotNull(server); + Assert.assertEquals(server.getUrl(), "https://" + WORKSPACE_ID_VALUE); + Assert.assertEquals(server.getProtocol(), "https"); + Assert.assertEquals(server.getAddress(), WORKSPACE_ID_VALUE); + Assert.assertEquals(server.getRef(), "wsagent"); + } + + /** + * Check defaults values + */ + @Test + public void testDefaults() throws Throwable { + HashMap serverConfs = new HashMap<>(); + + this.customServerEvaluationStrategy = + new CustomServerEvaluationStrategy("127.0.0.1", null, "-", "https", "8080"); + + Map portMapping = this.customServerEvaluationStrategy.getServers(containerInfo, "localhost", serverConfs); + + Assert.assertTrue(portMapping.containsKey("4401/tcp")); + ServerImpl server = portMapping.get("4401/tcp"); + Assert.assertNotNull(server); + Assert.assertEquals(server.getUrl(), "https://127.0.0.1-" + WORKSPACE_ID_VALUE); + Assert.assertEquals(server.getProtocol(), "https"); + Assert.assertEquals(server.getAddress(), "127.0.0.1-" + WORKSPACE_ID_VALUE); + Assert.assertEquals(server.getRef(), "wsagent"); + Assert.assertEquals(server.getRef(), "wsagent"); + } + + /** + * Check defaults values + */ + @Test + public void testDefaultsNoGateway() throws Throwable { + when(networkSettings.getGateway()).thenReturn(null); + HashMap serverConfs = new HashMap<>(); + this.customServerEvaluationStrategy = + new CustomServerEvaluationStrategy("127.0.0.1", null, "-", "https", "8080"); + Map portMapping = this.customServerEvaluationStrategy.getServers(containerInfo, "127.0.0.1", serverConfs); + Assert.assertTrue(portMapping.containsKey("4401/tcp")); + ServerImpl server = portMapping.get("4401/tcp"); + Assert.assertNotNull(server); + Assert.assertEquals(server.getUrl(), "https://127.0.0.1-" + WORKSPACE_ID_VALUE); + Assert.assertEquals(server.getProtocol(), "https"); + Assert.assertEquals(server.getAddress(), "127.0.0.1-" + WORKSPACE_ID_VALUE); + Assert.assertEquals(server.getRef(), "wsagent"); + Assert.assertEquals(server.getRef(), "wsagent"); + } + + + /** + * Check offline mode + */ + @Test + public void testOffline() throws Throwable { + Set exposedPorts = new HashSet<>(); + exposedPorts.add("22/tcp"); + exposedPorts.add("4401/tcp"); + exposedPorts.add("4411/tcp"); + exposedPorts.add("8080/tcp"); + List env = Arrays.asList(WORKSPACE_ID_PROPERTY, MACHINE_NAME_PROPERTY); + this.customServerEvaluationStrategy = + new CustomServerEvaluationStrategy("127.0.0.1", null, "-", "https", "8080"); + CustomServerEvaluationStrategy.RenderingEvaluation renderingEvaluation = this.customServerEvaluationStrategy + .getOfflineRenderingEvaluation(containerLabels, exposedPorts, env.stream().toArray(String[]::new)); + String eval = renderingEvaluation.render("", "4401/tcp"); + Assert.assertEquals(eval, WORKSPACE_ID_VALUE); + } + + + /** + * Check offline mode with external ip + */ + @Test + public void testOfflineExternal() throws Throwable { + Set exposedPorts = new HashSet<>(); + exposedPorts.add("22/tcp"); + exposedPorts.add("4401/tcp"); + exposedPorts.add("4411/tcp"); + exposedPorts.add("8080/tcp"); + List env = Arrays.asList(WORKSPACE_ID_PROPERTY, MACHINE_NAME_PROPERTY); + this.customServerEvaluationStrategy = + new CustomServerEvaluationStrategy("127.0.0.1", "127.0.0.1", "-", "https", "8080"); + CustomServerEvaluationStrategy.RenderingEvaluation renderingEvaluation = this.customServerEvaluationStrategy + .getOfflineRenderingEvaluation(containerLabels, exposedPorts, env.stream().toArray(String[]::new)); + String eval = renderingEvaluation.render("", "4401/tcp"); + Assert.assertEquals(eval, WORKSPACE_ID_VALUE); + } + + + /** + * Check offline mode with external ip + */ + //@Test(expectedExceptions = UnsupportedOperationException.class, expectedExceptionsMessageRegExp = "Unable to find the IP for the address .*") + public void testOfflineInvalidExternal() throws Throwable { + Set exposedPorts = new HashSet<>(); + exposedPorts.add("22/tcp"); + exposedPorts.add("4401/tcp"); + exposedPorts.add("4411/tcp"); + exposedPorts.add("8080/tcp"); + List env = Arrays.asList(WORKSPACE_ID_PROPERTY, MACHINE_NAME_PROPERTY); + this.customServerEvaluationStrategy = + new CustomServerEvaluationStrategy("127.0.0.1", "300.300.300.300", "-", "https", "8080"); + CustomServerEvaluationStrategy.RenderingEvaluation renderingEvaluation = this.customServerEvaluationStrategy + .getOfflineRenderingEvaluation(containerLabels, exposedPorts, env.stream().toArray(String[]::new)); + String eval = renderingEvaluation.render("", "4401/tcp"); + Assert.assertEquals(eval, WORKSPACE_ID_VALUE); + } + + +} + diff --git a/plugins/plugin-docker/che-plugin-openshift-client/pom.xml b/plugins/plugin-docker/che-plugin-openshift-client/pom.xml index 07c56ca643..de766c5df3 100644 --- a/plugins/plugin-docker/che-plugin-openshift-client/pom.xml +++ b/plugins/plugin-docker/che-plugin-openshift-client/pom.xml @@ -16,7 +16,7 @@ che-plugin-docker-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-openshift-client jar diff --git a/plugins/plugin-docker/pom.xml b/plugins/plugin-docker/pom.xml index 3d8c11ca83..634dfd225a 100644 --- a/plugins/plugin-docker/pom.xml +++ b/plugins/plugin-docker/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-docker-parent diff --git a/plugins/plugin-gdb/che-plugin-gdb-ide/pom.xml b/plugins/plugin-gdb/che-plugin-gdb-ide/pom.xml index 08596b2f99..c94a0fa5d7 100644 --- a/plugins/plugin-gdb/che-plugin-gdb-ide/pom.xml +++ b/plugins/plugin-gdb/che-plugin-gdb-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-gdb-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-gdb-ide jar diff --git a/plugins/plugin-gdb/che-plugin-gdb-server/pom.xml b/plugins/plugin-gdb/che-plugin-gdb-server/pom.xml index b9ceac03c8..26034dec3b 100644 --- a/plugins/plugin-gdb/che-plugin-gdb-server/pom.xml +++ b/plugins/plugin-gdb/che-plugin-gdb-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-gdb-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-gdb-server jar diff --git a/plugins/plugin-gdb/pom.xml b/plugins/plugin-gdb/pom.xml index 3e7a6a3042..c2a31546c1 100644 --- a/plugins/plugin-gdb/pom.xml +++ b/plugins/plugin-gdb/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-gdb-parent pom diff --git a/plugins/plugin-git/che-plugin-git-ext-git/pom.xml b/plugins/plugin-git/che-plugin-git-ext-git/pom.xml index 962cd1c6b1..1d14ab61d8 100644 --- a/plugins/plugin-git/che-plugin-git-ext-git/pom.xml +++ b/plugins/plugin-git/che-plugin-git-ext-git/pom.xml @@ -16,7 +16,7 @@ che-plugin-git-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-git-ext-git jar diff --git a/plugins/plugin-git/pom.xml b/plugins/plugin-git/pom.xml index c20b2d00e4..467215283f 100644 --- a/plugins/plugin-git/pom.xml +++ b/plugins/plugin-git/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-git-parent diff --git a/plugins/plugin-github/che-plugin-github-factory-resolver/pom.xml b/plugins/plugin-github/che-plugin-github-factory-resolver/pom.xml index 9b410b57a7..a103c4bc70 100644 --- a/plugins/plugin-github/che-plugin-github-factory-resolver/pom.xml +++ b/plugins/plugin-github/che-plugin-github-factory-resolver/pom.xml @@ -16,7 +16,7 @@ che-plugin-github-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-github-factory-resolver jar diff --git a/plugins/plugin-github/che-plugin-github-ide/pom.xml b/plugins/plugin-github/che-plugin-github-ide/pom.xml index de956406ff..040411a7b6 100644 --- a/plugins/plugin-github/che-plugin-github-ide/pom.xml +++ b/plugins/plugin-github/che-plugin-github-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-github-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-github-ide jar diff --git a/plugins/plugin-github/che-plugin-github-oauth2/pom.xml b/plugins/plugin-github/che-plugin-github-oauth2/pom.xml index 4c62cf043e..e02a07fc23 100644 --- a/plugins/plugin-github/che-plugin-github-oauth2/pom.xml +++ b/plugins/plugin-github/che-plugin-github-oauth2/pom.xml @@ -16,7 +16,7 @@ che-plugin-github-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-github-oauth2 jar diff --git a/plugins/plugin-github/che-plugin-github-provider-github/pom.xml b/plugins/plugin-github/che-plugin-github-provider-github/pom.xml index 8adfe6704c..306a3743a7 100644 --- a/plugins/plugin-github/che-plugin-github-provider-github/pom.xml +++ b/plugins/plugin-github/che-plugin-github-provider-github/pom.xml @@ -16,7 +16,7 @@ che-plugin-github-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-github-provider-github Che Plugin :: Github :: Credential provider diff --git a/plugins/plugin-github/che-plugin-github-pullrequest/pom.xml b/plugins/plugin-github/che-plugin-github-pullrequest/pom.xml index 6a6fb0c17d..bca260e1dc 100644 --- a/plugins/plugin-github/che-plugin-github-pullrequest/pom.xml +++ b/plugins/plugin-github/che-plugin-github-pullrequest/pom.xml @@ -16,7 +16,7 @@ che-plugin-github-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-github-pullrequest Che Plugin :: Github :: Pull request diff --git a/plugins/plugin-github/che-plugin-github-server/pom.xml b/plugins/plugin-github/che-plugin-github-server/pom.xml index 4d2cb85610..66855f7632 100644 --- a/plugins/plugin-github/che-plugin-github-server/pom.xml +++ b/plugins/plugin-github/che-plugin-github-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-github-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-github-server jar diff --git a/plugins/plugin-github/che-plugin-github-shared/pom.xml b/plugins/plugin-github/che-plugin-github-shared/pom.xml index 49e72f7fa0..82fb93efc6 100644 --- a/plugins/plugin-github/che-plugin-github-shared/pom.xml +++ b/plugins/plugin-github/che-plugin-github-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-github-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-github-shared Che Plugin :: Github :: Shared diff --git a/plugins/plugin-github/pom.xml b/plugins/plugin-github/pom.xml index f11a93aad8..8a4dfd0bc2 100644 --- a/plugins/plugin-github/pom.xml +++ b/plugins/plugin-github/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-github-parent diff --git a/plugins/plugin-gwt/che-plugin-gwt-ext-gwt/pom.xml b/plugins/plugin-gwt/che-plugin-gwt-ext-gwt/pom.xml index 4f73b1b6ec..908f732f56 100644 --- a/plugins/plugin-gwt/che-plugin-gwt-ext-gwt/pom.xml +++ b/plugins/plugin-gwt/che-plugin-gwt-ext-gwt/pom.xml @@ -16,7 +16,7 @@ che-plugin-gwt-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-gwt-ext-gwt jar diff --git a/plugins/plugin-gwt/pom.xml b/plugins/plugin-gwt/pom.xml index 29d1df5c83..c370663617 100644 --- a/plugins/plugin-gwt/pom.xml +++ b/plugins/plugin-gwt/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-gwt-parent diff --git a/plugins/plugin-help/che-plugin-help-ext-client/pom.xml b/plugins/plugin-help/che-plugin-help-ext-client/pom.xml index 56c11f2566..9dfa94c1a7 100644 --- a/plugins/plugin-help/che-plugin-help-ext-client/pom.xml +++ b/plugins/plugin-help/che-plugin-help-ext-client/pom.xml @@ -16,7 +16,7 @@ che-plugin-help-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-help-ext-client jar diff --git a/plugins/plugin-help/pom.xml b/plugins/plugin-help/pom.xml index dbc5c41a05..4ed06b1340 100644 --- a/plugins/plugin-help/pom.xml +++ b/plugins/plugin-help/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-help-parent diff --git a/plugins/plugin-java-debugger/che-plugin-java-debugger-ide/pom.xml b/plugins/plugin-java-debugger/che-plugin-java-debugger-ide/pom.xml index eec710bc13..d5e62389c9 100644 --- a/plugins/plugin-java-debugger/che-plugin-java-debugger-ide/pom.xml +++ b/plugins/plugin-java-debugger/che-plugin-java-debugger-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-debugger-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-debugger-ide jar diff --git a/plugins/plugin-java-debugger/che-plugin-java-debugger-server/pom.xml b/plugins/plugin-java-debugger/che-plugin-java-debugger-server/pom.xml index 2067eb3fec..42a885a92e 100644 --- a/plugins/plugin-java-debugger/che-plugin-java-debugger-server/pom.xml +++ b/plugins/plugin-java-debugger/che-plugin-java-debugger-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-debugger-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-debugger-server jar diff --git a/plugins/plugin-java-debugger/pom.xml b/plugins/plugin-java-debugger/pom.xml index bd120bf563..e07a0c8490 100644 --- a/plugins/plugin-java-debugger/pom.xml +++ b/plugins/plugin-java-debugger/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-debugger-parent pom diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/pom.xml b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/pom.xml index 743c8f2f74..5db21c8689 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filebuffers/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-ext-jdt-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.core.filebuffers jar diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filesystem/pom.xml b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filesystem/pom.xml index 640bb1450d..c5c506c582 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filesystem/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-filesystem/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-ext-jdt-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.core.filesystem jar diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/pom.xml b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/pom.xml index 28d7c22ad4..6d2759fe3f 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-core-resources/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-ext-jdt-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.core.resources jar diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/pom.xml b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/pom.xml index dc5132f0be..9ef132dccc 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-ext-jdt-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.jdt.ui jar diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jface-text/pom.xml b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jface-text/pom.xml index 1bc18f0c1f..00999216ec 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jface-text/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jface-text/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-ext-jdt-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.jface.text jar diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jface/pom.xml b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jface/pom.xml index 7185750dba..daf244131f 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jface/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jface/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-ext-jdt-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.jface jar diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/pom.xml b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/pom.xml index 8cf2428883..6427a874ae 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-ext-jdt-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.ltk.core.refactoring jar diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-search/pom.xml b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-search/pom.xml index 097da782e2..1ea18b33ce 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-search/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-search/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-ext-jdt-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.search jar diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ui-ide/pom.xml b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ui-ide/pom.xml index e9a315c139..a9e3b80b18 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ui-ide/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ui-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-ext-jdt-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.ui.ide jar diff --git a/plugins/plugin-java/che-plugin-java-ext-jdt/pom.xml b/plugins/plugin-java/che-plugin-java-ext-jdt/pom.xml index 982bbfb7f3..233fdaa626 100644 --- a/plugins/plugin-java/che-plugin-java-ext-jdt/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-jdt/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-ext-jdt-parent pom diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-client/pom.xml b/plugins/plugin-java/che-plugin-java-ext-lang-client/pom.xml index 5f7992f7fd..0b3b7a713f 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-client/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-lang-client/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-ext-lang-client jar diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-server/pom.xml b/plugins/plugin-java/che-plugin-java-ext-lang-server/pom.xml index 1ecbe26ad9..8d2de28e2a 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-server/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-lang-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-ext-lang-server Che Plugin :: Java :: Extension Java Server diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-shared/pom.xml b/plugins/plugin-java/che-plugin-java-ext-lang-shared/pom.xml index 276b55ab19..0a12ad335a 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-shared/pom.xml +++ b/plugins/plugin-java/che-plugin-java-ext-lang-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-ext-lang-shared Che Plugin :: Java :: Extension Java Shared diff --git a/plugins/plugin-java/che-plugin-java-ext-lang-shared/src/main/java/org/eclipse/che/ide/ext/java/shared/Constants.java b/plugins/plugin-java/che-plugin-java-ext-lang-shared/src/main/java/org/eclipse/che/ide/ext/java/shared/Constants.java index 82cb1c4fef..ad424bd8c9 100644 --- a/plugins/plugin-java/che-plugin-java-ext-lang-shared/src/main/java/org/eclipse/che/ide/ext/java/shared/Constants.java +++ b/plugins/plugin-java/che-plugin-java-ext-lang-shared/src/main/java/org/eclipse/che/ide/ext/java/shared/Constants.java @@ -16,17 +16,17 @@ package org.eclipse.che.ide.ext.java.shared; */ public final class Constants { // project categories - public static String JAVA_CATEGORY = "Java"; - public static String JAVA_ID = "java"; + public static final String JAVA_CATEGORY = "Java"; + public static final String JAVA_ID = "java"; // project attribute names - public static String LANGUAGE = "language"; - public static String LANGUAGE_VERSION = "languageVersion"; - public static String FRAMEWORK = "framework"; - public static String CONTAINS_JAVA_FILES = "containsJavaFiles"; - public static String SOURCE_FOLDER = "java.source.folder"; - public static String OUTPUT_FOLDER = "java.output.folder"; + public static final String LANGUAGE = "language"; + public static final String LANGUAGE_VERSION = "languageVersion"; + public static final String FRAMEWORK = "framework"; + public static final String CONTAINS_JAVA_FILES = "containsJavaFiles"; + public static final String SOURCE_FOLDER = "java.source.folder"; + public static final String OUTPUT_FOLDER = "java.output.folder"; - public static String JAVAC = "javac"; + public static final String JAVAC = "javac"; private Constants() { throw new UnsupportedOperationException("Unused constructor."); diff --git a/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-ide/pom.xml b/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-ide/pom.xml index c8ffec9d9f..7edbbcb8a3 100644 --- a/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-ide/pom.xml +++ b/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-plain org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-plain-ide jar diff --git a/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-server/pom.xml b/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-server/pom.xml index 6183013409..62edcebca1 100644 --- a/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-server/pom.xml +++ b/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-plain org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-plain-server Che Plugin :: Java :: Plain :: Server diff --git a/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-shared/pom.xml b/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-shared/pom.xml index ae7e5d96ca..4217c5054c 100644 --- a/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-shared/pom.xml +++ b/plugins/plugin-java/che-plugin-java-plain/che-plugin-java-plain-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-plain org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-plain-shared Che Plugin :: Java :: Plain :: Shared diff --git a/plugins/plugin-java/che-plugin-java-plain/pom.xml b/plugins/plugin-java/che-plugin-java-plain/pom.xml index deba2b7996..d193e8e20c 100644 --- a/plugins/plugin-java/che-plugin-java-plain/pom.xml +++ b/plugins/plugin-java/che-plugin-java-plain/pom.xml @@ -16,7 +16,7 @@ che-plugin-java-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-java-plain diff --git a/plugins/plugin-java/pom.xml b/plugins/plugin-java/pom.xml index 30f18bfe0f..e501cc5a1c 100644 --- a/plugins/plugin-java/pom.xml +++ b/plugins/plugin-java/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-java-parent diff --git a/plugins/plugin-json/che-plugin-json-server/pom.xml b/plugins/plugin-json/che-plugin-json-server/pom.xml index 3c926c7ab4..687b893d7d 100644 --- a/plugins/plugin-json/che-plugin-json-server/pom.xml +++ b/plugins/plugin-json/che-plugin-json-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-json-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-json-server Che Plugin :: JSON :: Extension Server diff --git a/plugins/plugin-json/pom.xml b/plugins/plugin-json/pom.xml index f0fce1ce09..eec8d5a339 100644 --- a/plugins/plugin-json/pom.xml +++ b/plugins/plugin-json/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-json-parent diff --git a/plugins/plugin-keybinding-eclipse/plugin-keybinding-eclipse-ide/pom.xml b/plugins/plugin-keybinding-eclipse/plugin-keybinding-eclipse-ide/pom.xml index f697e59301..88603f9ad2 100644 --- a/plugins/plugin-keybinding-eclipse/plugin-keybinding-eclipse-ide/pom.xml +++ b/plugins/plugin-keybinding-eclipse/plugin-keybinding-eclipse-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-keybinding-eclipse-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-keybinding-eclipse-ide diff --git a/plugins/plugin-keybinding-eclipse/pom.xml b/plugins/plugin-keybinding-eclipse/pom.xml index 2dd2bfeaa0..b6ac98ad99 100644 --- a/plugins/plugin-keybinding-eclipse/pom.xml +++ b/plugins/plugin-keybinding-eclipse/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-keybinding-eclipse-parent diff --git a/plugins/plugin-languageserver/che-plugin-languageserver-ide/pom.xml b/plugins/plugin-languageserver/che-plugin-languageserver-ide/pom.xml index e0fa0e5e11..82441f2126 100644 --- a/plugins/plugin-languageserver/che-plugin-languageserver-ide/pom.xml +++ b/plugins/plugin-languageserver/che-plugin-languageserver-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-languageserver-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT .. che-plugin-languageserver-ide diff --git a/plugins/plugin-languageserver/pom.xml b/plugins/plugin-languageserver/pom.xml index df6d9fd322..8919eee1e7 100644 --- a/plugins/plugin-languageserver/pom.xml +++ b/plugins/plugin-languageserver/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-languageserver-parent diff --git a/plugins/plugin-machine/che-plugin-machine-ext-server/pom.xml b/plugins/plugin-machine/che-plugin-machine-ext-server/pom.xml index fe592b6122..4c95328fab 100644 --- a/plugins/plugin-machine/che-plugin-machine-ext-server/pom.xml +++ b/plugins/plugin-machine/che-plugin-machine-ext-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-machine-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-machine-ext-server diff --git a/plugins/plugin-machine/che-plugin-machine-ssh-client/pom.xml b/plugins/plugin-machine/che-plugin-machine-ssh-client/pom.xml index d0fcd2c010..0438627c6c 100644 --- a/plugins/plugin-machine/che-plugin-machine-ssh-client/pom.xml +++ b/plugins/plugin-machine/che-plugin-machine-ssh-client/pom.xml @@ -16,7 +16,7 @@ che-plugin-machine-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-machine-ssh-client jar diff --git a/plugins/plugin-machine/pom.xml b/plugins/plugin-machine/pom.xml index d02f15b3be..56ad0ffba7 100644 --- a/plugins/plugin-machine/pom.xml +++ b/plugins/plugin-machine/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-machine-parent diff --git a/plugins/plugin-maven/che-plugin-maven-generator-archetype/pom.xml b/plugins/plugin-maven/che-plugin-maven-generator-archetype/pom.xml index 81c68efba9..657a4c1e2a 100644 --- a/plugins/plugin-maven/che-plugin-maven-generator-archetype/pom.xml +++ b/plugins/plugin-maven/che-plugin-maven-generator-archetype/pom.xml @@ -16,7 +16,7 @@ che-plugin-maven-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-maven-generator-archetype jar diff --git a/plugins/plugin-maven/che-plugin-maven-ide/pom.xml b/plugins/plugin-maven/che-plugin-maven-ide/pom.xml index 268cb528c9..9b8501670e 100644 --- a/plugins/plugin-maven/che-plugin-maven-ide/pom.xml +++ b/plugins/plugin-maven/che-plugin-maven-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-maven-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-maven-ide Che Plugin :: Maven :: Extension Maven Client diff --git a/plugins/plugin-maven/che-plugin-maven-server/pom.xml b/plugins/plugin-maven/che-plugin-maven-server/pom.xml index 139fc271ec..67beb6054f 100644 --- a/plugins/plugin-maven/che-plugin-maven-server/pom.xml +++ b/plugins/plugin-maven/che-plugin-maven-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-maven-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-maven-server jar diff --git a/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/core/MavenProjectManager.java b/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/core/MavenProjectManager.java index 196f759088..8aa76e4e7d 100644 --- a/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/core/MavenProjectManager.java +++ b/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/core/MavenProjectManager.java @@ -360,6 +360,22 @@ public class MavenProjectManager { } } + + public MavenProject getMavenProject(IProject iProject) { + readLock.lock(); + try { + return projectToMavenProjectMap.get(iProject); + } finally { + readLock.unlock(); + } + } + + + public MavenProject getMavenProject(String projectPath) { + final IProject project = workspaceProvider.get().getRoot().getProject(projectPath); + return getMavenProject(project); + } + private void fillMavenKeyMap(MavenProject mavenProject) { MavenKey mavenKey = mavenProject.getMavenKey(); mavenWorkspaceCache.put(mavenKey, mavenProject.getPomFile()); diff --git a/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/core/project/MavenModelReader.java b/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/core/project/MavenModelReader.java index 02e487a979..c240f75394 100644 --- a/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/core/project/MavenModelReader.java +++ b/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/core/project/MavenModelReader.java @@ -11,6 +11,7 @@ package org.eclipse.che.plugin.maven.server.core.project; import org.eclipse.che.commons.lang.Pair; +import org.eclipse.che.commons.xml.XMLTreeException; import org.eclipse.che.ide.maven.tools.Build; import org.eclipse.che.ide.maven.tools.Model; import org.eclipse.che.ide.maven.tools.Parent; @@ -116,6 +117,8 @@ public class MavenModelReader { model = Model.readFrom(pom); } catch (IOException e) { problems.add(MavenProjectProblem.newProblem(pom.getPath(), e.getMessage(), MavenProblemType.SYNTAX)); + } catch (XMLTreeException xmlExc) { + problems.add(MavenProjectProblem.newProblem(pom.getPath(), xmlExc.getMessage(), MavenProblemType.STRUCTURE)); } if (model == null) { diff --git a/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/projecttype/MavenValueProvider.java b/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/projecttype/MavenValueProvider.java new file mode 100644 index 0000000000..4673d23ca1 --- /dev/null +++ b/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/projecttype/MavenValueProvider.java @@ -0,0 +1,173 @@ +/******************************************************************************* + * 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.plugin.maven.server.projecttype; + +import org.eclipse.che.api.core.ForbiddenException; +import org.eclipse.che.api.core.ServerException; +import org.eclipse.che.api.project.server.FileEntry; +import org.eclipse.che.api.project.server.FolderEntry; +import org.eclipse.che.api.project.server.type.ReadonlyValueProvider; +import org.eclipse.che.api.project.server.type.ValueStorageException; +import org.eclipse.che.commons.xml.XMLTreeException; +import org.eclipse.che.ide.maven.tools.Model; +import org.eclipse.che.ide.maven.tools.Resource; +import org.eclipse.che.maven.data.MavenResource; +import org.eclipse.che.plugin.maven.server.core.MavenProjectManager; +import org.eclipse.che.plugin.maven.server.core.project.MavenProject; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import static java.util.Collections.singletonList; +import static org.eclipse.che.ide.ext.java.shared.Constants.SOURCE_FOLDER; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.ARTIFACT_ID; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_PACKAGING; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_RESOURCES_FOLDER; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_SOURCE_FOLDER; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_TEST_RESOURCES_FOLDER; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_TEST_SOURCE_FOLDER; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.GROUP_ID; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.PACKAGING; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.PARENT_ARTIFACT_ID; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.PARENT_GROUP_ID; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.PARENT_VERSION; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.RESOURCE_FOLDER; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.TEST_SOURCE_FOLDER; +import static org.eclipse.che.plugin.maven.shared.MavenAttributes.VERSION; + +/** + * @author Vitalii Parfonov + */ +public class MavenValueProvider extends ReadonlyValueProvider { + + + private MavenProjectManager mavenProjectManager; + private FolderEntry projectFolder; + + protected MavenValueProvider(MavenProjectManager mavenProjectManager, FolderEntry projectFolder) { + this.mavenProjectManager = mavenProjectManager; + this.projectFolder = projectFolder; + } + + @Override + public List getValues(String attributeName) throws ValueStorageException { + try { + if (mavenProjectManager == null) { + return readFromPom(attributeName); + } + + final MavenProject mavenProject = mavenProjectManager.getMavenProject(projectFolder.getPath().toString()); + if (mavenProject != null) { + return getFromMavenProject(mavenProject, attributeName); + } else { + return readFromPom(attributeName); + } + } catch (ServerException | ForbiddenException | IOException e) { + throwReadException(e); + } catch (XMLTreeException e) { + throw new ValueStorageException("Error parsing pom.xml : " + e.getMessage()); + } + return null; + } + + private List getFromMavenProject(MavenProject mavenProject, String attributeName) throws ValueStorageException { + switch (attributeName) { + case ARTIFACT_ID: + return singletonList(mavenProject.getMavenKey().getArtifactId()); + case GROUP_ID: + return singletonList(mavenProject.getMavenKey().getGroupId()); + case PACKAGING: + String packaging = mavenProject.getPackaging(); + return singletonList(packaging != null ? packaging : DEFAULT_PACKAGING); + case VERSION: + return singletonList(mavenProject.getMavenKey().getVersion()); + case PARENT_ARTIFACT_ID: + return singletonList(mavenProject.getParentKey() == null ? "" : mavenProject.getParentKey().getArtifactId()); + case PARENT_GROUP_ID: + return singletonList(mavenProject.getParentKey() == null ? "" : mavenProject.getParentKey().getGroupId()); + case PARENT_VERSION: + return singletonList(mavenProject.getParentKey() == null ? "" : mavenProject.getParentKey().getVersion()); + case SOURCE_FOLDER: + return (mavenProject.getSources() != null && !mavenProject.getSources().isEmpty()) ? mavenProject.getSources() + : singletonList(DEFAULT_SOURCE_FOLDER); + case TEST_SOURCE_FOLDER: + return (mavenProject.getTestSources() != null && !mavenProject.getTestSources().isEmpty()) ? mavenProject.getTestSources() + : singletonList( + DEFAULT_TEST_SOURCE_FOLDER); + case RESOURCE_FOLDER: + if (mavenProject.getResources() != null && !mavenProject.getResources().isEmpty()) { + return mavenProject.getResources().stream().map(MavenResource::getDirectory).collect(Collectors.toList()); + } else { + return Arrays.asList(DEFAULT_RESOURCES_FOLDER, DEFAULT_TEST_RESOURCES_FOLDER); + } + default: + throw new ValueStorageException(String.format("Unknown attribute %s", attributeName)); + } + } + + + private List readFromPom(String attributeName) + throws ServerException, ForbiddenException, IOException, XMLTreeException, ValueStorageException { + final Model model = readModel(projectFolder); + switch (attributeName) { + case ARTIFACT_ID: + return singletonList(model.getArtifactId()); + case GROUP_ID: + return singletonList(model.getGroupId()); + case PACKAGING: + String packaging = model.getPackaging(); + return singletonList(packaging != null ? packaging : DEFAULT_PACKAGING); + case VERSION: + return singletonList(model.getVersion()); + case PARENT_ARTIFACT_ID: + return singletonList(model.getParent() == null ? "" : model.getParent().getArtifactId()); + case PARENT_GROUP_ID: + return singletonList(model.getParent() == null ? "" : model.getParent().getGroupId()); + case PARENT_VERSION: + return singletonList(model.getParent() == null ? "" : model.getParent().getVersion()); + case SOURCE_FOLDER: + if (model.getBuild() != null && model.getBuild().getSourceDirectory() != null) { + return singletonList(model.getBuild().getSourceDirectory()); + } else { + return singletonList(DEFAULT_SOURCE_FOLDER); + } + case TEST_SOURCE_FOLDER: + if (model.getBuild() != null && model.getBuild().getTestSourceDirectory() != null) { + return singletonList(model.getBuild().getTestSourceDirectory()); + } else { + return singletonList(DEFAULT_TEST_SOURCE_FOLDER); + } + case RESOURCE_FOLDER: + if (model.getBuild() != null && model.getBuild().getResources() != null) { + return model.getBuild().getResources().stream().map(Resource::getDirectory).collect(Collectors.toList()); + } else { + return Arrays.asList(DEFAULT_RESOURCES_FOLDER, DEFAULT_TEST_RESOURCES_FOLDER); + } + default: + throw new ValueStorageException(String.format("Unknown attribute %s", attributeName)); + } + } + + protected Model readModel(FolderEntry projectFolder) throws ValueStorageException, ServerException, ForbiddenException, IOException { + FileEntry pomFile = (FileEntry)projectFolder.getChild("pom.xml"); + if (pomFile == null) { + throw new ValueStorageException("pom.xml does not exist."); + } + return Model.readFrom(pomFile.getInputStream()); + } + + protected void throwReadException(Exception e) throws ValueStorageException { + throw new ValueStorageException("Can't read pom.xml : " + e.getMessage()); + } + +} diff --git a/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/projecttype/MavenValueProviderFactory.java b/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/projecttype/MavenValueProviderFactory.java index 790fdb0997..78fdfe7415 100644 --- a/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/projecttype/MavenValueProviderFactory.java +++ b/plugins/plugin-maven/che-plugin-maven-server/src/main/java/org/eclipse/che/plugin/maven/server/projecttype/MavenValueProviderFactory.java @@ -10,120 +10,25 @@ *******************************************************************************/ package org.eclipse.che.plugin.maven.server.projecttype; -import org.eclipse.che.api.core.ForbiddenException; -import org.eclipse.che.api.core.ServerException; -import org.eclipse.che.api.project.server.FileEntry; import org.eclipse.che.api.project.server.FolderEntry; -import org.eclipse.che.api.project.server.type.ReadonlyValueProvider; import org.eclipse.che.api.project.server.type.ValueProvider; import org.eclipse.che.api.project.server.type.ValueProviderFactory; -import org.eclipse.che.api.project.server.type.ValueStorageException; -import org.eclipse.che.commons.xml.XMLTreeException; -import org.eclipse.che.ide.maven.tools.Build; -import org.eclipse.che.ide.maven.tools.Model; -import org.eclipse.che.ide.maven.tools.Resource; +import org.eclipse.che.plugin.maven.server.core.MavenProjectManager; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -import static org.eclipse.che.ide.ext.java.shared.Constants.SOURCE_FOLDER; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.ARTIFACT_ID; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_RESOURCES_FOLDER; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_SOURCE_FOLDER; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_TEST_RESOURCES_FOLDER; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.DEFAULT_TEST_SOURCE_FOLDER; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.GROUP_ID; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.PACKAGING; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.PARENT_ARTIFACT_ID; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.PARENT_GROUP_ID; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.PARENT_VERSION; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.RESOURCE_FOLDER; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.TEST_SOURCE_FOLDER; -import static org.eclipse.che.plugin.maven.shared.MavenAttributes.VERSION; +import javax.inject.Inject; /** * @author Evgen Vidolob */ public class MavenValueProviderFactory implements ValueProviderFactory { - protected Model readModel(FolderEntry projectFolder) throws ValueStorageException, ServerException, ForbiddenException, IOException { - FileEntry pomFile = (FileEntry)projectFolder.getChild("pom.xml"); - if (pomFile == null) { - throw new ValueStorageException("pom.xml does not exist."); - } - return Model.readFrom(pomFile.getInputStream()); - } + @Inject + MavenProjectManager mavenProjectManager; - protected void throwReadException(Exception e) throws ValueStorageException { - throw new ValueStorageException("Can't read pom.xml : " + e.getMessage()); - } @Override public ValueProvider newInstance(FolderEntry projectFolder) { - return new MavenValueProvider(projectFolder); + return new MavenValueProvider(mavenProjectManager, projectFolder); } - protected class MavenValueProvider extends ReadonlyValueProvider { - - protected FolderEntry projectFolder; - - protected MavenValueProvider(FolderEntry projectFolder) { - this.projectFolder = projectFolder; - } - - @Override - public List getValues(String attributeName) throws ValueStorageException { - try { - String value = ""; - final Model model = readModel(projectFolder); - if (attributeName.equals(ARTIFACT_ID)) { - value = model.getArtifactId(); - } else if (attributeName.equals(GROUP_ID)) { - value = model.getGroupId(); - } else if (attributeName.equals(PACKAGING)) { - final String packaging = model.getPackaging(); - value = packaging == null ? "" : packaging; - } else if (attributeName.equals(VERSION)) { - value = model.getVersion(); - } else if (attributeName.equals(PARENT_ARTIFACT_ID) && model.getParent() != null) { - value = model.getParent().getArtifactId(); - } else if (attributeName.equals(PARENT_GROUP_ID) && model.getParent() != null) { - value = model.getParent().getGroupId(); - } else if (attributeName.equals(PARENT_VERSION) && model.getParent() != null) { - value = model.getParent().getVersion(); - } else if (attributeName.equals(SOURCE_FOLDER)) { - Build build = model.getBuild(); - if (build != null && build.getSourceDirectory() != null) { - value = build.getSourceDirectory(); - } else { - value = DEFAULT_SOURCE_FOLDER; - } - } else if (attributeName.equals(TEST_SOURCE_FOLDER)) { - Build build = model.getBuild(); - if (build != null && build.getTestSourceDirectory() != null) { - value = build.getTestSourceDirectory(); - } else { - value = DEFAULT_TEST_SOURCE_FOLDER; - } - } else if (attributeName.equals(RESOURCE_FOLDER)) { - Build build = model.getBuild(); - if (build != null && build.getResources() != null) { - return build.getResources().stream().map(Resource::getDirectory).collect(Collectors.toList()); - } else { - return Arrays.asList(DEFAULT_RESOURCES_FOLDER, DEFAULT_TEST_RESOURCES_FOLDER); - } - } - - return Collections.singletonList(value); - } catch (ServerException | ForbiddenException | IOException e) { - throwReadException(e); - } catch (XMLTreeException e) { - throw new ValueStorageException("Error parsing pom.xml : " + e.getMessage()); - } - return null; - } - } } diff --git a/plugins/plugin-maven/che-plugin-maven-server/src/test/java/org/eclipse/che/plugin/maven/server/PomReconcilerTest.java b/plugins/plugin-maven/che-plugin-maven-server/src/test/java/org/eclipse/che/plugin/maven/server/PomReconcilerTest.java index 289214d495..c7ba68fdec 100644 --- a/plugins/plugin-maven/che-plugin-maven-server/src/test/java/org/eclipse/che/plugin/maven/server/PomReconcilerTest.java +++ b/plugins/plugin-maven/che-plugin-maven-server/src/test/java/org/eclipse/che/plugin/maven/server/PomReconcilerTest.java @@ -17,6 +17,7 @@ import org.eclipse.che.api.project.server.FolderEntry; import org.eclipse.che.api.project.server.ProjectRegistry; import org.eclipse.che.api.project.server.VirtualFileEntry; import org.eclipse.che.ide.ext.java.shared.dto.Problem; +import org.eclipse.che.maven.server.MavenTerminal; import org.eclipse.che.plugin.maven.server.core.EclipseWorkspaceProvider; import org.eclipse.che.plugin.maven.server.core.MavenCommunication; import org.eclipse.che.plugin.maven.server.core.MavenExecutorService; @@ -24,9 +25,9 @@ import org.eclipse.che.plugin.maven.server.core.MavenProjectManager; import org.eclipse.che.plugin.maven.server.core.MavenWorkspace; import org.eclipse.che.plugin.maven.server.core.classpath.ClasspathManager; import org.eclipse.che.plugin.maven.server.core.project.MavenProject; +import org.eclipse.che.plugin.maven.server.projecttype.MavenValueProvider; import org.eclipse.che.plugin.maven.server.rest.MavenServerService; import org.eclipse.che.plugin.maven.server.rmi.MavenServerManagerTest; -import org.eclipse.che.maven.server.MavenTerminal; import org.eclipse.che.plugin.maven.shared.MessageType; import org.eclipse.che.plugin.maven.shared.dto.NotificationMessage; import org.eclipse.core.resources.IProject; @@ -52,6 +53,7 @@ public class PomReconcilerTest extends BaseTest { private MavenProjectManager projectManager; private MavenWorkspace mavenWorkspace; + private MavenValueProvider mavenValueProvider; @BeforeMethod public void setUp() throws Exception { @@ -77,6 +79,7 @@ public class PomReconcilerTest extends BaseTest { new MavenProjectManager(wrapperManager, mavenServerManager, terminal, mavenNotifier, new EclipseWorkspaceProvider()); + ClasspathManager classpathManager = new ClasspathManager(root.getAbsolutePath(), wrapperManager, projectManager, terminal, mavenNotifier); diff --git a/plugins/plugin-maven/che-plugin-maven-server/src/test/java/org/eclipse/che/plugin/maven/server/projecttype/MavenValueProviderTest.java b/plugins/plugin-maven/che-plugin-maven-server/src/test/java/org/eclipse/che/plugin/maven/server/projecttype/MavenValueProviderTest.java new file mode 100644 index 0000000000..4432a9a1f5 --- /dev/null +++ b/plugins/plugin-maven/che-plugin-maven-server/src/test/java/org/eclipse/che/plugin/maven/server/projecttype/MavenValueProviderTest.java @@ -0,0 +1,399 @@ +/******************************************************************************* + * 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.plugin.maven.server.projecttype; + +import org.eclipse.che.api.project.server.FileEntry; +import org.eclipse.che.api.project.server.FolderEntry; +import org.eclipse.che.api.vfs.Path; +import org.eclipse.che.commons.lang.NameGenerator; +import org.eclipse.che.ide.ext.java.shared.Constants; +import org.eclipse.che.maven.data.MavenKey; +import org.eclipse.che.plugin.maven.server.core.MavenProjectManager; +import org.eclipse.che.plugin.maven.server.core.project.MavenProject; +import org.eclipse.che.plugin.maven.shared.MavenAttributes; +import org.mockito.Mock; +import org.mockito.testng.MockitoTestNGListener; +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import java.util.List; + +import static java.util.Collections.singletonList; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +/** + * @author Vitalii Parfonov + */ + +@Listeners(value = {MockitoTestNGListener.class}) +public class MavenValueProviderTest { + + String pomContent = "\n" + + "\n" + + " \n" + + " che-plugin-parent\n" + + " org.eclipse.che.plugin\n" + + " 5.0.0-SNAPSHOT\n" + + " " + + " 4.0.0\n" + + " my_group\n" + + " my_artifact\n" + + " 1.0-SNAPSHOT\n" + + " jar\n" + + " \n" + + " src" + + " test" + + " \n" + + ""; + + @Mock + private MavenProjectManager mavenProjectManager; + @Mock + private FolderEntry folderEntry; + @Mock + private MavenProject mavenProject; + @Mock + private MavenKey mavenKey; + @Mock + private MavenKey parentKey; + + private MavenValueProvider mavenValueProvider; + + + @BeforeMethod + public void setUp() { + when(folderEntry.getPath()).thenReturn(Path.of("")); + when(mavenProject.getMavenKey()).thenReturn(mavenKey); + when(mavenProject.getParentKey()).thenReturn(parentKey); + mavenValueProvider = new MavenValueProvider(mavenProjectManager, folderEntry); + } + + + @Test + public void getArtifactIdFromMavenProject() throws Exception { + String artifactId = NameGenerator.generate("artifactId-", 6); + when(mavenKey.getArtifactId()).thenReturn(artifactId); + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List artifactIds = mavenValueProvider.getValues(MavenAttributes.ARTIFACT_ID); + Assert.assertNotNull(artifactIds); + Assert.assertFalse(artifactIds.isEmpty()); + Assert.assertEquals(artifactIds.size(), 1); + Assert.assertNotNull(artifactIds.get(0)); + Assert.assertEquals(artifactIds.get(0), artifactId); + } + + + @Test + public void getGroupIdFromMavenProject() throws Exception { + String groupId = NameGenerator.generate("groupId-", 6); + when(mavenKey.getGroupId()).thenReturn(groupId); + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List groupIds = mavenValueProvider.getValues(MavenAttributes.GROUP_ID); + Assert.assertNotNull(groupIds); + Assert.assertFalse(groupIds.isEmpty()); + Assert.assertEquals(groupIds.size(), 1); + Assert.assertNotNull(groupIds.get(0)); + Assert.assertEquals(groupIds.get(0), groupId); + } + + + @Test + public void getVersionFromMavenProject() throws Exception { + String versionId = NameGenerator.generate("version-", 6); + when(mavenKey.getVersion()).thenReturn(versionId); + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List versions = mavenValueProvider.getValues(MavenAttributes.VERSION); + Assert.assertNotNull(versions); + Assert.assertFalse(versions.isEmpty()); + Assert.assertEquals(versions.size(), 1); + Assert.assertNotNull(versions.get(0)); + Assert.assertEquals(versions.get(0), versionId); + } + + + @Test + public void getPackagingFromMavenProject() throws Exception { + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + when(mavenProject.getPackaging()).thenReturn("war"); + List pkgs = mavenValueProvider.getValues(MavenAttributes.PACKAGING); + Assert.assertNotNull(pkgs); + Assert.assertFalse(pkgs.isEmpty()); + Assert.assertEquals(pkgs.size(), 1); + Assert.assertNotNull(pkgs.get(0)); + Assert.assertEquals(pkgs.get(0), "war"); + } + + @Test + public void getPackagingFromMavenProjectIfNotSet() throws Exception { + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List pkgs = mavenValueProvider.getValues(MavenAttributes.PACKAGING); + Assert.assertNotNull(pkgs); + Assert.assertFalse(pkgs.isEmpty()); + Assert.assertEquals(pkgs.size(), 1); + Assert.assertNotNull(pkgs.get(0)); + Assert.assertEquals(pkgs.get(0), "jar"); + } + + + @Test + public void getParentArtifactFromMavenProject() throws Exception { + String parentArtifact = NameGenerator.generate("parentArtifact", 6); + when(parentKey.getArtifactId()).thenReturn(parentArtifact); + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List values = mavenValueProvider.getValues(MavenAttributes.PARENT_ARTIFACT_ID); + Assert.assertNotNull(values); + Assert.assertFalse(values.isEmpty()); + Assert.assertEquals(values.size(), 1); + Assert.assertNotNull(values.get(0)); + Assert.assertEquals(values.get(0), parentArtifact); + } + + + @Test + public void getParentVersionFromMavenProject() throws Exception { + String parentVersionId = NameGenerator.generate("parent-version-", 6); + when(parentKey.getVersion()).thenReturn(parentVersionId); + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List versions = mavenValueProvider.getValues(MavenAttributes.PARENT_VERSION); + Assert.assertNotNull(versions); + Assert.assertFalse(versions.isEmpty()); + Assert.assertEquals(versions.size(), 1); + Assert.assertNotNull(versions.get(0)); + Assert.assertEquals(versions.get(0), parentVersionId); + } + + @Test + public void getParentGroupFromMavenProject() throws Exception { + String groupId = NameGenerator.generate("parent-group-", 6); + when(parentKey.getGroupId()).thenReturn(groupId); + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List values = mavenValueProvider.getValues(MavenAttributes.PARENT_GROUP_ID); + Assert.assertNotNull(values); + Assert.assertFalse(values.isEmpty()); + Assert.assertEquals(values.size(), 1); + Assert.assertNotNull(values.get(0)); + Assert.assertEquals(values.get(0), groupId); + } + + @Test + public void getSourceFromMavenProject() throws Exception { + final List strings = singletonList("src"); + when(mavenProject.getSources()).thenReturn(strings); + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List sources = mavenValueProvider.getValues(Constants.SOURCE_FOLDER); + Assert.assertNotNull(sources); + Assert.assertFalse(sources.isEmpty()); + Assert.assertEquals(sources.size(), 1); + Assert.assertEquals(sources, strings); + } + + @Test + public void getSourceFromMavenProjectIfNotSet() throws Exception { + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List sources = mavenValueProvider.getValues(Constants.SOURCE_FOLDER); + Assert.assertNotNull(sources); + Assert.assertFalse(sources.isEmpty()); + Assert.assertEquals(sources.size(), 1); + Assert.assertEquals(sources, singletonList(MavenAttributes.DEFAULT_SOURCE_FOLDER)); + } + + @Test + public void getTestSourceFromMavenProject() throws Exception { + List strings = singletonList("src/test"); + when(mavenProject.getTestSources()).thenReturn(strings); + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List sources = mavenValueProvider.getValues(MavenAttributes.TEST_SOURCE_FOLDER); + Assert.assertNotNull(sources); + Assert.assertFalse(sources.isEmpty()); + Assert.assertEquals(sources.size(), 1); + Assert.assertEquals(sources, strings); + } + + @Test + public void getTestSourceFromMavenProjectIfNotSet() throws Exception { + when(mavenProjectManager.getMavenProject(anyString())).thenReturn(mavenProject); + List sources = mavenValueProvider.getValues(MavenAttributes.TEST_SOURCE_FOLDER); + verify(mavenProjectManager).getMavenProject(anyString()); + Assert.assertNotNull(sources); + Assert.assertFalse(sources.isEmpty()); + Assert.assertEquals(sources.size(), 1); + Assert.assertEquals(sources, singletonList(MavenAttributes.DEFAULT_TEST_SOURCE_FOLDER)); + } + + + @Test + public void getArtifactIdFromPom() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pomContent.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List artifactIds = mavenValueProvider.getValues(MavenAttributes.ARTIFACT_ID); + Assert.assertNotNull(artifactIds); + Assert.assertFalse(artifactIds.isEmpty()); + Assert.assertEquals(artifactIds.size(), 1); + Assert.assertNotNull(artifactIds.get(0)); + Assert.assertEquals(artifactIds.get(0), "my_artifact"); + } + + + @Test + public void getGroupIdFromPom() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pomContent.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List groupIds = mavenValueProvider.getValues(MavenAttributes.GROUP_ID); + Assert.assertNotNull(groupIds); + Assert.assertFalse(groupIds.isEmpty()); + Assert.assertEquals(groupIds.size(), 1); + Assert.assertNotNull(groupIds.get(0)); + Assert.assertEquals(groupIds.get(0), "my_group"); + } + + + @Test + public void getVersionFromPom() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pomContent.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List versions = mavenValueProvider.getValues(MavenAttributes.VERSION); + Assert.assertNotNull(versions); + Assert.assertFalse(versions.isEmpty()); + Assert.assertEquals(versions.size(), 1); + Assert.assertNotNull(versions.get(0)); + Assert.assertEquals(versions.get(0), "1.0-SNAPSHOT"); + } + + + @Test + public void getPackagingFromPom() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pomContent.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List pkgs = mavenValueProvider.getValues(MavenAttributes.PACKAGING); + Assert.assertNotNull(pkgs); + Assert.assertFalse(pkgs.isEmpty()); + Assert.assertEquals(pkgs.size(), 1); + Assert.assertNotNull(pkgs.get(0)); + Assert.assertEquals(pkgs.get(0), "jar"); + } + + @Test + public void getPackagingFromPomIfNotSet() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + String pom = ""; + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pom.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List pkgs = mavenValueProvider.getValues(MavenAttributes.PACKAGING); + Assert.assertNotNull(pkgs); + Assert.assertFalse(pkgs.isEmpty()); + Assert.assertEquals(pkgs.size(), 1); + Assert.assertNotNull(pkgs.get(0)); + Assert.assertEquals(pkgs.get(0), "jar"); + } + + + @Test + public void getParentArtifactFromPom() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pomContent.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List values = mavenValueProvider.getValues(MavenAttributes.PARENT_ARTIFACT_ID); + Assert.assertNotNull(values); + Assert.assertFalse(values.isEmpty()); + Assert.assertEquals(values.size(), 1); + Assert.assertNotNull(values.get(0)); + Assert.assertEquals(values.get(0), "che-plugin-parent"); + } + + + @Test + public void getParentVersionFromPom() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pomContent.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List versions = mavenValueProvider.getValues(MavenAttributes.PARENT_VERSION); + Assert.assertNotNull(versions); + Assert.assertFalse(versions.isEmpty()); + Assert.assertEquals(versions.size(), 1); + Assert.assertNotNull(versions.get(0)); + Assert.assertEquals(versions.get(0), "5.0.0-SNAPSHOT"); + } + + @Test + public void getParentGroupFromPom() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pomContent.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List values = mavenValueProvider.getValues(MavenAttributes.PARENT_GROUP_ID); + Assert.assertNotNull(values); + Assert.assertFalse(values.isEmpty()); + Assert.assertEquals(values.size(), 1); + Assert.assertNotNull(values.get(0)); + Assert.assertEquals(values.get(0), "org.eclipse.che.plugin"); + } + + @Test + public void getSourceFromPom() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pomContent.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List sources = mavenValueProvider.getValues(Constants.SOURCE_FOLDER); + Assert.assertNotNull(sources); + Assert.assertFalse(sources.isEmpty()); + Assert.assertEquals(sources.size(), 1); + Assert.assertEquals(sources, singletonList("src")); + } + + @Test + public void getSourceFromPomIfNotSet() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + String pom = ""; + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pom.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List sources = mavenValueProvider.getValues(Constants.SOURCE_FOLDER); + Assert.assertNotNull(sources); + Assert.assertFalse(sources.isEmpty()); + Assert.assertEquals(sources.size(), 1); + Assert.assertEquals(sources, singletonList(MavenAttributes.DEFAULT_SOURCE_FOLDER)); + } + + @Test + public void getTestSourcePom() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pomContent.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List sources = mavenValueProvider.getValues(MavenAttributes.TEST_SOURCE_FOLDER); + Assert.assertNotNull(sources); + Assert.assertFalse(sources.isEmpty()); + Assert.assertEquals(sources.size(), 1); + Assert.assertEquals(sources, singletonList("test")); + } + + @Test + public void getTestSourceFromPomIfNotSet() throws Exception { + FileEntry fileEntry = mock(FileEntry.class); + String pom = ""; + when(fileEntry.getInputStream()).thenReturn(new ByteArrayInputStream(pom.getBytes(StandardCharsets.UTF_8))); + when(folderEntry.getChild(anyString())).thenReturn(fileEntry); + List sources = mavenValueProvider.getValues(MavenAttributes.TEST_SOURCE_FOLDER); + Assert.assertNotNull(sources); + Assert.assertFalse(sources.isEmpty()); + Assert.assertEquals(sources.size(), 1); + Assert.assertEquals(sources, singletonList(MavenAttributes.DEFAULT_TEST_SOURCE_FOLDER)); + } + +} diff --git a/plugins/plugin-maven/che-plugin-maven-shared/pom.xml b/plugins/plugin-maven/che-plugin-maven-shared/pom.xml index 5be9ef2502..5493844857 100644 --- a/plugins/plugin-maven/che-plugin-maven-shared/pom.xml +++ b/plugins/plugin-maven/che-plugin-maven-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-maven-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-maven-shared Che Plugin :: Maven :: Extension Maven Shared diff --git a/plugins/plugin-maven/che-plugin-maven-tools/pom.xml b/plugins/plugin-maven/che-plugin-maven-tools/pom.xml index 08cd97ec3f..b9ba5b64da 100644 --- a/plugins/plugin-maven/che-plugin-maven-tools/pom.xml +++ b/plugins/plugin-maven/che-plugin-maven-tools/pom.xml @@ -16,7 +16,7 @@ che-plugin-maven-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-java-maven-tools jar diff --git a/plugins/plugin-maven/che-plugin-maven-wsmaster/pom.xml b/plugins/plugin-maven/che-plugin-maven-wsmaster/pom.xml index 0758a7a047..e2e95982a5 100644 --- a/plugins/plugin-maven/che-plugin-maven-wsmaster/pom.xml +++ b/plugins/plugin-maven/che-plugin-maven-wsmaster/pom.xml @@ -16,7 +16,7 @@ che-plugin-maven-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-maven-wsmaster jar diff --git a/plugins/plugin-maven/maven-server/maven-server-api/pom.xml b/plugins/plugin-maven/maven-server/maven-server-api/pom.xml index 1a82375b7e..7d4b26c972 100644 --- a/plugins/plugin-maven/maven-server/maven-server-api/pom.xml +++ b/plugins/plugin-maven/maven-server/maven-server-api/pom.xml @@ -16,7 +16,7 @@ che-maven-server org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT maven-server-api jar diff --git a/plugins/plugin-maven/maven-server/maven-server-impl/pom.xml b/plugins/plugin-maven/maven-server/maven-server-impl/pom.xml index a0369b1741..a9c7398042 100644 --- a/plugins/plugin-maven/maven-server/maven-server-impl/pom.xml +++ b/plugins/plugin-maven/maven-server/maven-server-impl/pom.xml @@ -16,7 +16,7 @@ che-maven-server org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT maven-server-impl jar diff --git a/plugins/plugin-maven/maven-server/pom.xml b/plugins/plugin-maven/maven-server/pom.xml index 35ce7d84f0..c9c7d144c1 100644 --- a/plugins/plugin-maven/maven-server/pom.xml +++ b/plugins/plugin-maven/maven-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-maven-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-maven-server pom diff --git a/plugins/plugin-maven/pom.xml b/plugins/plugin-maven/pom.xml index 9df12b4f6d..69c6b183be 100644 --- a/plugins/plugin-maven/pom.xml +++ b/plugins/plugin-maven/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-maven-parent diff --git a/plugins/plugin-nodejs-debugger/che-plugin-nodejs-debugger-ide/pom.xml b/plugins/plugin-nodejs-debugger/che-plugin-nodejs-debugger-ide/pom.xml index aeed457589..de317f923e 100644 --- a/plugins/plugin-nodejs-debugger/che-plugin-nodejs-debugger-ide/pom.xml +++ b/plugins/plugin-nodejs-debugger/che-plugin-nodejs-debugger-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-nodejs-debugger-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-nodejs-debugger-ide jar diff --git a/plugins/plugin-nodejs-debugger/che-plugin-nodejs-debugger-server/pom.xml b/plugins/plugin-nodejs-debugger/che-plugin-nodejs-debugger-server/pom.xml index c8d5055418..487941a168 100644 --- a/plugins/plugin-nodejs-debugger/che-plugin-nodejs-debugger-server/pom.xml +++ b/plugins/plugin-nodejs-debugger/che-plugin-nodejs-debugger-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-nodejs-debugger-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-nodejs-debugger-server jar diff --git a/plugins/plugin-nodejs-debugger/pom.xml b/plugins/plugin-nodejs-debugger/pom.xml index 670660d426..a711bc145f 100644 --- a/plugins/plugin-nodejs-debugger/pom.xml +++ b/plugins/plugin-nodejs-debugger/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-nodejs-debugger-parent pom diff --git a/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/pom.xml b/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/pom.xml index 032cad4148..9e316a31b2 100644 --- a/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/pom.xml +++ b/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-nodejs-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-nodejs-lang-ide jar @@ -34,10 +34,6 @@ org.eclipse.che.core che-core-ide-api - - org.eclipse.che.core - che-core-ide-app - org.eclipse.che.plugin che-plugin-nodejs-lang-shared diff --git a/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/java/org/eclipse/che/plugin/nodejs/ide/NodeJsExtension.java b/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/java/org/eclipse/che/plugin/nodejs/ide/NodeJsExtension.java index e583724a4e..69c896a17d 100644 --- a/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/java/org/eclipse/che/plugin/nodejs/ide/NodeJsExtension.java +++ b/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/java/org/eclipse/che/plugin/nodejs/ide/NodeJsExtension.java @@ -12,15 +12,9 @@ package org.eclipse.che.plugin.nodejs.ide; import com.google.inject.Inject; -import org.eclipse.che.ide.api.action.ActionManager; -import org.eclipse.che.ide.api.action.DefaultActionGroup; -import org.eclipse.che.ide.api.constraints.Constraints; import org.eclipse.che.ide.api.extension.Extension; import org.eclipse.che.ide.api.icon.Icon; import org.eclipse.che.ide.api.icon.IconRegistry; -import org.eclipse.che.plugin.nodejs.ide.action.NewNodeJsFileAction; - -import static org.eclipse.che.ide.api.action.IdeActions.GROUP_FILE_NEW; /** * @author Dmitry Shnurenko @@ -31,13 +25,8 @@ public class NodeJsExtension { public static final String NODE_JS_CATEGORY = "Node.js"; @Inject - private void prepareActions(ActionManager actionManager, - NodeJsResources resources, - IconRegistry iconRegistry, - NewNodeJsFileAction newFileAction) { - DefaultActionGroup newGroup = (DefaultActionGroup)actionManager.getAction(GROUP_FILE_NEW); - actionManager.registerAction("newNodeJsFile", newFileAction); - newGroup.add(newFileAction, Constraints.FIRST); + private void prepareActions(NodeJsResources resources, + IconRegistry iconRegistry) { iconRegistry.registerIcon(new Icon(NODE_JS_CATEGORY + ".samples.category.icon", resources.jsIcon())); } } diff --git a/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/java/org/eclipse/che/plugin/nodejs/ide/NodeJsLocalizationConstant.java b/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/java/org/eclipse/che/plugin/nodejs/ide/NodeJsLocalizationConstant.java deleted file mode 100644 index c9b4b35e8d..0000000000 --- a/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/java/org/eclipse/che/plugin/nodejs/ide/NodeJsLocalizationConstant.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * 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.plugin.nodejs.ide; - -import com.google.gwt.i18n.client.Messages; - -/** - * @author Dmitry Shnurenko - */ -public interface NodeJsLocalizationConstant extends Messages { - - @Key("action.new.node.js.file.title") - String newNodeJsFileTitle(); - - @Key("action.new.node.js.file.description") - String newNodeJsFileDescription(); -} diff --git a/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/java/org/eclipse/che/plugin/nodejs/ide/action/NewNodeJsFileAction.java b/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/java/org/eclipse/che/plugin/nodejs/ide/action/NewNodeJsFileAction.java deleted file mode 100644 index 2c8f8cd973..0000000000 --- a/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/java/org/eclipse/che/plugin/nodejs/ide/action/NewNodeJsFileAction.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * 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.plugin.nodejs.ide.action; - -import com.google.inject.Inject; -import com.google.inject.Provider; -import com.google.web.bindery.event.shared.EventBus; - -import org.eclipse.che.ide.CoreLocalizationConstant; -import org.eclipse.che.ide.api.app.AppContext; -import org.eclipse.che.ide.api.dialogs.DialogFactory; -import org.eclipse.che.ide.api.editor.EditorAgent; -import org.eclipse.che.ide.api.notification.NotificationManager; -import org.eclipse.che.ide.newresource.AbstractNewResourceAction; -import org.eclipse.che.plugin.nodejs.ide.NodeJsLocalizationConstant; -import org.eclipse.che.plugin.nodejs.ide.NodeJsResources; -import org.eclipse.che.plugin.nodejs.shared.Constants; - -/** - * @author Dmitry Shnurenko - */ -public class NewNodeJsFileAction extends AbstractNewResourceAction { - - private static final String DEFAULT_CONTENT = "/* eslint-env node */"; - - @Inject - public NewNodeJsFileAction(NodeJsLocalizationConstant locale, - NodeJsResources resources, - DialogFactory dialogFactory, - CoreLocalizationConstant coreLocalizationConstant, - EventBus eventBus, - AppContext appContext, - NotificationManager notificationManager, - Provider editorAgentProvider) { - super(locale.newNodeJsFileTitle(), - locale.newNodeJsFileDescription(), - resources.jsIcon(), - dialogFactory, - coreLocalizationConstant, - eventBus, - appContext, - notificationManager, - editorAgentProvider); - } - - @Override - protected String getExtension() { - return Constants.NODE_JS_FILE_EXT; - } - - @Override - protected String getDefaultContent() { - return DEFAULT_CONTENT; - } -} diff --git a/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/resources/org/eclipse/che/plugin/nodejs/ide/NodeJsLocalizationConstant.properties b/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/resources/org/eclipse/che/plugin/nodejs/ide/NodeJsLocalizationConstant.properties deleted file mode 100644 index b6a4161580..0000000000 --- a/plugins/plugin-nodejs/che-plugin-nodejs-lang-ide/src/main/resources/org/eclipse/che/plugin/nodejs/ide/NodeJsLocalizationConstant.properties +++ /dev/null @@ -1,13 +0,0 @@ -# -# 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 -# - -action.new.node.js.file.title=New JavaScript File -action.new.node.js.file.description=Create new Node.js file diff --git a/plugins/plugin-nodejs/che-plugin-nodejs-lang-server/pom.xml b/plugins/plugin-nodejs/che-plugin-nodejs-lang-server/pom.xml index a1785ab9e9..c2d3b6fcca 100644 --- a/plugins/plugin-nodejs/che-plugin-nodejs-lang-server/pom.xml +++ b/plugins/plugin-nodejs/che-plugin-nodejs-lang-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-nodejs-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-nodejs-lang-server Che Plugin :: NodeJs :: Extension Server diff --git a/plugins/plugin-nodejs/che-plugin-nodejs-lang-shared/pom.xml b/plugins/plugin-nodejs/che-plugin-nodejs-lang-shared/pom.xml index 3efd24a095..5b42430c73 100644 --- a/plugins/plugin-nodejs/che-plugin-nodejs-lang-shared/pom.xml +++ b/plugins/plugin-nodejs/che-plugin-nodejs-lang-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-nodejs-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-nodejs-lang-shared Che Plugin :: NodeJs :: Extension Shared diff --git a/plugins/plugin-nodejs/pom.xml b/plugins/plugin-nodejs/pom.xml index 1eeda527ba..6701360241 100644 --- a/plugins/plugin-nodejs/pom.xml +++ b/plugins/plugin-nodejs/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-nodejs-parent diff --git a/plugins/plugin-orion/che-plugin-orion-compare/pom.xml b/plugins/plugin-orion/che-plugin-orion-compare/pom.xml index 04708c7b79..2497981449 100644 --- a/plugins/plugin-orion/che-plugin-orion-compare/pom.xml +++ b/plugins/plugin-orion/che-plugin-orion-compare/pom.xml @@ -16,7 +16,7 @@ che-plugin-orion-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-orion-compare jar diff --git a/plugins/plugin-orion/che-plugin-orion-editor/pom.xml b/plugins/plugin-orion/che-plugin-orion-editor/pom.xml index ceb929e975..970d22458c 100644 --- a/plugins/plugin-orion/che-plugin-orion-editor/pom.xml +++ b/plugins/plugin-orion/che-plugin-orion-editor/pom.xml @@ -16,7 +16,7 @@ che-plugin-orion-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-orion-editor diff --git a/plugins/plugin-orion/pom.xml b/plugins/plugin-orion/pom.xml index 8b3c593729..519507780b 100644 --- a/plugins/plugin-orion/pom.xml +++ b/plugins/plugin-orion/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-orion-parent diff --git a/plugins/plugin-php/che-plugin-php-lang-ide/pom.xml b/plugins/plugin-php/che-plugin-php-lang-ide/pom.xml index a133ac2bec..0857b14a71 100644 --- a/plugins/plugin-php/che-plugin-php-lang-ide/pom.xml +++ b/plugins/plugin-php/che-plugin-php-lang-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-php-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-php-lang-ide jar diff --git a/plugins/plugin-php/che-plugin-php-lang-server/pom.xml b/plugins/plugin-php/che-plugin-php-lang-server/pom.xml index f54386fb44..8f443de405 100644 --- a/plugins/plugin-php/che-plugin-php-lang-server/pom.xml +++ b/plugins/plugin-php/che-plugin-php-lang-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-php-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-php-lang-server Che Plugin :: PHP :: Extension Server diff --git a/plugins/plugin-php/che-plugin-php-lang-shared/pom.xml b/plugins/plugin-php/che-plugin-php-lang-shared/pom.xml index 60d3192953..8ef4ebffb4 100644 --- a/plugins/plugin-php/che-plugin-php-lang-shared/pom.xml +++ b/plugins/plugin-php/che-plugin-php-lang-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-php-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-php-lang-shared Che Plugin :: PHP :: Shared diff --git a/plugins/plugin-php/pom.xml b/plugins/plugin-php/pom.xml index fe1c7e6c84..3e56956abf 100644 --- a/plugins/plugin-php/pom.xml +++ b/plugins/plugin-php/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-php-parent diff --git a/plugins/plugin-product-info/pom.xml b/plugins/plugin-product-info/pom.xml index 6a7eff7960..b631db8268 100644 --- a/plugins/plugin-product-info/pom.xml +++ b/plugins/plugin-product-info/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-product-info diff --git a/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-ide/pom.xml b/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-ide/pom.xml index 0bd382a9c5..0e2815e17b 100644 --- a/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-ide/pom.xml +++ b/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-pullrequest-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-pullrequest-ide Che Plugin :: Pull request :: IDE diff --git a/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-server/pom.xml b/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-server/pom.xml index baa6047072..20583de04a 100644 --- a/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-server/pom.xml +++ b/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-pullrequest-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-pullrequest-server Che Plugin :: Pull request :: Server diff --git a/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-shared/pom.xml b/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-shared/pom.xml index 0c63d67dd2..13ff4c47fc 100644 --- a/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-shared/pom.xml +++ b/plugins/plugin-pullrequest-parent/che-plugin-pullrequest-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-pullrequest-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-pullrequest-shared Che Plugin :: Pull request :: Shared diff --git a/plugins/plugin-pullrequest-parent/pom.xml b/plugins/plugin-pullrequest-parent/pom.xml index 3f6fc5d864..58b6749a07 100644 --- a/plugins/plugin-pullrequest-parent/pom.xml +++ b/plugins/plugin-pullrequest-parent/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-pullrequest-parent pom diff --git a/plugins/plugin-python/che-plugin-python-lang-ide/pom.xml b/plugins/plugin-python/che-plugin-python-lang-ide/pom.xml index 846ea61063..def3190911 100644 --- a/plugins/plugin-python/che-plugin-python-lang-ide/pom.xml +++ b/plugins/plugin-python/che-plugin-python-lang-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-python-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-python-lang-ide jar diff --git a/plugins/plugin-python/che-plugin-python-lang-server/pom.xml b/plugins/plugin-python/che-plugin-python-lang-server/pom.xml index 8b115f31c8..cffac6f597 100644 --- a/plugins/plugin-python/che-plugin-python-lang-server/pom.xml +++ b/plugins/plugin-python/che-plugin-python-lang-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-python-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-python-lang-server Che Plugin :: Python :: Extension Server diff --git a/plugins/plugin-python/che-plugin-python-lang-shared/pom.xml b/plugins/plugin-python/che-plugin-python-lang-shared/pom.xml index c277a553af..ee0e327ade 100644 --- a/plugins/plugin-python/che-plugin-python-lang-shared/pom.xml +++ b/plugins/plugin-python/che-plugin-python-lang-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-python-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-python-lang-shared che-plugin-python-lang-shared diff --git a/plugins/plugin-python/pom.xml b/plugins/plugin-python/pom.xml index c789388913..0f9e12623e 100644 --- a/plugins/plugin-python/pom.xml +++ b/plugins/plugin-python/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-python-parent diff --git a/plugins/plugin-sdk/che-plugin-sdk-ext-plugins/pom.xml b/plugins/plugin-sdk/che-plugin-sdk-ext-plugins/pom.xml index 91723fa390..661b43f8fa 100644 --- a/plugins/plugin-sdk/che-plugin-sdk-ext-plugins/pom.xml +++ b/plugins/plugin-sdk/che-plugin-sdk-ext-plugins/pom.xml @@ -16,7 +16,7 @@ che-plugin-sdk-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-sdk-ext-plugins jar diff --git a/plugins/plugin-sdk/che-plugin-sdk-tools/pom.xml b/plugins/plugin-sdk/che-plugin-sdk-tools/pom.xml index 0de97b2db2..f344831f0e 100644 --- a/plugins/plugin-sdk/che-plugin-sdk-tools/pom.xml +++ b/plugins/plugin-sdk/che-plugin-sdk-tools/pom.xml @@ -16,7 +16,7 @@ che-plugin-sdk-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-sdk-tools jar diff --git a/plugins/plugin-sdk/pom.xml b/plugins/plugin-sdk/pom.xml index f445e4254f..dd9ae1939d 100644 --- a/plugins/plugin-sdk/pom.xml +++ b/plugins/plugin-sdk/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-sdk-parent diff --git a/plugins/plugin-ssh-machine/pom.xml b/plugins/plugin-ssh-machine/pom.xml index 9cc071342e..47d4f1fce7 100644 --- a/plugins/plugin-ssh-machine/pom.xml +++ b/plugins/plugin-ssh-machine/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-ssh-machine diff --git a/plugins/plugin-svn/che-plugin-svn-ext-ide/pom.xml b/plugins/plugin-svn/che-plugin-svn-ext-ide/pom.xml index 5f9f6e4f8e..fe37924a3a 100644 --- a/plugins/plugin-svn/che-plugin-svn-ext-ide/pom.xml +++ b/plugins/plugin-svn/che-plugin-svn-ext-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-svn-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-svn-ext-ide jar diff --git a/plugins/plugin-svn/che-plugin-svn-ext-server/pom.xml b/plugins/plugin-svn/che-plugin-svn-ext-server/pom.xml index 6799388ace..b2e22b8513 100644 --- a/plugins/plugin-svn/che-plugin-svn-ext-server/pom.xml +++ b/plugins/plugin-svn/che-plugin-svn-ext-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-svn-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-svn-ext-server jar diff --git a/plugins/plugin-svn/che-plugin-svn-ext-shared/pom.xml b/plugins/plugin-svn/che-plugin-svn-ext-shared/pom.xml index 6659e875bb..26bfa866f3 100644 --- a/plugins/plugin-svn/che-plugin-svn-ext-shared/pom.xml +++ b/plugins/plugin-svn/che-plugin-svn-ext-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-svn-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-svn-ext-shared jar diff --git a/plugins/plugin-svn/pom.xml b/plugins/plugin-svn/pom.xml index 2a5d5e80b6..ef7c743e22 100644 --- a/plugins/plugin-svn/pom.xml +++ b/plugins/plugin-svn/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-svn-parent diff --git a/plugins/plugin-terminal-ui/pom.xml b/plugins/plugin-terminal-ui/pom.xml deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/plugins/plugin-testing-java/plugin-testing-classpath/che-plugin-testing-classpath-maven-server/pom.xml b/plugins/plugin-testing-java/plugin-testing-classpath/che-plugin-testing-classpath-maven-server/pom.xml index 437f8406f8..7e5b3f575b 100644 --- a/plugins/plugin-testing-java/plugin-testing-classpath/che-plugin-testing-classpath-maven-server/pom.xml +++ b/plugins/plugin-testing-java/plugin-testing-classpath/che-plugin-testing-classpath-maven-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-testing-classpath org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-classpath-maven-server Che Plugin :: Java Testing :: Maven Classpath diff --git a/plugins/plugin-testing-java/plugin-testing-classpath/che-plugin-testing-classpath-server/pom.xml b/plugins/plugin-testing-java/plugin-testing-classpath/che-plugin-testing-classpath-server/pom.xml index 45d6423303..536510a6a5 100644 --- a/plugins/plugin-testing-java/plugin-testing-classpath/che-plugin-testing-classpath-server/pom.xml +++ b/plugins/plugin-testing-java/plugin-testing-classpath/che-plugin-testing-classpath-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-testing-classpath org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-classpath-server Che Plugin :: Java Testing :: Classpath diff --git a/plugins/plugin-testing-java/plugin-testing-classpath/pom.xml b/plugins/plugin-testing-java/plugin-testing-classpath/pom.xml index 1ab1229ad8..46ea1e28ed 100644 --- a/plugins/plugin-testing-java/plugin-testing-classpath/pom.xml +++ b/plugins/plugin-testing-java/plugin-testing-classpath/pom.xml @@ -16,7 +16,7 @@ che-plugin-testing-java-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-classpath pom diff --git a/plugins/plugin-testing-java/plugin-testing-junit/che-plugin-testing-junit-ide/pom.xml b/plugins/plugin-testing-java/plugin-testing-junit/che-plugin-testing-junit-ide/pom.xml index 372a992b6d..77d57fe009 100644 --- a/plugins/plugin-testing-java/plugin-testing-junit/che-plugin-testing-junit-ide/pom.xml +++ b/plugins/plugin-testing-java/plugin-testing-junit/che-plugin-testing-junit-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-testing-junit org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-junit-ide Che Plugin :: Java Testing :: JUnit IDE diff --git a/plugins/plugin-testing-java/plugin-testing-junit/che-plugin-testing-junit-server/pom.xml b/plugins/plugin-testing-java/plugin-testing-junit/che-plugin-testing-junit-server/pom.xml index 4558a68537..ee1010ec78 100644 --- a/plugins/plugin-testing-java/plugin-testing-junit/che-plugin-testing-junit-server/pom.xml +++ b/plugins/plugin-testing-java/plugin-testing-junit/che-plugin-testing-junit-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-testing-junit org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-junit-server Che Plugin :: Java Testing :: JUnit Server diff --git a/plugins/plugin-testing-java/plugin-testing-junit/pom.xml b/plugins/plugin-testing-java/plugin-testing-junit/pom.xml index 029f5127cb..522a60e7f8 100644 --- a/plugins/plugin-testing-java/plugin-testing-junit/pom.xml +++ b/plugins/plugin-testing-java/plugin-testing-junit/pom.xml @@ -16,7 +16,7 @@ che-plugin-testing-java-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-junit pom diff --git a/plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-ide/pom.xml b/plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-ide/pom.xml index 435d1de5a8..1ae24313d2 100644 --- a/plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-ide/pom.xml +++ b/plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-testing-testng org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-testng-ide Che Plugin :: Java Testing :: TestNG IDE diff --git a/plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-server/pom.xml b/plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-server/pom.xml index db289d7d29..1c6626e92e 100644 --- a/plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-server/pom.xml +++ b/plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-testing-testng org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-testng-server Che Plugin :: Java Testing :: TestNG Server diff --git a/plugins/plugin-testing-java/plugin-testing-testng/pom.xml b/plugins/plugin-testing-java/plugin-testing-testng/pom.xml index 8a8a7185b4..f56df9eb11 100644 --- a/plugins/plugin-testing-java/plugin-testing-testng/pom.xml +++ b/plugins/plugin-testing-java/plugin-testing-testng/pom.xml @@ -16,7 +16,7 @@ che-plugin-testing-java-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-testng pom diff --git a/plugins/plugin-testing-java/pom.xml b/plugins/plugin-testing-java/pom.xml index 397329dcd1..8c502b7240 100644 --- a/plugins/plugin-testing-java/pom.xml +++ b/plugins/plugin-testing-java/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-java-parent pom diff --git a/plugins/plugin-testing/che-plugin-testing-ide/pom.xml b/plugins/plugin-testing/che-plugin-testing-ide/pom.xml index c39871df13..e497980708 100644 --- a/plugins/plugin-testing/che-plugin-testing-ide/pom.xml +++ b/plugins/plugin-testing/che-plugin-testing-ide/pom.xml @@ -16,7 +16,7 @@ che-plugin-testing-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-ide Che Plugin :: Testing :: IDE diff --git a/plugins/plugin-testing/pom.xml b/plugins/plugin-testing/pom.xml index 5e7c9a8d52..eeff8cd17b 100644 --- a/plugins/plugin-testing/pom.xml +++ b/plugins/plugin-testing/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-testing-parent pom diff --git a/plugins/plugin-urlfactory/pom.xml b/plugins/plugin-urlfactory/pom.xml index bf8a8e47ab..b97ed51eb1 100644 --- a/plugins/plugin-urlfactory/pom.xml +++ b/plugins/plugin-urlfactory/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-url-factory diff --git a/plugins/plugin-web/che-plugin-web-ext-server/pom.xml b/plugins/plugin-web/che-plugin-web-ext-server/pom.xml index c12b46a620..c651a4c83b 100644 --- a/plugins/plugin-web/che-plugin-web-ext-server/pom.xml +++ b/plugins/plugin-web/che-plugin-web-ext-server/pom.xml @@ -16,7 +16,7 @@ che-plugin-web-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-web-ext-server diff --git a/plugins/plugin-web/che-plugin-web-ext-shared/pom.xml b/plugins/plugin-web/che-plugin-web-ext-shared/pom.xml index f59ea352ce..d5461e6157 100644 --- a/plugins/plugin-web/che-plugin-web-ext-shared/pom.xml +++ b/plugins/plugin-web/che-plugin-web-ext-shared/pom.xml @@ -16,7 +16,7 @@ che-plugin-web-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-web-ext-shared diff --git a/plugins/plugin-web/che-plugin-web-ext-web/pom.xml b/plugins/plugin-web/che-plugin-web-ext-web/pom.xml index ceb9bc3311..6ad11539fe 100644 --- a/plugins/plugin-web/che-plugin-web-ext-web/pom.xml +++ b/plugins/plugin-web/che-plugin-web-ext-web/pom.xml @@ -16,7 +16,7 @@ che-plugin-web-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-web-ext-web jar diff --git a/plugins/plugin-web/pom.xml b/plugins/plugin-web/pom.xml index 4bf78514ad..0f58be6115 100644 --- a/plugins/plugin-web/pom.xml +++ b/plugins/plugin-web/pom.xml @@ -16,7 +16,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-web-parent diff --git a/plugins/plugin-zend-debugger/che-plugin-zend-debugger-ide/pom.xml b/plugins/plugin-zend-debugger/che-plugin-zend-debugger-ide/pom.xml index f857222a77..b94cea0d25 100644 --- a/plugins/plugin-zend-debugger/che-plugin-zend-debugger-ide/pom.xml +++ b/plugins/plugin-zend-debugger/che-plugin-zend-debugger-ide/pom.xml @@ -13,7 +13,7 @@ che-plugin-zend-debugger-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-zend-debugger-ide jar diff --git a/plugins/plugin-zend-debugger/che-plugin-zend-debugger-server/pom.xml b/plugins/plugin-zend-debugger/che-plugin-zend-debugger-server/pom.xml index 52e0ed10c3..40289e9971 100644 --- a/plugins/plugin-zend-debugger/che-plugin-zend-debugger-server/pom.xml +++ b/plugins/plugin-zend-debugger/che-plugin-zend-debugger-server/pom.xml @@ -13,7 +13,7 @@ che-plugin-zend-debugger-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-plugin-zend-debugger-server jar diff --git a/plugins/plugin-zend-debugger/pom.xml b/plugins/plugin-zend-debugger/pom.xml index 404c8d7f12..42e0e06b3f 100644 --- a/plugins/plugin-zend-debugger/pom.xml +++ b/plugins/plugin-zend-debugger/pom.xml @@ -13,7 +13,7 @@ che-plugin-parent org.eclipse.che.plugin - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-plugin-zend-debugger-parent diff --git a/plugins/pom.xml b/plugins/pom.xml index a30af039a8..3eab15dcfd 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -16,12 +16,12 @@ che-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml org.eclipse.che.plugin che-plugin-parent - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT pom Che Plugin :: Parent diff --git a/pom.xml b/pom.xml index 6ce4a86f4a..f42a294a34 100644 --- a/pom.xml +++ b/pom.xml @@ -16,11 +16,11 @@ maven-depmgt-pom org.eclipse.che.depmgt - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che che-parent - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT pom Che Parent @@ -43,9 +43,9 @@ https://github.com/eclipse/che - 5.10.0-SNAPSHOT - 5.10.0-SNAPSHOT - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT + 5.11.0-SNAPSHOT + 5.11.0-SNAPSHOT 1.0-beta2 diff --git a/samples/pom.xml b/samples/pom.xml index d2587b28a7..e74a222b2b 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -16,12 +16,12 @@ che-parent org.eclipse.che - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml org.eclipse.che.sample che-sample-parent - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT pom Che Sample :: Parent diff --git a/samples/sample-plugin-actions/che-sample-plugin-actions-ide/pom.xml b/samples/sample-plugin-actions/che-sample-plugin-actions-ide/pom.xml index 3ad48bd0ae..057d4a9f01 100644 --- a/samples/sample-plugin-actions/che-sample-plugin-actions-ide/pom.xml +++ b/samples/sample-plugin-actions/che-sample-plugin-actions-ide/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-actions-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-actions-ide jar diff --git a/samples/sample-plugin-actions/pom.xml b/samples/sample-plugin-actions/pom.xml index 9f7bc26444..9bb117212c 100644 --- a/samples/sample-plugin-actions/pom.xml +++ b/samples/sample-plugin-actions/pom.xml @@ -16,7 +16,7 @@ che-sample-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-sample-plugin-actions-parent diff --git a/samples/sample-plugin-embedjs/che-sample-plugin-embedjs-ide/pom.xml b/samples/sample-plugin-embedjs/che-sample-plugin-embedjs-ide/pom.xml index 2a0ab50cb4..3c81b37db2 100644 --- a/samples/sample-plugin-embedjs/che-sample-plugin-embedjs-ide/pom.xml +++ b/samples/sample-plugin-embedjs/che-sample-plugin-embedjs-ide/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-embedjs-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-embedjs-ide jar diff --git a/samples/sample-plugin-embedjs/pom.xml b/samples/sample-plugin-embedjs/pom.xml index 0d75517c38..caac280fd0 100644 --- a/samples/sample-plugin-embedjs/pom.xml +++ b/samples/sample-plugin-embedjs/pom.xml @@ -16,7 +16,7 @@ che-sample-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-sample-plugin-embedjs-parent diff --git a/samples/sample-plugin-filetype/che-sample-plugin-filetype-ide/pom.xml b/samples/sample-plugin-filetype/che-sample-plugin-filetype-ide/pom.xml index d18d65ec4e..ecf330423a 100644 --- a/samples/sample-plugin-filetype/che-sample-plugin-filetype-ide/pom.xml +++ b/samples/sample-plugin-filetype/che-sample-plugin-filetype-ide/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-filetype-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-filetype-ide jar diff --git a/samples/sample-plugin-filetype/pom.xml b/samples/sample-plugin-filetype/pom.xml index aa56145bc7..a44912289a 100644 --- a/samples/sample-plugin-filetype/pom.xml +++ b/samples/sample-plugin-filetype/pom.xml @@ -16,7 +16,7 @@ che-sample-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-sample-plugin-filetype-parent diff --git a/samples/sample-plugin-json/che-sample-plugin-json-ide/pom.xml b/samples/sample-plugin-json/che-sample-plugin-json-ide/pom.xml index bfeb73083b..80920fab5f 100644 --- a/samples/sample-plugin-json/che-sample-plugin-json-ide/pom.xml +++ b/samples/sample-plugin-json/che-sample-plugin-json-ide/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-json-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-json-ide jar diff --git a/samples/sample-plugin-json/che-sample-plugin-json-server/pom.xml b/samples/sample-plugin-json/che-sample-plugin-json-server/pom.xml index 4b16b267ec..2081978909 100644 --- a/samples/sample-plugin-json/che-sample-plugin-json-server/pom.xml +++ b/samples/sample-plugin-json/che-sample-plugin-json-server/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-json-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-json-server Che Sample :: Plugin JSON :: Server diff --git a/samples/sample-plugin-json/che-sample-plugin-json-shared/pom.xml b/samples/sample-plugin-json/che-sample-plugin-json-shared/pom.xml index 6896a59c01..4765eff03f 100644 --- a/samples/sample-plugin-json/che-sample-plugin-json-shared/pom.xml +++ b/samples/sample-plugin-json/che-sample-plugin-json-shared/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-json-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-json-shared Che Sample :: Plugin JSON :: Shared diff --git a/samples/sample-plugin-json/pom.xml b/samples/sample-plugin-json/pom.xml index dcae6935ab..75ea1684d6 100644 --- a/samples/sample-plugin-json/pom.xml +++ b/samples/sample-plugin-json/pom.xml @@ -16,7 +16,7 @@ che-sample-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-sample-plugin-json-parent diff --git a/samples/sample-plugin-nativeaccess/che-sample-plugin-nativeaccess-ide/pom.xml b/samples/sample-plugin-nativeaccess/che-sample-plugin-nativeaccess-ide/pom.xml index b2b417eab9..694c0ae2d1 100644 --- a/samples/sample-plugin-nativeaccess/che-sample-plugin-nativeaccess-ide/pom.xml +++ b/samples/sample-plugin-nativeaccess/che-sample-plugin-nativeaccess-ide/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-nativeaccess-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-nativeaccess-ide jar diff --git a/samples/sample-plugin-nativeaccess/pom.xml b/samples/sample-plugin-nativeaccess/pom.xml index 137ac54656..d06e8b2b39 100644 --- a/samples/sample-plugin-nativeaccess/pom.xml +++ b/samples/sample-plugin-nativeaccess/pom.xml @@ -16,7 +16,7 @@ che-sample-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-sample-plugin-nativeaccess-parent diff --git a/samples/sample-plugin-parts/che-sample-plugin-parts-ide/pom.xml b/samples/sample-plugin-parts/che-sample-plugin-parts-ide/pom.xml index 7e1ad3afa8..3cf69cca58 100644 --- a/samples/sample-plugin-parts/che-sample-plugin-parts-ide/pom.xml +++ b/samples/sample-plugin-parts/che-sample-plugin-parts-ide/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-parts-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-parts-ide jar diff --git a/samples/sample-plugin-parts/pom.xml b/samples/sample-plugin-parts/pom.xml index a56d613514..d15cb80e55 100644 --- a/samples/sample-plugin-parts/pom.xml +++ b/samples/sample-plugin-parts/pom.xml @@ -16,7 +16,7 @@ che-sample-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-sample-plugin-parts-parent diff --git a/samples/sample-plugin-serverservice/che-sample-plugin-serverservice-ide/pom.xml b/samples/sample-plugin-serverservice/che-sample-plugin-serverservice-ide/pom.xml index 4a01887970..1e9e8b4a23 100644 --- a/samples/sample-plugin-serverservice/che-sample-plugin-serverservice-ide/pom.xml +++ b/samples/sample-plugin-serverservice/che-sample-plugin-serverservice-ide/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-serverservice-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-serverservice-ide jar diff --git a/samples/sample-plugin-serverservice/che-sample-plugin-serverservice-server/pom.xml b/samples/sample-plugin-serverservice/che-sample-plugin-serverservice-server/pom.xml index 8b9c6bb014..cdd9ffec56 100644 --- a/samples/sample-plugin-serverservice/che-sample-plugin-serverservice-server/pom.xml +++ b/samples/sample-plugin-serverservice/che-sample-plugin-serverservice-server/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-serverservice-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-serverservice-server Che Sample :: Plugin ServerService :: Server diff --git a/samples/sample-plugin-serverservice/pom.xml b/samples/sample-plugin-serverservice/pom.xml index 02366e6c1c..b7b5b9e1d9 100644 --- a/samples/sample-plugin-serverservice/pom.xml +++ b/samples/sample-plugin-serverservice/pom.xml @@ -16,7 +16,7 @@ che-sample-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-sample-plugin-serverservice-parent diff --git a/samples/sample-plugin-wizard/che-sample-plugin-wizard-ide/pom.xml b/samples/sample-plugin-wizard/che-sample-plugin-wizard-ide/pom.xml index ddb908183e..acb8121bb3 100644 --- a/samples/sample-plugin-wizard/che-sample-plugin-wizard-ide/pom.xml +++ b/samples/sample-plugin-wizard/che-sample-plugin-wizard-ide/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-wizard-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-wizard-ide jar diff --git a/samples/sample-plugin-wizard/che-sample-plugin-wizard-server/pom.xml b/samples/sample-plugin-wizard/che-sample-plugin-wizard-server/pom.xml index cb8da4e3ff..f52becfa64 100644 --- a/samples/sample-plugin-wizard/che-sample-plugin-wizard-server/pom.xml +++ b/samples/sample-plugin-wizard/che-sample-plugin-wizard-server/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-wizard-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-wizard-server Che Sample :: Plugin Wizard :: Server diff --git a/samples/sample-plugin-wizard/che-sample-plugin-wizard-shared/pom.xml b/samples/sample-plugin-wizard/che-sample-plugin-wizard-shared/pom.xml index b157f12be9..4275abafe5 100644 --- a/samples/sample-plugin-wizard/che-sample-plugin-wizard-shared/pom.xml +++ b/samples/sample-plugin-wizard/che-sample-plugin-wizard-shared/pom.xml @@ -16,7 +16,7 @@ che-sample-plugin-wizard-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-sample-plugin-wizard-shared Che Sample :: Plugin Wizard :: Shared diff --git a/samples/sample-plugin-wizard/pom.xml b/samples/sample-plugin-wizard/pom.xml index f091256598..e23e55d8da 100644 --- a/samples/sample-plugin-wizard/pom.xml +++ b/samples/sample-plugin-wizard/pom.xml @@ -16,7 +16,7 @@ che-sample-parent org.eclipse.che.sample - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml che-sample-plugin-wizard-parent diff --git a/wsagent/agent/pom.xml b/wsagent/agent/pom.xml index 0b02209f82..cb87d05f4b 100644 --- a/wsagent/agent/pom.xml +++ b/wsagent/agent/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT wsagent Workspace Agent diff --git a/wsagent/agent/src/main/resources/org.eclipse.che.ws-agent.script.sh b/wsagent/agent/src/main/resources/org.eclipse.che.ws-agent.script.sh index 4dbf11eb8f..49b30de877 100644 --- a/wsagent/agent/src/main/resources/org.eclipse.che.ws-agent.script.sh +++ b/wsagent/agent/src/main/resources/org.eclipse.che.ws-agent.script.sh @@ -54,7 +54,7 @@ command -v ${JAVA_HOME}/bin/java >/dev/null 2>&1 || { INSTALL_JDK=true; } && { java_version=$(${JAVA_HOME}/bin/java -version 2>&1 | grep version | awk '{print $NF}' | sed 's/"//g' | cut -d '.' -f2) - if [ ! "${java_version}" -eq "8" ]; then + if [ -z ${java_version} ] || [ ! "${java_version}" -eq "8" ]; then INSTALL_JDK=true; fi } diff --git a/wsagent/agent/src/test/java/org/eclipse/che/api/agent/WsAgentLauncherTest.java b/wsagent/agent/src/test/java/org/eclipse/che/api/agent/WsAgentLauncherTest.java index 19d38dc405..88e2456c11 100644 --- a/wsagent/agent/src/test/java/org/eclipse/che/api/agent/WsAgentLauncherTest.java +++ b/wsagent/agent/src/test/java/org/eclipse/che/api/agent/WsAgentLauncherTest.java @@ -66,6 +66,7 @@ public class WsAgentLauncherTest { Mockito.when(machine.getId()).thenReturn(MACHINE_ID); Mockito.when(machine.getWorkspaceId()).thenReturn(WORKSPACE_ID); Mockito.when(machine.getRuntime()).thenReturn(machineRuntime); + Mockito.when(machine.getNode()).thenReturn(Mockito.mock(InstanceNode.class)); Mockito.doReturn(Collections.singletonMap(WS_AGENT_PORT, SERVER)).when(machineRuntime).getServers(); Mockito.when(requestFactory.fromUrl(Matchers.anyString())).thenReturn(pingRequest); Mockito.when(wsAgentPingRequestFactory.createRequest(machine)).thenReturn(pingRequest); diff --git a/wsagent/che-core-api-debug-shared/pom.xml b/wsagent/che-core-api-debug-shared/pom.xml index 379c3e9bbe..a3301cfa60 100644 --- a/wsagent/che-core-api-debug-shared/pom.xml +++ b/wsagent/che-core-api-debug-shared/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-debug-shared jar diff --git a/wsagent/che-core-api-debug/pom.xml b/wsagent/che-core-api-debug/pom.xml index 97ce21cf8c..d2485d55c0 100644 --- a/wsagent/che-core-api-debug/pom.xml +++ b/wsagent/che-core-api-debug/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-debug Che Core :: API :: Debug diff --git a/wsagent/che-core-api-git-shared/pom.xml b/wsagent/che-core-api-git-shared/pom.xml index 9b7bd067a2..4a4cc1d5cb 100644 --- a/wsagent/che-core-api-git-shared/pom.xml +++ b/wsagent/che-core-api-git-shared/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-git-shared jar diff --git a/wsagent/che-core-api-git/pom.xml b/wsagent/che-core-api-git/pom.xml index 260b11b9f3..97ba8c6506 100644 --- a/wsagent/che-core-api-git/pom.xml +++ b/wsagent/che-core-api-git/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-git jar diff --git a/wsagent/che-core-api-languageserver-maven-plugin/pom.xml b/wsagent/che-core-api-languageserver-maven-plugin/pom.xml index 8f2e3a9522..396838dae3 100644 --- a/wsagent/che-core-api-languageserver-maven-plugin/pom.xml +++ b/wsagent/che-core-api-languageserver-maven-plugin/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-languageserver-maven-plugin maven-plugin diff --git a/wsagent/che-core-api-languageserver-shared/pom.xml b/wsagent/che-core-api-languageserver-shared/pom.xml index 2e16b4226c..b9d5579f60 100644 --- a/wsagent/che-core-api-languageserver-shared/pom.xml +++ b/wsagent/che-core-api-languageserver-shared/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-languageserver-shared jar diff --git a/wsagent/che-core-api-languageserver/pom.xml b/wsagent/che-core-api-languageserver/pom.xml index 4b7a445ef4..a3b31bd1d6 100644 --- a/wsagent/che-core-api-languageserver/pom.xml +++ b/wsagent/che-core-api-languageserver/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-languageserver jar diff --git a/wsagent/che-core-api-oauth/pom.xml b/wsagent/che-core-api-oauth/pom.xml index 3a4c4b1c73..58d923d647 100644 --- a/wsagent/che-core-api-oauth/pom.xml +++ b/wsagent/che-core-api-oauth/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-oauth jar diff --git a/wsagent/che-core-api-project-shared/pom.xml b/wsagent/che-core-api-project-shared/pom.xml index 850c0a2573..0429975811 100644 --- a/wsagent/che-core-api-project-shared/pom.xml +++ b/wsagent/che-core-api-project-shared/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-project-shared jar diff --git a/wsagent/che-core-api-project/pom.xml b/wsagent/che-core-api-project/pom.xml index 48e328b4d5..fe2e630471 100644 --- a/wsagent/che-core-api-project/pom.xml +++ b/wsagent/che-core-api-project/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-project jar @@ -101,7 +101,7 @@ org.eclipse.che.core che-core-api-project-shared - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.core diff --git a/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/vfs/impl/file/event/detectors/EditorFileTracker.java b/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/vfs/impl/file/event/detectors/EditorFileTracker.java index b8dfebfe0c..0161be2b3b 100644 --- a/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/vfs/impl/file/event/detectors/EditorFileTracker.java +++ b/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/vfs/impl/file/event/detectors/EditorFileTracker.java @@ -42,7 +42,6 @@ import java.util.function.Consumer; import static java.nio.charset.Charset.defaultCharset; import static org.eclipse.che.api.project.shared.dto.event.FileWatcherEventType.DELETED; import static org.eclipse.che.api.project.shared.dto.event.FileWatcherEventType.MODIFIED; -import static org.eclipse.che.api.vfs.watcher.FileWatcherManager.EMPTY_CONSUMER; import static org.eclipse.che.dto.server.DtoFactory.newDto; import static org.slf4j.LoggerFactory.getLogger; @@ -165,7 +164,8 @@ public class EditorFileTracker { } private Consumer getCreateConsumer(String endpointId, String path) { - return EMPTY_CONSUMER; + // for case when file is updated through recreation + return getModifyConsumer(endpointId, path); } private Consumer getModifyConsumer(String endpointId, String path) { diff --git a/wsagent/che-core-api-testing-shared/pom.xml b/wsagent/che-core-api-testing-shared/pom.xml index debea82b9d..03ad2eb567 100644 --- a/wsagent/che-core-api-testing-shared/pom.xml +++ b/wsagent/che-core-api-testing-shared/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-testing-shared Che Core :: API :: Testing Shared diff --git a/wsagent/che-core-api-testing/pom.xml b/wsagent/che-core-api-testing/pom.xml index 8e3bc08492..5b55d25026 100644 --- a/wsagent/che-core-api-testing/pom.xml +++ b/wsagent/che-core-api-testing/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-testing Che Core :: API :: Testing diff --git a/wsagent/che-core-git-impl-jgit/pom.xml b/wsagent/che-core-git-impl-jgit/pom.xml index 86f07bb6c0..b566caa1c3 100644 --- a/wsagent/che-core-git-impl-jgit/pom.xml +++ b/wsagent/che-core-git-impl-jgit/pom.xml @@ -17,7 +17,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-git-impl-jgit jar diff --git a/wsagent/che-core-ssh-key-ide/pom.xml b/wsagent/che-core-ssh-key-ide/pom.xml index f77eca7c5a..4d3812c16e 100644 --- a/wsagent/che-core-ssh-key-ide/pom.xml +++ b/wsagent/che-core-ssh-key-ide/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.plugin che-plugin-ssh-key-ide diff --git a/wsagent/che-core-ssh-key-server/pom.xml b/wsagent/che-core-ssh-key-server/pom.xml index 8c13a5cfdc..fba8d42ea5 100644 --- a/wsagent/che-core-ssh-key-server/pom.xml +++ b/wsagent/che-core-ssh-key-server/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT org.eclipse.che.plugin che-plugin-ssh-key-server diff --git a/wsagent/che-wsagent-core/pom.xml b/wsagent/che-wsagent-core/pom.xml index 68cfd01716..8ee04038ce 100644 --- a/wsagent/che-wsagent-core/pom.xml +++ b/wsagent/che-wsagent-core/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-wsagent-core war diff --git a/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/CheWsAgentServletModule.java b/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/CheWsAgentServletModule.java index 66ab86c2fd..2c4c128152 100644 --- a/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/CheWsAgentServletModule.java +++ b/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/CheWsAgentServletModule.java @@ -12,6 +12,7 @@ package org.eclipse.che.wsagent.server; import com.google.inject.servlet.ServletModule; +import org.eclipse.che.api.core.cors.CheCorsFilter; import org.eclipse.che.inject.DynaModule; import org.everrest.guice.servlet.GuiceEverrestServlet; @@ -27,6 +28,7 @@ import org.everrest.guice.servlet.GuiceEverrestServlet; public class CheWsAgentServletModule extends ServletModule { @Override protected void configureServlets() { + filter("/*").through(CheCorsFilter.class); serveRegex("^/api((?!(/(ws|eventbus)($|/.*)))/.*)").with(GuiceEverrestServlet.class); } } diff --git a/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/WsAgentServletModule.java b/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/WsAgentServletModule.java index f655466408..99675c6c5a 100644 --- a/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/WsAgentServletModule.java +++ b/wsagent/che-wsagent-core/src/main/java/org/eclipse/che/wsagent/server/WsAgentServletModule.java @@ -12,7 +12,6 @@ package org.eclipse.che.wsagent.server; import com.google.inject.servlet.ServletModule; -import org.eclipse.che.api.core.cors.CheCorsFilter; import org.eclipse.che.inject.DynaModule; import org.everrest.websockets.WSConnectionTracker; @@ -26,7 +25,5 @@ public class WsAgentServletModule extends ServletModule { @Override protected void configureServlets() { getServletContext().addListener(new WSConnectionTracker()); - filter("/*").through(CheCorsFilter.class); - } } diff --git a/wsagent/pom.xml b/wsagent/pom.xml index c04e99e71c..296f8a60f6 100644 --- a/wsagent/pom.xml +++ b/wsagent/pom.xml @@ -16,12 +16,12 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../core/pom.xml org.eclipse.che.core che-agent-parent - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT pom Che Agent Parent diff --git a/wsagent/wsagent-local/pom.xml b/wsagent/wsagent-local/pom.xml index 033d1a2093..6d48fea208 100644 --- a/wsagent/wsagent-local/pom.xml +++ b/wsagent/wsagent-local/pom.xml @@ -16,7 +16,7 @@ che-agent-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT wsagent-local Che Core :: API :: Agent diff --git a/wsmaster/che-core-api-account/pom.xml b/wsmaster/che-core-api-account/pom.xml index c4084e879d..6c42983060 100644 --- a/wsmaster/che-core-api-account/pom.xml +++ b/wsmaster/che-core-api-account/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-account Che Core :: API :: Account diff --git a/wsmaster/che-core-api-auth-shared/pom.xml b/wsmaster/che-core-api-auth-shared/pom.xml index bbc285a13a..ed5db3ae29 100644 --- a/wsmaster/che-core-api-auth-shared/pom.xml +++ b/wsmaster/che-core-api-auth-shared/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-auth-shared jar diff --git a/wsmaster/che-core-api-auth/pom.xml b/wsmaster/che-core-api-auth/pom.xml index 5cbd38b7d0..65af7bf66c 100644 --- a/wsmaster/che-core-api-auth/pom.xml +++ b/wsmaster/che-core-api-auth/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-auth jar diff --git a/wsmaster/che-core-api-factory-shared/pom.xml b/wsmaster/che-core-api-factory-shared/pom.xml index 72cc397247..d9ab87fb02 100644 --- a/wsmaster/che-core-api-factory-shared/pom.xml +++ b/wsmaster/che-core-api-factory-shared/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-factory-shared jar diff --git a/wsmaster/che-core-api-factory/pom.xml b/wsmaster/che-core-api-factory/pom.xml index 9f6980c62c..8d55910863 100644 --- a/wsmaster/che-core-api-factory/pom.xml +++ b/wsmaster/che-core-api-factory/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-factory jar diff --git a/wsmaster/che-core-api-machine-shared/pom.xml b/wsmaster/che-core-api-machine-shared/pom.xml index f37c7141c2..f38589c167 100644 --- a/wsmaster/che-core-api-machine-shared/pom.xml +++ b/wsmaster/che-core-api-machine-shared/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-machine-shared jar diff --git a/wsmaster/che-core-api-project-templates-shared/pom.xml b/wsmaster/che-core-api-project-templates-shared/pom.xml index 3937daf4f3..7a61861149 100644 --- a/wsmaster/che-core-api-project-templates-shared/pom.xml +++ b/wsmaster/che-core-api-project-templates-shared/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-project-templates-shared Che Core :: API :: Project Templates :: Shared diff --git a/wsmaster/che-core-api-project-templates/pom.xml b/wsmaster/che-core-api-project-templates/pom.xml index 09f34c124f..8149ff53c6 100644 --- a/wsmaster/che-core-api-project-templates/pom.xml +++ b/wsmaster/che-core-api-project-templates/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-project-templates Che Core :: API :: Project Templates diff --git a/wsmaster/che-core-api-ssh-shared/pom.xml b/wsmaster/che-core-api-ssh-shared/pom.xml index c6b45213ec..223775fdb1 100644 --- a/wsmaster/che-core-api-ssh-shared/pom.xml +++ b/wsmaster/che-core-api-ssh-shared/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-ssh-shared jar diff --git a/wsmaster/che-core-api-ssh/pom.xml b/wsmaster/che-core-api-ssh/pom.xml index d29e2558fb..27c273d5d3 100644 --- a/wsmaster/che-core-api-ssh/pom.xml +++ b/wsmaster/che-core-api-ssh/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-ssh jar diff --git a/wsmaster/che-core-api-system-shared/pom.xml b/wsmaster/che-core-api-system-shared/pom.xml index 944bb3f619..e693b4f966 100644 --- a/wsmaster/che-core-api-system-shared/pom.xml +++ b/wsmaster/che-core-api-system-shared/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-system-shared jar diff --git a/wsmaster/che-core-api-system/pom.xml b/wsmaster/che-core-api-system/pom.xml index 80da9e1281..c45dc8d6e7 100644 --- a/wsmaster/che-core-api-system/pom.xml +++ b/wsmaster/che-core-api-system/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-system jar diff --git a/wsmaster/che-core-api-user-shared/pom.xml b/wsmaster/che-core-api-user-shared/pom.xml index abfd9a37cd..508d9712fe 100644 --- a/wsmaster/che-core-api-user-shared/pom.xml +++ b/wsmaster/che-core-api-user-shared/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-user-shared Che Core :: API :: User :: Shared diff --git a/wsmaster/che-core-api-user/pom.xml b/wsmaster/che-core-api-user/pom.xml index 69b602149a..bd9794fc68 100644 --- a/wsmaster/che-core-api-user/pom.xml +++ b/wsmaster/che-core-api-user/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-user Che Core :: API :: User diff --git a/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/UserManager.java b/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/UserManager.java index cee09c3e27..366951f297 100644 --- a/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/UserManager.java +++ b/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/UserManager.java @@ -50,6 +50,7 @@ import static org.eclipse.che.commons.lang.NameGenerator.generate; * * @author Max Shaposhnik (mshaposhnik@codenvy.com) * @author Yevhenii Voevodin + * @author Anton Korneta */ @Singleton public class UserManager { @@ -220,6 +221,58 @@ public class UserManager { return userDao.getAll(maxItems, skipCount); } + /** + * Returns all users whose email address contains specified {@code emailPart}. + * + * @param emailPart + * fragment of user's email + * @param maxItems + * the maximum number of users to return + * @param skipCount + * the number of users to skip + * @return list of matched users + * @throws NullPointerException + * when {@code emailPart} is null + * @throws IllegalArgumentException + * when {@code maxItems} or {@code skipCount} is negative or + * when {@code skipCount} more than {@value Integer#MAX_VALUE} + * @throws ServerException + * when any other error occurs + */ + public Page getByEmailPart(String emailPart, int maxItems, long skipCount) throws ServerException { + requireNonNull(emailPart, "Required non-null email part"); + checkArgument(maxItems >= 0, "The number of items to return can't be negative"); + checkArgument(skipCount >= 0 && skipCount <= Integer.MAX_VALUE, + "The number of items to skip can't be negative or greater than " + Integer.MAX_VALUE); + return userDao.getByEmailPart(emailPart, maxItems, skipCount); + } + + /** + * Returns all users whose name contains specified {@code namePart}. + * + * @param namePart + * fragment of user's name + * @param maxItems + * the maximum number of users to return + * @param skipCount + * the number of users to skip + * @return list of matched users + * @throws NullPointerException + * when {@code namePart} is null + * @throws IllegalArgumentException + * when {@code maxItems} or {@code skipCount} is negative or + * when {@code skipCount} more than {@value Integer#MAX_VALUE} + * @throws ServerException + * when any other error occurs + */ + public Page getByNamePart(String namePart, int maxItems, long skipCount) throws ServerException { + requireNonNull(namePart, "Required non-null name part"); + checkArgument(maxItems >= 0, "The number of items to return can't be negative"); + checkArgument(skipCount >= 0 && skipCount <= Integer.MAX_VALUE, + "The number of items to skip can't be negative or greater than " + Integer.MAX_VALUE); + return userDao.getByNamePart(namePart, maxItems, skipCount); + } + /** * Gets total count of all users * diff --git a/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/jpa/JpaUserDao.java b/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/jpa/JpaUserDao.java index 26be30b2e8..528f666c27 100644 --- a/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/jpa/JpaUserDao.java +++ b/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/jpa/JpaUserDao.java @@ -193,6 +193,60 @@ public class JpaUserDao implements UserDao { } } + @Override + @Transactional + public Page getByNamePart(String namePart, int maxItems, long skipCount) throws ServerException { + requireNonNull(namePart, "Required non-null name part"); + checkArgument(maxItems >= 0, "The number of items to return can't be negative"); + checkArgument(skipCount >= 0 && skipCount <= Integer.MAX_VALUE, + "The number of items to skip can't be negative or greater than " + Integer.MAX_VALUE); + try { + final List list = managerProvider.get() + .createNamedQuery("User.getByNamePart", UserImpl.class) + .setParameter("name", namePart.toLowerCase()) + .setMaxResults(maxItems) + .setFirstResult((int)skipCount) + .getResultList() + .stream() + .map(JpaUserDao::erasePassword) + .collect(toList()); + final long count = managerProvider.get() + .createNamedQuery("User.getByNamePartCount", Long.class) + .setParameter("name", namePart.toLowerCase()) + .getSingleResult(); + return new Page<>(list, skipCount, maxItems, count); + } catch (RuntimeException x) { + throw new ServerException(x.getLocalizedMessage(), x); + } + } + + @Override + @Transactional + public Page getByEmailPart(String emailPart, int maxItems, long skipCount) throws ServerException { + requireNonNull(emailPart, "Required non-null email part"); + checkArgument(maxItems >= 0, "The number of items to return can't be negative"); + checkArgument(skipCount >= 0 && skipCount <= Integer.MAX_VALUE, + "The number of items to skip can't be negative or greater than " + Integer.MAX_VALUE); + try { + final List list = managerProvider.get() + .createNamedQuery("User.getByEmailPart", UserImpl.class) + .setParameter("email", emailPart.toLowerCase()) + .setMaxResults(maxItems) + .setFirstResult((int)skipCount) + .getResultList() + .stream() + .map(JpaUserDao::erasePassword) + .collect(toList()); + final long count = managerProvider.get() + .createNamedQuery("User.getByEmailPartCount", Long.class) + .setParameter("email", emailPart.toLowerCase()) + .getSingleResult(); + return new Page<>(list, skipCount, maxItems, count); + } catch (RuntimeException x) { + throw new ServerException(x.getLocalizedMessage(), x); + } + } + @Override @Transactional public long getTotalCount() throws ServerException { diff --git a/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/model/impl/UserImpl.java b/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/model/impl/UserImpl.java index a72316a341..f8a95fe0a3 100644 --- a/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/model/impl/UserImpl.java +++ b/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/model/impl/UserImpl.java @@ -49,8 +49,15 @@ import java.util.Objects; @NamedQuery(name = "User.getAll", query = "SELECT u FROM Usr u"), @NamedQuery(name = "User.getTotalCount", - query = "SELECT COUNT(u) FROM Usr u") - + query = "SELECT COUNT(u) FROM Usr u"), + @NamedQuery(name = "User.getByEmailPart", + query = "SELECT u FROM Usr u WHERE LOWER(u.email) LIKE CONCAT('%', :email, '%')"), + @NamedQuery(name = "User.getByEmailPartCount", + query = "SELECT COUNT(u) FROM Usr u WHERE LOWER(u.email) LIKE CONCAT('%', :email, '%')"), + @NamedQuery(name = "User.getByNamePart", + query = "SELECT u FROM Usr u WHERE LOWER(u.name) LIKE CONCAT('%', :name, '%')"), + @NamedQuery(name = "User.getByNamePartCount", + query = "SELECT COUNT(u) FROM Usr u WHERE LOWER(u.name) LIKE CONCAT('%', :name, '%')") } ) @Table(name = "usr") diff --git a/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/spi/UserDao.java b/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/spi/UserDao.java index 9663da6eab..863c67a136 100644 --- a/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/spi/UserDao.java +++ b/wsmaster/che-core-api-user/src/main/java/org/eclipse/che/api/user/server/spi/UserDao.java @@ -29,6 +29,7 @@ import org.eclipse.che.api.user.server.model.impl.UserImpl; * such kind of inconsistencies are expected by design and may be treated further. * * @author Yevhenii Voevodin + * @author Anton Korneta */ public interface UserDao { @@ -176,6 +177,56 @@ public interface UserDao { */ Page getAll(int maxItems, long skipCount) throws ServerException; + /** + * Returns all users whose name contains(case insensitively) specified {@code namePart}. + * + * @param namePart + * fragment of user's name + * @param maxItems + * the maximum number of users to return + * @param skipCount + * the number of users to skip + * @return list of matched users + * @throws NullPointerException + * when {@code namePart} is null + * @throws IllegalArgumentException + * when {@code maxItems} or {@code skipCount} is negative or + * when {@code skipCount} more than {@value Integer#MAX_VALUE} + * @throws ServerException + * when any other error occurs + */ + Page getByNamePart(String namePart, int maxItems, long skipCount) throws ServerException; + + /** + * Returns all users whose email address contains(case insensitively) specified {@code emailPart}. + * + *

For example if email fragment would be 'CHE' then result of search will include the following: + *

+     *  |        emails          |  result  |
+     *  | Cherkassy@example.com  |    +     |
+     *  | preacher@example.com   |    +     |
+     *  | user@ukr.che           |    +     |
+     *  | johny@example.com      |    -     |
+     *  | CoachEddie@example.com |    +     |
+     * 
+ * + * @param emailPart + * fragment of user's email + * @param maxItems + * the maximum number of users to return + * @param skipCount + * the number of users to skip + * @return list of matched users + * @throws NullPointerException + * when {@code emailPart} is null + * @throws IllegalArgumentException + * when {@code maxItems} or {@code skipCount} is negative or + * when {@code skipCount} more than {@value Integer#MAX_VALUE} + * @throws ServerException + * when any other error occurs + */ + Page getByEmailPart(String emailPart, int maxItems, long skipCount) throws ServerException; + /** * Get count of all users from persistent layer. * diff --git a/wsmaster/che-core-api-user/src/test/java/org/eclipse/che/api/user/server/spi/tck/UserDaoTest.java b/wsmaster/che-core-api-user/src/test/java/org/eclipse/che/api/user/server/spi/tck/UserDaoTest.java index 9687a255d0..373a0b1d4b 100644 --- a/wsmaster/che-core-api-user/src/test/java/org/eclipse/che/api/user/server/spi/tck/UserDaoTest.java +++ b/wsmaster/che-core-api-user/src/test/java/org/eclipse/che/api/user/server/spi/tck/UserDaoTest.java @@ -34,8 +34,11 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; +import java.util.Set; import static java.util.Arrays.asList; +import static java.util.Arrays.stream; +import static java.util.stream.Collectors.toSet; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doCallRealMethod; import static org.mockito.Mockito.mock; @@ -56,6 +59,8 @@ public class UserDaoTest { private static final int COUNT_OF_USERS = 5; + private static final String NAME_PREFIX = "user_name-"; + private UserImpl[] users; @Inject @@ -73,7 +78,7 @@ public class UserDaoTest { for (int i = 0; i < users.length; i++) { final String id = NameGenerator.generate("user", Constants.ID_LENGTH); - final String name = "user_name-" + i; + final String name = NAME_PREFIX + i; final String email = name + "@eclipse.org"; final String password = NameGenerator.generate("", Constants.PASSWORD_LENGTH); final List aliases = new ArrayList<>(asList("google:" + name, "github:" + name)); @@ -418,6 +423,72 @@ public class UserDaoTest { .count(), users.length); } + @Test(expectedExceptions = NullPointerException.class) + public void throwsNpeWhenGettingByNamePartWithNullEmailPart() throws Exception { + userDao.getByNamePart(null, 0, 0); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void throwsIllegalArgExceptionWhenGettingByNamePartWithNegativeMaxItems() throws Exception { + userDao.getByNamePart(NAME_PREFIX, -1, 0); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void throwsIllegalArgExceptionWhenGettingByNamePartWithNegativeSkipCount() throws Exception { + userDao.getByNamePart(NAME_PREFIX, 10, -1); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void throwsIllegalArgExceptionWhenGettingByNamePartWithSkipCountThatGreaterThanLimit() throws Exception { + userDao.getByNamePart(NAME_PREFIX, 10, 0xffffffffL); + } + + @Test + public void getsUsersByNamePart() throws Exception { + Set actual = stream(users).map(u -> new UserImpl(u.getId(), + u.getEmail(), + u.getName(), + null, + u.getAliases())).collect(toSet()); + + Set expect = new HashSet<>(userDao.getByNamePart(NAME_PREFIX, users.length, 0).getItems()); + + assertEquals(actual, expect); + } + + @Test(expectedExceptions = NullPointerException.class) + public void throwsNpeWhenGettingByEmailPartWithNullEmailPart() throws Exception { + userDao.getByEmailPart(null, 0, 0); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void throwsIllegalArgExceptionWhenGettingByEmailPartWithNegativeMaxItems() throws Exception { + userDao.getByEmailPart(NAME_PREFIX, -1, 0); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void throwsIllegalArgExceptionWhenGettingByEmailPartWithNegativeSkipCount() throws Exception { + userDao.getByEmailPart(NAME_PREFIX, 10, -1); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void throwsIllegalArgExceptionWhenGettingByEmailPartWithSkipCountThatGreaterThanLimit() throws Exception { + userDao.getByEmailPart(NAME_PREFIX, 10, 0xffffffffL); + } + + @Test + public void getsUsersByEmailPart() throws Exception { + Set actual = stream(users).map(u -> new UserImpl(u.getId(), + u.getEmail(), + u.getName(), + null, + u.getAliases())).collect(toSet()); + + Set expect = new HashSet<>(userDao.getByEmailPart(NAME_PREFIX, users.length, 0).getItems()); + + assertEquals(actual, expect); + } + private static void assertEqualsNoPassword(User actual, User expected) { assertNotNull(actual, "Expected not-null user"); assertEquals(actual.getId(), expected.getId()); diff --git a/wsmaster/che-core-api-workspace-shared/pom.xml b/wsmaster/che-core-api-workspace-shared/pom.xml index de4033d35f..ecb6ae5f2f 100644 --- a/wsmaster/che-core-api-workspace-shared/pom.xml +++ b/wsmaster/che-core-api-workspace-shared/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-workspace-shared jar diff --git a/wsmaster/che-core-api-workspace/pom.xml b/wsmaster/che-core-api-workspace/pom.xml index 36e2d0a6a2..431294a5af 100644 --- a/wsmaster/che-core-api-workspace/pom.xml +++ b/wsmaster/che-core-api-workspace/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-api-workspace jar diff --git a/wsmaster/che-core-sql-schema/pom.xml b/wsmaster/che-core-sql-schema/pom.xml index e845dcbea0..04cf6b4300 100644 --- a/wsmaster/che-core-sql-schema/pom.xml +++ b/wsmaster/che-core-sql-schema/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT che-core-sql-schema Che Core :: SQL :: Schema diff --git a/wsmaster/che-core-sql-schema/src/main/resources/che-schema/5.11.0/1__optimize_user_search.sql b/wsmaster/che-core-sql-schema/src/main/resources/che-schema/5.11.0/1__optimize_user_search.sql new file mode 100644 index 0000000000..063e4f5d15 --- /dev/null +++ b/wsmaster/che-core-sql-schema/src/main/resources/che-schema/5.11.0/1__optimize_user_search.sql @@ -0,0 +1,15 @@ +-- +-- [2012] - [2017] Codenvy, S.A. +-- All Rights Reserved. +-- +-- NOTICE: All information contained herein is, and remains +-- the property of Codenvy S.A. and its suppliers, +-- if any. The intellectual and technical concepts contained +-- herein are proprietary to Codenvy S.A. +-- and its suppliers and may be covered by U.S. and Foreign Patents, +-- patents in process, and are protected by trade secret or copyright law. +-- Dissemination of this information or reproduction of this material +-- is strictly forbidden unless prior written permission is obtained +-- from Codenvy S.A.. +-- + diff --git a/wsmaster/che-core-sql-schema/src/main/resources/che-schema/5.11.0/postgresql/1__optimize_user_search.sql b/wsmaster/che-core-sql-schema/src/main/resources/che-schema/5.11.0/postgresql/1__optimize_user_search.sql new file mode 100644 index 0000000000..90b1df11fe --- /dev/null +++ b/wsmaster/che-core-sql-schema/src/main/resources/che-schema/5.11.0/postgresql/1__optimize_user_search.sql @@ -0,0 +1,17 @@ +-- +-- [2012] - [2017] Codenvy, S.A. +-- All Rights Reserved. +-- +-- NOTICE: All information contained herein is, and remains +-- the property of Codenvy S.A. and its suppliers, +-- if any. The intellectual and technical concepts contained +-- herein are proprietary to Codenvy S.A. +-- and its suppliers and may be covered by U.S. and Foreign Patents, +-- patents in process, and are protected by trade secret or copyright law. +-- Dissemination of this information or reproduction of this material +-- is strictly forbidden unless prior written permission is obtained +-- from Codenvy S.A.. +-- +CREATE EXTENSION IF NOT EXISTS pg_trgm; +CREATE INDEX index_user_lower_email ON usr USING GIN (LOWER(email) gin_trgm_ops); +CREATE INDEX index_user_lower_name ON usr USING GIN (LOWER(name) gin_trgm_ops); diff --git a/wsmaster/integration-tests/cascade-removal/pom.xml b/wsmaster/integration-tests/cascade-removal/pom.xml index 27048140aa..ce14958015 100644 --- a/wsmaster/integration-tests/cascade-removal/pom.xml +++ b/wsmaster/integration-tests/cascade-removal/pom.xml @@ -16,7 +16,7 @@ integration-tests-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT cascade-removal Integration Tests :: Cascade Removal diff --git a/wsmaster/integration-tests/pom.xml b/wsmaster/integration-tests/pom.xml index 1ffe0c9f28..7e82727f33 100644 --- a/wsmaster/integration-tests/pom.xml +++ b/wsmaster/integration-tests/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../pom.xml integration-tests-parent diff --git a/wsmaster/integration-tests/postgresql-tck/pom.xml b/wsmaster/integration-tests/postgresql-tck/pom.xml index d159c037cf..3497ef0ff8 100644 --- a/wsmaster/integration-tests/postgresql-tck/pom.xml +++ b/wsmaster/integration-tests/postgresql-tck/pom.xml @@ -16,7 +16,7 @@ integration-tests-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT postgresql-tck jar diff --git a/wsmaster/pom.xml b/wsmaster/pom.xml index 5fb9f1732b..7af839e440 100644 --- a/wsmaster/pom.xml +++ b/wsmaster/pom.xml @@ -16,11 +16,11 @@ che-core-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT ../core/pom.xml che-master-parent - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT pom Che Master Parent diff --git a/wsmaster/wsmaster-local/pom.xml b/wsmaster/wsmaster-local/pom.xml index 66bf3f07ad..d0e411f72e 100644 --- a/wsmaster/wsmaster-local/pom.xml +++ b/wsmaster/wsmaster-local/pom.xml @@ -16,7 +16,7 @@ che-master-parent org.eclipse.che.core - 5.10.0-SNAPSHOT + 5.11.0-SNAPSHOT wsmaster-local Che Core :: API :: Impl Local