HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2012-12-18 fa9cd9865b75e907aea2aaffa21e598db2be26dd
new editor widget for alias name
3 files modified
52 ■■■■ changed files
hsarweb/src/de/hsadmin/web/EMailAliasModule.java 44 ●●●● patch | view | raw | blame | history
hsarweb/src/texts/emailalias.properties 5 ●●●● patch | view | raw | blame | history
hsarweb/src/texts/emailalias_de.properties 3 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/EMailAliasModule.java
@@ -6,11 +6,10 @@
import de.hsadmin.web.config.ModuleConfig;
import de.hsadmin.web.config.PropertyConfig;
import de.hsadmin.web.config.PropertyDefaultValue;
import de.hsadmin.web.config.PropertySelectValues;
import de.hsadmin.web.config.PropertyTableColumn;
import de.hsadmin.web.vaadin.EMailTargetPropertyFieldFactory;
import de.hsadmin.web.vaadin.SelectPropertyFieldFactory;
import de.hsadmin.web.vaadin.PacPrefixedNamePropertyFieldFactory;
public class EMailAliasModule extends GenericModule {
@@ -22,40 +21,10 @@
    protected void initModule() {
        MainApplication application = getApplication();
        moduleConfig = new ModuleConfig("emailalias", application.getLocale());
        String login = application.getRunAs();
        final String pac = login.length() >= 5 ? login.substring(0, 5) : "";
        PropertyConfig idProp = new PropertyConfig(moduleConfig, "id", Long.class, PropertyTableColumn.INTERNAL_KEY);
        idProp.setReadOnly(true);
        PropertyConfig nameProp = new PropertyConfig(moduleConfig, "name", String.class);
        nameProp.setDefaultValue(new PropertyDefaultValue() {
            @Override
            public String getDefaultValue() {
                if (pac.length() >= 5) {
                    return pac + "-";
                }
                return "";
            }
        });
        nameProp.setWriteOnce(true);
        PropertyConfig targetProp = new PropertyConfig(moduleConfig, "target", String.class, new EMailTargetPropertyFieldFactory(this));
        targetProp.setExpandRatio(0.8f);
        targetProp.setDefaultValue(new PropertyDefaultValue() {
            @Override
            public String getDefaultValue() {
                if (pac.length() >= 5) {
                    return pac + "-";
                }
                return "";
            }
        });
        PropertyConfig pacProp = new PropertyConfig(moduleConfig, "pac", String.class, PropertyTableColumn.HIDDEN, new SelectPropertyFieldFactory());
        pacProp.setDefaultValue(new PropertyDefaultValue() {
            @Override
            public String getDefaultValue() {
                return pac;
            }
        });
        pacProp.setSelectValues(new PropertySelectValues() {
        PropertyConfig nameProp = new PropertyConfig(moduleConfig, "name", String.class, new PacPrefixedNamePropertyFieldFactory(this));
        nameProp.setSelectValues(new PropertySelectValues() {
            @Override
            public boolean newItemsAllowed() {
                return false;
@@ -64,6 +33,7 @@
            public boolean hasSelectList() {
                return true;
            }
            @Override
            public Map<String, String> getSelectValues() {
                List<String> list = getPackets();
@@ -74,11 +44,11 @@
                return map;
            }
        });
        pacProp.setWriteOnce(true);
        nameProp.setWriteOnce(true);
        PropertyConfig targetProp = new PropertyConfig(moduleConfig, "target", String.class, new EMailTargetPropertyFieldFactory(this));
        targetProp.setExpandRatio(0.8f);
        idProp.setShowInForm(false);
        pacProp.setShowInForm(false);
        moduleConfig.addProperty(idProp);
        moduleConfig.addProperty(pacProp);
        moduleConfig.addProperty(nameProp);
        moduleConfig.addProperty(targetProp);
    }
hsarweb/src/texts/emailalias.properties
@@ -1,5 +1,8 @@
id=identifier
name=name
name=alias
name.pacprefix=packet
name.separator=-
name.postfix=aliaspart
target=target(s)
pac=packet
moduletitle=email aliases
hsarweb/src/texts/emailalias_de.properties
@@ -1,5 +1,8 @@
id=Schl├╝ssel
name=Alias
name.pacprefix=Paket
name.separator=-
name.postfix=Alias-Postfix
target=Ziel(e)
pac=Paket
moduletitle=EMail Aliases