From 350897f1632ca00cdc0f28e8dcc2042235e6e184 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Mon, 23 May 2011 17:56:13 +0200
Subject: [PATCH] kleine Verbesserungen, tickets #47 und #48

---
 hsarweb/src/de/hsadmin/web/HomeModule.java                             |    3 +
 hsarweb/src/de/hsadmin/web/UnixUserModule.java                         |    3 +
 hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java           |    2 +
 hsarweb/src/de/hsadmin/web/EMailAddressModule.java                     |    8 +++
 hsarweb/src/de/hsadmin/web/DatabaseUserModule.java                     |    2 +
 hsarweb/src/de/hsadmin/web/DomainModule.java                           |    3 +
 hsarweb/src/texts/main.properties                                      |    3 -
 hsarweb/src/de/hsadmin/web/vaadin/EMailTargetPropertyFieldFactory.java |    5 +-
 hsarweb/src/de/hsadmin/web/vaadin/DefaultPropertyFieldFactory.java     |    2 
 hsarweb/src/de/hsadmin/web/vaadin/GenericForm.java                     |    2 
 hsarweb/src/texts/main_de.properties                                   |    3 -
 hsarweb/src/de/hsadmin/web/config/PropertyConfig.java                  |   13 ++++++
 hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html                 |    4 ++
 hsarweb/src/de/hsadmin/web/config/PropertyFormVisible.java             |    9 ++++
 hsarweb/src/de/hsadmin/web/MainApplication.java                        |   21 +---------
 hsarweb/src/de/hsadmin/web/vaadin/PasswordPropertyFieldFactory.java    |    4 +-
 hsarweb/src/de/hsadmin/web/vaadin/SelectPropertyFieldFactory.java      |    4 +-
 hsarweb/src/de/hsadmin/web/EMailAliasModule.java                       |    2 +
 hsarweb/src/de/hsadmin/web/DatabaseModule.java                         |    4 +
 hsarweb/src/de/hsadmin/web/vaadin/DatePropertyFieldFactory.java        |    2 
 20 files changed, 62 insertions(+), 37 deletions(-)

diff --git a/hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html b/hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html
new file mode 100644
index 0000000..31dc7b7
--- /dev/null
+++ b/hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html
@@ -0,0 +1,4 @@
+<div style="width:100%; background-color:white;">
+	<div  style="margin:0px; padding:0px; vertical-align:top; float:left; ">(c) Hostsharing eG, <a href="https://www.hostsharing.net/impressum">Impressum</a></div>
+	<div  style="margin:0px; padding:0px; vertical-align:top; text-align:right; ">hsarweb (Vers. 2.0a, 23.05.2011)</div>
+</div>
\ No newline at end of file
diff --git a/hsarweb/src/de/hsadmin/web/DatabaseModule.java b/hsarweb/src/de/hsadmin/web/DatabaseModule.java
index 3d69f04..3ccea15 100644
--- a/hsarweb/src/de/hsadmin/web/DatabaseModule.java
+++ b/hsarweb/src/de/hsadmin/web/DatabaseModule.java
@@ -124,7 +124,9 @@
 				return map;
 			}
 		});
-		ownerProp.setWriteOnce(true);
+		idProp.setShowInForm(false);
+		pacProp.setShowInForm(false);
+		encodingProp.setShowInForm(false);
 		moduleConfig.addProperty(idProp);
 		moduleConfig.addProperty(pacProp);
 		moduleConfig.addProperty(nameProp);
diff --git a/hsarweb/src/de/hsadmin/web/DatabaseUserModule.java b/hsarweb/src/de/hsadmin/web/DatabaseUserModule.java
index 8038a85..c42d5a5 100644
--- a/hsarweb/src/de/hsadmin/web/DatabaseUserModule.java
+++ b/hsarweb/src/de/hsadmin/web/DatabaseUserModule.java
@@ -67,6 +67,8 @@
 		});
 		pacProp.setWriteOnce(true);
 		PropertyConfig passwordProp = new PropertyConfig(moduleConfig, "password", String.class, PropertyTableColumn.NONE, new PasswordPropertyFieldFactory(this));
+		idProp.setShowInForm(false);
+		pacProp.setShowInForm(false);
 		moduleConfig.addProperty(idProp);
 		moduleConfig.addProperty(pacProp);
 		moduleConfig.addProperty(nameProp);
