HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2011-05-23 350897f1632ca00cdc0f28e8dcc2042235e6e184
kleine Verbesserungen, tickets #47 und #48
2 files added
18 files modified
99 ■■■■■ changed files
hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html 4 ●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/DatabaseModule.java 4 ●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/DatabaseUserModule.java 2 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/DomainModule.java 3 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/EMailAddressModule.java 8 ●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/EMailAliasModule.java 2 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/HomeModule.java 3 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/MainApplication.java 21 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/UnixUserModule.java 3 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/config/PropertyConfig.java 13 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/config/PropertyFormVisible.java 9 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/vaadin/DatePropertyFieldFactory.java 2 ●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/vaadin/DefaultPropertyFieldFactory.java 2 ●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/vaadin/EMailTargetPropertyFieldFactory.java 5 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/vaadin/GenericForm.java 2 ●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/vaadin/PasswordPropertyFieldFactory.java 4 ●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/vaadin/SelectPropertyFieldFactory.java 4 ●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java 2 ●●●●● patch | view | raw | blame | history
hsarweb/src/texts/main.properties 3 ●●●●● patch | view | raw | blame | history
hsarweb/src/texts/main_de.properties 3 ●●●●● patch | view | raw | blame | history
hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html
New 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>
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);
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);
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);
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);
    }
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);
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);
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() {
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);
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;
    }
    
}
hsarweb/src/de/hsadmin/web/config/PropertyFormVisible.java
New file
@@ -0,0 +1,9 @@
package de.hsadmin.web.config;
public interface PropertyFormVisible {
    public abstract void setShowInForm(boolean dontShow);
    public abstract boolean isShowInForm();
}
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) {
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) {
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;
        }
    }
}
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);
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;
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) {
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() {
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
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