kleine Verbesserungen, tickets #47 und #48

This commit is contained in:
Peter Hormanns 2011-05-23 15:56:13 +00:00
parent 11b58e4007
commit 350897f163
20 changed files with 62 additions and 37 deletions

View File

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

View File

@ -124,7 +124,9 @@ public abstract class DatabaseModule extends GenericModule {
return map;
}
});
ownerProp.setWriteOnce(true);
idProp.setShowInForm(false);
pacProp.setShowInForm(false);
encodingProp.setShowInForm(false);
moduleConfig.addProperty(idProp);
moduleConfig.addProperty(pacProp);
moduleConfig.addProperty(nameProp);

View File

@ -67,6 +67,8 @@ public abstract class DatabaseUserModule extends GenericModule {
});
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);

View File

@ -68,6 +68,9 @@ public class DomainModule extends GenericModule {
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);

View File

@ -66,13 +66,19 @@ public class EMailAddressModule extends GenericModule {
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);
}

View File

@ -74,6 +74,8 @@ public class EMailAliasModule extends GenericModule {
}
});
pacProp.setWriteOnce(true);
idProp.setShowInForm(false);
pacProp.setShowInForm(false);
moduleConfig.addProperty(idProp);
moduleConfig.addProperty(pacProp);
moduleConfig.addProperty(nameProp);

View File

@ -76,6 +76,9 @@ public class HomeModule extends AbstractModule implements ComponentFactory, Upda
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);

View File

@ -18,20 +18,15 @@ import com.vaadin.terminal.ExternalResource;
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;
@ -48,8 +43,6 @@ public class MainApplication extends Application implements HttpServletRequestLi
private Map<String, Module> modules;
private Locale requestLocale;
private CustomLayout header;
@Override
public void init() {
@ -74,17 +67,6 @@ public class MainApplication extends Application implements HttpServletRequestLi
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 @@ public class MainApplication extends Application implements HttpServletRequestLi
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() {

View File

@ -114,6 +114,9 @@ public class UnixUserModule extends GenericModule {
return "0";
}
});
pacProp.setShowInForm(false);
idProp.setShowInForm(false);
useridProp.setShowInForm(false);
moduleConfig.addProperty(pacProp);
moduleConfig.addProperty(idProp);
moduleConfig.addProperty(useridProp);

View File

@ -6,7 +6,7 @@ import java.util.Map;
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 @@ public class PropertyConfig implements Serializable, PropertyDefaultValue, Prope
private PropertyFieldFactory propFieldFactory;
private PropertyDefaultValue defaultValue;
private PropertySelectValues selectValues;
private boolean showInForm = true;
public PropertyConfig(ModuleConfig moduleConfig, String id, Class<?> clasz) {
this.moduleConfig = moduleConfig;
@ -127,4 +128,14 @@ public class PropertyConfig implements Serializable, PropertyDefaultValue, Prope
propFieldFactory.setWriteOnce(writeOnce);
}
@Override
public boolean isShowInForm() {
return showInForm;
}
@Override
public void setShowInForm(boolean show) {
showInForm = show;
}
}

View File

@ -0,0 +1,9 @@
package de.hsadmin.web.config;
public interface PropertyFormVisible {
public abstract void setShowInForm(boolean dontShow);
public abstract boolean isShowInForm();
}

View File

@ -18,7 +18,7 @@ public class DatePropertyFieldFactory implements PropertyFieldFactory {
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) {

View File

@ -9,7 +9,7 @@ import de.hsadmin.web.config.PropertyFieldFactory;
public class DefaultPropertyFieldFactory implements PropertyFieldFactory {
private boolean readOnly = false;
private boolean writeOnce;
private boolean writeOnce = false;
@Override
public Object createFieldComponent(PropertyConfig prop, Object value) {

View File

@ -24,8 +24,8 @@ import de.hsadmin.web.config.PropertyFieldFactory;
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 @@ public class EMailTargetPropertyFieldFactory implements PropertyFieldFactory {
return value;
}
}
}

View File

@ -56,7 +56,7 @@ public class GenericForm {
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);

View File

@ -13,8 +13,8 @@ import de.hsadmin.web.config.PropertyFieldFactory;
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;

View File

@ -11,8 +11,8 @@ import de.hsadmin.web.config.PropertyFieldFactory;
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) {

View File

@ -173,6 +173,7 @@ public class TableComponentFactory implements ComponentFactory, Serializable {
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 @@ public class TableComponentFactory implements ComponentFactory, Serializable {
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() {

View File

@ -5,9 +5,6 @@ confirmdelete=confirm delete
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

View File

@ -5,6 +5,3 @@ confirmdelete=Diesen Eintrag l
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