diff --git a/hsarweb/src/de/hsadmin/web/DomainModule.java b/hsarweb/src/de/hsadmin/web/DomainModule.java
index 02cc348..ef39e5f 100644
--- a/hsarweb/src/de/hsadmin/web/DomainModule.java
+++ b/hsarweb/src/de/hsadmin/web/DomainModule.java
@@ -68,6 +68,9 @@
 		hiveProp.setReadOnly(true);
 		PropertyConfig sinceProp = new PropertyConfig(moduleConfig, "since", Date.class, new DatePropertyFieldFactory());
 		sinceProp.setReadOnly(true);
+		idProp.setShowInForm(false);
+		pacProp.setShowInForm(false);
+		hiveProp.setShowInForm(false);
 		moduleConfig.addProperty(idProp);
 		moduleConfig.addProperty(nameProp);
 		moduleConfig.addProperty(userProp);
diff --git a/hsarweb/src/de/hsadmin/web/EMailAddressModule.java b/hsarweb/src/de/hsadmin/web/EMailAddressModule.java
index 75fecc4..dc3d4e3 100644
--- a/hsarweb/src/de/hsadmin/web/EMailAddressModule.java
+++ b/hsarweb/src/de/hsadmin/web/EMailAddressModule.java
@@ -66,13 +66,19 @@
 		pacProp.setReadOnly(true);
 		PropertyConfig fulldomainProp = new PropertyConfig(moduleConfig, "fulldomain", String.class, PropertyTableColumn.HIDDEN);
 		fulldomainProp.setReadOnly(true);
+		idProp.setShowInForm(false);
+		localpartProp.setShowInForm(false);
+		subdomainProp.setShowInForm(false);
+		domainProp.setShowInForm(false);
+		pacProp.setShowInForm(false);
+		fulldomainProp.setShowInForm(false);
 		moduleConfig.addProperty(idProp);
+		moduleConfig.addProperty(domAdminProp);
 		moduleConfig.addProperty(fullAddressProp);
 		moduleConfig.addProperty(localpartProp);
 		moduleConfig.addProperty(subdomainProp);
 		moduleConfig.addProperty(domainProp);
 		moduleConfig.addProperty(targetProp);
-		moduleConfig.addProperty(domAdminProp);
 		moduleConfig.addProperty(pacProp);
 		moduleConfig.addProperty(fulldomainProp);
 	}
diff --git a/hsarweb/src/de/hsadmin/web/EMailAliasModule.java b/hsarweb/src/de/hsadmin/web/EMailAliasModule.java
index ab9b162..ff6f04e 100644
--- a/hsarweb/src/de/hsadmin/web/EMailAliasModule.java
+++ b/hsarweb/src/de/hsadmin/web/EMailAliasModule.java
@@ -74,6 +74,8 @@
 			}
 		});
 		pacProp.setWriteOnce(true);
+		idProp.setShowInForm(false);
+		pacProp.setShowInForm(false);
 		moduleConfig.addProperty(idProp);
 		moduleConfig.addProperty(pacProp);
 		moduleConfig.addProperty(nameProp);
diff --git a/hsarweb/src/de/hsadmin/web/HomeModule.java b/hsarweb/src/de/hsadmin/web/HomeModule.java
index 5b4ae2c..d71e536 100644
--- a/hsarweb/src/de/hsadmin/web/HomeModule.java
+++ b/hsarweb/src/de/hsadmin/web/HomeModule.java
@@ -76,6 +76,9 @@
 		PropertyConfig passwordProp = new PropertyConfig(moduleConfig, "password", String.class, PropertyTableColumn.NONE, new PasswordPropertyFieldFactory(this));
 		PropertyConfig commentProp = new PropertyConfig(moduleConfig, "comment", String.class);
 		commentProp.setReadOnly(true);
+		idProp.setShowInForm(false);
+		pacProp.setShowInForm(false);
+		useridProp.setShowInForm(false);
 		moduleConfig.addProperty(idProp);
 		moduleConfig.addProperty(pacProp);
 		moduleConfig.addProperty(useridProp);
diff --git a/hsarweb/src/de/hsadmin/web/MainApplication.java b/hsarweb/src/de/hsadmin/web/MainApplication.java
index 4b84e9e..f2a2527 100644
--- a/hsarweb/src/de/hsadmin/web/MainApplication.java
+++ b/hsarweb/src/de/hsadmin/web/MainApplication.java
@@ -18,20 +18,15 @@
 import com.vaadin.terminal.Terminal;
 import com.vaadin.terminal.ThemeResource;
 import com.vaadin.terminal.gwt.server.HttpServletRequestListener;
