Merge branch 'master' into spi

6.19.x
Artem Zatsarynnyi 2017-08-17 15:21:26 +03:00
commit 51fed52707
325 changed files with 3877 additions and 729 deletions

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>bootstrapper</artifactId>
<name>Agents :: Bootstrapper</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>exec-agent</artifactId>
<name>Agent :: Exec</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>git-credentials-agent</artifactId>
<name>Git Credentials Agent</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>go-agents</artifactId>
<name>Agent :: Golang agents</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>ls-csharp-agent</artifactId>
<name>Language Server C# Agent</name>

View File

@ -61,8 +61,8 @@ if echo ${LINUX_TYPE} | grep -qi "rhel"; then
command -v dotnet >/dev/null 2>&1 || {
${SUDO} subscription-manager repos --enable=rhel-7-server-dotnet-rpms;
${SUDO} yum install scl-utils rh-dotnetcore10;
${SUDO} scl enable rh-dotnetcore10 bash;
${SUDO} yum install scl-utils rh-dotnetcore20;
${SUDO} scl enable rh-dotnetcore20 bash;
}
command -v nodejs >/dev/null 2>&1 || {
@ -79,8 +79,8 @@ elif echo ${LINUX_TYPE} | grep -qi "Red Hat"; then
command -v dotnet >/dev/null 2>&1 || {
${SUDO} subscription-manager repos --enable=rhel-7-server-dotnet-rpms;
${SUDO} yum install scl-utils rh-dotnetcore10;
${SUDO} scl enable rh-dotnetcore10 bash;
${SUDO} yum install scl-utils rh-dotnetcore20;
${SUDO} scl enable rh-dotnetcore20 bash;
}
command -v nodejs >/dev/null 2>&1 || {
@ -91,7 +91,7 @@ elif echo ${LINUX_TYPE} | grep -qi "Red Hat"; then
# Ubuntu 14.04 16.04 / Linux Mint 17
# Install for Ubuntu 14.04, 16.04, 16.10 & Linux Mint 17, 18 (64 bit)
####################################
elif echo ${LINUX_TYPE} | grep -qi "ubuntu"; then
test "${PACKAGES}" = "" || {
@ -99,22 +99,28 @@ elif echo ${LINUX_TYPE} | grep -qi "ubuntu"; then
${SUDO} apt-get -y install ${PACKAGES};
}
let RELEASE_NAME="trusty"
{
if echo ${LINUX_VERSION} | grep -qi "14.04"; then
RELEASE_NAME="trusty"
fi
if echo ${LINUX_VERSION} | grep -qi "16.04"; then
RELEASE_NAME="xenial"
fi
if echo ${LINUX_VERSION} | grep -qi "16.10"; then
RELEASE_NAME="yakkety"
fi
};
command -v dotnet >/dev/null 2>&1 || {
${SUDO} apt-get update;
${SUDO} apt-get -y install apt-transport-https;
{
if echo ${LINUX_VERSION} | grep -qi "16.04"; then
${SUDO} sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
${SUDO} apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
else
${SUDO} sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
${SUDO} apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
fi
};
${SUDO} sh -c 'echo "deb [arch=amd64] http://apt-mo.trafficmanager.net/repos/dotnet-release/ '${RELEASE_NAME}' main" > /etc/apt/sources.list.d/dotnetdev.list'
${SUDO} apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
${SUDO} apt-get update
${SUDO} apt-get -y install dotnet-dev-1.0.0-preview2-003121
${SUDO} apt-get -y install dotnet-sdk-2.0.0-preview2-006497
}
command -v nodejs >/dev/null 2>&1 || {
@ -136,7 +142,7 @@ elif echo ${LINUX_TYPE} | grep -qi "debian"; then
}
command -v dotnet >/dev/null 2>&1 || {
curl -L -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=809130;
curl -L -o dotnet.tar.gz https://aka.ms/dotnet-sdk-2.0.0-preview2-linux-x64-bin;
${SUDO} apt-get update;
${SUDO} apt-get -y install libunwind8 gettext;
${SUDO} mkdir -p /opt/dotnet;
@ -154,7 +160,7 @@ elif echo ${LINUX_TYPE} | grep -qi "debian"; then
${SUDO} apt-get install -y nodejs;
}
# Fedora 23
# Fedora 24, 25, 26
###########
elif echo ${LINUX_TYPE} | grep -qi "fedora"; then
PACKAGES=${PACKAGES}" procps-ng"
@ -163,7 +169,7 @@ elif echo ${LINUX_TYPE} | grep -qi "fedora"; then
}
command -v dotnet >/dev/null 2>&1 || {
curl -L -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=816869;
curl -L -o dotnet.tar.gz https://aka.ms/dotnet-sdk-2.0.0-preview2-linux-x64-bin;
${SUDO} dnf -y install libunwind libicu;
${SUDO} mkdir -p /opt/dotnet;
${SUDO} tar zxf dotnet.tar.gz -C /opt/dotnet;
@ -177,8 +183,7 @@ elif echo ${LINUX_TYPE} | grep -qi "fedora"; then
}
# CentOS 7.1 & Oracle Linux 7.1
# CentOS 7.1 (64 bit) & Oracle Linux 7.1 (64 bit)
###############################
elif echo ${LINUX_TYPE} | grep -qi "centos"; then
test "${PACKAGES}" = "" || {
@ -186,7 +191,7 @@ elif echo ${LINUX_TYPE} | grep -qi "centos"; then
}
command -v dotnet >/dev/null 2>&1 || {
curl -L -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=809131;
curl -L -o dotnet.tar.gz https://aka.ms/dotnet-sdk-2.0.0-preview2-linux-x64-bin;
${SUDO} yum -y install libunwind libicu;
${SUDO} mkdir -p /opt/dotnet;
${SUDO} tar zxf dotnet.tar.gz -C /opt/dotnet;
@ -200,7 +205,7 @@ elif echo ${LINUX_TYPE} | grep -qi "centos"; then
}
# openSUSE 13.2
# SUSE Linux Enterprise Server (64 bit), openSUSE (64 bit)
###############
elif echo ${LINUX_TYPE} | grep -qi "opensuse"; then
test "${PACKAGES}" = "" || {
@ -208,7 +213,7 @@ elif echo ${LINUX_TYPE} | grep -qi "opensuse"; then
}
command -v dotnet >/dev/null 2>&1 || {
curl -L -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=816867;
curl -L -o dotnet.tar.gz https://aka.ms/dotnet-sdk-2.0.0-preview2-linux-x64-bin
${SUDO} zypper install -y libunwind libicu;
${SUDO} mkdir -p /opt/dotnet;
${SUDO} tar zxf dotnet.tar.gz -C /opt/dotnet;

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>ls-json-agent</artifactId>
<name>Language Server Json Agent</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>ls-php-agent</artifactId>
<name>Language Server PHP Agent</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>ls-python-agent</artifactId>
<name>Language Server python Agent</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>ls-typescript-agent</artifactId>
<name>Language Server typescript Agent</name>

View File

@ -16,11 +16,11 @@
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>che-agents-parent</artifactId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Che Agents Parent</name>
<modules>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>ssh-agent</artifactId>
<name>SSH Agent</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>terminal-agent</artifactId>
<name>Agent :: Terminal</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>unison-agent</artifactId>
<name>Unison Agent</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>assembly-ide-war</artifactId>
<packaging>war</packaging>
@ -31,6 +31,10 @@
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-ide-core</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-activity-ide</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-composer-ide</artifactId>
@ -413,9 +417,25 @@
<configuration>
<sources>
<source>${generated.sources.directory}</source>
<source>src/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/webapp</directory>
<targetPath></targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>assembly-main</artifactId>
<packaging>pom</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>assembly-wsagent-server</artifactId>
<packaging>pom</packaging>

View File

@ -0,0 +1,3 @@
1502958214000
(?:[^/]+/)*?[^/]*?
META-INF(?:$|/.+)

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>assembly-wsagent-war</artifactId>
<packaging>war</packaging>
@ -31,6 +31,10 @@
<groupId>org.eclipse.che.lib</groupId>
<artifactId>che-swagger-module</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-activity-server</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-composer-server</artifactId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>assembly-wsmaster-war</artifactId>
<packaging>war</packaging>
@ -196,6 +196,10 @@
<groupId>org.eclipse.che.lib</groupId>
<artifactId>che-swagger-module</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-activity-wsmaster</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.plugin</groupId>
<artifactId>che-plugin-docker-client</artifactId>

View File

@ -165,7 +165,7 @@ public class WsMasterModule extends AbstractModule {
bind(org.eclipse.che.api.deploy.WsMasterAnalyticsAddresser.class);
install(new org.eclipse.che.api.workspace.server.activity.inject.WorkspaceActivityModule());
install(new org.eclipse.che.plugin.activity.inject.WorkspaceActivityModule());
install(new org.eclipse.che.api.core.rest.CoreRestModule());
install(new org.eclipse.che.api.core.util.FileCleaner.FileCleanerModule());

View File

@ -16,12 +16,12 @@
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.eclipse.che</groupId>
<artifactId>che-assembly-parent</artifactId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Che IDE :: Parent</name>
<modules>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-api-core</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-api-dto-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-api-dto</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-api-model</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-db-vendor-h2</artifactId>
<name>Che Core :: DB :: Vendor H2</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-db-vendor-postgresql</artifactId>
<name>Che Core :: DB :: Vendor PostgreSQL</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-db</artifactId>
<name>Che Core :: DB</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-typescript-dto-maven-plugin</artifactId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-commons-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-commons-annotations</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-commons-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-commons-inject</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-commons-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-commons-j2ee</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-commons-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-commons-json</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-commons-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-commons-lang</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-commons-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-commons-schedule</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-commons-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-commons-test</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-commons-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-commons-xml</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>che-core-commons-parent</artifactId>

View File

@ -16,12 +16,12 @@
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-parent</artifactId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Che Core Parent</name>
<modules>

27
dashboard/.dockerignore Normal file
View File

@ -0,0 +1,27 @@
Dockerfile
node_modules
bower_components
target
pom.xml
./typings
./tmp
./codeverage
# Eclipse #
###################
*.launch
.classpath
.project
.settings/
bin/
test-output/
maven-eclipse.xml
# Idea #
##################
*.iml
*.ipr
*.iws
.idea/

22
dashboard/Dockerfile Normal file
View File

@ -0,0 +1,22 @@
# Copyright (c) 2012-2017 Red Hat, Inc
# 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
# This is a Dockerfile allowing to build dashboard by using a docker container.
# Build step: $ docker build -t eclipse-che-dashboard
# It builds an archive file that can be used by doing later
# $ docker run --rm eclipse-che-dashboard | tar -C target/ -zxf -
FROM mhart/alpine-node:6
RUN apk update && \
apk add --no-cache git
COPY package.json /dashboard/
RUN cd /dashboard && npm install
COPY bower.json /dashboard/
RUN cd /dashboard && ./node_modules/.bin/bower install --allow-root
COPY . /dashboard/
RUN cd /dashboard && npm run build && cd target/ && tar zcf /tmp/dashboard.tar.gz dist/
CMD zcat /tmp/dashboard.tar.gz

View File

@ -4,20 +4,30 @@ Eclipse Che is a next generation Eclipse IDE and open source alternative to Inte
Che Dashboard
==============
#Requirements
- Python `v2.7.x`(`v3.x.x`currently not supported)
- Node.js `v4.x.x` (`v5.x.x` / `v6.x.x` are currently not supported)
- npm
## Requirements
- Docker
Installation instructions for Node.js and npm can be found on the following [link](https://docs.npmjs.com/getting-started/installing-node).
#Quick start
## Quick start
```sh
cd che/dashboard
mvn clean install
```
note: by default it will build dashboard using a docker image.
If all required tools are installed locally, the native profile can be used instead of the docker build by following command:
```sh
$ mvn -Pnative clean install
```
Required tools for native build:
- Python `v2.7.x`(`v3.x.x`currently not supported)
- Node.js `v4.x.x`, `v5.x.x` or `v6.x.x`
- npm
Installation instructions for Node.js and npm can be found on the following [link](https://docs.npmjs.com/getting-started/installing-node).
## Running
In order to run the project, the serve command is used
```sh

View File

@ -16,7 +16,7 @@ var gutil = require('gulp-util');
*/
exports.paths = {
src: 'src',
dist: 'dist',
dist: 'target/dist',
tmp: '.tmp',
e2e: 'e2e'
};

View File

@ -16,12 +16,12 @@
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.eclipse.che.dashboard</groupId>
<artifactId>che-dashboard-war</artifactId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Che Dashboard :: Web App</name>
<inceptionYear>2015</inceptionYear>
@ -35,72 +35,13 @@
<build>
<finalName>dashboard-war</finalName>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/bower_components</directory>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/node_modules</directory>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/dist</directory>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Download NPM dependencies -->
<exec dir="${basedir}" executable="npm" failonerror="true">
<arg value="install" />
</exec>
<!-- Change base HREF of the application that will be hosted on /dashboard -->
<replace file="${basedir}/dist/index.html">
<replacetoken><![CDATA[<base href="/">]]></replacetoken>
<replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue>
</replace>
</target>
</configuration>
</execution>
<execution>
<id>compilation</id>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target unless="skipTests">
<!-- Run unit tests -->
<exec dir="${basedir}" executable="gulp" failonerror="true">
<arg value="test" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>dist</directory>
<directory>target/dist</directory>
</resource>
</webResources>
<webXml>${basedir}/src/webapp/WEB-INF/web.xml</webXml>
@ -129,6 +70,134 @@
</plugins>
</build>
<profiles>
<profile>
<!-- Docker build used by default, to use native build, use -Pnative -->
<id>docker</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>build-image</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- build user dashboard with maven -->
<exec dir="${basedir}" executable="docker" failonerror="true">
<arg value="build" />
<arg value="-t" />
<arg value="eclipse-che-dashboard" />
<arg value="." />
</exec>
</target>
</configuration>
</execution>
<execution>
<id>unpack-docker-build</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- build user dashboard with docker -->
<exec executable="bash">
<arg value="-c" />
<arg value="docker run --rm eclipse-che-dashboard | tar -C target/ -xf -" />
</exec>
</target>
</configuration>
</execution>
<execution>
<id>update-href</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Change base HREF of the application that will be hosted on /dashboard -->
<replace file="${basedir}/target/dist/index.html">
<replacetoken><![CDATA[<base href="/">]]></replacetoken>
<replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue>
</replace>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/bower_components</directory>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/node_modules</directory>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>build-dashboard</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- build user dashboard -->
<exec dir="${basedir}" executable="npm" failonerror="true">
<arg value="install" />
</exec>
<!-- Change base HREF of the application that will be hosted on /dashboard -->
<replace file="${basedir}/target/dist/index.html">
<replacetoken><![CDATA[<base href="/">]]></replacetoken>
<replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue>
</replace>
</target>
</configuration>
</execution>
<execution>
<id>compilation</id>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target unless="skipTests">
<!-- Run unit tests -->
<exec dir="${basedir}" executable="gulp" failonerror="true">
<arg value="test" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>qa</id>
<build>

View File

@ -163,7 +163,7 @@ export class CreateWorkspaceSvc {
createWorkspace(workspaceConfig: che.IWorkspaceConfig, attributes?: any): ng.IPromise<any> {
const namespaceId = this.namespaceSelectorSvc.getNamespaceId(),
projectTemplates = this.projectSourceSelectorService.getProjectTemplates();
workspaceConfig.projects = projectTemplates;
return this.checkEditingProgress().then(() => {
return this.cheWorkspace.createWorkspaceFromConfig(namespaceId, workspaceConfig, attributes).then((workspace: che.IWorkspace) => {
@ -177,13 +177,9 @@ export class CreateWorkspaceSvc {
}).then(() => {
return this.cheWorkspace.fetchWorkspaceDetails(workspace.id);
}).then(() => {
return this.createProjects(workspace.id, projectTemplates);
}).then(() => {
this.getIDE().ProjectExplorer.refresh();
return this.importProjects(workspace.id, projectTemplates);
return this.addProjectCommands(workspace.id, projectTemplates);
}).then(() => {
let IDE = this.getIDE();
IDE.ProjectExplorer.refresh();
IDE.CommandManager.refresh();
});
}, (error: any) => {
@ -242,20 +238,18 @@ export class CreateWorkspaceSvc {
}
/**
* Imports bunch of projects in row.
* Returns resolved promise if all project are imported properly, otherwise returns rejected promise with list of names of failed projects.
* Adds commands from the bunch of projects in row.
* Returns resolved promise if all commands are aded properly, otherwise returns rejected promise with list of names of failed projects.
*
* @param {string} workspaceId the workspace ID
* @param {Array<che.IProjectTemplate>} projectTemplates the list of project templates to import
* @param {Array<che.IProjectTemplate>} projectTemplates the list of project templates
* @return {IPromise<any>}
*/
importProjects(workspaceId: string, projectTemplates: Array<che.IProjectTemplate>): ng.IPromise<any> {
addProjectCommands(workspaceId: string, projectTemplates: Array<che.IProjectTemplate>): ng.IPromise<any> {
const defer = this.$q.defer();
defer.resolve();
let accumulatorPromise = defer.promise;
const projectTypeResolverService = this.cheWorkspace.getWorkspaceAgent(workspaceId).getProjectTypeResolver();
const failedProjects = [];
accumulatorPromise = projectTemplates.reduce((_accumulatorPromise: ng.IPromise<any>, project: che.IProjectTemplate) => {
@ -263,8 +257,6 @@ export class CreateWorkspaceSvc {
return this.addCommands(workspaceId, project.name, project.commands).catch(() => {
// adding commands errors, ignore them here
return this.$q.when();
}).then(() => {
return projectTypeResolverService.resolveProjectType(project as any);
}).catch((error: any) => {
failedProjects.push(project.name);
if (error && error.message) {

View File

@ -39,7 +39,7 @@
<i class="fa fa-clock-o workspace-item-temp" ng-if="workspaceItemCtrl.workspace.temporary"></i>
</div>
<div flex-gt-xs="15"
lass="che-list-item-name workspace-item-ram"
class="che-list-item-name workspace-item-ram"
ng-click="workspaceItemCtrl.redirectToWorkspaceDetails();">
<span class="che-xs-header noselect" hide-gt-xs>RAM</span>
<span class="workspace-consumed-value">{{workspaceItemCtrl.getMemoryLimit(workspaceItemCtrl.workspace)}}</span>

View File

@ -10,3 +10,353 @@ The source code and build scripts used to create this binary are available for d
* grab official jdk sources by version from "http://hg.openjdk.java.net" reference - https://git.alpinelinux.org/cgit/aports/tree/community/openjdk8/APKBUILD?id=027d8ceca1422c0ffc3fe3a22523f22abedd694c#n43
* add alpine specific patches reference - https://git.alpinelinux.org/cgit/aports/tree/community/openjdk8?id=027d8ceca1422c0ffc3fe3a22523f22abedd694c
* perform build
The following license applies to OpenJDK
The GNU General Public License (GPL)
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public License is intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users. This General Public License applies to
most of the Free Software Foundation's software and to any other program whose
authors commit to using it. (Some other Free Software Foundation software is
covered by the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom to
distribute copies of free software (and charge for this service if you wish),
that you receive source code or can get it if you want it, that you can change
the software or use pieces of it in new free programs; and that you know you
can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny
you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of the
software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for
a fee, you must give the recipients all the rights that you have. You must
make sure that they, too, receive or can get the source code. And you must
show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If the
software is modified by someone else and passed on, we want its recipients to
know that what they have is not the original, so that any problems introduced
by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will
individually obtain patent licenses, in effect making the program proprietary.
To prevent this, we have made it clear that any patent must be licensed for
everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms of
this General Public License. The "Program", below, refers to any such program
or work, and a "work based on the Program" means either the Program or any
derivative work under copyright law: that is to say, a work containing the
Program or a portion of it, either verbatim or with modifications and/or
translated into another language. (Hereinafter, translation is included
without limitation in the term "modification".) Each licensee is addressed as
"you".
Activities other than copying, distribution and modification are not covered by
this License; they are outside its scope. The act of running the Program is
not restricted, and the output from the Program is covered only if its contents
constitute a work based on the Program (independent of having been made by
running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as
you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this License
and to the absence of any warranty; and give any other recipients of the
Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may
at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus
forming a work based on the Program, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all of
these conditions:
a) You must cause the modified files to carry prominent notices stating
that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or
in part contains or is derived from the Program or any part thereof, to be
licensed as a whole at no charge to all third parties under the terms of
this License.
c) If the modified program normally reads commands interactively when run,
you must cause it, when started running for such interactive use in the
most ordinary way, to print or display an announcement including an
appropriate copyright notice and a notice that there is no warranty (or
else, saying that you provide a warranty) and that users may redistribute
the program under these conditions, and telling the user how to view a copy
of this License. (Exception: if the Program itself is interactive but does
not normally print such an announcement, your work based on the Program is
not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License, and
its terms, do not apply to those sections when you distribute them as separate
works. But when you distribute the same sections as part of a whole which is a
work based on the Program, the distribution of the whole must be on the terms
of this License, whose permissions for other licensees extend to the entire
whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise the
right to control the distribution of derivative or collective works based on
the Program.
In addition, mere aggregation of another work not based on the Program with the
Program (or with a work based on the Program) on a volume of a storage or
distribution medium does not bring the other work under the scope of this
License.
3. You may copy and distribute the Program (or a work based on it, under
Section 2) in object code or executable form under the terms of Sections 1 and
2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source
code, which must be distributed under the terms of Sections 1 and 2 above
on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to
give any third party, for a charge no more than your cost of physically
performing source distribution, a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of Sections 1
and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to
distribute corresponding source code. (This alternative is allowed only
for noncommercial distribution and only if you received the program in
object code or executable form with such an offer, in accord with
Subsection b above.)
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all
the source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and installation
of the executable. However, as a special exception, the source code
distributed need not include anything that is normally distributed (in either
source or binary form) with the major components (compiler, kernel, and so on)
of the operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the source
code from the same place counts as distribution of the source code, even though
third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as
expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate
your rights under this License. However, parties who have received copies, or
rights, from you under this License will not have their licenses terminated so
long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it.
However, nothing else grants you permission to modify or distribute the Program
or its derivative works. These actions are prohibited by law if you do not
accept this License. Therefore, by modifying or distributing the Program (or
any work based on the Program), you indicate your acceptance of this License to
do so, and all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program),
the recipient automatically receives a license from the original licensor to
copy, distribute or modify the Program subject to these terms and conditions.
You may not impose any further restrictions on the recipients' exercise of the
rights granted herein. You are not responsible for enforcing compliance by
third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues), conditions
are imposed on you (whether by court order, agreement or otherwise) that
contradict the conditions of this License, they do not excuse you from the
conditions of this License. If you cannot distribute so as to satisfy
simultaneously your obligations under this License and any other pertinent
obligations, then as a consequence you may not distribute the Program at all.
For example, if a patent license would not permit royalty-free redistribution
of the Program by all those who receive copies directly or indirectly through
you, then the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply and
the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or
other property right claims or to contest validity of any such claims; this
section has the sole purpose of protecting the integrity of the free software
distribution system, which is implemented by public license practices. Many
people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose that
choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original
copyright holder who places the Program under this License may add an explicit
geographical distribution limitation excluding those countries, so that
distribution is permitted only in or among countries not thus excluded. In
such case, this License incorporates the limitation as if written in the body
of this License.
9. The Free Software Foundation may publish revised and/or new versions of the
General Public License from time to time. Such new versions will be similar in
spirit to the present version, but may differ in detail to address new problems
or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any later
version", you have the option of following the terms and conditions either of
that version or of any later version published by the Free Software Foundation.
If the Program does not specify a version number of this License, you may
choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation,
write to the Free Software Foundation; we sometimes make exceptions for this.
Our decision will be guided by the two goals of preserving the free status of
all derivatives of our free software and of promoting the sharing and reuse of
software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible
use to the public, the best way to achieve this is to make it free software
which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach
them to the start of each source file to most effectively convey the exclusion
of warranty; and each file should have at least the "copyright" line and a
pointer to where the full notice is found.
One line to give the program's name and a brief idea of what it does.
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it
starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free
software, and you are welcome to redistribute it under certain conditions;
type 'show c' for details.
The hypothetical commands 'show w' and 'show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may be
called something other than 'show w' and 'show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the program, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
'Gnomovision' (which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General Public
License instead of this License.
"CLASSPATH" EXCEPTION TO THE GPL
Certain source files distributed by Oracle America and/or its affiliates are
subject to the following clarification and special exception to the GPL, but
only where Oracle has expressly included in the particular source file's header
the words "Oracle designates this particular file as subject to the "Classpath"
exception as provided by Oracle in the LICENSE file that accompanied this code."
Linking this library statically or dynamically with other modules is making
a combined work based on this library. Thus, the terms and conditions of
the GNU General Public License cover the whole combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent modules,
and to copy and distribute the resulting executable under terms of your
choice, provided that you also meet, for each linked independent module,
the terms and conditions of the license of that module. An independent
module is a module which is not derived from or based on this library. If
you modify this library, you may extend this exception to your version of
the library, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version.

View File

@ -0,0 +1,4 @@
IMAGE_INIT=eclipse/che-init:5.17.0
IMAGE_CHE=eclipse/che-server:5.17.0
IMAGE_COMPOSE=docker/compose:1.8.1
IMAGE_TRAEFIK=traefik:v1.3.0-rc3

View File

@ -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

View File

@ -1 +1 @@
5.15.0
5.16.0

View File

@ -21,6 +21,7 @@
# -Dfindbugs.skip=true
# -Dgwt.compiler.localWorkers=2 -T 1C
# -Dskip-validate-sources
# -Pnative
# clean install
#
# For Windows, replace $HOME with maven repo directory.

View File

@ -126,6 +126,13 @@
# Defaults to the same value of CHE_WORKSPACE_JAVA_OPTIONS.
#CHE_WORKSPACE_MAVEN_OPTIONS=NULL
# Workspace Idle timeout
# The length of time after which workspaces will be automatically stopped, if no activity
# has been detected on them. Currently, keyboard and mouse interactions in IDE, as well as HTTP
# requests to ws-agent count as activity. Set "0" to disable automatic stop of inactive workspaces.
# Default to the value of this property in che.properties (3600000)
#CHE_WORKSPACE_AGENT_DEV_INACTIVE__STOP__TIMEOUT__MS=0
########################################################################################
##### #####
##### NETWORKING #####

View File

@ -17,13 +17,13 @@
<parent>
<artifactId>maven-depmgt-pom</artifactId>
<groupId>org.eclipse.che.depmgt</groupId>
<version>5.16.0</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>dto-typescript</artifactId>
<packaging>pom</packaging>
<name>Che TypeScript DTO</name>
<properties>
<che.version>5.16.0-SNAPSHOT</che.version>
<che.version>5.17.0-SNAPSHOT</che.version>
</properties>
<repositories>
<repository>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-ide-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-dyna-provider-generator-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-ide-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-ide-api</artifactId>

View File

@ -138,14 +138,14 @@ public class MutableProjectConfig implements ProjectConfig {
public void setOptions(Map<String, String> options) {
this.options = options;
}
public List<CommandDto> getCommands() {
if (commands == null) {
commands = newArrayList();
}
return commands;
}
public void setCommands(List<CommandDto> commands) {
this.commands = commands;
}

View File

@ -12,6 +12,8 @@ package org.eclipse.che.ide.api.statepersistance;
import elemental.json.JsonObject;
import org.eclipse.che.api.promises.client.Promise;
import javax.validation.constraints.NotNull;
/**
@ -20,14 +22,48 @@ import javax.validation.constraints.NotNull;
* a multibinder in order to be picked-up on IDE start-up:
* <p>
* <code>
* GinMapBinder<String, StateComponent> stateComponents = GinMapBinder.newMapBinder(binder(), String.class, StateComponent.class);
* stateComponents.addBinding("foo").to(Foo.class);
* GinMultibinder<StateComponent> stateComponents = GinMultibinder.newSetBinder(binder(), StateComponent.class);
* stateComponents.addBinding().to(Foo.class);
* </code>
* </p>
*
* @author Evgen Vidolob
* @author Vlad Zhukovskyi
*/
public interface StateComponent {
/**
* The minimum priority that state component can have.
*
* @see #getPriority()
* @since 5.16.0
*/
int MIN_PRIORITY = 1;
/**
* The default priority that is assigned to a state component.
*
* @see #getPriority()
* @since 5.16.0
*/
int DEFAULT_PRIORITY = 5;
/**
* The maximum priority that state component can have.
*
* @see #getPriority()
* @since 5.16.0
*/
int MAX_PRIORITY = 10;
/**
* Identifier of the component which may have persistent state. Usually uses to identify from the raw json.
*
* @return component id, any string value, non-null and non-empty. If null occurred, then component is not take a part in serialization
* @since 5.16.0
*/
String getId();
/**
* Called when component should store his state.
*
@ -39,8 +75,23 @@ public interface StateComponent {
/**
* Called when component should restore his state.
*
* @param state the component state object
* @param state
* the component state object
*/
void loadState(@NotNull JsonObject state);
Promise<Void> loadState(@NotNull JsonObject state);
/**
* Priority of the execution. Each component may be prioritized to execute one self.
* Values should be from 1 (the last one to execute) to 10 (should be executed as first). Default value is 5.
*
* @return priority for the interceptor in which it should be run
* @see #MIN_PRIORITY
* @see #DEFAULT_PRIORITY
* @see #MAX_PRIORITY
* @since 5.16.0
*/
default int getPriority() {
return DEFAULT_PRIORITY;
}
}

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-ide-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-ide-app</artifactId>
<packaging>jar</packaging>

View File

@ -11,6 +11,7 @@
package org.eclipse.che.ide.actions;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import org.eclipse.che.ide.CoreLocalizationConstant;
@ -34,10 +35,10 @@ import static org.eclipse.che.ide.part.perspectives.project.ProjectPerspective.P
@Singleton
public class NavigateToFileAction extends AbstractPerspectiveAction {
private final NavigateToFilePresenter presenter;
private final Provider<NavigateToFilePresenter> navigateToFilePresenterProvider;
@Inject
public NavigateToFileAction(NavigateToFilePresenter presenter,
public NavigateToFileAction(Provider<NavigateToFilePresenter> navigateToFilePresenterProvider,
Resources resources,
CoreLocalizationConstant localizationConstant) {
super(singletonList(PROJECT_PERSPECTIVE_ID),
@ -45,16 +46,17 @@ public class NavigateToFileAction extends AbstractPerspectiveAction {
localizationConstant.actionNavigateToFileDescription(),
null,
resources.navigateToFile());
this.presenter = presenter;
this.navigateToFilePresenterProvider = navigateToFilePresenterProvider;
}
@Override
public void actionPerformed(ActionEvent e) {
presenter.showDialog();
navigateToFilePresenterProvider.get().showDialog();
}
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
event.getPresentation().setEnabledAndVisible(true);
}
}

View File

@ -462,31 +462,32 @@ public class EditorAgentImpl implements EditorAgent,
@Override
@SuppressWarnings("unchecked")
public void loadState(@NotNull final JsonObject state) {
public Promise<Void> loadState(@NotNull final JsonObject state) {
if (state.hasKey("FILES")) {
JsonObject files = state.getObject("FILES");
EditorPartStack partStack = editorMultiPartStack.createRootPartStack();
final Map<EditorPartPresenter, EditorPartStack> activeEditors = new HashMap<>();
List<Promise<Void>> restore = restore(files, partStack, activeEditors);
Promise<ArrayOf<?>> promise = promiseProvider.all2(restore.toArray(new Promise[restore.size()]));
promise.then(new Operation() {
@Override
public void apply(Object arg) throws OperationException {
String activeFile = "";
if (state.hasKey("ACTIVE_EDITOR")) {
activeFile = state.getString("ACTIVE_EDITOR");
}
EditorPartPresenter activeEditorPart = null;
for (Map.Entry<EditorPartPresenter, EditorPartStack> entry : activeEditors.entrySet()) {
entry.getValue().setActivePart(entry.getKey());
if (activeFile.equals(entry.getKey().getEditorInput().getFile().getLocation().toString())) {
activeEditorPart = entry.getKey();
}
}
workspaceAgent.setActivePart(activeEditorPart);
promise.then((Operation)ignored -> {
String activeFile = "";
if (state.hasKey("ACTIVE_EDITOR")) {
activeFile = state.getString("ACTIVE_EDITOR");
}
EditorPartPresenter activeEditorPart = null;
for (Map.Entry<EditorPartPresenter, EditorPartStack> entry : activeEditors.entrySet()) {
entry.getValue().setActivePart(entry.getKey());
if (activeFile.equals(entry.getKey().getEditorInput().getFile().getLocation().toString())) {
activeEditorPart = entry.getKey();
}
}
workspaceAgent.setActivePart(activeEditorPart);
});
return promise.thenPromise(ignored -> promiseProvider.resolve(null));
}
return promiseProvider.resolve(null);
}
private List<Promise<Void>> restore(JsonObject files, EditorPartStack editorPartStack,
@ -689,4 +690,14 @@ public class EditorAgentImpl implements EditorAgent,
}
}
}
@Override
public int getPriority() {
return MIN_PRIORITY;
}
@Override
public String getId() {
return "editor";
}
}

View File

@ -177,8 +177,11 @@ public class EditorGroupSynchronizationImpl implements EditorGroupSynchronizatio
final Document document = documentHandle.getDocument();
final String oldContent = document.getContents();
final TextPosition cursorPosition = document.getCursorPosition();
if (Objects.equals(newContent, oldContent)) {
return;
}
final TextPosition cursorPosition = document.getCursorPosition();
if (!(virtualFile instanceof File)) {
replaceContent(document, newContent, oldContent, cursorPosition);
return;
@ -187,7 +190,7 @@ public class EditorGroupSynchronizationImpl implements EditorGroupSynchronizatio
final File file = (File)virtualFile;
final String currentStamp = file.getModificationStamp();
if (eventModificationStamp == null && !Objects.equals(newContent, oldContent)) {
if (eventModificationStamp == null) {
replaceContent(document, newContent, oldContent, cursorPosition);
return;
}

View File

@ -0,0 +1,108 @@
/*******************************************************************************
* 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.factory.utils;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.api.promises.client.*;
import org.eclipse.che.api.promises.client.js.Promises;
import org.eclipse.che.ide.CoreLocalizationConstant;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.notification.NotificationManager;
import org.eclipse.che.ide.api.notification.StatusNotification;
import org.eclipse.che.ide.api.oauth.OAuth2AuthenticatorRegistry;
import org.eclipse.che.ide.api.project.wizard.ImportProjectNotificationSubscriberFactory;
import org.eclipse.che.ide.api.resources.Project;
import org.eclipse.che.ide.part.explorer.project.ProjectExplorerPresenter;
import org.eclipse.che.ide.projectimport.wizard.ProjectImportOutputJsonRpcNotifier;
import org.eclipse.che.ide.projectimport.wizard.ProjectImporter;
import org.eclipse.che.ide.projectimport.wizard.ProjectResolver;
import org.eclipse.che.ide.ui.dialogs.askcredentials.AskCredentialsDialog;
import java.util.*;
import static org.eclipse.che.ide.api.notification.StatusNotification.DisplayMode.FLOAT_MODE;
import static org.eclipse.che.ide.api.notification.StatusNotification.Status.FAIL;
import static org.eclipse.che.ide.api.notification.StatusNotification.Status.PROGRESS;
/**
* Imports projects on file system.
*/
@Singleton
public class InitialProjectImporter extends ProjectImporter {
private final ProjectImportOutputJsonRpcNotifier subscriber;
private final NotificationManager notificationManager;
private final CoreLocalizationConstant locale;
@Inject
public InitialProjectImporter(CoreLocalizationConstant localizationConstant,
ImportProjectNotificationSubscriberFactory subscriberFactory,
AppContext appContext,
ProjectResolver projectResolver,
AskCredentialsDialog credentialsDialog,
OAuth2AuthenticatorRegistry oAuth2AuthenticatorRegistry,
ProjectImportOutputJsonRpcNotifier subscriber,
NotificationManager notificationManager,
CoreLocalizationConstant locale,
ProjectExplorerPresenter projectExplorerPresenter) {
super(localizationConstant, subscriberFactory, appContext, projectResolver, credentialsDialog, oAuth2AuthenticatorRegistry);
this.subscriber = subscriber;
this.notificationManager = notificationManager;
this.locale = locale;
}
/**
* Import source projects and if it's already exist in workspace
* then show warning notification
*
* @param projects
* list of projects that already exist in workspace and will be imported on file system
*/
public void importProjects(final List<Project> projects) {
if (projects.isEmpty()) {
return;
}
final Project importProject = projects.remove(0);
final StatusNotification notification = notificationManager.notify(locale.cloningSource(importProject.getName()), null, PROGRESS, FLOAT_MODE);
subscriber.subscribe(importProject.getName(), notification);
appContext.getWorkspaceRoot()
.importProject()
.withBody(importProject)
.send()
.then(new Operation<Project>() {
@Override
public void apply(Project project) throws OperationException {
subscriber.onSuccess();
appContext.getWorkspaceRoot().synchronize();
importProjects(projects);
}
}).catchErrorPromise(
new Function<PromiseError, Promise<Project>>() {
@Override
public Promise<Project> apply(PromiseError err) throws FunctionException {
subscriber.onFailure(err.getMessage());
notification.setTitle(locale.cloningSourceFailedTitle(importProject.getName()));
notification.setStatus(FAIL);
return Promises.resolve(null);
}
}
);
}
}

View File

@ -32,6 +32,8 @@ import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.ide.CoreLocalizationConstant;
import org.eclipse.che.ide.actions.CreateProjectAction;
import org.eclipse.che.ide.actions.ImportProjectAction;
import org.eclipse.che.ide.actions.NavigateToFileAction;
import org.eclipse.che.ide.actions.find.FindActionAction;
import org.eclipse.che.ide.api.ProductInfoDataProvider;
import org.eclipse.che.ide.api.action.Action;
import org.eclipse.che.ide.api.action.ActionEvent;
@ -63,7 +65,10 @@ import static org.eclipse.che.ide.api.resources.Resource.PROJECT;
*/
public class EmptyEditorsPanel extends Composite implements ResourceChangedEvent.ResourceChangedHandler {
private static EmptyEditorsPanelUiBinder ourUiBinder = GWT.create(EmptyEditorsPanelUiBinder.class);
interface EmptyEditorsPanelUiBinder extends UiBinder<Widget, EmptyEditorsPanel> {}
private static EmptyEditorsPanelUiBinder uiBinder = GWT.create(EmptyEditorsPanelUiBinder.class);
protected final AppContext appContext;
private final ActionManager actionManager;
private final Provider<PerspectiveManager> perspectiveManagerProvider;
@ -72,7 +77,11 @@ public class EmptyEditorsPanel extends Composite implements ResourceChangedEvent
private final CoreLocalizationConstant localizationConstant;
private final Map<String, Action> noFiles = new HashMap<>();
private final Map<String, Action> noProjects = new HashMap<>();
private final Map<String, Action> factoryActions = new HashMap<>();
@UiField
protected DivElement title;
@UiField
@ -94,22 +103,28 @@ public class EmptyEditorsPanel extends Composite implements ResourceChangedEvent
CoreLocalizationConstant localizationConstant,
NewFileAction newFileAction,
CreateProjectAction createProjectAction,
ImportProjectAction importProjectAction) {
ImportProjectAction importProjectAction,
FindActionAction findActionAction,
NavigateToFileAction navigateToFileAction
) {
this(actionManager, perspectiveManagerProvider, keyBindingAgent, appContext, localizationConstant, newFileAction,
createProjectAction, importProjectAction);
eventBus.addHandler(ResourceChangedEvent.getType(), this);
final SVGResource logo = productInfoDataProvider.getWaterMarkLogo();
if (nonNull(logo)) {
this.logo.appendChild(new SVGImage(logo).getSvgElement().getElement());
}
factoryActions.put(findActionAction.getTemplatePresentation().getText(), findActionAction);
factoryActions.put(navigateToFileAction.getTemplatePresentation().getText(), navigateToFileAction);
//Sometimes initialization of Create/Import Project actions are completed after the Empty editor page is rendered.
//In this case we need to wait when actions will be initialized.
Timer hoverToRenderTimer = new Timer() {
@Override
public void run() {
renderNoProjects();
render();
}
};
hoverToRenderTimer.schedule(500);
@ -137,8 +152,7 @@ public class EmptyEditorsPanel extends Composite implements ResourceChangedEvent
presentationFactory = new PresentationFactory();
Widget rootElement = ourUiBinder.createAndBindUi(this);
initWidget(rootElement);
initWidget(uiBinder.createAndBindUi(this));
}
@Override
@ -153,18 +167,23 @@ public class EmptyEditorsPanel extends Composite implements ResourceChangedEvent
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
updateOnProjectsChange();
render();
}
});
}
private void updateOnProjectsChange() {
if (appContext.getProjects().length != 0) {
renderNoFiles();
} else {
protected void render() {
if (appContext.getProjects() != null && appContext.getProjects().length == 0) {
renderNoProjects();
return;
}
if (appContext.getWorkspace().getAttributes().containsKey("factoryId")) {
renderFactoryActions();
return;
}
renderNoFiles();
}
protected void renderNoProjects() {
@ -175,12 +194,15 @@ public class EmptyEditorsPanel extends Composite implements ResourceChangedEvent
render(localizationConstant.emptyStateNoFiles(), noFiles);
}
protected void renderFactoryActions() {
render(localizationConstant.emptyStateNoFiles(), factoryActions);
}
private void render(String title, Map<String, Action> actions) {
this.title.setInnerText(title);
container.removeAllChildren();
Element listElement = Elements.createElement("ul", new String[] {style.list()});
for (Map.Entry<String, Action> pair : actions.entrySet()) {
LIElement liElement = Elements.createLiElement();
liElement.appendChild(renderAction(pair.getKey(), pair.getValue()));
@ -237,5 +259,4 @@ public class EmptyEditorsPanel extends Composite implements ResourceChangedEvent
String actionLabel();
}
interface EmptyEditorsPanelUiBinder extends UiBinder<Widget, EmptyEditorsPanel> {}
}

View File

@ -65,7 +65,7 @@
border: 1px solid fontColor;
color: fontColor;
border-radius: 2px;
margin-left: 50px;
margin-left: 30px;
}
.actionLabel {

View File

@ -12,6 +12,7 @@ package org.eclipse.che.ide.part.explorer.project;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.dom.client.Style;
import com.google.gwt.user.client.Timer;
import com.google.inject.Provider;
import com.google.web.bindery.event.shared.EventBus;
@ -46,13 +47,17 @@ public class EmptyTreePanel extends EmptyEditorsPanel {
super(actionManager, perspectiveManagerProvider, keyBindingAgent, appContext, localizationConstant, newFileAction,
createProjectAction, importProjectAction);
eventBus.addHandler(ResourceChangedEvent.getType(), this);
root.getStyle().setTop(46, Style.Unit.PX);
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
//Sometimes initialization of Create/Import Project actions are completed after the Empty editor page is rendered.
//In this case we need to wait when actions will be initialized.
new Timer() {
@Override
public void execute() {
public void run() {
renderNoProjects();
}
});
}.schedule(500);
}
@Override
@ -66,4 +71,5 @@ public class EmptyTreePanel extends EmptyEditorsPanel {
}
});
}
}

View File

@ -13,7 +13,10 @@ package org.eclipse.che.ide.part.explorer.project;
import elemental.json.Json;
import elemental.json.JsonArray;
import elemental.json.JsonObject;
import org.eclipse.che.api.promises.client.*;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseError;
import org.eclipse.che.api.promises.client.PromiseProvider;
import org.eclipse.che.ide.api.statepersistance.StateComponent;
import org.eclipse.che.ide.ui.smartTree.data.Node;
import org.eclipse.che.ide.resource.Path;
@ -25,58 +28,53 @@ import org.eclipse.che.ide.util.loging.Log;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* Persists and restore state of the project explorer presenter, like expanded nodes and showing hidden files
*
* @author Vlad Zhukovskyi
*/
@Singleton
public class ProjectExplorerStateComponent implements StateComponent {
private static final String PATH_PARAM_ID = "revealPath";
private static final String PATH_PARAM_ID = "revealPath";
private static final String SHOW_HIDDEN_FILES = "showHiddenFiles";
private final ProjectExplorerPresenter projectExplorer;
private final TreeResourceRevealer revealer;
private final LoaderFactory loaderFactory;
private final TreeResourceRevealer revealer;
private final LoaderFactory loaderFactory;
private final PromiseProvider promises;
@Inject
public ProjectExplorerStateComponent(ProjectExplorerPresenter projectExplorer, TreeResourceRevealer revealer, LoaderFactory loaderFactory) {
public ProjectExplorerStateComponent(ProjectExplorerPresenter projectExplorer,
TreeResourceRevealer revealer,
LoaderFactory loaderFactory,
PromiseProvider promises) {
this.projectExplorer = projectExplorer;
this.revealer = revealer;
this.loaderFactory = loaderFactory;
this.promises = promises;
}
@Override
public JsonObject getState() {
final List<Path> paths = new ArrayList<>();
/*
The main idea is to look up all expanded nodes in project tree and gather the last one's children.
Then check if child is resource, then we store the path in user preference.
*/
outer:
for (Node node : projectExplorer.getTree().getNodeStorage().getAll()) {
if (projectExplorer.getTree().isExpanded(node) && node instanceof ResourceNode) {
final List<Node> childrenToStore = projectExplorer.getTree().getNodeStorage().getChildren(node);
for (Node children : childrenToStore) {
if (children instanceof ResourceNode) {
paths.add(((ResourceNode) children).getData().getLocation());
continue outer;
}
}
}
}
JsonObject state = Json.createObject();
JsonArray array = Json.createArray();
state.put(PATH_PARAM_ID, array);
List<String> rawPaths = projectExplorer.getTree()
.getNodeStorage()
.getAll()
.stream()
.filter(node -> projectExplorer.getTree().isExpanded(node))
.filter(node -> node instanceof ResourceNode)
.map(node -> ((ResourceNode)node).getData().getLocation().toString())
.collect(Collectors.toList());
int i = 0;
for (Path path : paths) {
array.set(i++, path.toString());
for (String path : rawPaths) {
array.set(i++, path);
}
state.put(SHOW_HIDDEN_FILES, projectExplorer.isShowHiddenFiles());
@ -85,7 +83,7 @@ public class ProjectExplorerStateComponent implements StateComponent {
}
@Override
public void loadState(@NotNull JsonObject state) {
public Promise<Void> loadState(@NotNull JsonObject state) {
if (state.hasKey(SHOW_HIDDEN_FILES)) {
projectExplorer.showHiddenFiles(state.getBoolean(SHOW_HIDDEN_FILES));
}
@ -93,61 +91,61 @@ public class ProjectExplorerStateComponent implements StateComponent {
JsonArray paths = state.hasKey(PATH_PARAM_ID) ? state.getArray(PATH_PARAM_ID) : Json.createArray();
if (paths.length() == 0) {
return;
return promises.resolve(null);
}
Promise<Node> revealPromise = null;
final MessageLoader loader = loaderFactory.newLoader("Restoring project structure...");
MessageLoader loader = loaderFactory.newLoader("Restoring project structure...");
loader.show();
for (int i = 0; i < paths.length(); i++) {
final String path = paths.getString(i);
String path = paths.getString(i);
if (revealPromise == null) {
revealPromise = revealer.reveal(Path.valueOf(path), false).thenPromise(new Function<Node, Promise<Node>>() {
@Override
public Promise<Node> apply(Node node) throws FunctionException {
if (node != null) {
projectExplorer.getTree().setExpanded(node, true, false);
}
return revealer.reveal(Path.valueOf(path), false);
}
});
revealPromise = revealer.reveal(Path.valueOf(path), false)
.thenPromise(this::doExpand);
continue;
}
revealPromise.thenPromise(new Function<Node, Promise<Node>>() {
@Override
public Promise<Node> apply(Node node) throws FunctionException {
if (node != null) {
projectExplorer.getTree().setExpanded(node, true, false);
}
return revealer.reveal(Path.valueOf(path), false);
}
}).catchError(new Function<PromiseError, Node>() {
@Override
public Node apply(PromiseError error) throws FunctionException {
Log.info(getClass(), error.getMessage());
return null;
}
});
revealPromise.thenPromise(node -> revealer.reveal(Path.valueOf(path), false))
.thenPromise(this::doExpand)
.catchError(this::logError);
}
if (revealPromise != null) {
revealPromise.then(new Operation<Node>() {
@Override
public void apply(Node node) throws OperationException {
loader.hide();
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
loader.hide();
}
revealPromise.then(node -> {
loader.hide();
}).catchError(error -> {
loader.hide();
});
}
if (revealPromise == null) {
return promises.resolve(null);
}
return revealPromise.thenPromise(ignored -> promises.resolve(null));
}
private Promise<Node> doExpand(Node node) {
projectExplorer.getTree().setExpanded(node, true);
return promises.resolve(null);
}
private Promise<Node> logError(PromiseError error) {
Log.info(getClass(), error.getMessage());
return promises.resolve(null);
}
@Override
public int getPriority() {
return MAX_PRIORITY;
}
@Override
public String getId() {
return "projectExplorer";
}
}

View File

@ -17,6 +17,8 @@ import elemental.json.JsonObject;
import com.google.inject.Provider;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.js.Promises;
import org.eclipse.che.commons.annotation.Nullable;
import org.eclipse.che.ide.api.constraints.Constraints;
import org.eclipse.che.ide.api.parts.ActivePartChangedEvent;
@ -341,7 +343,7 @@ public abstract class AbstractPerspective implements Presenter, Perspective,
}
@Override
public void loadState(@NotNull JsonObject state) {
public Promise<Void> loadState(@NotNull JsonObject state) {
if (state.hasKey("PART_STACKS")) {
JsonObject partStacksState = state.getObject("PART_STACKS");
@ -372,6 +374,8 @@ public abstract class AbstractPerspective implements Presenter, Perspective,
setActivePart(provider.get());
}
}
return Promises.resolve(null);
}
/**
@ -457,4 +461,8 @@ public abstract class AbstractPerspective implements Presenter, Perspective,
}
}
@Override
public String getId() {
return null;
}
}

View File

@ -31,7 +31,7 @@ import org.eclipse.che.ide.rest.HTTPHeader;
import org.eclipse.che.ide.rest.Unmarshallable;
import org.eclipse.che.ide.util.NameUtils;
import java.util.Iterator;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
@ -136,16 +136,7 @@ public class MainPagePresenter extends AbstractWizardPage<MutableProjectConfig>
protected void onSuccess(ProjectImporterData data) {
List<ProjectImporterDescriptor> result = data.getImporters();
String defaultImporterId = data.getConfiguration().get(DEFAULT_PROJECT_IMPORTER);
Iterator<ProjectImporterDescriptor> itr = result.iterator();
while (itr.hasNext()) {
ProjectImporterDescriptor importer = itr.next();
if (importer.getId().equals(defaultImporterId)) {
Set<ProjectImporterDescriptor> importersSet = new LinkedHashSet<>();
importersSet.add(importer);
importersByCategory.put(importer.getCategory(), importersSet);
itr.remove();
}
}
result.sort(getProjectImporterComparator(defaultImporterId));
ProjectImporterDescriptor defaultImporter = null;
for (ProjectImporterDescriptor importer : result) {
@ -192,6 +183,20 @@ public class MainPagePresenter extends AbstractWizardPage<MutableProjectConfig>
fetchProjectImporters(callback);
}
private Comparator<ProjectImporterDescriptor> getProjectImporterComparator(String defaultImporterId) {
return (o1, o2) -> {
if (o1.getId().equals(defaultImporterId)) {
return -1;
}
if (o2.getId().equals(defaultImporterId)) {
return 1;
}
return 0;
};
}
/** {@inheritDoc} */
@Override
public void onEnterClicked() {

View File

@ -18,24 +18,26 @@ import elemental.json.JsonObject;
import com.google.common.annotations.VisibleForTesting;
import com.google.gwt.user.client.Timer;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.core.model.workspace.Workspace;
import org.eclipse.che.api.promises.client.Operation;
import org.eclipse.che.api.promises.client.OperationException;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseError;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.statepersistance.StateComponent;
import org.eclipse.che.api.promises.client.PromiseProvider;
import org.eclipse.che.ide.api.WindowActionEvent;
import org.eclipse.che.ide.api.WindowActionHandler;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.preferences.PreferencesManager;
import org.eclipse.che.ide.api.statepersistance.StateComponent;
import org.eclipse.che.ide.api.workspace.WorkspaceReadyEvent;
import org.eclipse.che.ide.util.loging.Log;
import java.util.Map;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import static java.util.Comparator.comparingInt;
import static java.util.stream.Collectors.toList;
/**
* Responsible for persisting and restoring IDE state across sessions.
@ -43,6 +45,7 @@ import java.util.Map;
*
* @author Artem Zatsarynnyi
* @author Yevhen Vydolob
* @author Vlad Zhukovskyi
*/
@Singleton
public class AppStateManager {
@ -52,21 +55,30 @@ public class AppStateManager {
private static final String WORKSPACE = "workspace";
private final Map<String, Provider<StateComponent>> persistenceComponents;
private final PreferencesManager preferencesManager;
private final JsonFactory jsonFactory;
private final AppContext appContext;
private JsonObject allWsState;
/**
* Sorted by execution priority list of persistence state components.
*/
private final List<StateComponent> persistenceComponents;
private final PreferencesManager preferencesManager;
private final JsonFactory jsonFactory;
private final PromiseProvider promises;
private final AppContext appContext;
private JsonObject allWsState;
@Inject
public AppStateManager(Map<String, Provider<StateComponent>> persistenceComponents,
public AppStateManager(Set<StateComponent> persistenceComponents,
PreferencesManager preferencesManager,
JsonFactory jsonFactory,
PromiseProvider promises,
EventBus eventBus,
AppContext appContext) {
this.persistenceComponents = persistenceComponents;
this.persistenceComponents = persistenceComponents.stream()
.sorted(comparingInt(StateComponent::getPriority).reversed())
.collect(toList());
this.preferencesManager = preferencesManager;
this.jsonFactory = jsonFactory;
this.promises = promises;
this.appContext = appContext;
// delay is required because we need to wait some time while different components initialized
@ -123,10 +135,15 @@ public class AppStateManager {
try {
if (settings.hasKey(WORKSPACE)) {
JsonObject workspace = settings.getObject(WORKSPACE);
Promise<Void> sequentialRestore = promises.resolve(null);
for (String key : workspace.keys()) {
if (persistenceComponents.containsKey(key)) {
StateComponent component = persistenceComponents.get(key).get();
component.loadState(workspace.getObject(key));
Optional<StateComponent> stateComponent = persistenceComponents.stream()
.filter(component -> component.getId().equals(key))
.findAny();
if (stateComponent.isPresent()) {
StateComponent component = stateComponent.get();
Log.debug(getClass(), "Restore state for the component ID: " + component.getId());
sequentialRestore = sequentialRestore.thenPromise(ignored -> component.loadState(workspace.getObject(key)));
}
}
}
@ -136,14 +153,15 @@ public class AppStateManager {
}
public Promise<Void> persistWorkspaceState() {
final String wsId = appContext.getWorkspace().getId();
final JsonObject settings = Json.createObject();
String wsId = appContext.getWorkspace().getId();
JsonObject settings = Json.createObject();
JsonObject workspace = Json.createObject();
settings.put(WORKSPACE, workspace);
for (Map.Entry<String, Provider<StateComponent>> entry : persistenceComponents.entrySet()) {
for (StateComponent entry : persistenceComponents) {
try {
String key = entry.getKey();
workspace.put(key, entry.getValue().get().getState());
Log.debug(getClass(), "Persist state for the component ID: " + entry.getId());
workspace.put(entry.getId(), entry.getState());
} catch (Exception e) {
Log.error(getClass(), e);
}
@ -155,14 +173,12 @@ public class AppStateManager {
private Promise<Void> writeStateToPreferences(JsonObject state) {
final String json = state.toJson();
preferencesManager.setValue(PREFERENCE_PROPERTY_NAME, json);
return preferencesManager.flushPreferences().catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError arg) throws OperationException {
Log.error(AppStateManager.class, "Failed to store app's state to user's preferences");
}
return preferencesManager.flushPreferences().catchError(error -> {
Log.error(AppStateManager.class, "Failed to store app's state to user's preferences: " + error.getMessage());
});
}
@Deprecated
public boolean hasStateForWorkspace(String wsId) {
return allWsState.hasKey(wsId);
}

View File

@ -12,6 +12,7 @@ package org.eclipse.che.ide.statepersistance;
import com.google.gwt.inject.client.AbstractGinModule;
import com.google.gwt.inject.client.multibindings.GinMapBinder;
import com.google.gwt.inject.client.multibindings.GinMultibinder;
import org.eclipse.che.ide.api.statepersistance.StateComponent;
import org.eclipse.che.ide.editor.EditorAgentImpl;
@ -25,9 +26,9 @@ public class PersistenceApiModule extends AbstractGinModule {
protected void configure() {
bind(AppStateManager.class).asEagerSingleton();
GinMapBinder<String, StateComponent> stateComponents = GinMapBinder.newMapBinder(binder(), String.class, StateComponent.class);
stateComponents.addBinding("workspace").to(WorkspacePresenter.class);
stateComponents.addBinding("editor").to(EditorAgentImpl.class);
stateComponents.addBinding("projectExplorer").to(ProjectExplorerStateComponent.class);
GinMultibinder<StateComponent> stateComponents = GinMultibinder.newSetBinder(binder(), StateComponent.class);
stateComponents.addBinding().to(WorkspacePresenter.class);
stateComponents.addBinding().to(EditorAgentImpl.class);
stateComponents.addBinding().to(ProjectExplorerStateComponent.class);
}
}

View File

@ -10,16 +10,19 @@
*******************************************************************************/
package org.eclipse.che.ide.workspace;
import com.google.inject.Provider;
import elemental.json.Json;
import elemental.json.JsonObject;
import elemental.util.ArrayOf;
import elemental.util.Collections;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import com.google.inject.name.Named;
import org.eclipse.che.ide.api.statepersistance.StateComponent;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseProvider;
import org.eclipse.che.ide.api.constraints.Constraints;
import org.eclipse.che.ide.api.mvp.Presenter;
import org.eclipse.che.ide.api.parts.PartPresenter;
@ -29,6 +32,7 @@ import org.eclipse.che.ide.api.parts.Perspective;
import org.eclipse.che.ide.api.parts.PerspectiveManager;
import org.eclipse.che.ide.api.parts.PerspectiveManager.PerspectiveTypeListener;
import org.eclipse.che.ide.api.parts.WorkspaceAgent;
import org.eclipse.che.ide.api.statepersistance.StateComponent;
import org.eclipse.che.ide.menu.MainMenuPresenter;
import org.eclipse.che.ide.menu.StatusPanelGroupPresenter;
import org.eclipse.che.ide.ui.toolbar.MainToolbar;
@ -50,14 +54,15 @@ import java.util.Map;
public class WorkspacePresenter implements Presenter, WorkspaceView.ActionDelegate, WorkspaceAgent, PerspectiveTypeListener,
StateComponent {
private final WorkspaceView view;
private final String defaultPerspectiveId;
private final MainMenuPresenter mainMenu;
private final StatusPanelGroupPresenter bottomMenu;
private final ToolbarPresenter toolbarPresenter;
private final Provider<PerspectiveManager> perspectiveManagerProvider;
private final WorkspaceView view;
private final String defaultPerspectiveId;
private final PromiseProvider promises;
private final MainMenuPresenter mainMenu;
private final StatusPanelGroupPresenter bottomMenu;
private final ToolbarPresenter toolbarPresenter;
private final Provider<PerspectiveManager> perspectiveManagerProvider;
private Perspective activePerspective;
private Perspective activePerspective;
@Inject
public WorkspacePresenter(WorkspaceView view,
@ -65,9 +70,11 @@ public class WorkspacePresenter implements Presenter, WorkspaceView.ActionDelega
MainMenuPresenter mainMenu,
StatusPanelGroupPresenter bottomMenu,
@MainToolbar ToolbarPresenter toolbarPresenter,
@Named("defaultPerspectiveId") String defaultPerspectiveId) {
@Named("defaultPerspectiveId") String defaultPerspectiveId,
PromiseProvider promises) {
this.view = view;
this.defaultPerspectiveId = defaultPerspectiveId;
this.promises = promises;
this.view.setDelegate(this);
this.toolbarPresenter = toolbarPresenter;
@ -85,6 +92,7 @@ public class WorkspacePresenter implements Presenter, WorkspaceView.ActionDelega
public void go(AcceptsOneWidget container) {
mainMenu.go(view.getMenuPanel());
toolbarPresenter.go(view.getToolbarPanel());
container.setWidget(view);
}
@ -161,16 +169,24 @@ public class WorkspacePresenter implements Presenter, WorkspaceView.ActionDelega
}
@Override
public void loadState(JsonObject state) {
public Promise<Void> loadState(JsonObject state) {
if (state.hasKey("perspectives")) {
JsonObject perspectives = state.getObject("perspectives");
Map<String, Perspective> perspectiveMap = perspectiveManagerProvider.get().getPerspectives();
ArrayOf<Promise<?>> perspectivePromises = Collections.arrayOf();
for (String key : perspectives.keys()) {
if (perspectiveMap.containsKey(key)) {
perspectiveMap.get(key).loadState(perspectives.getObject(key));
perspectivePromises.push(perspectiveMap.get(key).loadState(perspectives.getObject(key)));
}
}
return promises.all2(perspectivePromises).thenPromise(ignored -> promises.resolve(null));
}
return promises.resolve(null);
}
@Override
public String getId() {
return "workspace";
}
}

View File

@ -15,22 +15,33 @@ import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.HandlerRegistration;
import org.eclipse.che.ide.api.editor.EditorAgent;
import org.eclipse.che.ide.api.editor.EditorInput;
import org.eclipse.che.ide.api.editor.EditorPartPresenter;
import org.eclipse.che.ide.api.editor.EditorWithAutoSave;
import org.eclipse.che.ide.api.editor.document.Document;
import org.eclipse.che.ide.api.editor.document.DocumentEventBus;
import org.eclipse.che.ide.api.editor.document.DocumentHandle;
import org.eclipse.che.ide.api.editor.document.DocumentStorage;
import org.eclipse.che.ide.api.editor.document.DocumentStorage.DocumentCallback;
import org.eclipse.che.ide.api.editor.events.DocumentChangedEvent;
import org.eclipse.che.ide.api.editor.events.FileContentUpdateEvent;
import org.eclipse.che.ide.api.editor.texteditor.TextEditor;
import org.eclipse.che.ide.api.notification.NotificationManager;
import org.eclipse.che.ide.api.notification.StatusNotification;
import org.eclipse.che.ide.api.resources.File;
import org.eclipse.che.ide.api.resources.VirtualFile;
import org.eclipse.che.ide.resource.Path;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import static org.eclipse.che.ide.api.notification.StatusNotification.DisplayMode.NOT_EMERGE_MODE;
import static org.eclipse.che.ide.api.notification.StatusNotification.Status.SUCCESS;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.anyString;
@ -46,29 +57,39 @@ import static org.mockito.Mockito.withSettings;
/** @author Roman Nikitenko */
@RunWith(MockitoJUnitRunner.class)
public class EditorGroupSynchronizationImplTest {
private static final String FILE_CONTENT = "some content";
private static final String FILE_NEW_CONTENT = "some content to update";
private static final String FILE_LOCATION = "testProject/src/main/java/org/eclipse/che/examples/someFile";
@Mock
private EventBus eventBus;
private EventBus eventBus;
@Mock
private EditorAgent editorAgent;
private EditorAgent editorAgent;
@Mock
private Document document;
private Document document;
@Mock
private DocumentHandle documentHandle;
private DocumentHandle documentHandle;
@Mock
private DocumentEventBus documentEventBus;
private DocumentEventBus documentEventBus;
@Mock
private DocumentStorage documentStorage;
private DocumentStorage documentStorage;
@Mock
private NotificationManager notificationManager;
private NotificationManager notificationManager;
@Mock
private HandlerRegistration handlerRegistration;
private HandlerRegistration handlerRegistration;
@Mock
private DocumentChangedEvent documentChangeEvent;
private DocumentChangedEvent documentChangeEvent;
@Mock
private FileContentUpdateEvent fileContentUpdateEvent;
@Mock
private EditorInput editorInput;
@Captor
private ArgumentCaptor<DocumentCallback> documentCallbackCaptor;
private EditorPartPresenter activeEditor;
private EditorPartPresenter openedEditor1;
private EditorPartPresenter openedEditor2;
private VirtualFile virtualFile;
private EditorGroupSynchronizationImpl editorGroupSynchronization;
@Before
@ -76,6 +97,7 @@ public class EditorGroupSynchronizationImplTest {
activeEditor = mock(EditorPartPresenter.class, withSettings().extraInterfaces(TextEditor.class, EditorWithAutoSave.class));
openedEditor1 = mock(EditorPartPresenter.class, withSettings().extraInterfaces(TextEditor.class, EditorWithAutoSave.class));
openedEditor2 = mock(EditorPartPresenter.class, withSettings().extraInterfaces(TextEditor.class, EditorWithAutoSave.class));
virtualFile = mock(VirtualFile.class, withSettings().extraInterfaces(File.class));
when(((EditorWithAutoSave)openedEditor1).isAutoSaveEnabled()).thenReturn(true);
when(((EditorWithAutoSave)openedEditor2).isAutoSaveEnabled()).thenReturn(true);
@ -89,13 +111,61 @@ public class EditorGroupSynchronizationImplTest {
when(((TextEditor)openedEditor1).getDocument()).thenReturn(document);
when(((TextEditor)openedEditor2).getDocument()).thenReturn(document);
when(document.getContents()).thenReturn("some content");
when(document.getContents()).thenReturn(FILE_CONTENT);
when(openedEditor1.getEditorInput()).thenReturn(editorInput);
when(editorInput.getFile()).thenReturn(virtualFile);
when(virtualFile.getLocation()).thenReturn(new Path(FILE_LOCATION));
when(documentEventBus.addHandler((Event.Type<Object>)anyObject(), anyObject())).thenReturn(handlerRegistration);
editorGroupSynchronization = new EditorGroupSynchronizationImpl(eventBus, documentStorage, notificationManager);
}
@Test
public void shouldUpdateContentOnFileContentUpdateEvent() {
editorGroupSynchronization.addEditor(openedEditor1);
reset(documentEventBus);
when(fileContentUpdateEvent.getFilePath()).thenReturn(FILE_LOCATION);
editorGroupSynchronization.onFileContentUpdate(fileContentUpdateEvent);
verify(documentStorage).getDocument(anyObject(), documentCallbackCaptor.capture());
documentCallbackCaptor.getValue().onDocumentReceived(FILE_NEW_CONTENT);
verify(document).replace(anyInt(), anyInt(), eq(FILE_NEW_CONTENT));
verify(notificationManager, never()).notify(anyString(), (StatusNotification.Status)anyObject(), anyObject());
}
@Test
public void shouldSkipUpdateContentOnFileContentUpdateEventWhenContentTheSame() {
editorGroupSynchronization.addEditor(openedEditor1);
reset(documentEventBus);
when(fileContentUpdateEvent.getFilePath()).thenReturn(FILE_LOCATION);
editorGroupSynchronization.onFileContentUpdate(fileContentUpdateEvent);
verify(documentStorage).getDocument(anyObject(), documentCallbackCaptor.capture());
documentCallbackCaptor.getValue().onDocumentReceived(FILE_CONTENT);
verify(document, never()).replace(anyInt(), anyInt(), anyString());
verify(notificationManager, never()).notify(anyString(), (StatusNotification.Status)anyObject(), anyObject());
}
@Test
public void shouldNotifyAboutExternalOperationAtUpdateContentWhenStampIsDifferent() {
editorGroupSynchronization.addEditor(openedEditor1);
reset(documentEventBus);
when(fileContentUpdateEvent.getFilePath()).thenReturn(FILE_LOCATION);
when(fileContentUpdateEvent.getModificationStamp()).thenReturn("some stamp");
editorGroupSynchronization.onFileContentUpdate(fileContentUpdateEvent);
verify(documentStorage).getDocument(anyObject(), documentCallbackCaptor.capture());
documentCallbackCaptor.getValue().onDocumentReceived(FILE_NEW_CONTENT);
verify(notificationManager).notify(anyString(), anyString(), eq(SUCCESS), eq(NOT_EMERGE_MODE));
}
@Test
public void shouldAddEditor() {
reset(documentEventBus);
@ -109,7 +179,6 @@ public class EditorGroupSynchronizationImplTest {
public void shouldUpdateContentAtAddingEditorWhenGroupHasUnsavedData() {
editorGroupSynchronization.addEditor(openedEditor1);
reset(documentEventBus);
when(((TextEditor)openedEditor1).getDocument()).thenReturn(document);
when(((EditorWithAutoSave)openedEditor1).isAutoSaveEnabled()).thenReturn(false);
editorGroupSynchronization.addEditor(activeEditor);

View File

@ -18,10 +18,12 @@ import com.google.gwtmockito.GwtMockitoTestRunner;
import com.google.inject.Provider;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.promises.client.Function;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseProvider;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.statepersistance.StateComponent;
import org.eclipse.che.ide.api.preferences.PreferencesManager;
import org.eclipse.che.ide.api.statepersistance.StateComponent;
import org.eclipse.che.ide.api.workspace.model.WorkspaceImpl;
import org.junit.Before;
import org.junit.Test;
@ -30,10 +32,11 @@ import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import java.util.HashMap;
import java.util.Map;
import java.util.HashSet;
import java.util.Set;
import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
@ -45,6 +48,7 @@ import static org.mockito.Mockito.when;
*
* @author Artem Zatsarynnyi
* @author Dmitry Shnurenko
* @author Vlad Zhukovskyi
*/
@RunWith(GwtMockitoTestRunner.class)
public class AppStateManagerTest {
@ -52,27 +56,35 @@ public class AppStateManagerTest {
private static final String WS_ID = "ws_id";
@Mock
private StateComponent component1;
private StateComponent component1;
@Mock
private StateComponent component2;
private StateComponent component2;
@Mock
private Provider<StateComponent> component1Provider;
@Mock
private Provider<StateComponent> component2Provider;
@Mock
private Promise<Void> promise;
private Promise<Void> promise;
@Mock
private Promise<String> contentPromise;
@Mock
private PreferencesManager preferencesManager;
@Mock
private JsonFactory jsonFactory;
private JsonFactory jsonFactory;
@Mock
private EventBus eventBus;
@Mock
private AppContext appContext;
@Mock
private JsonObject pref;
private JsonObject pref;
@Mock
private PromiseProvider promiseProvider;
@Mock
private Promise<Void> sequentialRestore;
@Captor
private ArgumentCaptor<Function<Void, Promise<Void>>> sequentialRestoreThenFunction;
@Captor
private ArgumentCaptor<String> preferenceArgumentCaptor;
@ -88,17 +100,24 @@ public class AppStateManagerTest {
when(workspace.getId()).thenReturn(WS_ID);
when(appContext.getWorkspace()).thenReturn(workspace);
Map<String, Provider<StateComponent>> components = new HashMap<>();
components.put("component1", component1Provider);
components.put("component2", component2Provider);
// Map<String, Provider<StateComponent>> components = new HashMap<>();
// components.put("component1", component1Provider);
// components.put("component2", component2Provider);
when(component1Provider.get()).thenReturn(component1);
when(component2Provider.get()).thenReturn(component2);
Set<StateComponent> components = new HashSet<>();
components.add(component1);
components.add(component2);
when(component1.getId()).thenReturn("component1");
when(component2.getId()).thenReturn("component2");
when(preferencesManager.flushPreferences()).thenReturn(promise);
when(preferencesManager.getValue(AppStateManager.PREFERENCE_PROPERTY_NAME)).thenReturn("");
when(jsonFactory.parse(anyString())).thenReturn(pref = Json.createObject());
appStateManager = new AppStateManager(components, preferencesManager, jsonFactory, eventBus, appContext);
appStateManager = new AppStateManager(components, preferencesManager, jsonFactory, promiseProvider, eventBus, appContext);
appStateManager.readStateFromPreferences();
}
@ -165,8 +184,13 @@ public class AppStateManagerTest {
workspace.put("component1", comp1);
comp1.put("key1", "value1");
when(promiseProvider.resolve(any(Void.class))).thenReturn(sequentialRestore);
appStateManager.restoreWorkspaceState();
verify(sequentialRestore).thenPromise(sequentialRestoreThenFunction.capture());
sequentialRestoreThenFunction.getValue().apply(null);
ArgumentCaptor<JsonObject> stateCaptor = ArgumentCaptor.forClass(JsonObject.class);
verify(component1).loadState(stateCaptor.capture());

View File

@ -11,10 +11,13 @@
package org.eclipse.che.ide.workspace;
import com.google.inject.Provider;
import elemental.json.Json;
import elemental.json.JsonObject;
import elemental.util.ArrayOf;
import org.eclipse.che.ide.api.parts.PartPresenter;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.api.promises.client.PromiseProvider;
import org.eclipse.che.ide.api.parts.Perspective;
import org.eclipse.che.ide.api.parts.PerspectiveManager;
import org.eclipse.che.ide.menu.MainMenuPresenter;
@ -32,16 +35,20 @@ import java.util.HashMap;
import java.util.Map;
import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* Unit tests for the {@link WorkspacePresenter}.
*
* @author Evgen Vidolob
* @author Vlad Zhukovskyi
*/
@RunWith(MockitoJUnitRunner.class)
public class WorkspacePresenterPersistenceTest {
@Mock
private WorkspaceView workspaceView;
@Mock
@ -55,12 +62,12 @@ public class WorkspacePresenterPersistenceTest {
@Mock
private ToolbarPresenter toolbarPresenter;
@Mock
private PartPresenter part1;
private PromiseProvider promiseProvider;
private WorkspacePresenter presenter;
@Mock
private Provider<PerspectiveManager> perspectiveManagerProvider;
private Provider<PerspectiveManager> perspectiveManagerProvider;
private PerspectiveManager perspectiveManager;
@ -78,7 +85,8 @@ public class WorkspacePresenterPersistenceTest {
mainMenuPresenter,
statusPanelGroupPresenter,
toolbarPresenter,
"perspective1");
"perspective1",
promiseProvider);
}
@ -102,6 +110,8 @@ public class WorkspacePresenterPersistenceTest {
JsonObject perspective1State = Json.createObject();
perspectives.put("perspective1", perspective1State);
when(promiseProvider.all2(any(ArrayOf.class))).thenReturn(mock(Promise.class));
presenter.loadState(state);
verify(perspective1).loadState(perspective1State);

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-ide-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-ide-generators</artifactId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-ide-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-ide-stacks</artifactId>
@ -29,6 +29,7 @@
<artifactId>license-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/type-ceylon.svg</exclude>
<exclude>**/type-bitnami.svg</exclude>
<exclude>**/type-zend.svg</exclude>
</excludes>

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 109 KiB

View File

@ -405,7 +405,7 @@
"id": "dotnet-default",
"creator": "ide",
"name": ".NET",
"description": "Default .NET Stack with .NET Core SDK",
"description": "Default .NET 2.0 Stack with .NET Core SDK",
"scope": "general",
"tags": [
"Ubuntu",
@ -415,11 +415,11 @@
"components": [
{
"name": "Ubuntu",
"version": "14.04"
"version": "16.04"
},
{
"name": ".NET Core SDK",
"version": "1.0.0-preview1-002702"
"version": "2.0.0-preview2-006497"
}
],
"source": {
@ -2371,6 +2371,14 @@
"previewUrl": "http://${server.port.8080}",
"goal": "Run"
}
}, {
"commandLine": "scl enable rh-maven33 'mvn vertx:debug -f ${current.project.path}'",
"name": "debug",
"type": "custom",
"attributes": {
"previewUrl": "http://${server.port.8080}",
"goal": "Debug"
}
}]
},
"stackIcon": {
@ -2448,6 +2456,15 @@
"previewUrl": "http://${server.port.8080}",
"goal": "Run"
}
},
{
"commandLine": "scl enable rh-maven33 'mvn spring-boot:run -Drun.jvmArguments=\"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005\" -f ${current.project.path}'",
"name": "debug",
"type": "custom",
"attributes": {
"previewUrl": "http://${server.port.8080}",
"goal": "Debug"
}
}
]
},
@ -2487,7 +2504,6 @@
"attributes": {
"memoryLimitBytes": "2147483648"
},
"installers": [
"org.eclipse.che.terminal",
"org.eclipse.che.ws-agent",
@ -2641,7 +2657,7 @@
"default": {
"machines": {
"dev-machine": {
"agents": [
"installers": [
"org.eclipse.che.exec", "org.eclipse.che.terminal", "org.eclipse.che.ws-agent", "org.eclipse.che.ssh"
],
"servers": {},
@ -2690,7 +2706,7 @@
"default": {
"machines": {
"dev-machine": {
"agents": [
"installers": [
"org.eclipse.che.exec", "org.eclipse.che.terminal", "org.eclipse.che.ws-agent", "org.eclipse.che.ssh"
],
"servers": {},
@ -2747,7 +2763,7 @@
"default": {
"machines": {
"dev-machine": {
"agents": [
"installers": [
"org.eclipse.che.terminal",
"org.eclipse.che.ws-agent",
"org.eclipse.che.ssh"
@ -2772,6 +2788,156 @@
"name": "type-blank.svg",
"mediaType": "image/svg+xml"
}
},
{
"description": "Ceylon stack with Java, JavaScript and Dart backends on CentOS.",
"creator": "ide",
"scope": "advanced",
"name": "Ceylon with Java JavaScript Dart on CentOS",
"id": "ceylon-java-javascript-dart-centos",
"source": {
"origin": "eclipse/centos_ceylon_nodejs_dart",
"type": "image"
},
"components": [
{
"version": "---",
"name": "CentOS"
},
{
"version": "1.8.0_131",
"name": "JDK"
},
{
"version": "3.3.9",
"name": "Maven"
},
{
"version": "8.0.24",
"name": "Tomcat"
},
{
"version": "1.3.2",
"name": "Ceylon"
},
{
"version": "1.24.2",
"name": "Dart SDK"
},
{
"version": "6.11.1",
"name": "NodeJS"
}
],
"tags": [
"Java",
"JDK",
"Maven",
"Tomcat",
"CentOS",
"Git",
"Ceylon",
"Dart"
],
"workspaceConfig": {
"defaultEnv": "default",
"environments": {
"default": {
"machines": {
"dev-machine": {
"attributes": {
"memoryLimitBytes": "2147483648"
},
"servers": {},
"installers": [
"org.eclipse.che.exec",
"org.eclipse.che.terminal",
"org.eclipse.che.ws-agent",
"org.eclipse.che.ssh",
"org.eclipse.che.ls.json",
"org.eclipse.che.ls.js-ts"
]
}
},
"recipe": {
"location": "eclipse/centos_ceylon_nodejs_dart",
"type": "dockerimage"
}
}
},
"projects": [],
"name": "default",
"commands": [
{
"commandLine": "rm -Rf ${current.project.path}/modules ",
"name": "clean modules",
"attributes": {
"goal": "Build",
"previewUrl": ""
},
"type": "custom"
},
{
"commandLine": "cd ${current.project.path} && ceylon compile",
"name": "compile for JVM",
"attributes": {
"goal": "Build",
"previewUrl": ""
},
"type": "custom"
},
{
"commandLine": "cd ${current.project.path} && ceylon compile-js",
"name": "compile for JS",
"attributes": {
"goal": "Build",
"previewUrl": ""
},
"type": "custom"
},
{
"commandLine": "cd ${current.project.path} && ceylon compile-dart",
"name": "compile for Dart",
"attributes": {
"goal": "Build",
"previewUrl": ""
},
"type": "custom"
},
{
"commandLine": "cd ${current.project.path} && ceylon run",
"name": "Run on JVM",
"attributes": {
"goal": "Run",
"previewUrl": ""
},
"type": "custom"
},
{
"commandLine": "cd ${current.project.path} && ceylon run-js",
"name": "Run on NodeJS",
"attributes": {
"goal": "Run",
"previewUrl": ""
},
"type": "custom"
},
{
"commandLine": "cd ${current.project.path} && ceylon run-dart $(ceylon config get runtool.module)",
"name": "Run on Dart",
"attributes": {
"goal": "Run",
"previewUrl": ""
},
"type": "custom"
}
],
"links": []
},
"stackIcon": {
"name": "type-ceylon.svg",
"mediaType": "image/svg+xml"
}
},
{
"id": "openshift-default",

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-ide-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-ide-templates</artifactId>

View File

@ -906,11 +906,11 @@
]
},
{
"name": "aspnet-web-simple",
"displayName": "aspnet-web-simple",
"path": "/aspnet-web-simple",
"description": "A simple ASP.net web sample.",
"projectType": "blank",
"name": "dotnet-web-simple",
"displayName": "dotnet-web-simple",
"path": "/dotnet-web-simple",
"description": "A simple .NET 2.0 web sample.",
"projectType": "csharp",
"mixins": [],
"attributes": {
"language": [
@ -921,7 +921,7 @@
"problems": [],
"source": {
"type": "git",
"location": "https://github.com/che-samples/aspnet-web-simple.git",
"location": "https://github.com/che-samples/dotnet-web-simple.git",
"parameters": {}
},
"commands": [
@ -1564,5 +1564,28 @@
"tags": [
"TypeScript","ts"
]
},
{
"name": "ceylon-hello-world",
"displayName": "ceylon-hello-world",
"path": "/ceylon-hello-world",
"description": "A Ceylon 'Hello World' project example that runs on all supported backends.",
"projectType": "blank",
"mixins": [],
"attributes": {
},
"modules": [],
"problems": [],
"source": {
"type": "git",
"location": "https://github.com/che-samples/ceylon-hello-world",
"parameters": {}
},
"commands": [],
"links": [],
"category": "Samples",
"tags": [
"Ceylon"
]
}
]

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-ide-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-ide-ui</artifactId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-ide-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-orion-editor</artifactId>
<packaging>jar</packaging>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.eclipse.che.core</groupId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-ide-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-commons-gwt</artifactId>
<name>Che Core :: Commons :: GWT</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-core-ide-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
</parent>
<artifactId>che-core-gwt-logger</artifactId>
<name>Che Core :: Commons :: GWT Logger</name>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.eclipse.che.core</groupId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-infrastructures-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>infrastructure-docker</artifactId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>che-infrastructures-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>infrastructure-openshift</artifactId>

View File

@ -16,11 +16,11 @@
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>che-infrastructures-parent</artifactId>
<version>5.16.0-SNAPSHOT</version>
<version>5.17.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Che Infrastructures Parent</name>
<modules>

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>che-plugin-activity-parent</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>che-plugin-activity-ide</artifactId>
<packaging>jar</packaging>
<name>Che Plugin :: Activity :: IDE</name>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-ide-api</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>

View File

@ -0,0 +1,56 @@
/*******************************************************************************
* 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.activity.ide;
import com.google.gwt.core.client.Callback;
import com.google.gwt.core.client.ScriptInjector;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.extension.Extension;
import javax.inject.Inject;
import javax.inject.Singleton;
import static com.google.gwt.core.client.ScriptInjector.TOP_WINDOW;
/**
* Adds activity tracking script to IDE.
*
* @author Max Shaposhnik (mshaposhnik@codenvy.com)
*/
@Singleton
@Extension(title = "Activity Tracking Extension", version = "1.0.0")
public class ActivityTrackingExtension {
@Inject
public ActivityTrackingExtension(AppContext appContext) {
ScriptInjector.fromUrl("/_app/activity.js")
.setWindow(TOP_WINDOW)
.setCallback(new Callback<Void, Exception>() {
@Override
public void onSuccess(Void result) {
init(appContext.getMasterApiEndpoint(), appContext.getWorkspaceId());
}
@Override
public void onFailure(Exception reason) {
}
private native void init(String restContext, String wsId) /*-{
$wnd.ActivityTracker.init(restContext, wsId);
}-*/;
})
.inject();
}
}

View File

@ -0,0 +1,19 @@
<!--
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
-->
<module>
<inherits name="com.google.gwt.user.User"/>
<public path="public"/>
<source path="ide"/>
</module>

View File

@ -0,0 +1,60 @@
/*
* 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
*/
var ActivityTracker = new function () {
var url;
var timeoutInterval = 30000;
var maxErrors = 10;
var errors = 0;
var active;
this.init = function (restContext, workspaceId) {
this.url = restContext + "/activity/" + workspaceId;
document.addEventListener("mousemove", ActivityTracker.setActive);
document.addEventListener("keypress", ActivityTracker.setActive);
setInterval(ActivityTracker.sendRequest, timeoutInterval);
};
this.setActive = function() {
if (!active && errors < maxErrors) {
active = true;
}
}
this.sendRequest = function () {
if (!active) {
return;
}
active = false;
var request;
if (window.XMLHttpRequest) {
request = new XMLHttpRequest();
} else {
request = new ActiveXObject("Microsoft.XMLHTTP");
}
request.onreadystatechange = function () {
if (request.readyState == 4) {
if (request.status == 204) {
errors = 0;
} else {
errors++;
}
}
};
request.open("PUT", ActivityTracker.url, true);
request.send();
};
};

View File

@ -11,16 +11,22 @@
Codenvy, S.A. - initial API and implementation
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>che-agent-parent</artifactId>
<groupId>org.eclipse.che.core</groupId>
<version>5.16.0-SNAPSHOT</version>
<artifactId>che-plugin-activity-parent</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>5.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>activity</artifactId>
<name>Che Core :: API :: Activity</name>
<artifactId>che-plugin-activity-server</artifactId>
<packaging>jar</packaging>
<name>Che Plugin :: Activity :: Server</name>
<dependencies>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-servlet</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
@ -29,6 +35,10 @@
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-core</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-commons-inject</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-commons-schedule</artifactId>
@ -42,11 +52,6 @@
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>

View File

@ -0,0 +1,27 @@
/*******************************************************************************
* 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.activity;
import com.google.inject.servlet.ServletModule;
import org.eclipse.che.inject.DynaModule;
/**
* @author Mihail Kuznyetsov
*/
@DynaModule
public class ActivityServletModule extends ServletModule {
@Override
protected void configureServlets() {
filter("/*").through(org.eclipse.che.plugin.activity.LastAccessTimeFilter.class);
}
}

View File

@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.activity;
package org.eclipse.che.plugin.activity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.activity;
package org.eclipse.che.plugin.activity;
import org.eclipse.che.api.core.rest.HttpJsonRequestFactory;
import org.eclipse.che.commons.schedule.ScheduleRate;

View File

@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.activity;
package org.eclipse.che.plugin.activity;
import org.mockito.InjectMocks;

View File

@ -8,7 +8,7 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.activity;
package org.eclipse.che.plugin.activity;
import org.eclipse.che.api.core.rest.HttpJsonRequestFactory;
import org.mockito.Mock;
@ -17,7 +17,6 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

Some files were not shown because too many files have changed in this diff Show More