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/08/16 13:51:42 UTC
[05/15] incubator-tamaya git commit: - Moved UI module into sandbox,
including UI parts. - Decoupled accordingly existing modules from UI.
- Fixed a few quality issues.
- Moved UI module into sandbox, including UI parts.
- Decoupled accordingly existing modules from UI.
- Fixed a few quality issues.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/0370a240
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/0370a240
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/0370a240
Branch: refs/heads/master
Commit: 0370a240cc32a899a616f5cb9379dcaf1afe357c
Parents: 4a3388d
Author: anatole <an...@apache.org>
Authored: Tue Aug 16 15:50:17 2016 +0200
Committer: anatole <an...@apache.org>
Committed: Tue Aug 16 15:51:30 2016 +0200
----------------------------------------------------------------------
modules/events/pom.xml | 7 -
.../org/apache/tamaya/events/ui/EventView.java | 181 --------------
.../services/org.apache.tamaya.ui.ViewProvider | 19 --
.../main/resources/ui/lang/tamaya.properties | 24 --
.../services/org.apache.tamaya.ui.ViewProvider | 19 --
.../src/test/resources/config/application.yml | 31 ---
modules/formats/pom.xml | 7 -
.../cdi/internal/CDIAwareServiceContext.java | 8 +-
.../org/apache/tamaya/etcd/ConsulWriteTest.java | 4 +-
modules/integration/karaf/pom.xml | 95 -------
modules/integration/pom.xml | 1 -
modules/model/pom.xml | 6 -
.../apache/tamaya/model/ConfigModelManager.java | 2 +
modules/mutable-config/pom.xml | 6 -
.../mutableconfig/ChangePropagationPolicy.java | 2 -
.../mutableconfig/MutableConfiguration.java | 1 -
.../spi/MutablePropertySource.java | 1 -
.../mutableconfig/ui/ConfigEditorWidget.java | 132 ----------
.../mutableconfig/ui/ConfigUpdaterView.java | 121 ---------
.../tamaya/mutableconfig/ui/ProtocolWidget.java | 90 -------
.../ui/TransactionControlWidget.java | 229 -----------------
.../services/org.apache.tamaya.ui.ViewProvider | 19 --
.../main/resources/ui/lang/tamaya.properties | 35 ---
modules/pom.xml | 1 -
modules/resolver/pom.xml | 6 -
modules/resources/pom.xml | 7 -
modules/ui/pom.xml | 246 -------------------
.../org/apache/tamaya/ui/ApplicationLayout.java | 72 ------
.../java/org/apache/tamaya/ui/CurrentUser.java | 58 -----
.../main/java/org/apache/tamaya/ui/NavBar.java | 127 ----------
.../java/org/apache/tamaya/ui/TamayaUI.java | 77 ------
.../java/org/apache/tamaya/ui/UIConstants.java | 36 ---
.../main/java/org/apache/tamaya/ui/User.java | 154 ------------
.../java/org/apache/tamaya/ui/VadiinApp.java | 97 --------
.../java/org/apache/tamaya/ui/ViewProvider.java | 73 ------
.../tamaya/ui/components/LazyProvider.java | 81 ------
.../tamaya/ui/components/PageTitleUpdater.java | 47 ----
.../ui/components/VerticalSpacedLayout.java | 32 ---
.../org/apache/tamaya/ui/event/EventBus.java | 52 ----
.../org/apache/tamaya/ui/event/LogoutEvent.java | 48 ----
.../apache/tamaya/ui/event/NavigationEvent.java | 53 ----
.../ConfigurationBasedMessageProvider.java | 176 -------------
.../ui/internal/ConfiguredMessageProvider.java | 61 -----
.../ui/internal/ConfiguredUserService.java | 76 ------
.../internal/ResourceBundleMessageProvider.java | 91 -------
.../tamaya/ui/internal/URLPropertySource.java | 78 ------
.../tamaya/ui/services/MessageProvider.java | 43 ----
.../apache/tamaya/ui/services/UserService.java | 30 ---
.../org/apache/tamaya/ui/views/ConfigView.java | 229 -----------------
.../org/apache/tamaya/ui/views/ErrorView.java | 43 ----
.../org/apache/tamaya/ui/views/HomeView.java | 94 -------
.../org/apache/tamaya/ui/views/SystemView.java | 117 ---------
.../views/TamayaGeneralSystemInfoProvider.java | 56 -----
.../apache/tamaya/ui/views/login/LoginBox.java | 112 ---------
.../tamaya/ui/views/login/LoginEvent.java | 55 -----
.../apache/tamaya/ui/views/login/LoginView.java | 37 ---
.../META-INF/javaconfiguration.properties | 21 --
.../services/org.apache.tamaya.ui.ViewProvider | 21 --
...rg.apache.tamaya.ui.services.MessageProvider | 19 --
.../org.apache.tamaya.ui.services.UserService | 19 --
.../src/main/resources/config/application.yml | 28 ---
.../main/resources/ui/lang/tamaya.properties | 28 ---
.../src/test/resources/config/application.yml | 36 ---
.../staged/src/test/resources/tamaya-TEST.yaml | 27 ++
.../src/test/resources/tamaya-config.yaml | 91 ++-----
sandbox/pom.xml | 1 +
sandbox/ui/base/pom.xml | 156 ++++++++++++
.../org/apache/tamaya/ui/ApplicationLayout.java | 72 ++++++
.../java/org/apache/tamaya/ui/CurrentUser.java | 58 +++++
.../main/java/org/apache/tamaya/ui/NavBar.java | 127 ++++++++++
.../java/org/apache/tamaya/ui/TamayaUI.java | 77 ++++++
.../java/org/apache/tamaya/ui/UIConstants.java | 36 +++
.../main/java/org/apache/tamaya/ui/User.java | 154 ++++++++++++
.../java/org/apache/tamaya/ui/VadiinApp.java | 97 ++++++++
.../java/org/apache/tamaya/ui/ViewProvider.java | 73 ++++++
.../tamaya/ui/components/LazyProvider.java | 81 ++++++
.../tamaya/ui/components/PageTitleUpdater.java | 47 ++++
.../ui/components/VerticalSpacedLayout.java | 32 +++
.../org/apache/tamaya/ui/event/EventBus.java | 52 ++++
.../org/apache/tamaya/ui/event/LogoutEvent.java | 48 ++++
.../apache/tamaya/ui/event/NavigationEvent.java | 53 ++++
.../org/apache/tamaya/ui/events/EventView.java | 181 ++++++++++++++
.../ConfigurationBasedMessageProvider.java | 176 +++++++++++++
.../ui/internal/ConfiguredMessageProvider.java | 61 +++++
.../ui/internal/ConfiguredUserService.java | 76 ++++++
.../internal/ResourceBundleMessageProvider.java | 91 +++++++
.../tamaya/ui/internal/URLPropertySource.java | 78 ++++++
.../tamaya/ui/services/MessageProvider.java | 43 ++++
.../apache/tamaya/ui/services/UserService.java | 30 +++
.../org/apache/tamaya/ui/views/ConfigView.java | 229 +++++++++++++++++
.../org/apache/tamaya/ui/views/ErrorView.java | 43 ++++
.../org/apache/tamaya/ui/views/HomeView.java | 94 +++++++
.../org/apache/tamaya/ui/views/SystemView.java | 117 +++++++++
.../views/TamayaGeneralSystemInfoProvider.java | 56 +++++
.../apache/tamaya/ui/views/login/LoginBox.java | 112 +++++++++
.../tamaya/ui/views/login/LoginEvent.java | 55 +++++
.../apache/tamaya/ui/views/login/LoginView.java | 37 +++
.../META-INF/javaconfiguration.properties | 21 ++
.../services/org.apache.tamaya.ui.ViewProvider | 24 ++
...rg.apache.tamaya.ui.services.MessageProvider | 19 ++
.../org.apache.tamaya.ui.services.UserService | 19 ++
.../src/main/resources/config/application.yml | 28 +++
.../main/resources/ui/lang/tamaya.properties | 28 +++
.../src/test/resources/config/application.yml | 36 +++
.../org/apache/tamaya/ui/events/EventView.java | 181 ++++++++++++++
.../services/org.apache.tamaya.ui.ViewProvider | 19 ++
sandbox/ui/mutableconfig/pom.xml | 36 +++
.../ui/mutableconfig/ConfigEditorWidget.java | 132 ++++++++++
.../ui/mutableconfig/ConfigUpdaterView.java | 121 +++++++++
.../tamaya/ui/mutableconfig/ProtocolWidget.java | 90 +++++++
.../mutableconfig/TransactionControlWidget.java | 229 +++++++++++++++++
.../services/org.apache.tamaya.ui.ViewProvider | 19 ++
112 files changed, 3697 insertions(+), 3843 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/events/pom.xml
----------------------------------------------------------------------
diff --git a/modules/events/pom.xml b/modules/events/pom.xml
index 0952795..fb6c3b3 100644
--- a/modules/events/pom.xml
+++ b/modules/events/pom.xml
@@ -57,13 +57,6 @@ under the License.
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-ui</artifactId>
- <version>${project.version}</version>
- <optional>true</optional>
- </dependency>
-
- <dependency>
<groupId>org.hamcrest</groupId>
<artifactId>java-hamcrest</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/events/src/main/java/org/apache/tamaya/events/ui/EventView.java
----------------------------------------------------------------------
diff --git a/modules/events/src/main/java/org/apache/tamaya/events/ui/EventView.java b/modules/events/src/main/java/org/apache/tamaya/events/ui/EventView.java
deleted file mode 100644
index 2c4dead..0000000
--- a/modules/events/src/main/java/org/apache/tamaya/events/ui/EventView.java
+++ /dev/null
@@ -1,181 +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.events.ui;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.Property;
-import com.vaadin.navigator.View;
-import com.vaadin.navigator.ViewChangeListener;
-import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Notification;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.TextField;
-import org.apache.tamaya.events.ConfigEvent;
-import org.apache.tamaya.events.ConfigEventListener;
-import org.apache.tamaya.events.ConfigEventManager;
-import org.apache.tamaya.spi.ServiceContextManager;
-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;
-import java.util.Date;
-
-/**
- * Tamaya View for observing the current event stream.
- */
-public class EventView extends VerticalSpacedLayout implements View {
-
- /**
- * Provider used to register the view.
- */
- @Priority(20)
- public static final class Provider implements ViewProvider{
-
- @Override
- public ViewLifecycle getLifecycle() {
- return ViewLifecycle.EAGER;
- }
-
- @Override
- public String getName() {
- return "view.events.name";
- }
-
- @Override
- public String getUrlPattern() {
- return "/events";
- }
-
- @Override
- public String getDisplayName() {
- return getName();
- }
-
- @Override
- public View createView(Object... params){
- return new EventView();
- }
- }
-
- private CheckBox changeMonitorEnabled = new CheckBox(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.events.button.enableMonitoring"));
- private Button clearViewButton = new Button(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.events.button.clearView"));
- private TextField pollingInterval = new TextField(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.events.field.pollingInterval"));
- private Table eventsTable = new Table(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.events.table.name"));
-
-
- public EventView() {
- Label caption = new Label(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.events.name"));
- Label description = new Label(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.events.description"),
- ContentMode.HTML);
-
- ConfigEventManager.addListener(new ConfigEventListener() {
- @Override
- public void onConfigEvent(ConfigEvent<?> event) {
- addEvent(event);
- }
- });
- changeMonitorEnabled.addValueChangeListener(new Property.ValueChangeListener() {
- @Override
- public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
- ConfigEventManager.enableChangeMonitoring(changeMonitorEnabled.getValue());
- if(changeMonitorEnabled.getValue()) {
- Notification.show("Event Monitoring (Polling) active.");
- }else{
- Notification.show("Event Monitoring (Polling) inactive.");
- }
- }
- });
- clearViewButton.addClickListener(new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent clickEvent) {
- eventsTable.removeAllItems();
- Notification.show("Events cleared.");
- }
- });
-
- HorizontalLayout eventSettings = new HorizontalLayout();
- eventSettings.addComponents(changeMonitorEnabled, new Label(" Polling Interval"), pollingInterval, clearViewButton);
- changeMonitorEnabled.setValue(ConfigEventManager.isChangeMonitoring());
- pollingInterval.setValue(String.valueOf(ConfigEventManager.getChangeMonitoringPeriod()));
- pollingInterval.setRequired(true);
- pollingInterval.addValueChangeListener(new Property.ValueChangeListener() {
- @Override
- public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
- try{
- long millis = Long.parseLong((String)valueChangeEvent.getProperty().getValue());
- ConfigEventManager.setChangeMonitoringPeriod(millis);
- Notification.show("Updated Event Monitoring Poll Interval to " + millis + " milliseconds.");
- }catch(Exception e){
- Notification.show("Cannot update Event Monitoring Poll Interval to "
- + valueChangeEvent.getProperty().getValue(), Notification.Type.ERROR_MESSAGE);
- }
- }
- });
- eventsTable.addContainerProperty("Timestamp", Date.class, null);
- eventsTable.addContainerProperty("Type", String.class, "?");
- eventsTable.addContainerProperty("Payload", String.class, "<empty>");
- eventsTable.addContainerProperty("Version", String.class, "?");
- eventsTable.setPageLength(20);
- eventsTable.setWidth("100%");
- eventsTable.setResponsive(true);
-
-
- caption.addStyleName(UIConstants.LABEL_HUGE);
- description.addStyleName(UIConstants.LABEL_LARGE);
- addComponents(caption, description, eventSettings, eventsTable);
- }
-
- private void addEvent(ConfigEvent<?> evt){
- Object newItemId = eventsTable.addItem();
- Item row = eventsTable.getItem(newItemId);
- row.getItemProperty("Timestamp").setValue(new Date(evt.getTimestamp()));
- row.getItemProperty("Type").setValue(evt.getResourceType().getSimpleName());
- String value = String.valueOf(evt.getResource());
- String valueShort = value.length()<150?value:value.substring(0,147)+"...";
- row.getItemProperty("Payload").setValue(valueShort);
- row.getItemProperty("Version").setValue(evt.getVersion());
- }
-
-
- private String getCaption(String key, String value) {
- int index = key.lastIndexOf('.');
- if(index<0){
- return key + " = " + value;
- }else{
- return key.substring(index+1) + " = " + value;
- }
- }
-
- @Override
- public void enter(ViewChangeListener.ViewChangeEvent event) {
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/events/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
----------------------------------------------------------------------
diff --git a/modules/events/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider b/modules/events/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
deleted file mode 100644
index f779d5c..0000000
--- a/modules/events/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
+++ /dev/null
@@ -1,19 +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 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.events.ui.EventView$Provider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/events/src/main/resources/ui/lang/tamaya.properties
----------------------------------------------------------------------
diff --git a/modules/events/src/main/resources/ui/lang/tamaya.properties b/modules/events/src/main/resources/ui/lang/tamaya.properties
deleted file mode 100644
index 8f83a5c..0000000
--- a/modules/events/src/main/resources/ui/lang/tamaya.properties
+++ /dev/null
@@ -1,24 +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 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.
-#
-
-view.events.name=Configuration Events
-view.events.table.name=Observed Events
-view.events.button.enableMonitoring=Change Monitor active
-view.events.button.clearView=Clear View
-view.events.description=This view shows the configuration events triggered in the system.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/events/src/test/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
----------------------------------------------------------------------
diff --git a/modules/events/src/test/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider b/modules/events/src/test/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
deleted file mode 100644
index f779d5c..0000000
--- a/modules/events/src/test/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
+++ /dev/null
@@ -1,19 +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 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.events.ui.EventView$Provider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/events/src/test/resources/config/application.yml
----------------------------------------------------------------------
diff --git a/modules/events/src/test/resources/config/application.yml b/modules/events/src/test/resources/config/application.yml
deleted file mode 100644
index 00d6d43..0000000
--- a/modules/events/src/test/resources/config/application.yml
+++ /dev/null
@@ -1,31 +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 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/0370a240/modules/formats/pom.xml
----------------------------------------------------------------------
diff --git a/modules/formats/pom.xml b/modules/formats/pom.xml
index f85a9d4..3db73c9 100644
--- a/modules/formats/pom.xml
+++ b/modules/formats/pom.xml
@@ -61,13 +61,6 @@ under the License.
<artifactId>junit</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-ui</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/CDIAwareServiceContext.java
----------------------------------------------------------------------
diff --git a/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/CDIAwareServiceContext.java b/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/CDIAwareServiceContext.java
index 94e6685..c431c21 100644
--- a/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/CDIAwareServiceContext.java
+++ b/modules/integration/cdi-se/src/main/java/org/apache/tamaya/integration/cdi/internal/CDIAwareServiceContext.java
@@ -19,8 +19,8 @@
package org.apache.tamaya.integration.cdi.internal;
import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.clsupport.CLAwareServiceContext;
import org.apache.tamaya.spi.ServiceContext;
+import org.apache.tamaya.spi.ServiceContextManager;
import javax.annotation.Priority;
import javax.enterprise.inject.Instance;
@@ -49,10 +49,6 @@ import java.util.concurrent.ConcurrentHashMap;
* provided with the Tamaya core modules.</p>
*/
public class CDIAwareServiceContext implements ServiceContext {
- /**
- * List current services loaded, per classloader.
- */
- private final CLAwareServiceContext clAwareServiceContext = new CLAwareServiceContext();
/**
* Singletons.
@@ -86,7 +82,7 @@ public class CDIAwareServiceContext implements ServiceContext {
*/
@Override
public <T> List<T> getServices(final Class<T> serviceType) {
- List<T> found = clAwareServiceContext.getServices(serviceType);
+ List<T> found = ServiceContextManager.getServiceContext().getServices(serviceType);
BeanManager beanManager = TamayaCDIIntegration.getBeanManager();
Instance<T> cdiInstances = null;
if(beanManager!=null){
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/integration/consul/src/test/java/org/apache/tamaya/etcd/ConsulWriteTest.java
----------------------------------------------------------------------
diff --git a/modules/integration/consul/src/test/java/org/apache/tamaya/etcd/ConsulWriteTest.java b/modules/integration/consul/src/test/java/org/apache/tamaya/etcd/ConsulWriteTest.java
index 466c738..202d0e3 100644
--- a/modules/integration/consul/src/test/java/org/apache/tamaya/etcd/ConsulWriteTest.java
+++ b/modules/integration/consul/src/test/java/org/apache/tamaya/etcd/ConsulWriteTest.java
@@ -48,7 +48,7 @@ public class ConsulWriteTest {
@org.junit.Test
public void testSetNormal() throws Exception {
if (!execute) return;
- UUID taID = UUID.randomUUID();
+ String taID = UUID.randomUUID().toString();
propertySource.put(taID, "testSetNormal", taID.toString());
propertySource.commitTransaction(taID);
}
@@ -57,7 +57,7 @@ public class ConsulWriteTest {
@org.junit.Test
public void testDelete() throws Exception {
if(!execute)return;
- UUID taID = UUID.randomUUID();
+ String taID = UUID.randomUUID().toString();
propertySource.put(taID, "testDelete", taID.toString());
propertySource.commitTransaction(taID);
assertEquals(propertySource.get("testDelete").getValue(), taID.toString());
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/integration/karaf/pom.xml
----------------------------------------------------------------------
diff --git a/modules/integration/karaf/pom.xml b/modules/integration/karaf/pom.xml
deleted file mode 100644
index a94e54c..0000000
--- a/modules/integration/karaf/pom.xml
+++ /dev/null
@@ -1,95 +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 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>
- <artifactId>tamaya-integration</artifactId>
- <groupId>org.apache.tamaya.ext</groupId>
- <version>0.3-incubating-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <name>Apache Tamaya Integration - Karaf Features Parent</name>
- <artifactId>tamaya-integration-karaf-all</artifactId>
- <groupId>org.apache.tamaya.ext.karaf</groupId>
- <packaging>pom</packaging>
-
- <properties>
- <karaf.version>4.0.5</karaf.version>
- </properties>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.karaf.tooling</groupId>
- <artifactId>karaf-maven-plugin</artifactId>
- <version>${karaf.version}</version>
- <extensions>true</extensions>
- <configuration>
- <javase>1.7</javase>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <groupId>org.apache.karaf.tooling</groupId>
- <artifactId>karaf-maven-plugin</artifactId>
- <extensions>true</extensions>
- </plugin>
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <modules>
- <module>tamaya-api-feature</module>
- <module>tamaya-core-feature</module>
- <module>tamaya-json-feature</module>
- <module>tamaya-yaml-feature</module>
- <module>tamaya-filter-feature</module>
- <module>tamaya-mutable-config-feature</module>
- <module>tamaya-injection-feature</module>
- <module>tamaya-model-feature</module>
- <module>tamaya-events-feature</module>
- <module>tamaya-etcd-feature</module>
- <module>tamaya-consul-feature</module>
- <module>tamaya-all-feature</module>
- <module>tamaya-assembly</module>
- </modules>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/integration/pom.xml
----------------------------------------------------------------------
diff --git a/modules/integration/pom.xml b/modules/integration/pom.xml
index edfa709..df4775d 100644
--- a/modules/integration/pom.xml
+++ b/modules/integration/pom.xml
@@ -38,7 +38,6 @@ under the License.
<module>camel</module>
<module>etcd</module>
<module>consul</module>
- <module>karaf</module>
</modules>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/model/pom.xml
----------------------------------------------------------------------
diff --git a/modules/model/pom.xml b/modules/model/pom.xml
index c03ba0e..b121c24 100644
--- a/modules/model/pom.xml
+++ b/modules/model/pom.xml
@@ -94,12 +94,6 @@ under the License.
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-ui</artifactId>
- <version>${project.version}</version>
- <optional>true</optional>
- </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/model/src/main/java/org/apache/tamaya/model/ConfigModelManager.java
----------------------------------------------------------------------
diff --git a/modules/model/src/main/java/org/apache/tamaya/model/ConfigModelManager.java b/modules/model/src/main/java/org/apache/tamaya/model/ConfigModelManager.java
index 8a3cbc6..078b0dc 100644
--- a/modules/model/src/main/java/org/apache/tamaya/model/ConfigModelManager.java
+++ b/modules/model/src/main/java/org/apache/tamaya/model/ConfigModelManager.java
@@ -72,6 +72,8 @@ public final class ConfigModelManager {
case Group:
b.append("GROUP ");
break;
+ default:
+ break;
}
b.append(formatWithFixedLength(model.getOwner(), 10)).append(' ');
b.append(formatWithFixedLength(model.getName(), 50));
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/mutable-config/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mutable-config/pom.xml b/modules/mutable-config/pom.xml
index 85dacd5..8f0204d 100644
--- a/modules/mutable-config/pom.xml
+++ b/modules/mutable-config/pom.xml
@@ -48,12 +48,6 @@ under the License.
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-ui</artifactId>
- <version>${project.version}</version>
- <optional>true</optional>
- </dependency>
- <dependency>
<groupId>org.apache.tamaya</groupId>
<artifactId>tamaya-core</artifactId>
<version>${project.version}</version>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ChangePropagationPolicy.java
----------------------------------------------------------------------
diff --git a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ChangePropagationPolicy.java b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ChangePropagationPolicy.java
index 8e675ab..350ca09 100644
--- a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ChangePropagationPolicy.java
+++ b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ChangePropagationPolicy.java
@@ -18,12 +18,10 @@
*/
package org.apache.tamaya.mutableconfig;
-import org.apache.tamaya.mutableconfig.propertysources.ConfigChangeContext;
import org.apache.tamaya.spi.PropertySource;
import java.util.Collection;
import java.util.Map;
-import java.util.UUID;
/**
* Policy that defines how changes are applied to the available
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/MutableConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/MutableConfiguration.java b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/MutableConfiguration.java
index 4f24701..90b0673 100644
--- a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/MutableConfiguration.java
+++ b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/MutableConfiguration.java
@@ -25,7 +25,6 @@ import org.apache.tamaya.mutableconfig.spi.MutablePropertySource;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-import java.util.UUID;
/**
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/spi/MutablePropertySource.java
----------------------------------------------------------------------
diff --git a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/spi/MutablePropertySource.java b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/spi/MutablePropertySource.java
index cf4b6ee..8b2e097 100644
--- a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/spi/MutablePropertySource.java
+++ b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/spi/MutablePropertySource.java
@@ -23,7 +23,6 @@ import org.apache.tamaya.spi.PropertySource;
import java.util.Collection;
import java.util.Map;
-import java.util.UUID;
/**
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ConfigEditorWidget.java
----------------------------------------------------------------------
diff --git a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ConfigEditorWidget.java b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ConfigEditorWidget.java
deleted file mode 100644
index bc8f9f4..0000000
--- a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ConfigEditorWidget.java
+++ /dev/null
@@ -1,132 +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.mutableconfig.ui;
-
-import com.vaadin.ui.*;
-import org.apache.tamaya.mutableconfig.MutableConfiguration;
-import org.apache.tamaya.spi.ServiceContextManager;
-import org.apache.tamaya.ui.services.MessageProvider;
-
-import java.util.Objects;
-
-/**
- * Tamaya UI view to change configuration.
- */
-public class ConfigEditorWidget extends FormLayout {
-
- private MutableConfiguration mutableConfig;
-
- private ProtocolWidget logWriter;
- private TransactionControlWidget taWidget;
-
- private TextField configKey = new TextField(
- ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.text.configKey"));
- private TextField configValue = new TextField(
- ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.text.configValue"));
- private Button updateButton = new Button(ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.button.updateKey"));
- private Button removeButton = new Button(ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.button.removeKey"));
- private Button readButton = new Button(ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.button.readKey"));
-
- public ConfigEditorWidget(MutableConfiguration mutableConfig, ProtocolWidget logWriter, TransactionControlWidget taWidget) {
- this.mutableConfig = Objects.requireNonNull(mutableConfig);
- this.logWriter = Objects.requireNonNull(logWriter);
- this.taWidget = Objects.requireNonNull(taWidget);
- configKey.setWidth(50, Unit.PERCENTAGE);
- configValue.setWidth(50, Unit.PERCENTAGE);
- addComponents(configKey, configValue);
- HorizontalLayout buttonLayout = new HorizontalLayout();
- buttonLayout.addComponents(readButton, new Label(" "), updateButton, removeButton);
- buttonLayout.setSpacing(true);
- addComponents(buttonLayout);
- initActions();
- }
-
- private void initActions() {
- updateButton.addClickListener(new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent clickEvent) {
- if(mutableConfig.isWritable(configKey.getValue())){
- mutableConfig.put(configKey.getValue(), configValue.getValue());
- Notification.show("Added " + configKey.getValue() + " = " + configValue.getValue(),
- Notification.Type.TRAY_NOTIFICATION);
- logWriter.println(" - PUT " + configKey.getValue() + " = " + configValue.getValue());
- configKey.setValue("");
- configValue.setValue("");
- }else{
- Notification.show("Could not add " + configKey.getValue() + " = " + configValue.getValue(),
- Notification.Type.ERROR_MESSAGE);
- logWriter.println(" - PUT " + configKey.getValue() + " rejected - not writable.");
- }
- taWidget.update();
- }
- });
- removeButton.addClickListener(new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent clickEvent) {
- if(mutableConfig.isRemovable(configKey.getValue())){
- mutableConfig.remove(configKey.getValue());
- logWriter.println(" - DEL " + configKey.getValue());
- Notification.show("Removed " + configKey.getValue(),
- Notification.Type.TRAY_NOTIFICATION);
- configKey.setValue("");
- configValue.setValue("");
- }else{
- Notification.show("Could not remove " + configKey.getValue(),
- Notification.Type.ERROR_MESSAGE);
- logWriter.println(" - DEL " + configKey.getValue() + " rejected - not removable.");
- }
- taWidget.update();
- }
- });
- readButton.addClickListener(new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent clickEvent) {
- if(mutableConfig.isExisting(configKey.getValue())){
- String key = configKey.getValue();
- configValue.setValue(mutableConfig.get(key));
- Notification.show("Successfully read " + configKey.getValue(),
- Notification.Type.TRAY_NOTIFICATION);
- logWriter.println(" - GET " + key + " = " + configValue.getValue());
- logWriter.println(" - removable: " + mutableConfig.isRemovable(key));
- logWriter.println(" - writable : " + mutableConfig.isWritable(key));
- }else{
- Notification.show("Could not read " + configKey.getValue(),
- Notification.Type.ERROR_MESSAGE);
- logWriter.println(" - GET " + configKey.getValue() + " rejected - not existing.");
- }
- taWidget.update();
- }
- });
- }
-
- private String getCaption(String key, String value) {
- int index = key.lastIndexOf('.');
- if(index<0){
- return key + " = " + value;
- }else{
- return key.substring(index+1) + " = " + value;
- }
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ConfigUpdaterView.java
----------------------------------------------------------------------
diff --git a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ConfigUpdaterView.java b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ConfigUpdaterView.java
deleted file mode 100644
index 474aeea..0000000
--- a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ConfigUpdaterView.java
+++ /dev/null
@@ -1,121 +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.mutableconfig.ui;
-
-import com.vaadin.navigator.View;
-import com.vaadin.navigator.ViewChangeListener;
-import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.PopupView;
-import org.apache.tamaya.mutableconfig.MutableConfiguration;
-import org.apache.tamaya.mutableconfig.MutableConfigurationProvider;
-import org.apache.tamaya.mutableconfig.spi.MutablePropertySource;
-import org.apache.tamaya.spi.ServiceContextManager;
-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;
-
-/**
- * Tamaya UI view to change configuration.
- */
-public class ConfigUpdaterView extends VerticalSpacedLayout implements View {
-
- /**
- * Provider to register the view.
- */
- @Priority(50)
- public static final class Provider implements ViewProvider{
-
- @Override
- public ViewLifecycle getLifecycle() {
- return ViewLifecycle.LAZY;
- }
-
- @Override
- public String getName() {
- return "view.edit.name";
- }
-
- @Override
- public String getUrlPattern() {
- return "/edit";
- }
-
- @Override
- public String getDisplayName() {
- return ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.name");
- }
-
- @Override
- public View createView(Object... params){
- return new ConfigUpdaterView();
- }
- }
-
- private ProtocolWidget logWidget = new ProtocolWidget();
- private PopupView logPopup = new PopupView("Show log", logWidget);
-
- private MutableConfiguration mutableConfig = MutableConfigurationProvider.getMutableConfiguration();
-
- private TransactionControlWidget taControl = new TransactionControlWidget(mutableConfig,
- logWidget);
- private PopupView taDetails = new PopupView("Transaction Details", taControl);
-
- private ConfigEditorWidget editorWidget = new ConfigEditorWidget(mutableConfig, logWidget, taControl);
-
-
- public ConfigUpdaterView() {
- Label caption = new Label(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.edit.name"));
- Label description = new Label(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.edit.description"),
- ContentMode.HTML);
-
- caption.addStyleName(UIConstants.LABEL_HUGE);
- description.addStyleName(UIConstants.LABEL_LARGE);
- logWidget.print("INFO: Writable Property Sources: ");
- for(MutablePropertySource ps:mutableConfig.getMutablePropertySources()){
- logWidget.print(ps.getName(), ", ");
- }
- logWidget.println();
- logWidget.setHeight(100, Unit.PERCENTAGE);
- HorizontalLayout hl = new HorizontalLayout(taDetails, logPopup);
- hl.setSpacing(true);
- addComponents(caption, description, editorWidget, hl);
- }
-
- private String getCaption(String key, String value) {
- int index = key.lastIndexOf('.');
- if(index<0){
- return key + " = " + value;
- }else{
- return key.substring(index+1) + " = " + value;
- }
- }
-
- @Override
- public void enter(ViewChangeListener.ViewChangeEvent event) {
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ProtocolWidget.java
----------------------------------------------------------------------
diff --git a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ProtocolWidget.java b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ProtocolWidget.java
deleted file mode 100644
index 001dd40..0000000
--- a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/ProtocolWidget.java
+++ /dev/null
@@ -1,90 +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.mutableconfig.ui;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.TextArea;
-import com.vaadin.ui.VerticalLayout;
-import org.apache.tamaya.spi.ServiceContextManager;
-import org.apache.tamaya.ui.services.MessageProvider;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-/**
- * Widget showing a text protocol wioth a clear button to clear the widget space.
- */
-public class ProtocolWidget extends VerticalLayout{
-
- private TextArea textArea = new TextArea(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.edit.textArea.protocol"));
- private Button clearButton = new Button(ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.button.clearProtocol"));
-
- private StringWriter protocol = new StringWriter();
- private PrintWriter writer = new PrintWriter(protocol);
-
- public ProtocolWidget(){
- textArea.setWidth(600, Unit.PIXELS);
- textArea.setHeight(400, Unit.PERCENTAGE);
- textArea.setReadOnly(true);
- clearButton.addClickListener(new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent clickEvent) {
- protocol.getBuffer().setLength(0);
- flush();
- }
- });
- textArea.setSizeFull();
- addComponents(textArea, clearButton);
- setWidth(700, Unit.PIXELS);
- setHeight(500, Unit.PERCENTAGE);
- }
-
- public PrintWriter getWriter(){
- return writer;
- }
-
- public void println(){
- writer.println();
- }
-
- public void println(Object... items){
- for(int i=0;i<items.length;i++){
- writer.print(items[i]);
- }
- writer.println();
- flush();
- }
-
- public void print(Object... items){
- for(int i=0;i<items.length;i++){
- writer.print(items[i]);
- }
- flush();
- }
-
- private void flush(){
- writer.flush();
- textArea.setReadOnly(false);
- textArea.setValue(protocol.toString());
- textArea.setReadOnly(true);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/TransactionControlWidget.java
----------------------------------------------------------------------
diff --git a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/TransactionControlWidget.java b/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/TransactionControlWidget.java
deleted file mode 100644
index 40440c6..0000000
--- a/modules/mutable-config/src/main/java/org/apache/tamaya/mutableconfig/ui/TransactionControlWidget.java
+++ /dev/null
@@ -1,229 +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.mutableconfig.ui;
-
-import com.vaadin.data.Property;
-import com.vaadin.ui.*;
-import org.apache.tamaya.mutableconfig.ChangePropagationPolicy;
-import org.apache.tamaya.mutableconfig.MutableConfiguration;
-import org.apache.tamaya.mutableconfig.MutableConfigurationProvider;
-import org.apache.tamaya.mutableconfig.propertysources.ConfigChangeContext;
-import org.apache.tamaya.spi.ServiceContextManager;
-import org.apache.tamaya.ui.components.VerticalSpacedLayout;
-import org.apache.tamaya.ui.services.MessageProvider;
-
-import java.util.Arrays;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Tamaya UI view to change configuration.
- */
-public class TransactionControlWidget extends TabSheet {
-
- private Field taID = new TextField("Transaction ID");
- private Field taContent = new TextArea("Transaction Context");
- private VerticalLayout taLayout = new VerticalLayout(taID, taContent);
-
- private CheckBox autoCommit = new CheckBox(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.edit.box.autoCommit"));
-
- private ComboBox changePropagationPolicy = new ComboBox(ServiceContextManager.getServiceContext()
- .getService(MessageProvider.class).getMessage("view.edit.select.propagationPolicy"),
- Arrays.asList(new String[]{"ALL", "MOST_SIGNIFICANT_ONLY", "NONE", "CUSTOM"}));
-
- private TextField changePropagationPolicyOther = new TextField(
- ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.text.propagationPolicyOther"),
- MutableConfigurationProvider.getApplyAllChangePolicy().getClass().getName());
-
- private MutableConfiguration mutableConfig;
- private Button startTAButton = new Button(ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.button.startTransaction"));
- private Button rollbackTAButton = new Button(ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.button.rollbackTransaction"));
- private Button commitTAButton = new Button(ServiceContextManager.getServiceContext().getService(MessageProvider.class)
- .getMessage("view.edit.button.commitTransaction"));
- private ProtocolWidget logWriter;
- private VerticalSpacedLayout leftLayout = new VerticalSpacedLayout();
-
- public TransactionControlWidget(MutableConfiguration mutableConfig, ProtocolWidget logWriter) {
- taContent.setReadOnly(true);
- taContent.setWidth(600, Unit.PIXELS);
- taContent.setHeight(250, Unit.PIXELS);
- taLayout.setWidth(600, Unit.PIXELS);
- taID.setReadOnly(true);
- this.mutableConfig = Objects.requireNonNull(mutableConfig);
- this.logWriter = Objects.requireNonNull(logWriter);
- changePropagationPolicy.setWidth(500, Unit.PIXELS);
- changePropagationPolicyOther.setWidth(500, Unit.PIXELS);
- HorizontalLayout buttonLayout = new HorizontalLayout();
- buttonLayout.addComponents(startTAButton, commitTAButton, rollbackTAButton);
- leftLayout.addComponents(changePropagationPolicy, changePropagationPolicyOther, buttonLayout);
- addTab(leftLayout, "Transaction Control");
- addTab(taLayout, "Transaction Details");
- setWidth(600, Unit.PIXELS);
- initActions();
- update();
- }
-
- private void initActions() {
- autoCommit.addValueChangeListener(new Property.ValueChangeListener() {
- @Override
- public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
- mutableConfig.setAutoCommit(autoCommit.getValue());
- if(mutableConfig.getAutoCommit()) {
- Notification.show("Autocommit is now ON.",
- Notification.Type.TRAY_NOTIFICATION);
- }else{
- Notification.show("Autocommit is now OFF.",
- Notification.Type.TRAY_NOTIFICATION);
- }
- logWriter.println(" - Set Auto-Commit to " + autoCommit.getValue());
- }
- });
- changePropagationPolicy.addValueChangeListener(new Property.ValueChangeListener() {
- @Override
- public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
- changePropagationPolicyOther.setEnabled(false);
- changePropagationPolicyOther.addValueChangeListener(new Property.ValueChangeListener() {
- @Override
- public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
- String className = changePropagationPolicyOther.getValue();
- try {
- mutableConfig.setChangePropagationPolicy(
- (ChangePropagationPolicy) Class.forName(className).newInstance());
- logWriter.println(" - Set ChangePropagationPolicy " + className);
- Notification.show("ChangePropagationPolicy is now CUSTOM: " + className);
- } catch (Exception e) {
- Notification.show("Failed to apply change policy: " + className + ": " + e,
- Notification.Type.ERROR_MESSAGE);
- }
- }
- });
- switch ((String) changePropagationPolicy.getValue()) {
- case "MOST_SIGNIFICANT_ONLY":
- mutableConfig.setChangePropagationPolicy(
- MutableConfigurationProvider.getApplyMostSignificantOnlyChangePolicy());
- Notification.show("ChangePropagationPolicy is now MOST_SIGNIFICANT_ONLY.",
- Notification.Type.TRAY_NOTIFICATION);
- logWriter.println(" - Set ChangePropagationPolicy to MOST_SIGNIFICANT_ONLY.");
- break;
- case "NONE":
- Notification.show("Applying none equals being your config READ-ONLY.",
- Notification.Type.ASSISTIVE_NOTIFICATION);
- mutableConfig.setChangePropagationPolicy(
- MutableConfigurationProvider.getApplyNonePolicy());
- Notification.show("ChangePropagationPolicy is now NONE.", Notification.Type.TRAY_NOTIFICATION);
- logWriter.println(" - Set ChangePropagationPolicy to NONE.");
- break;
- case "CUSTOM":
- changePropagationPolicyOther.setEnabled(true);
- break;
- case "ALL":
- default:
- mutableConfig.setChangePropagationPolicy(
- MutableConfigurationProvider.getApplyAllChangePolicy());
- Notification.show("ChangePropagationPolicy is now ALL.", Notification.Type.TRAY_NOTIFICATION);
- logWriter.println(" - Set ChangePropagationPolicy to ALL.");
- }
- }
- });
- startTAButton.addClickListener(new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent clickEvent) {
- String taId = mutableConfig.startTransaction();
- update();
- Notification.show("Transaction started: " + taId, Notification.Type.TRAY_NOTIFICATION);
- logWriter.println("Started Transaction: " + taId);
- }
- });
- rollbackTAButton.addClickListener(new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent clickEvent) {
- String taId = mutableConfig.getTransactionId();
- mutableConfig.rollbackTransaction();
- update();
- Notification.show("Transaction rolled back: " + taId, Notification.Type.TRAY_NOTIFICATION);
- logWriter.println("Rolled back Transaction: " + taId);
- }
- });
- commitTAButton.addClickListener(new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent clickEvent) {
- String taId = mutableConfig.getTransactionId();
- mutableConfig.commitTransaction();
- update();
- Notification.show("Transaction comitted: " + taId, Notification.Type.TRAY_NOTIFICATION);
- logWriter.println("Committed Transaction: " + taId);
- }
- });
- }
-
- public void update(){
- taID.setReadOnly(false);
- taContent.setReadOnly(false);
- if(mutableConfig.getTransactionId()==null){
- taID.setValue("N/A");
- }else {
- taID.setValue(mutableConfig.getTransactionId());
- }
- StringBuilder b = new StringBuilder();
- ConfigChangeContext changes = mutableConfig.getConfigChangeContext();
- if(mutableConfig.getTransactionId()==null){
- startTAButton.setEnabled(true);
- rollbackTAButton.setEnabled(false);
- commitTAButton.setEnabled(false);
- changePropagationPolicy.setEnabled(true);
- changePropagationPolicyOther.setEnabled(true);
- b.append("No Transaction Context available.");
- }else{
- b.append("TA ID : ").append(changes.getTransactionID()).append('\n');
- b.append("Started at : ").append(changes.getStartedAt()).append("\n\n");
- b.append("PUT:\n");
- b.append("====\n");
- for(Map.Entry<String,String> en:changes.getAddedProperties().entrySet()){
- b.append(en.getKey()).append(" = ").append(en.getValue()).append("\n\n");
- }
- b.append("DEL:\n");
- b.append("====\n");
- for(String key:changes.getRemovedProperties()){
- b.append(key).append("\n\n");
- }
- startTAButton.setEnabled(false);
- rollbackTAButton.setEnabled(true);
- commitTAButton.setEnabled(true);
- changePropagationPolicy.setEnabled(false);
- changePropagationPolicyOther.setEnabled(false);
- }
- taContent.setValue(b.toString());
- taID.setReadOnly(true);
- taContent.setReadOnly(true);
- }
-
- private String getCaption(String key, String value) {
- int index = key.lastIndexOf('.');
- if (index < 0) {
- return key + " = " + value;
- } else {
- return key.substring(index + 1) + " = " + value;
- }
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/mutable-config/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
----------------------------------------------------------------------
diff --git a/modules/mutable-config/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider b/modules/mutable-config/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
deleted file mode 100644
index d2ac687..0000000
--- a/modules/mutable-config/src/main/resources/META-INF/services/org.apache.tamaya.ui.ViewProvider
+++ /dev/null
@@ -1,19 +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 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.mutableconfig.ui.ConfigUpdaterView$Provider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/mutable-config/src/main/resources/ui/lang/tamaya.properties
----------------------------------------------------------------------
diff --git a/modules/mutable-config/src/main/resources/ui/lang/tamaya.properties b/modules/mutable-config/src/main/resources/ui/lang/tamaya.properties
deleted file mode 100644
index 3a8be1a..0000000
--- a/modules/mutable-config/src/main/resources/ui/lang/tamaya.properties
+++ /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 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.
-#
-view.edit.name=Edit Configuration
-view.edit.description=This is a simple Tamaya configuration editor for changing configuration values. \
- It gives you full control on Tamaya's mutability features and transactions.
-view.edit.select.propagationPolicy=Change Propagation Policy
-view.edit.text.propagationPolicyOther=Custom Change Propagation Policy (Class)
-view.edit.textArea.protocol=Action Protocol
-view.edit.box.autoCommit=Auto-Commit
-
-view.edit.button.startTransaction=Start TA
-view.edit.button.rollbackTransaction=Rollback
-view.edit.button.commitTransaction=Commit
-view.edit.text.configKey=Configuration Key
-view.edit.text.configValue=Value
-view.edit.button.updateKey=Write/Update
-view.edit.button.removeKey=Delete
-view.edit.button.readKey=Read from Config
-view.edit.button.clearProtocol=Clear Protocol
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/pom.xml
----------------------------------------------------------------------
diff --git a/modules/pom.xml b/modules/pom.xml
index 43f75e5..e32b92f 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -55,7 +55,6 @@ under the License.
<module>server</module>
<module>spi-support</module>
<module>yaml</module>
- <module>ui</module>
</modules>
<build>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/resolver/pom.xml
----------------------------------------------------------------------
diff --git a/modules/resolver/pom.xml b/modules/resolver/pom.xml
index 0a6ee9d..596abb7 100644
--- a/modules/resolver/pom.xml
+++ b/modules/resolver/pom.xml
@@ -52,12 +52,6 @@ under the License.
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-ui</artifactId>
- <version>${project.version}</version>
- <optional>true</optional>
- </dependency>
- <dependency>
<groupId>org.hamcrest</groupId>
<artifactId>java-hamcrest</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/resources/pom.xml
----------------------------------------------------------------------
diff --git a/modules/resources/pom.xml b/modules/resources/pom.xml
index 2ef966b..1ba7dbe 100644
--- a/modules/resources/pom.xml
+++ b/modules/resources/pom.xml
@@ -46,13 +46,6 @@ under the License.
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-ui</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
<groupId>org.hamcrest</groupId>
<artifactId>java-hamcrest</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/ui/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ui/pom.xml b/modules/ui/pom.xml
deleted file mode 100644
index e5b86f7..0000000
--- a/modules/ui/pom.xml
+++ /dev/null
@@ -1,246 +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>jar</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>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tamaya.ext</groupId>
- <artifactId>tamaya-functions</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>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>
- </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>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>2.4.1</version>
- <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>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/ui/src/main/java/org/apache/tamaya/ui/ApplicationLayout.java
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/java/org/apache/tamaya/ui/ApplicationLayout.java b/modules/ui/src/main/java/org/apache/tamaya/ui/ApplicationLayout.java
deleted file mode 100644
index 20190be..0000000
--- a/modules/ui/src/main/java/org/apache/tamaya/ui/ApplicationLayout.java
+++ /dev/null
@@ -1,72 +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.HorizontalLayout;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.UI;
-import org.apache.tamaya.ui.components.PageTitleUpdater;
-import org.apache.tamaya.ui.views.ErrorView;
-
-
-/**
- * UI main layout.
- */
-public class ApplicationLayout extends HorizontalLayout {
-
- private NavBar navBar;
- private Panel content;
- private NavigationBar navigator;
-
- public ApplicationLayout(UI ui) {
- addStyleName(UIConstants.MAIN_LAYOUT);
- setSizeFull();
- initLayouts();
- setupNavigator(ui);
- }
-
- public NavigationBar getNavigationBar(){
- return navigator;
- }
-
- private void initLayouts() {
- navBar = new NavBar(this);
- // 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(UI ui) {
- navigator = new NavigationBar(ui, content, navBar);
-
- // 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("/home");
- navigator.setErrorView(ErrorView.class);
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0370a240/modules/ui/src/main/java/org/apache/tamaya/ui/CurrentUser.java
----------------------------------------------------------------------
diff --git a/modules/ui/src/main/java/org/apache/tamaya/ui/CurrentUser.java b/modules/ui/src/main/java/org/apache/tamaya/ui/CurrentUser.java
deleted file mode 100644
index 09fcf57..0000000
--- a/modules/ui/src/main/java/org/apache/tamaya/ui/CurrentUser.java
+++ /dev/null
@@ -1,58 +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 retrieving a user from the VaadinSession
- */
-public final class CurrentUser {
- /** The key used. */
- private static final String KEY = "currentUser";
-
- /**
- * Singleton constructor.
- */
- private CurrentUser(){}
-
- /**
- * Set the current users.
- * @param user the current user, not null.
- */
- public static void set(User user) {
- VaadinSession.getCurrent().setAttribute(KEY, user);
- }
-
- /**
- * Get the current user.
- * @return the current user, or null.
- */
- public static User get() {
- return (User) VaadinSession.getCurrent().getAttribute(KEY);
- }
-
- /**
- * Checks if the current user is present and logged in.
- * @return {@code true} if user is present and logged in.
- */
- public static boolean isLoggedIn() {
- return get() != null && get().isLoggedin();
- }
-}