-import com.vaadin.ui.Button;
 import com.vaadin.ui.Component;
 import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Embedded;
-import com.vaadin.ui.HorizontalLayout;
 import com.vaadin.ui.Link;
 import com.vaadin.ui.TabSheet;
 import com.vaadin.ui.VerticalLayout;
 import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
 import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
 import com.vaadin.ui.TabSheet.Tab;
 import com.vaadin.ui.Window.Notification;
-import com.vaadin.ui.themes.BaseTheme;
 
 import de.hsadmin.web.config.LocaleConfig;
 import de.hsadmin.web.config.ModuleConfig;
@@ -47,8 +42,6 @@
 	private Remote remote;
 	private Map<String, Module> modules;
 	private Locale requestLocale;
-
-	private CustomLayout header;
 
 
 	@Override
@@ -74,17 +67,6 @@
 		Window mainWindow = new Window(localeConfig.getText("applicationtitle"));
 		VerticalLayout verticalLayout = new VerticalLayout();
 		verticalLayout.setSizeFull();
-//		HorizontalLayout banner = new HorizontalLayout();
-//		Embedded image = new Embedded(null, new ThemeResource("../hs/icons/logo.png"));
-//		image.setMimeType("image/png");
-//		Embedded bgImage = new Embedded(null, new ThemeResource("../hs/icons/bg.png"));
-//		bgImage.setMimeType("image/png");
-//		Link logout = new Link("logout", new ExternalResource(localeConfig.getText("logout.link")));
-//		banner.addComponent(image);
-//		banner.addComponent(bgImage);
-//		banner.addComponent(logout);
-//		banner.setExpandRatio(bgImage, 1.0f);
-//		verticalLayout.addComponent(banner);
 		CustomLayout banner = new CustomLayout("../../hs/layout/header");
 		verticalLayout.addComponent(banner);
 		TabSheet tabs = new TabSheet();
@@ -110,7 +92,8 @@
 		tabs.addListener(this);
 		verticalLayout.addComponent(tabs);
 		verticalLayout.setExpandRatio(tabs, 1.0f);
-		verticalLayout.addComponent(new Link(localeConfig.getText("impressum.label"), new ExternalResource(localeConfig.getText("impressum.link"))));
+		CustomLayout footer = new CustomLayout("../../hs/layout/footer");
+		verticalLayout.addComponent(footer);
 		mainWindow.setContent(verticalLayout);
 		setMainWindow(mainWindow);
 		setErrorHandler(new Terminal.ErrorListener() {
diff --git a/hsarweb/src/de/hsadmin/web/UnixUserModule.java b/hsarweb/src/de/hsadmin/web/UnixUserModule.java
index 3549cd8..4198990 100644
--- a/hsarweb/src/de/hsadmin/web/UnixUserModule.java
+++ b/hsarweb/src/de/hsadmin/web/UnixUserModule.java
@@ -114,6 +114,9 @@
 				return "0";
 			}
 		});
+		pacProp.setShowInForm(false);
+		idProp.setShowInForm(false);
+		useridProp.setShowInForm(false);
 		moduleConfig.addProperty(pacProp);
 		moduleConfig.addProperty(idProp);
 		moduleConfig.addProperty(useridProp);
diff --git a/hsarweb/src/de/hsadmin/web/config/PropertyConfig.java b/hsarweb/src/de/hsadmin/web/config/PropertyConfig.java
index ca04fd9..cfbead6 100644
--- a/hsarweb/src/de/hsadmin/web/config/PropertyConfig.java
+++ b/hsarweb/src/de/hsadmin/web/config/PropertyConfig.java
@@ -6,7 +6,7 @@
 
 import de.hsadmin.web.vaadin.DefaultPropertyFieldFactory;
 
