You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2016/04/19 13:54:43 UTC
[10/15] incubator-tamaya git commit: TAMAYA-149 Final fixes
restabilizing modules after Tomcat is now used.
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/modules/ui/src/main/java/org/apache/tamaya/ui/views/ErrorView.java
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/java/org/apache/tamaya/ui/views/ErrorView.java b/modules/ui/src/main/java/org/apache/tamaya/ui/views/ErrorView.java
new file mode 100644
index 0000000..ef3fa2e
--- /dev/null
+++ b/modules/ui/src/main/java/org/apache/tamaya/ui/views/ErrorView.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.ui.views;
+
+import com.vaadin.navigator.View;
+import com.vaadin.navigator.ViewChangeListener;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.VerticalLayout;
+import org.apache.tamaya.ui.UIConstants;
+
+public class ErrorView extends VerticalLayout implements View {
+
+ @Override
+ public void enter(ViewChangeListener.ViewChangeEvent event) {
+ setSizeFull();
+ setMargin(true);
+ Label label = new Label("Could not find a view with that name. You are most likely doing it wrong.");
+ label.addStyleName(UIConstants.LABEL_FAILURE);
+
+ addComponent(label);
+ setComponentAlignment(label, Alignment.MIDDLE_CENTER);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/modules/ui/src/main/java/org/apache/tamaya/ui/views/HomeView.java
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/java/org/apache/tamaya/ui/views/HomeView.java b/modules/ui/src/main/java/org/apache/tamaya/ui/views/HomeView.java
new file mode 100644
index 0000000..78297d2
--- /dev/null
+++ b/modules/ui/src/main/java/org/apache/tamaya/ui/views/HomeView.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.ui.views;
+
+import com.vaadin.navigator.View;
+import com.vaadin.navigator.ViewChangeListener;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Label;
+import org.apache.tamaya.spi.ServiceContextManager;
+import org.apache.tamaya.ui.CurrentUser;
+import org.apache.tamaya.ui.UIConstants;
+import org.apache.tamaya.ui.ViewProvider;
+import org.apache.tamaya.ui.components.VerticalSpacedLayout;
+import org.apache.tamaya.ui.services.MessageProvider;
+
+import javax.annotation.Priority;
+
+
+public class HomeView extends VerticalSpacedLayout implements View {
+
+ @Priority(0)
+ public static final class Provider implements ViewProvider{
+
+ @Override
+ public ViewLifecycle getLifecycle() {
+ return ViewLifecycle.CREATE;
+ }
+
+ @Override
+ public String getUrlPattern() {
+ return "";
+ }
+
+ @Override
+ public String getDisplayName() {
+ return ServiceContextManager.getServiceContext().getService(MessageProvider.class)
+ .getMessage("view.home.name");
+ }
+
+ @Override
+ public View createView(){
+ return new HomeView();
+ }
+ }
+
+ public HomeView() {
+ Label caption = new Label("Welcome, " + CurrentUser.get().getUserID());
+ Label description = new Label(
+ "<b>Apache Tamaya</b> is an API and extendable framework for accessing and managing configuration.<br/> \n" +
+ "Please check the project's home page <a href='http://tamaya.incubator.apache.org'>http://tamaya.incubator.apache.org</a>.",
+ ContentMode.HTML);
+
+ addComponents(caption, description);
+
+ caption.addStyleName(UIConstants.LABEL_HUGE);
+ description.addStyleName(UIConstants.LABEL_LARGE);
+
+ }
+
+ @Override
+ public void enter(ViewChangeListener.ViewChangeEvent event) {
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginBox.java
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginBox.java b/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginBox.java
new file mode 100644
index 0000000..049d885
--- /dev/null
+++ b/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginBox.java
@@ -0,0 +1,91 @@
+package org.apache.tamaya.ui.views.login;
+
+import com.vaadin.event.ShortcutAction;
+import com.vaadin.ui.*;
+import org.apache.tamaya.spi.ServiceContextManager;
+import org.apache.tamaya.ui.UIConstants;
+import org.apache.tamaya.ui.User;
+import org.apache.tamaya.ui.event.EventBus;
+import org.apache.tamaya.ui.services.MessageProvider;
+import org.apache.tamaya.ui.services.UserService;
+
+
+public class LoginBox extends VerticalLayout {
+
+ private UserService userService = new UserService() {
+ @Override
+ public User login(String userId, String credentials) {
+ if("admin".equals(userId)){
+ return new User("admin", "Administrator");
+ }
+ return null;
+ }
+ }; // TODO Load
+ private TextField username;
+ private PasswordField password;
+
+ public LoginBox() {
+ setWidth("400px");
+ addStyleName(UIConstants.LOGIN_BOX);
+ setSpacing(true);
+ setMargin(true);
+
+ addCaption();
+ addForm();
+ addButtons();
+ }
+
+ private void addCaption() {
+ Label caption = new Label("Login to system");
+ addComponent(caption);
+
+ caption.addStyleName(UIConstants.LABEL_H1);
+ }
+
+ private void addForm() {
+ FormLayout loginForm = new FormLayout();
+ MessageProvider mp = ServiceContextManager.getServiceContext().getService(MessageProvider.class);
+ username = new TextField(mp.getMessage("default.label.username"));
+ password = new PasswordField(mp.getMessage("default.label.password"));
+ loginForm.addComponents(username, password);
+ addComponent(loginForm);
+ loginForm.setSpacing(true);
+ for(Component component:loginForm){
+ component.setWidth("100%");
+ }
+ username.focus();
+ }
+
+ private void addButtons() {
+ HorizontalLayout buttonsLayout = new HorizontalLayout();
+ Button forgotButton = new Button("Forgot", new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent clickEvent) {
+ Notification.show("Not implemented", Notification.Type.TRAY_NOTIFICATION);
+ }
+ });
+ Button loginButton = new Button("Login", new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent clickEvent) {
+ login();
+ }
+ });
+ buttonsLayout.addComponents(forgotButton, loginButton);
+ addComponent(buttonsLayout);
+ buttonsLayout.setSpacing(true);
+ forgotButton.addStyleName(UIConstants.BUTTON_LINK);
+ loginButton.addStyleName(UIConstants.BUTTON_PRIMARY);
+ loginButton.setClickShortcut(ShortcutAction.KeyCode.ENTER);
+ setComponentAlignment(buttonsLayout, Alignment.BOTTOM_RIGHT);
+ }
+
+ private void login() {
+ User user = userService.login(username.getValue(), password.getValue());
+ if(user!=null){
+ EventBus.post(new LoginEvent(user));
+ }else{
+ Notification.show("Login failed.", "Hint: use any non-empty strings", Notification.Type.WARNING_MESSAGE);
+ username.focus();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginEvent.java
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginEvent.java b/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginEvent.java
new file mode 100644
index 0000000..b6ba2b4
--- /dev/null
+++ b/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginEvent.java
@@ -0,0 +1,15 @@
+package org.apache.tamaya.ui.views.login;
+
+import org.apache.tamaya.ui.User;
+
+public class LoginEvent {
+ private User user;
+
+ public LoginEvent(User user) {
+ this.user = user;
+ }
+
+ public User getUser() {
+ return user;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginView.java
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginView.java b/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginView.java
new file mode 100644
index 0000000..e1181d1
--- /dev/null
+++ b/modules/ui/src/main/java/org/apache/tamaya/ui/views/login/LoginView.java
@@ -0,0 +1,13 @@
+package org.apache.tamaya.ui.views.login;
+
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.VerticalLayout;
+
+public class LoginView extends VerticalLayout {
+
+ public LoginView() {
+ setSizeFull();
+ setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
+ addComponent(new LoginBox());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/modules/ui/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider b/modules/ui/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
new file mode 100644
index 0000000..eeb467b
--- /dev/null
+++ b/modules/ui/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
@@ -0,0 +1,21 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy current the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+org.apache.tamaya.ui.views.HomeView$Provider
+org.apache.tamaya.ui.views.ConfigView$Provider
+org.apache.tamaya.ui.views.ComponentView$Provider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/modules/ui/src/main/resources/META-INF/services/org.apache.tamaya.ui.services.MessageProvider
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/resources/META-INF/services/org.apache.tamaya.ui.services.MessageProvider b/modules/ui/src/main/resources/META-INF/services/org.apache.tamaya.ui.services.MessageProvider
new file mode 100644
index 0000000..6ce4a9f
--- /dev/null
+++ b/modules/ui/src/main/resources/META-INF/services/org.apache.tamaya.ui.services.MessageProvider
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy current the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+org.apache.tamaya.ui.internal.ConfigurationBasedMessageProvider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/modules/ui/src/main/resources/config/application.yml
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/resources/config/application.yml b/modules/ui/src/main/resources/config/application.yml
new file mode 100644
index 0000000..a22ec36
--- /dev/null
+++ b/modules/ui/src/main/resources/config/application.yml
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy current the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+server:
+ type: default
+ maxThreads: 1024
+ applicationConnectors:
+ - type: http
+ port: 8090
+ adminConnectors:
+ - type: http
+ port: 8091
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/modules/ui/src/main/resources/ui/lang/tamaya.properties
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/resources/ui/lang/tamaya.properties b/modules/ui/src/main/resources/ui/lang/tamaya.properties
new file mode 100644
index 0000000..16880d4
--- /dev/null
+++ b/modules/ui/src/main/resources/ui/lang/tamaya.properties
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy current the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+project.name=Apache Tamaya
+default.label.logout=Log out
+default.label.unknown=<unknown>
+default.label.username=Username
+default.label.password=Password
+default.label.components=Components
+
+view.config.name=Configuration
+view.home.name=Home
+view.components.name=Components
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/modules/ui/src/test/resources/config/application.yml
----------------------------------------------------------------------
diff --git a/modules/ui/src/test/resources/config/application.yml b/modules/ui/src/test/resources/config/application.yml
new file mode 100644
index 0000000..33c353c
--- /dev/null
+++ b/modules/ui/src/test/resources/config/application.yml
@@ -0,0 +1,32 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy current the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+server:
+ type: default
+ maxThreads: 1024
+ applicationConnectors:
+ - type: http
+ port: 8090
+ - type: https
+ port: 8453
+ adminConnectors:
+ - type: http
+ port: 8091
+ - type: https
+ port: 8453
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/ui/pom.xml b/sandbox/ui/pom.xml
deleted file mode 100644
index 4edbeb8..0000000
--- a/sandbox/ui/pom.xml
+++ /dev/null
@@ -1,254 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy current the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<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">
-
- <parent>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-extensions</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
-
- <packaging>war</packaging>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>tamaya-ui</artifactId>
- <name>Apache Tamaya Modules - UI</name>
-
- <properties>
- <vaadin.version>7.6.4</vaadin.version>
- <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
- <mainClass>org.apache.tamaya.ui.VaadinApplication</mainClass>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <servlet.api.version>3.0.1</servlet.api.version>
- <tomcat.version>7.0.57</tomcat.version>
- <jersey.version>1.19.1</jersey.version>
- <guava.version>18.0</guava.version>
- </properties>
-
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>com.vaadin</groupId>
- <artifactId>vaadin-bom</artifactId>
- <version>${vaadin.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-core</artifactId>
- <version>${project.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-spisupport</artifactId>
- <version>${project.version}</version>
- </dependency>
- <!--<dependency>-->
- <!--<groupId>javax.servlet</groupId>-->
- <!--<artifactId>javax.servlet-api</artifactId>-->
- <!--<version>${servlet.api.version}</version>-->
- <!--</dependency>-->
- <dependency>
- <groupId>com.vaadin</groupId>
- <artifactId>vaadin-server</artifactId>
- </dependency>
- <dependency>
- <groupId>com.vaadin</groupId>
- <artifactId>vaadin-push</artifactId>
- </dependency>
- <dependency>
- <groupId>com.vaadin</groupId>
- <artifactId>vaadin-client-compiled</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>${guava.version}</version>
- </dependency>
- <dependency>
- <groupId>com.vaadin</groupId>
- <artifactId>vaadin-themes</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat.embed</groupId>
- <artifactId>tomcat-embed-core</artifactId>
- <version>${tomcat.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat.embed</groupId>
- <artifactId>tomcat-embed-jasper</artifactId>
- <version>${tomcat.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat.embed</groupId>
- <artifactId>tomcat-embed-logging-juli</artifactId>
- <version>${tomcat.version}</version>
- </dependency>
- <!--<dependency>-->
- <!--<groupId>javax.ws.rs</groupId>-->
- <!--<artifactId>jsr311-api</artifactId>-->
- <!--<version>1.1.1</version>-->
- <!--<scope>provided</scope>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>com.sun.jersey</groupId>-->
- <!--<artifactId>jersey-server</artifactId>-->
- <!--<version>${jersey.version}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>com.sun.jersey</groupId>-->
- <!--<artifactId>jersey-servlet</artifactId>-->
- <!--<version>${jersey.version}</version>-->
- <!--</dependency>-->
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>src/main/webapp/VAADIN/themes/mytheme/addons.scss</exclude>
- <exclude>src/main/webapp/VAADIN/themes/mytheme/styles.css</exclude>
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- <!-- Exclude some unnecessary files generated by the GWT compiler. -->
- <packagingExcludes>WEB-INF/classes/VAADIN/gwt-unitCache/**,
- WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>com.vaadin</groupId>
- <artifactId>vaadin-maven-plugin</artifactId>
- <version>${vaadin.plugin.version}</version>
- <configuration>
- <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
- <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
- <draftCompile>false</draftCompile>
- <compileReport>false</compileReport>
- <style>OBF</style>
- <strict>true</strict>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>update-theme</goal>
- <goal>update-widgetset</goal>
- <goal>compile</goal>
- <!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
- <goal>compile-theme</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clean-plugin</artifactId>
- <!--<version>2.6.1</version>-->
- <!-- Clean up also any pre-compiled themes -->
- <configuration>
- <filesets>
- <fileset>
- <directory>src/main/webapp/VAADIN/themes</directory>
- <includes>
- <include>**/styles.css</include>
- <include>**/styles.scss.cache</include>
- </includes>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-shade-plugin</artifactId>
- <configuration>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- <filters>
- <filter>
- <artifact>*:*</artifact>
- <excludes>
- <exclude>META-INF/*.SF</exclude>
- <exclude>META-INF/*.DSA</exclude>
- <exclude>META-INF/*.RSA</exclude>
- </excludes>
- </filter>
- </filters>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <mainClass>${mainClass}</mainClass>
- </transformer>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-
- <repositories>
- <repository>
- <id>vaadin-addons</id>
- <url>http://maven.vaadin.com/vaadin-addons</url>
- </repository>
- <repository>
- <id>vaadin-snapshots</id>
- <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/ApplicationLayout.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/ApplicationLayout.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/ApplicationLayout.java
deleted file mode 100644
index 2c303a8..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/ApplicationLayout.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui;
-
-import com.vaadin.navigator.Navigator;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Panel;
-import org.apache.tamaya.spi.ServiceContextManager;
-import org.apache.tamaya.ui.components.LazyProvider;
-import org.apache.tamaya.ui.components.PageTitleUpdater;
-import org.apache.tamaya.ui.views.ErrorView;
-
-
-public class ApplicationLayout extends HorizontalLayout {
-
- private NavBar navBar;
- private Panel content;
- private Navigator navigator;
-
- public ApplicationLayout() {
- addStyleName(UIConstants.MAIN_LAYOUT);
-
- setSizeFull();
-
- initLayouts();
- setupNavigator();
- }
-
- private void initLayouts() {
- navBar = new NavBar();
- // Use panel as main content container to allow it's content to scroll
- content = new Panel();
- content.setSizeFull();
- content.addStyleName(UIConstants.PANEL_BORDERLESS);
-
- addComponents(navBar, content);
- setExpandRatio(content, 1);
- }
-
- private void setupNavigator() {
- navigator = new Navigator(VadiinApp.getCurrent(), content);
-
- registerViews();
-
- // Add view change listeners so we can do things like select the correct menu item and update the page title
- navigator.addViewChangeListener(navBar);
- navigator.addViewChangeListener(new PageTitleUpdater());
-
- navigator.navigateTo(navigator.getState());
- }
-
- private void registerViews() {
- for(ViewProvider provider: ServiceContextManager.getServiceContext().getServices(ViewProvider.class)) {
- addView(provider);
- }
- navigator.setErrorView(ErrorView.class);
- }
-
- /**
- * Registers av given view to the navigator and adds it to the NavBar
- */
- private void addView(ViewProvider provider) {
-
- switch (provider.getLifecycle()) {
- case CREATE:
- navigator.addView(provider.getUrlPattern(), provider.createView());
- break;
- case LAZY:
- navigator.addProvider(new LazyProvider(provider.getUrlPattern(), provider));
- break;
- case EAGER:
- try {
- navigator.addView(provider.getUrlPattern(), provider.createView());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- navBar.addView(provider.getUrlPattern(), provider.getDisplayName());
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/Content.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/Content.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/Content.java
deleted file mode 100644
index c03fdf1..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/Content.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui;
-
-import com.vaadin.ui.HorizontalSplitPanel;
-import com.vaadin.ui.Label;
-
-import java.io.Serializable;
-
-/**
- * Created by atsticks on 29.03.16.
- */
-public class Content extends HorizontalSplitPanel implements Serializable{
-
- public Content(){
- this.addComponents(new Label("Left"), new Label("Content"));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/CurrentUser.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/CurrentUser.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/CurrentUser.java
deleted file mode 100644
index 8c754e2..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/CurrentUser.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui;
-
-import com.vaadin.server.VaadinSession;
-
-/**
- * Convenience wrapper for storing and retreiving a user from the VaadinSession
- */
-public class CurrentUser {
-
- private static final String KEY = "currentser";
-
- public static void set(User user) {
- VaadinSession.getCurrent().setAttribute(KEY, user);
- }
-
- public static User get() {
- return (User) VaadinSession.getCurrent().getAttribute(KEY);
- }
-
- public static boolean isLoggedIn() {
- return get() != null;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/NavBar.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/NavBar.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/NavBar.java
deleted file mode 100644
index 16b9860..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/NavBar.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui;
-
-import com.vaadin.navigator.ViewChangeListener;
-import com.vaadin.server.FontAwesome;
-import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CssLayout;
-import com.vaadin.ui.Label;
-import org.apache.tamaya.spi.ServiceContextManager;
-import org.apache.tamaya.ui.event.EventBus;
-import org.apache.tamaya.ui.event.LogoutEvent;
-import org.apache.tamaya.ui.event.NavigationEvent;
-import org.apache.tamaya.ui.services.MessageProvider;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class NavBar extends CssLayout implements ViewChangeListener {
-
- private Map<String, Button> buttonMap = new HashMap<>();
-
- public NavBar() {
- setHeight("100%");
- addStyleName(UIConstants.MENU_ROOT);
- addStyleName(UIConstants.NAVBAR);
- MessageProvider messages = ServiceContextManager.getServiceContext().getService(MessageProvider.class);
- Label logo = new Label("<strong>"+ messages.getMessage("project.name")+"</strong>", ContentMode.HTML);
- logo.addStyleName(UIConstants.MENU_TITLE);
- addComponent(logo);
-
- addLogoutButton();
- }
-
- private void addLogoutButton() {
- MessageProvider messages = ServiceContextManager.getServiceContext().getService(MessageProvider.class);
- Button logout = new Button(messages.getMessage("default.label.logout"), new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent clickEvent) {
- EventBus.post(new LogoutEvent());
- }
- });
- addComponent(logout);
-
- logout.addStyleName(UIConstants.BUTTON_LOGOUT);
- logout.addStyleName(UIConstants.BUTTON_BORDERLESS);
- logout.setIcon(FontAwesome.SIGN_OUT);
- }
-
- public void addView(final String uri, String displayName) {
- Button viewButton = new Button(displayName, new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent clickEvent) {
- EventBus.post(new NavigationEvent(uri));
- }
- });
- viewButton.addStyleName(UIConstants.MENU_ITEM);
- viewButton.addStyleName(UIConstants.BUTTON_BORDERLESS);
- buttonMap.put(uri, viewButton);
-
- addComponent(viewButton, components.size() - 1);
- }
-
- @Override
- public boolean beforeViewChange(ViewChangeEvent event) {
- return true; // false blocks navigation, always return true here
- }
-
- @Override
- public void afterViewChange(ViewChangeEvent event) {
- for(Button button: buttonMap.values()){
- button.removeStyleName(UIConstants.SELECTED);
- }
- Button button = buttonMap.get(event.getViewName());
- if (button != null) button.addStyleName(UIConstants.SELECTED);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/TamayaUI.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/TamayaUI.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/TamayaUI.java
deleted file mode 100644
index b90c402..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/TamayaUI.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui;
-
-import com.vaadin.server.VaadinServlet;
-import org.apache.catalina.Context;
-import org.apache.catalina.Wrapper;
-import org.apache.catalina.startup.Tomcat;
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.ConfigurationProvider;
-
-import java.io.File;
-import java.util.logging.Logger;
-
-public class TamayaUI {
-
- private static final Logger LOG = Logger.getLogger(TamayaUI.class.getName());
-
-
- public static void main(String[] args) throws Exception {
- Configuration config = ConfigurationProvider.getConfiguration();
- String contextPath = config.getOrDefault("tamaya.server.contextPath", "/tamaya");
- String appBase = ".";
- Tomcat tomcat = new Tomcat();
- tomcat.setPort(Integer.valueOf(config.getOrDefault("tamaya.server.port", Integer.class, 8090) ));
-
- // Define a web application context.
- Context context = tomcat.addWebapp(contextPath, new File(
- appBase).getAbsolutePath());
- // Add Vadiin servlet
- Wrapper wrapper = tomcat.addServlet(context, "vadiin-servlet",
- VaadinServlet.class.getName());
- wrapper.addInitParameter("ui",
- VadiinApp.class.getName());
- wrapper.addInitParameter("productionMode",config.getOrDefault("tamaya.server.productionMode", String.class,
- "false"));
- wrapper.addInitParameter("asyncSupported", "true");
- context.addServletMapping("/*", "vadiin-servlet");
- // bootstrap.addBundle(new AssetsBundle("/VAADIN", "/VAADIN", null, "vaadin"));
- tomcat.start();
- tomcat.getServer().await();
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/UIConstants.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/UIConstants.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/UIConstants.java
deleted file mode 100644
index 2f75b5c..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/UIConstants.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui;
-
-import com.vaadin.ui.themes.ValoTheme;
-
-/**
- * Helper for theme. Less typos in CSS style names and easier to find usages in project.
- */
-public class UIConstants extends ValoTheme {
-
- public static final String MAIN_LAYOUT = "main-layout";
- public static final String NAVBAR = "navbar";
- public static final String SELECTED = "selected";
- public static final String LOGIN_BOX = "login-box";
-
-
- public static final String BUTTON_LOGOUT = "logout";
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/User.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/User.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/User.java
deleted file mode 100644
index 2201bdb..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/User.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui;
-
-import org.apache.tamaya.spi.ServiceContextManager;
-import org.apache.tamaya.ui.services.MessageProvider;
-
-import java.util.Date;
-import java.util.Objects;
-
-/**
- * Created by atsticks on 29.03.16.
- */
-public class User {
-
- private String userID = "-";
- private String fulLName = ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("default.label.unknown");
- private Date logInDate = new Date();
-
- public User(String userID, String fullName){
- this.userID = Objects.requireNonNull(userID);
- this.fulLName = fullName;
- if(fullName==null){
- this.fulLName = userID;
- }
- }
-
- public String getUserID() {
- return userID;
- }
-
- public String getFullName() {
- return fulLName;
- }
-
- public String getLoginDate(){
- return logInDate.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/VadiinApp.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/VadiinApp.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/VadiinApp.java
deleted file mode 100644
index 60f3d34..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/VadiinApp.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui;
-
-import com.google.common.eventbus.Subscribe;
-import com.vaadin.annotations.Theme;
-import com.vaadin.annotations.Title;
-import com.vaadin.server.Page;
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.server.VaadinSession;
-import com.vaadin.ui.*;
-import org.apache.tamaya.ui.event.LogoutEvent;
-import org.apache.tamaya.ui.event.NavigationEvent;
-import org.apache.tamaya.ui.views.login.LoginEvent;
-import org.apache.tamaya.ui.views.login.LoginView;
-
-/**
- * This UI is the application entry point. A UI may either represent a browser window
- * (or tab) or some part of a html page where a Vaadin application is embedded.
- * <p>
- * The UI is initialized using {@link #init(VaadinRequest)}. This method is intended to be
- * overridden to add component to the user interface and initialize non-component functionality.
- */
-@Theme("valo")
-@Title("Tamaya")
-public class VadiinApp extends UI {
-
- private Content content = new Content();
-
- @Override
- protected void init(VaadinRequest vaadinRequest) {
- setupEventBus();
-
- if (CurrentUser.isLoggedIn()) {
- setContent(new ApplicationLayout());
- } else {
- setContent(new LoginView());
- }
- }
-
- @Subscribe
- public void userLoggedIn(
- LoginEvent event) {
- CurrentUser.set(event.getUser());
- setContent(new ApplicationLayout());
- }
-
- @Subscribe
- public void navigateTo(NavigationEvent view) {
- getNavigator().navigateTo(view.getViewName());
- }
-
- public static VadiinApp getCurrent() {
- return (VadiinApp) UI.getCurrent();
- }
-
- @Subscribe
- public void logout(LogoutEvent logoutEvent) {
- // Don't invalidate the underlying HTTP session if you are using it for something else
- VaadinSession.getCurrent().getSession().invalidate();
- VaadinSession.getCurrent().close();
- Page.getCurrent().reload();
-
- }
-
- private void setupEventBus() {
- org.apache.tamaya.ui.event.EventBus.register(this);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/ViewProvider.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/ViewProvider.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/ViewProvider.java
deleted file mode 100644
index 35990ab..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/ViewProvider.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui;
-
-import com.vaadin.navigator.View;
-
-/**
- * Interface to register Tamaya UI parts. For priorization also use the @Priority annotations.
- */
-public interface ViewProvider {
-
- /**
- * View lifecycle options that determine when a view is created and how long an instance is used.
- */
- enum ViewLifecycle {
- /** Creates a new view instance whenever the view is showed. */
- CREATE,
- /** Loads the view on first access. */
- LAZY,
- /** Eagerly preloads the view. */
- EAGER
- }
-
- /**
- * Get the view lifecycle model.
- * @return the lifecycle model, not null.
- */
- ViewLifecycle getLifecycle();
-
- /**
- * Get the url pattern where this view should be accessible.
- * @return the url pattern, not null.
- */
- String getUrlPattern();
-
- /**
- * Get the name to be displayed for this view. This value will also be used to lookup a name from the {@code /ui/lang/tamaya}
- * bundle. If not found the value returned will be used for display.
- *
- * @return the name to be displayed, or its resource bundle key, not null.
- */
- String getDisplayName();
-
- /**
- * Method that is called to create a new view instance.
- * @see #getLifecycle()
- * @return a new view instance, not null.
- */
- View createView();
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/LazyProvider.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/LazyProvider.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/LazyProvider.java
deleted file mode 100644
index 867b802..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/LazyProvider.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui.components;
-
-import com.vaadin.navigator.View;
-import org.apache.tamaya.ui.ViewProvider;
-
-import java.util.Objects;
-
-/**
- * Lazily initializes a view when it's first accessed, then always returns the
- * same instance on subsequent calls.
- */
-public class LazyProvider implements com.vaadin.navigator.ViewProvider {
- private ViewProvider provider;
- private View view;
-
- public LazyProvider(String viewName, ViewProvider provider) {
- this.provider = Objects.requireNonNull(provider);
- }
-
- @Override
- public String getViewName(String s) {
- return provider.getDisplayName();
- }
-
- @Override
- public View getView(String viewName) {
- if (view == null) {
- view = provider.createView();
- }
- return view;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/PageTitleUpdater.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/PageTitleUpdater.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/PageTitleUpdater.java
deleted file mode 100644
index a236d55..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/PageTitleUpdater.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui.components;
-
-import com.vaadin.navigator.View;
-import com.vaadin.navigator.ViewChangeListener;
-import com.vaadin.server.Page;
-import org.apache.tamaya.spi.ServiceContextManager;
-import org.apache.tamaya.ui.services.MessageProvider;
-
-
-public class PageTitleUpdater implements ViewChangeListener {
-
- @Override
- public boolean beforeViewChange(ViewChangeEvent event) {
- return true;
- }
-
- @Override
- public void afterViewChange(ViewChangeEvent event) {
- View view = event.getNewView();
- String displayName = ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view."+view.getClass().getSimpleName()+".name");
- if (displayName != null) {
- Page.getCurrent().setTitle(displayName);
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/VerticalSpacedLayout.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/VerticalSpacedLayout.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/VerticalSpacedLayout.java
deleted file mode 100644
index 94fc980..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/components/VerticalSpacedLayout.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui.components;
-
-import com.vaadin.ui.VerticalLayout;
-
-/**
- * Vertical layout with spacing and margin on by default
- */
-public class VerticalSpacedLayout extends VerticalLayout {
-
- public VerticalSpacedLayout() {
- setMargin(true);
- setSpacing(true);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/EventBus.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/EventBus.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/EventBus.java
deleted file mode 100644
index ffa9ba4..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/EventBus.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui.event;
-
-
-import com.google.common.eventbus.SubscriberExceptionContext;
-import com.google.common.eventbus.SubscriberExceptionHandler;
-
-/**
- * Convenience class for accessing the _UI Scoped_ EventBus. If you are using something like the CDI event
- * bus, you don't need a class like this.
- */
-public final class EventBus {
-
- private static final com.google.common.eventbus.EventBus EVENT_BUS =
- new com.google.common.eventbus.EventBus(new SubscriberExceptionHandler(){
- @Override
- public void handleException(Throwable throwable, SubscriberExceptionContext subscriberExceptionContext) {
- throwable.printStackTrace();
- }
- });
-
- private EventBus(){}
-
- public static void register(final Object listener) {
- EVENT_BUS.register(listener);
- }
-
- public static void unregister(final Object listener) {
- EVENT_BUS.unregister(listener);
- }
-
- public static void post(final Object event) {
- EVENT_BUS.post(event);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/LogoutEvent.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/LogoutEvent.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/LogoutEvent.java
deleted file mode 100644
index ec00a42..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/LogoutEvent.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui.event;
-
-public class LogoutEvent {
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/NavigationEvent.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/NavigationEvent.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/NavigationEvent.java
deleted file mode 100644
index 9d3b744..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/event/NavigationEvent.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui.event;
-
-
-public class NavigationEvent {
- private String viewName;
-
- public NavigationEvent(String viewName) {
- this.viewName = viewName;
- }
-
- public String getViewName() {
- return viewName;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ConfigurationBasedMessageProvider.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ConfigurationBasedMessageProvider.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ConfigurationBasedMessageProvider.java
deleted file mode 100644
index 99521c4..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ConfigurationBasedMessageProvider.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui.internal;
-
-import org.apache.tamaya.ConfigurationProvider;
-import org.apache.tamaya.spi.ConfigurationContext;
-import org.apache.tamaya.spi.ConfigurationContextBuilder;
-import org.apache.tamaya.spisupport.BasePropertySource;
-import org.apache.tamaya.spisupport.DefaultConfiguration;
-import org.apache.tamaya.ui.services.MessageProvider;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Component resolving messages for being shown in the UI, based on the ResourceBundle mechanisms.
- * The baseName used can optionally be configured by setting {@code tamaya.ui.baseName} either as system property,
- * environment property or Tamaya configuration. Be aware that the JDK resource bundle mechanism only reads
- * the first property file on the classpath (or a corresponding class file implementing ResourceBundle).
- */
-public final class ConfigurationBasedMessageProvider implements MessageProvider{
-
- /**
- * The property name for configuring the resource bundle's base name either as
- * system property, environment property or configuration entry.
- */
- private static final String TAMAYA_UI_BASE_NAME = "tamaya.ui.baseName";
-
- private final String baseName = evaluateBaseName();
-
- private Map<String, Map<String,String>> propertiesCache = new ConcurrentHashMap<>();
-
-
- /**
- * Private singleton constructor.
- */
- public ConfigurationBasedMessageProvider(){
-
- }
-
- /**
- * Get a message using the defaul locale.
- * @param key the message key, not null.
- * @return the resolved message, or the bundle ID, never null.
- */
- public String getMessage(String key){
- return getMessage(key, Locale.getDefault());
- }
-
- /**
- * Get a message.
- * @param key the message key, not null.
- * @param locale the target locale, or null, for the default locale.
- * @return the resolved message, or the key, never null.
- */
- public String getMessage(String key, Locale locale){
- List<String> bundleIds = evaluateBundleIds(locale);
- for(String bundleID:bundleIds){
- Map<String,String> entries = this.propertiesCache.get(bundleID);
- if(entries==null){
- entries = loadEntries(bundleID);
- }
- String value = entries.get(key);
- if(value!=null){
- return value;
- }
- }
- return null;
- }
-
- private Map<String, String> loadEntries(String bundleID) {
- ConfigurationContextBuilder ctxBuilder = ConfigurationProvider.getConfigurationContextBuilder();
- for(String format:new String[]{"xml", "properties"}) {
- try {
- Enumeration<URL> urls = getClass().getClassLoader().getResources(bundleID+"."+format);
- while(urls.hasMoreElements()){
- URL url = urls.nextElement();
- ctxBuilder.addPropertySources(new URLPropertySource(url));
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- Map<String, String> entries = new DefaultConfiguration(ctxBuilder.build()).getProperties();
- this.propertiesCache.put(bundleID, entries);
- return entries;
- }
-
- private List<String> evaluateBundleIds(Locale locale) {
- List<String> bundleIds = new ArrayList<>();
- String country = locale.getCountry();
- if(country==null){
- country="";
- }
- String lang = locale.getLanguage();
- if(lang==null){
- lang="";
- }
- String variant = locale.getVariant();
- if(variant==null){
- variant="";
- }
- String key = baseName + "_"+country+"_"+lang+"_"+variant;
- key = reduceKey(key);
- if(!bundleIds.contains(key)){
- bundleIds.add(key);
- }
- key = baseName + "_"+country+"_"+lang;
- key = reduceKey(key);
- if(!bundleIds.contains(key)){
- bundleIds.add(key);
- }
- key = baseName + "_"+country;
- key = reduceKey(key);
- if(!bundleIds.contains(key)){
- bundleIds.add(key);
- }
- key = baseName;
- if(!bundleIds.contains(key)){
- bundleIds.add(key);
- }
- return bundleIds;
- }
-
- /**
- * Remove all doubled '_' hereby normalizing the bundle key.
- * @param key the key, not null.
- * @return the normaliuzed key, not null.
- */
- private String reduceKey(String key) {
- String reduced = key.replace("___","_").replace("__","_");
- if(reduced.endsWith("_")){
- reduced = reduced.substring(0,reduced.length()-1);
- }
- return reduced;
- }
-
- /**
- * Evaluates the base name to be used for creating the resource bundle used.
- * @return
- */
- private String evaluateBaseName() {
- String baseName = System.getProperty(TAMAYA_UI_BASE_NAME);
- if(baseName==null || baseName.isEmpty()){
- baseName = System.getenv("tamaya.ui.baseName");
- }
- if(baseName==null || baseName.isEmpty()){
- baseName = ConfigurationProvider.getConfiguration().get("tamaya.ui.baseName");
- }
- if(baseName==null || baseName.isEmpty()){
- baseName = "ui/lang/tamaya";
- }
- return baseName.replace('.', '/');
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ConfiguredMessageProvider.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ConfiguredMessageProvider.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ConfiguredMessageProvider.java
deleted file mode 100644
index e2a761c..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ConfiguredMessageProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-///*
-// * Licensed to the Apache Software Foundation (ASF) under one
-// * or more contributor license agreements. See the NOTICE file
-// * distributed with this work for additional information
-// * regarding copyright ownership. The ASF licenses this file
-// * to you under the Apache License, Version 2.0 (the
-// * "License"); you may not use this file except in compliance
-// * with the License. You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0
-// *
-// * Unless required by applicable law or agreed to in writing,
-// * software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// * KIND, either express or implied. See the License for the
-// * specific language governing permissions and limitations
-// * under the License.
-// */
-//package org.apache.tamaya.ui.internal;
-//
-//import org.apache.tamaya.ui.services.MessageProvider;
-//
-//import java.util.Locale;
-//import java.util.ResourceBundle;
-//
-///**
-// * Component resolving messages for being shown in the UI, based on the ResourceBundle mechanisms.
-// */
-//public class ConfiguredMessageProvider implements MessageProvider{
-//
-// /**
-// * Private singleton constructor.
-// */
-// public ConfiguredMessageProvider(){}
-//
-// /**
-// * Get a message using the defaul locale.
-// * @param bundleID the message bundle key, not null.
-// * @return the resolved message, or the bundle ID, never null.
-// */
-// public String getMessage(String bundleID){
-// return getMessage(bundleID, Locale.getDefault());
-// }
-//
-// /**
-// * Get a message.
-// * @param bundleID the message bundle key, not null.
-// * @param locale the target locale, or null, for the default locale.
-// * @return the resolved message, or the bundle ID, never null.
-// */
-// public String getMessage(String bundleID, Locale locale){
-// try{
-// ResourceBundle bundle = ResourceBundle.getBundle("ui/lang/tamaya", locale);
-// return bundle.getString(bundleID);
-// }
-// catch(Exception e){
-// return bundleID;
-// }
-// }
-//
-//}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ResourceBundleMessageProvider.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ResourceBundleMessageProvider.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ResourceBundleMessageProvider.java
deleted file mode 100644
index c0aa092..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/ResourceBundleMessageProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-///*
-// * Licensed to the Apache Software Foundation (ASF) under one
-// * or more contributor license agreements. See the NOTICE file
-// * distributed with this work for additional information
-// * regarding copyright ownership. The ASF licenses this file
-// * to you under the Apache License, Version 2.0 (the
-// * "License"); you may not use this file except in compliance
-// * with the License. You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0
-// *
-// * Unless required by applicable law or agreed to in writing,
-// * software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// * KIND, either express or implied. See the License for the
-// * specific language governing permissions and limitations
-// * under the License.
-// */
-//package org.apache.tamaya.ui.internal;
-//
-//import org.apache.tamaya.ConfigurationProvider;
-//import org.apache.tamaya.ui.services.MessageProvider;
-//
-//import java.util.Locale;
-//import java.util.ResourceBundle;
-//
-///**
-// * Component resolving messages for being shown in the UI, based on the ResourceBundle mechanisms.
-// * The baseName used can optionally be configured by setting {@code tamaya.ui.baseName} either as system property,
-// * environment property or Tamaya configuration. Be aware that the JDK resource bundle mechanism only reads
-// * the first property file on the classpath (or a corresponding class file implementing ResourceBundle).
-// */
-//public class ResourceBundleMessageProvider implements MessageProvider{
-//
-// private static final String BASENAME = evaluateBaseName();
-//
-// /**
-// * The property name for configuring the resource bundle's base name either as
-// * system property, environment property or configuration entry.
-// */
-// private static final String TAMAYA_UI_BASE_NAME = "tamaya.ui.baseName";
-//
-// /**
-// * Evaluates the base name to be used for creating the resource bundle used.
-// * @return
-// */
-// private static String evaluateBaseName() {
-// String baseName = System.getProperty(TAMAYA_UI_BASE_NAME);
-// if(baseName==null || baseName.isEmpty()){
-// baseName = System.getenv("tamaya.ui.baseName");
-// }
-// if(baseName==null || baseName.isEmpty()){
-// baseName = ConfigurationProvider.getConfiguration().get("tamaya.ui.baseName");
-// }
-// if(baseName==null || baseName.isEmpty()){
-// baseName = "ui/lang/tamaya";
-// }
-// return baseName;
-// }
-//
-// /**
-// * Private singleton constructor.
-// */
-// public ResourceBundleMessageProvider(){}
-//
-// /**
-// * Get a message using the defaul locale.
-// * @param bundleID the message bundle key, not null.
-// * @return the resolved message, or the bundle ID, never null.
-// */
-// public String getMessage(String bundleID){
-// return getMessage(bundleID, Locale.getDefault());
-// }
-//
-// /**
-// * Get a message.
-// * @param bundleID the message bundle key, not null.
-// * @param locale the target locale, or null, for the default locale.
-// * @return the resolved message, or the bundle ID, never null.
-// */
-// public String getMessage(String bundleID, Locale locale){
-// try{
-// ResourceBundle bundle = ResourceBundle.getBundle(BASENAME, locale);
-// return bundle.getString(bundleID);
-// }
-// catch(Exception e){
-// return bundleID;
-// }
-// }
-//
-//}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/URLPropertySource.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/URLPropertySource.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/URLPropertySource.java
deleted file mode 100644
index 0727515..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/internal/URLPropertySource.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.apache.tamaya.ui.internal;
-
-import org.apache.tamaya.spisupport.BasePropertySource;
-import org.apache.tamaya.spisupport.MapPropertySource;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Simple property source, used for internationalization.
- */
-final class URLPropertySource extends BasePropertySource{
-
- private static final Logger LOG = Logger.getLogger(URLPropertySource.class.getName());
- private URL url;
- private Map<String, String> properties;
-
- public URLPropertySource(URL url){
- this.url = Objects.requireNonNull(url);
- load();
- }
-
- /**
- * Loads/reloads the properties from the URL. If loading of the properties failed the previus state is preserved,
- * unless there is no such state. In this case an empty map is assigned.
- */
- public void load(){
- try(InputStream is = url.openStream()) {
- Properties props = new Properties();
- if (url.getFile().endsWith(".xml")) {
- props.loadFromXML(is);
- } else {
- props.load(is);
- }
- properties = Collections.unmodifiableMap(MapPropertySource.getMap(props));
- }
- catch(Exception e){
- LOG.log(Level.WARNING, "Failed to read config from "+url,e);
- if(properties==null) {
- properties = Collections.emptyMap();
- }
- }
- }
-
- @Override
- public String getName() {
- return url.toString();
- }
-
- @Override
- public Map<String, String> getProperties() {
- return properties;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/services/MessageProvider.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/services/MessageProvider.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/services/MessageProvider.java
deleted file mode 100644
index a15ae46..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/services/MessageProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui.services;
-
-import java.util.Locale;
-
-/**
- * Component resolving messages for being shown in the UI.
- */
-public interface MessageProvider {
-
- /**
- * Get a message using the default locale.
- * @param key the message key, not null.
- * @return the resolved message, or the key, never null.
- */
- String getMessage(String key);
-
- /**
- * Get a message.
- * @param key the message key, not null.
- * @param locale the target locale, or null, for the default locale.
- * @return the resolved message, or the key, never null.
- */
- String getMessage(String key, Locale locale);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1a11d159/sandbox/ui/src/main/java/org/apache/tamaya/ui/services/UserService.java
----------------------------------------------------------------------
diff --git a/sandbox/ui/src/main/java/org/apache/tamaya/ui/services/UserService.java b/sandbox/ui/src/main/java/org/apache/tamaya/ui/services/UserService.java
deleted file mode 100644
index 71a8a43..0000000
--- a/sandbox/ui/src/main/java/org/apache/tamaya/ui/services/UserService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.ui.services;
-
-import org.apache.tamaya.ui.User;
-
-/**
- * Created by atsticks on 29.03.16.
- */
-public interface UserService {
-
- User login(String userId, String credentials);
-
-}