-public class PropertyConfig implements Serializable, PropertyDefaultValue, PropertySelectValues {
+public class PropertyConfig implements Serializable, PropertyDefaultValue, PropertySelectValues, PropertyFormVisible {
 
 	private static final long serialVersionUID = 1L;
 	
@@ -17,6 +17,7 @@
 	private PropertyFieldFactory propFieldFactory;
 	private PropertyDefaultValue defaultValue;
 	private PropertySelectValues selectValues;
+	private boolean showInForm = true;
 	
 	public PropertyConfig(ModuleConfig moduleConfig, String id, Class<?> clasz) {
 		this.moduleConfig = moduleConfig;
@@ -126,5 +127,15 @@
 	public void setWriteOnce(boolean writeOnce) {
 		propFieldFactory.setWriteOnce(writeOnce);
 	}
+
+	@Override
+	public boolean isShowInForm() {
+		return showInForm;
+	}
+
+	@Override
+	public void setShowInForm(boolean show) {
+		showInForm = show;
+	}
 	
 }
diff --git a/hsarweb/src/de/hsadmin/web/config/PropertyFormVisible.java b/hsarweb/src/de/hsadmin/web/config/PropertyFormVisible.java
new file mode 100644
index 0000000..c50f401
--- /dev/null
+++ b/hsarweb/src/de/hsadmin/web/config/PropertyFormVisible.java
@@ -0,0 +1,9 @@
+package de.hsadmin.web.config;
+
+public interface PropertyFormVisible {
+
+	public abstract void setShowInForm(boolean dontShow);
+
+	public abstract boolean isShowInForm();
+	
+}
diff --git a/hsarweb/src/de/hsadmin/web/vaadin/DatePropertyFieldFactory.java b/hsarweb/src/de/hsadmin/web/vaadin/DatePropertyFieldFactory.java
index c1dc066..626f1d8 100644
--- a/hsarweb/src/de/hsadmin/web/vaadin/DatePropertyFieldFactory.java
+++ b/hsarweb/src/de/hsadmin/web/vaadin/DatePropertyFieldFactory.java
@@ -18,7 +18,7 @@
 	public static final DateFormat serverDf = DateFormat.getDateInstance(DateFormat.SHORT);
 	
 	private boolean readOnly = false;
-	private boolean writeOnce;
+	private boolean writeOnce = false;
 	
 	@Override
 	public Object createFieldComponent(PropertyConfig prop, Object value) {
diff --git a/hsarweb/src/de/hsadmin/web/vaadin/DefaultPropertyFieldFactory.java b/hsarweb/src/de/hsadmin/web/vaadin/DefaultPropertyFieldFactory.java
index 80ea527..02d1c45 100644
--- a/hsarweb/src/de/hsadmin/web/vaadin/DefaultPropertyFieldFactory.java
+++ b/hsarweb/src/de/hsadmin/web/vaadin/DefaultPropertyFieldFactory.java
@@ -9,7 +9,7 @@
 public class DefaultPropertyFieldFactory implements PropertyFieldFactory {
 
 	private boolean readOnly = false;
-	private boolean writeOnce;
+	private boolean writeOnce = false;
 	
 	@Override
 	public Object createFieldComponent(PropertyConfig prop, Object value) {
diff --git a/hsarweb/src/de/hsadmin/web/vaadin/EMailTargetPropertyFieldFactory.java b/hsarweb/src/de/hsadmin/web/vaadin/EMailTargetPropertyFieldFactory.java
index 106d30a..8e47771 100644
--- a/hsarweb/src/de/hsadmin/web/vaadin/EMailTargetPropertyFieldFactory.java
+++ b/hsarweb/src/de/hsadmin/web/vaadin/EMailTargetPropertyFieldFactory.java
@@ -24,8 +24,8 @@
 public class EMailTargetPropertyFieldFactory implements PropertyFieldFactory {
 
 	private Module module;
-	private boolean readOnly;
-	private boolean writeOnce;
+	private boolean readOnly = false;
+	private boolean writeOnce = false;
 	private List<String> users;
 	private List<String> mailAliases;
 	private Map<Integer, SingleEMailTarget> targets;
@@ -245,4 +245,5 @@
 			return value;
 		}
 	}
+
 }
diff --git a/hsarweb/src/de/hsadmin/web/vaadin/GenericForm.java b/hsarweb/src/de/hsadmin/web/vaadin/GenericForm.java
index c04cee5..a854c29 100644
--- a/hsarweb/src/de/hsadmin/web/vaadin/GenericForm.java
+++ b/hsarweb/src/de/hsadmin/web/vaadin/GenericForm.java
@@ -56,7 +56,7 @@
 				f.setData(entityId);
 				Layout layout = f.getLayout();
 				for (PropertyConfig prop : config.getPropertyList()) {
-					if (!prop.getPropTableColumn().equals(PropertyTableColumn.INTERNAL_KEY)) {
+					if (!prop.getPropTableColumn().equals(PropertyTableColumn.INTERNAL_KEY) && prop.isShowInForm()) {
 						PropertyFieldFactory propFieldFactory = prop.getPropFieldFactory();
 						Object value = row.get(prop.getId());
 						Component component = (Component) propFieldFactory.createFieldComponent(prop, value);
diff --git a/hsarweb/src/de/hsadmin/web/vaadin/PasswordPropertyFieldFactory.java b/hsarweb/src/de/hsadmin/web/vaadin/PasswordPropertyFieldFactory.java
index 7264273..e5ccbf3 100644
--- a/hsarweb/src/de/hsadmin/web/vaadin/PasswordPropertyFieldFactory.java
+++ b/hsarweb/src/de/hsadmin/web/vaadin/PasswordPropertyFieldFactory.java
@@ -13,8 +13,8 @@
 public class PasswordPropertyFieldFactory implements PropertyFieldFactory {
 
 	private Module module;
-	private boolean readOnly;
-	private boolean writeOnce;
+	private boolean readOnly = false;
+	private boolean writeOnce = false;
 
 	public PasswordPropertyFieldFactory(Module module) {
 		this.module = module;
diff --git a/hsarweb/src/de/hsadmin/web/vaadin/SelectPropertyFieldFactory.java b/hsarweb/src/de/hsadmin/web/vaadin/SelectPropertyFieldFactory.java
index a901388..446b61f 100644
--- a/hsarweb/src/de/hsadmin/web/vaadin/SelectPropertyFieldFactory.java
+++ b/hsarweb/src/de/hsadmin/web/vaadin/SelectPropertyFieldFactory.java
@@ -11,8 +11,8 @@
 
 public class SelectPropertyFieldFactory implements PropertyFieldFactory {
 
-	private boolean readOnly;
-	private boolean writeOnce;
+	private boolean readOnly = false;
+	private boolean writeOnce = false;
 
 	@Override
 	public Object createFieldComponent(PropertyConfig prop, Object value) {
diff --git a/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java b/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java
index ae16bde..9b46fe0 100644
--- a/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java
+++ b/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java
@@ -173,6 +173,7 @@
 		final Button button = new Button();
 		final Module thisModule = module;
 		button.setIcon(icon);
+		button.setDescription(module.getApplication().getLocaleConfig().getText("update"));
 		button.setData(id);
 		button.setStyleName(BaseTheme.BUTTON_LINK);
 		button.addListener(new Button.ClickListener() {
@@ -230,6 +231,7 @@
 		ThemeResource icon = new ThemeResource("../runo/icons/16/document-delete.png");
 		final Button button = new Button();
 		button.setIcon(icon);
+		button.setDescription(module.getApplication().getLocaleConfig().getText("delete"));
 		button.setData(id);
 		button.setStyleName(BaseTheme.BUTTON_LINK);
 		button.addListener(new Button.ClickListener() {
diff --git a/hsarweb/src/texts/main.properties b/hsarweb/src/texts/main.properties
index 8b43bfa..8d1c4cf 100644
--- a/hsarweb/src/texts/main.properties
+++ b/hsarweb/src/texts/main.properties
@@ -5,9 +5,6 @@
 save=save
 abort=abort
 new=new
-impressum.label=Published by
-impressum.link=https://www.hostsharing.net/impressum
-logo.link=https://www.hostsharing.net/logo.png
 modules.NONE=de.hsadmin.web.HomeModule
 modules.USER=de.hsadmin.web.HomeModule
 modules.DOM_ADMIN=de.hsadmin.web.DomainReadonlyModule,de.hsadmin.web.EMailAddressModule,de.hsadmin.web.HomeModule
diff --git a/hsarweb/src/texts/main_de.properties b/hsarweb/src/texts/main_de.properties
index 7e2fa73..25e3e77 100644
--- a/hsarweb/src/texts/main_de.properties
+++ b/hsarweb/src/texts/main_de.properties
@@ -5,6 +5,3 @@
 save=speichern
 abort=abbrechen
 new=Eintrag anlegen
-impressum.label=Impressum
-impressum.link=https://www.hostsharing.net/impressum
-logo.link=https://www.hostsharing.net/logo.png

--
Gitblit v1.9.3