HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2012-07-27 3d4e839918e5be3f719853223161199c2e24f19c
clean code
2 files deleted
2 files renamed
20 files modified
233 ■■■■■ changed files
hsarback/lib/commons-logging-1.1.1.jar patch | view | raw | blame | history
hsarback/src/de/hsadmin/cliClientConnector/TechnicalException.java 5 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/AbstractModuleImpl.java 2 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/AnnFieldValidation.java 2 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/AnnModuleImpl.java 2 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/EntityInfo.java 12 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/EntitySessionHelper.java 11 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/GenericModuleImpl.java 14 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/TicketValidator.java 9 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/Transaction.java 15 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/qserv/QueueTask.java 50 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/cust/Customer.java 4 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/db/Database.java 10 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/db/DatabaseUser.java 8 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/db/MySqlDatabase.java 6 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/db/MySqlUser.java 6 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/db/PgSqlDatabase.java 6 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/db/PgSqlUser.java 6 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/Domain.java 12 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainOption.java 4 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/email/EMailAddress.java 14 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/email/EMailAlias.java 12 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/Pac.java 5 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/user/UnixUser.java 18 ●●●●● patch | view | raw | blame | history
hsarback/lib/commons-logging-1.1.1.jar
Binary files differ
hsarback/src/de/hsadmin/cliClientConnector/TechnicalException.java
@@ -3,6 +3,7 @@
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import javax.naming.NamingException;
import javax.persistence.RollbackException;
public class TechnicalException extends RuntimeException {
@@ -17,6 +18,10 @@
        super(errorMsg);
    }
    public TechnicalException(String errorMsg, NamingException e) {
        super(errorMsg + "\n" + extractCauseMessage(e));
    }
    private static String extractCauseMessage(Throwable e) {
        if (e.getMessage() != null && !(e instanceof RollbackException)) {
            return e.getMessage();
hsarback/src/de/hsadmin/core/model/AbstractModuleImpl.java
@@ -179,7 +179,7 @@
    }
    protected void queueProcessor(Processor proc, UnixUser user, AbstractEntity entity, String action) {
        EntityInfo entityInfo = entity.getClass().getAnnotation(EntityInfo.class);
        Entity entityInfo = entity.getClass().getAnnotation(Entity.class);
        String entityTypeName = entityInfo != null ? entityInfo.name() : entity.getClass().getSimpleName();
        StringBuilder details = new StringBuilder();
        String title = entityTypeName + " (" + entity.createStringKey() + ") " + action;
hsarback/src/de/hsadmin/core/model/AnnFieldValidation.java
File was renamed from hsarback/src/de/hsadmin/core/model/FieldValidation.java
@@ -7,6 +7,6 @@
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface FieldValidation {
public @interface AnnFieldValidation {
    String value();
}
hsarback/src/de/hsadmin/core/model/AnnModuleImpl.java
File was renamed from hsarback/src/de/hsadmin/core/model/ModuleImpl.java
@@ -4,7 +4,7 @@
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface ModuleImpl
public @interface AnnModuleImpl
{
    Class<?> value();
}
hsarback/src/de/hsadmin/core/model/EntityInfo.java
File was deleted
hsarback/src/de/hsadmin/core/model/EntitySessionHelper.java
@@ -1,11 +1,7 @@
package de.hsadmin.core.model;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class EntitySessionHelper {
    private static Log log = LogFactory.getLog(EntitySessionHelper.class);
    /**
     *  helper method to create a wrapper for checking the rights according to
@@ -14,16 +10,11 @@
     * @return
     */
    public static AbstractModuleImpl createEntitySessionWrapper(Class<? extends AbstractEntity> entityClass, Transaction tx) {
        // get in instance
        AbstractModuleImpl impl = null;
        try {
            Class<?> wrapperClass = determineModuleImpl(entityClass);
            // instantiate wrapper
            impl = instantiateModuleImpl(tx, wrapperClass);
        } catch (ClassNotFoundException exc) {
            log.info("entity class '"
                            + entityClass.getCanonicalName()
                            + "' has no session wrapper => using restrictive default access rights");
            impl = new SecureDefaultModuleImpl();
            impl.construct(tx);
        } catch (Exception exc) {
@@ -42,7 +33,7 @@
    private static Class<?> determineModuleImpl(Class<? extends AbstractEntity> entityClass)
            throws ClassNotFoundException {
        ModuleImpl wrapperAnnot = entityClass.getAnnotation(ModuleImpl.class);
        AnnModuleImpl wrapperAnnot = entityClass.getAnnotation(AnnModuleImpl.class);
        Class<?> wrapperClass = null;
        if (wrapperAnnot != null) {
            wrapperClass = wrapperAnnot.value();
hsarback/src/de/hsadmin/core/model/GenericModuleImpl.java
@@ -5,12 +5,7 @@
import java.util.List;
import java.util.regex.Pattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class GenericModuleImpl implements ModuleInterface {
    private static final Log log = LogFactory.getLog(GenericModuleImpl.class);
    private Transaction tx;
    
@@ -24,7 +19,6 @@
    @Override
    public AbstractEntity initialize(AbstractEntity newEntity) throws HSAdminException {
        log.trace("initialize(" + newEntity + ")");
        AbstractModuleImpl wrapper = 
            EntitySessionHelper.createEntitySessionWrapper(newEntity.getClass(), tx);
        return wrapper.initialize(newEntity);
@@ -35,7 +29,6 @@
        validateFields(newEntity);
        if (!newEntity.isNew())
            throw new HSAdminException("cannot add an already persistent entity");
        log.trace("add(" + newEntity + ")");
        AbstractModuleImpl wrapper = 
            EntitySessionHelper.createEntitySessionWrapper(newEntity.getClass(), tx);
        return wrapper.add(newEntity);
@@ -43,21 +36,18 @@
    @Override
    public AbstractEntity find(Class<? extends AbstractEntity> entityClass, Object key) throws HSAdminException {
        log.trace("find(" + entityClass + ", " + key + ")");
        AbstractModuleImpl wrapper = EntitySessionHelper.createEntitySessionWrapper(entityClass, tx);
        return wrapper.find(entityClass, key);
    }
    @Override
    public AbstractEntity findByString(Class<? extends AbstractEntity> entityClass, String key) throws HSAdminException {
        log.trace("find(" + entityClass + ", " + key + ")");
        AbstractModuleImpl wrapper = EntitySessionHelper.createEntitySessionWrapper(entityClass, tx);
        return wrapper.findByString(entityClass, key);
    }
    @Override
    public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass, String condition, String orderBy) throws HSAdminException {
        log.trace("search(" + entityClass + ", " + condition + ")");
        AbstractModuleImpl wrapper = EntitySessionHelper.createEntitySessionWrapper(entityClass, tx);
        return wrapper.search(entityClass, condition, orderBy);
    }
@@ -67,14 +57,12 @@
        validateFields(existingEntity);
        if (existingEntity.isNew())
            return add(existingEntity);
        log.debug("update(" + existingEntity + ")");
        AbstractModuleImpl wrapper = EntitySessionHelper.createEntitySessionWrapper(existingEntity.getClass(), tx);
        return wrapper.update(existingEntity);
    }
    @Override
    public void delete(AbstractEntity existingEntity) throws HSAdminException {
        log.trace("delete(" + existingEntity + ")");
        AbstractModuleImpl wrapper = 
            EntitySessionHelper.createEntitySessionWrapper(existingEntity.getClass(), tx);
        wrapper.delete(existingEntity);
@@ -93,7 +81,7 @@
    private void validateAllFields(Class<?> clasz, AbstractEntity anEntity)
            throws HSAdminException {
        for (Field f : clasz.getDeclaredFields()) {
            FieldValidation fieldValidation = f.getAnnotation(FieldValidation.class);
            AnnFieldValidation fieldValidation = f.getAnnotation(AnnFieldValidation.class);
            if (fieldValidation != null) {
                try {
                    Method method = clasz.getMethod(getterName(f));
hsarback/src/de/hsadmin/core/model/TicketValidator.java
@@ -8,13 +8,8 @@
import java.net.URL;
import java.net.URLConnection;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class TicketValidator {
    private static final Log log = LogFactory.getLog(TicketValidator.class);
    private static TicketValidator instance;
    
@@ -49,7 +44,6 @@
        }
        // real implementation
        if (proxyServiceURL == null || proxyValidateURL == null) {
            log.fatal("TicketValidator is not initialized.");
            throw new RuntimeException("TicketValidator is not initialized.");
        }
        try {
@@ -68,13 +62,10 @@
                nextLine = reader.readLine();
            }
            inputStream.close();
            log.debug("Ticket validation failed: " + ticket);
            throw new AuthenticationException("Invalid Ticket: " + ticket);
        } catch (MalformedURLException e) {
            log.fatal(e);
            throw new AuthenticationException(e.getMessage());
        } catch (IOException e) {
            log.fatal(e);
            throw new AuthenticationException(e.getMessage());
        }
    }
hsarback/src/de/hsadmin/core/model/Transaction.java
@@ -15,10 +15,7 @@
import javax.persistence.EntityTransaction;
import javax.persistence.Query;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.openjpa.persistence.OpenJPAEntityManager;
//import org.hibernate.Session;
import de.hsadmin.cliClientConnector.TechnicalException;
import de.hsadmin.core.qserv.QueueClient;
@@ -30,8 +27,6 @@
public class Transaction {
    private static final Log log = LogFactory.getLog(Transaction.class);
    private EntityManager entityManager;
    private QueueConnectionFactory queueConnectionFactory;
    private String loginName;
@@ -49,9 +44,7 @@
            Context env = (Context) ctx.lookup("java:comp/env");
            queueConnectionFactory = (QueueConnectionFactory) env.lookup("jms/QueueCF");
        } catch (NamingException e) {
            log.fatal(e);
            e.printStackTrace();
            throw new TechnicalException(e);
            throw new TechnicalException("no jms queue: jms/QueueCF",  e);
        }
    }
@@ -69,9 +62,7 @@
                Context env = (Context) ctx.lookup("java:comp/env");
                return (Queue) env.lookup("jms/" + queueName);
            } catch (NamingException e) {
                log.fatal(e);
                e.printStackTrace();
                return null;
                throw new TechnicalException("no jms queue: jms/" + queueName, e);
            }
        }
        return null;
@@ -141,7 +132,7 @@
        try {
            entityManager.getTransaction().rollback();
        } catch (IllegalStateException e) {
            log.info(e);
            // can't rollback
        }
    }
    
hsarback/src/de/hsadmin/core/qserv/QueueTask.java
@@ -3,51 +3,59 @@
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.Transient;
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.EntityInfo;
import de.hsadmin.core.model.ModuleImpl;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.mods.qstat.QTaskModuleImpl;
import de.hsadmin.mods.user.UnixUser;
@javax.persistence.Entity(name = "QueueTasks")
@javax.persistence.Table(name = "queue_task")
@javax.persistence.SequenceGenerator(name = "QueueTaskSeqGen", sequenceName = "queue_task_id_seq")
@EntityInfo(name = "Systemauftrag")
@ModuleImpl(QTaskModuleImpl.class)
@Entity(name = "QueueTasks")
@Table(name = "queue_task")
@SequenceGenerator(name = "QueueTaskSeqGen", sequenceName = "queue_task_id_seq")
@AnnModuleImpl(QTaskModuleImpl.class)
public class QueueTask extends AbstractEntity implements Serializable {
    private static final long serialVersionUID = 2171870783383767875L;
    @javax.persistence.Id
    @javax.persistence.GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "QueueTaskSeqGen")
    @javax.persistence.Column(name = "task_id", columnDefinition = "integer")
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "QueueTaskSeqGen")
    @Column(name = "task_id", columnDefinition = "integer")
    private long id;
    @javax.persistence.JoinColumn(name="user_id", columnDefinition="integer", nullable=true)
    @javax.persistence.ManyToOne(fetch=FetchType.EAGER)
    @JoinColumn(name="user_id", columnDefinition="integer", nullable=true)
    @ManyToOne(fetch=FetchType.EAGER)
    private UnixUser user;
    @javax.persistence.Column(name = "started", columnDefinition = "date")
    @javax.persistence.Temporal(javax.persistence.TemporalType.TIMESTAMP)
    @Column(name = "started", columnDefinition = "date")
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date started;
    @javax.persistence.Column(name = "finished", columnDefinition = "date", nullable = true)
    @javax.persistence.Temporal(javax.persistence.TemporalType.TIMESTAMP)
    @Column(name = "finished", columnDefinition = "date", nullable = true)
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date finished;
    @javax.persistence.Column(name = "title", columnDefinition = "character varying(192)")
    @Column(name = "title", columnDefinition = "character varying(192)")
    private String title;
    @javax.persistence.Column(name = "details", columnDefinition = "text", nullable = true)
    @Column(name = "details", columnDefinition = "text", nullable = true)
    private String details;
    private Processor proc;
    @javax.persistence.Column(name = "exception", columnDefinition = "text", nullable = true)
    @Column(name = "exception", columnDefinition = "text", nullable = true)
    private String exception;
    public QueueTask() {
@@ -136,7 +144,7 @@
     * virtual attribute done
     * @return
     */
    @javax.persistence.Transient
    @Transient
    public boolean isDone() {
        return finished != null;
    }
@@ -149,7 +157,7 @@
     * virtual attribute status
     * @return
     */
    @javax.persistence.Transient
    @Transient
    public QueueTaskStatus getStatus() {
        return isDone() ? (exception == null ? QueueTaskStatus.DONE
                : QueueTaskStatus.ERROR) : QueueTaskStatus.PENDING;
hsarback/src/de/hsadmin/mods/cust/Customer.java
@@ -23,13 +23,13 @@
import javax.persistence.Transient;
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.ModuleImpl;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.mods.pac.Pac;
import de.hsadmin.mods.user.UnixUser;
@Entity(name = "Customers")
@Table(name = "business_partner")
@ModuleImpl(de.hsadmin.mods.cust.CustomerModuleImpl.class)
@AnnModuleImpl(de.hsadmin.mods.cust.CustomerModuleImpl.class)
public class Customer extends AbstractEntity implements Serializable {
    private static final long serialVersionUID = -7450594652238392616L;
hsarback/src/de/hsadmin/mods/db/Database.java
@@ -23,7 +23,7 @@
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.AbstractModuleImpl;
import de.hsadmin.core.model.FieldValidation;
import de.hsadmin.core.model.AnnFieldValidation;
import de.hsadmin.core.model.SearchFilter;
import de.hsadmin.mods.pac.Pac;
import de.hsadmin.mods.user.UnixUser;
@@ -43,15 +43,15 @@
    @Column(name = "database_id", columnDefinition = "integer", updatable=false, insertable=false)
    private long id;
    @FieldValidation("[a-zA-Z]*")
    @AnnFieldValidation("[a-zA-Z]*")
    @Column(name = "engine", columnDefinition = "character varying(12)", updatable=false)
    private String instance;
    @FieldValidation("[a-z0-9\\_]*")
    @AnnFieldValidation("[a-z0-9\\_]*")
    @Column(name = "name", columnDefinition = "character varying(24)", updatable=false)
    private String name;
    @FieldValidation("[a-z0-9\\_]*")
    @AnnFieldValidation("[a-z0-9\\_]*")
    @Column(name = "owner", columnDefinition = "character varying(24)")
    private String owner;
@@ -59,7 +59,7 @@
    @ManyToOne(fetch = EAGER)
    private Pac pac;
    @FieldValidation("[A-Za-z0-9\\_\\-]*")
    @AnnFieldValidation("[A-Za-z0-9\\_\\-]*")
    @Column(name = "encoding", columnDefinition = "character varying(24)", updatable=false)
    private String encoding;
hsarback/src/de/hsadmin/mods/db/DatabaseUser.java
@@ -24,7 +24,7 @@
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.AbstractModuleImpl;
import de.hsadmin.core.model.FieldValidation;
import de.hsadmin.core.model.AnnFieldValidation;
import de.hsadmin.mods.pac.Pac;
import de.hsadmin.mods.user.UnixUser;
@@ -42,15 +42,15 @@
    @Column(name = "dbuser_id", columnDefinition = "integer", updatable=false, insertable=false)
    private long id;
    @FieldValidation("[a-z0-9\\_]*")
    @AnnFieldValidation("[a-z0-9\\_]*")
    @Column(name = "name", columnDefinition = "character varying(24)", updatable=false)
    private String name;
    @FieldValidation("[^']*")
    @AnnFieldValidation("[^']*")
    @Transient
    private String password;
    @FieldValidation("[a-zA-Z]*")
    @AnnFieldValidation("[a-zA-Z]*")
    @Column(name = "engine", columnDefinition = "character varying(12)", updatable=false)
    protected String instance;
hsarback/src/de/hsadmin/mods/db/MySqlDatabase.java
@@ -5,17 +5,15 @@
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import de.hsadmin.core.model.EntityInfo;
import de.hsadmin.core.model.ModuleImpl;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.core.model.SearchFilter;
import de.hsadmin.mods.pac.Pac;
@Entity(name = "MySqlDatabases")
@DiscriminatorValue("mysql")
@EntityInfo(name = "MySQL Datenbank")
@SearchFilter("obj.instance = 'mysql' AND (" + "    obj.pac = :loginUserPac OR "
        + "    obj.pac.customer.memberCode = :loginUserName )")
@ModuleImpl(de.hsadmin.mods.db.MySqlDatabaseModuleImpl.class)
@AnnModuleImpl(de.hsadmin.mods.db.MySqlDatabaseModuleImpl.class)
public class MySqlDatabase extends Database implements Serializable {
    
    private static final long serialVersionUID = 2862112440807946042L;
hsarback/src/de/hsadmin/mods/db/MySqlUser.java
@@ -5,18 +5,16 @@
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import de.hsadmin.core.model.EntityInfo;
import de.hsadmin.core.model.ModuleImpl;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.core.model.SearchFilter;
import de.hsadmin.mods.pac.Pac;
@Entity(name = "MySqlUsers")
@DiscriminatorValue("mysql")
@EntityInfo(name = "MySQL Konto")
@SearchFilter("obj.instance = 'mysql' AND ("
        + "    obj.pac = :loginUserPac OR "
        + "    obj.pac.customer.memberCode = :loginUserName )")
@ModuleImpl(de.hsadmin.mods.db.MySqlUserModuleImpl.class)
@AnnModuleImpl(de.hsadmin.mods.db.MySqlUserModuleImpl.class)
public class MySqlUser extends DatabaseUser implements Serializable {
    
    private static final long serialVersionUID = 6218494776881999478L;
hsarback/src/de/hsadmin/mods/db/PgSqlDatabase.java
@@ -5,18 +5,16 @@
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import de.hsadmin.core.model.EntityInfo;
import de.hsadmin.core.model.ModuleImpl;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.core.model.SearchFilter;
import de.hsadmin.mods.pac.Pac;
@Entity(name = "PgSqlDatabases")
@DiscriminatorValue("pgsql")
@EntityInfo(name = "PostgreSQL Datenbank")
@SearchFilter("obj.instance = 'pgsql' AND (" 
        + "    obj.pac = :loginUserPac OR "
        + "    obj.pac.customer.memberCode = :loginUserName )")
@ModuleImpl(de.hsadmin.mods.db.PgSqlDatabaseModuleImpl.class)
@AnnModuleImpl(de.hsadmin.mods.db.PgSqlDatabaseModuleImpl.class)
public class PgSqlDatabase extends Database implements Serializable {
    
    private static final long serialVersionUID = 6688358817554938015L;
hsarback/src/de/hsadmin/mods/db/PgSqlUser.java
@@ -5,17 +5,15 @@
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import de.hsadmin.core.model.EntityInfo;
import de.hsadmin.core.model.ModuleImpl;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.core.model.SearchFilter;
import de.hsadmin.mods.pac.Pac;
@Entity(name = "PgSqlUsers")
@DiscriminatorValue("pgsql")
@EntityInfo(name = "PostgreSQL Konto")
@SearchFilter("obj.instance = 'pgsql' AND (" + "    obj.pac = :loginUserPac OR "
        + "    obj.pac.customer.memberCode = :loginUserName )")
@ModuleImpl(de.hsadmin.mods.db.PgSqlUserModuleImpl.class)
@AnnModuleImpl(de.hsadmin.mods.db.PgSqlUserModuleImpl.class)
public class PgSqlUser extends DatabaseUser implements Serializable {
    private static final long serialVersionUID = -1097602753310286629L;
hsarback/src/de/hsadmin/mods/dom/Domain.java
@@ -22,14 +22,14 @@
import javax.persistence.Temporal;
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.FieldValidation;
import de.hsadmin.core.model.ModuleImpl;
import de.hsadmin.core.model.AnnFieldValidation;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.mods.user.UnixUser;
@Entity(name = "Domains")
@Table(name = "domain")
@SequenceGenerator(name = "DomainsSeqGen", sequenceName = "domain_domain_id_seq")
@ModuleImpl(de.hsadmin.mods.dom.DomainModuleImpl.class)
@AnnModuleImpl(de.hsadmin.mods.dom.DomainModuleImpl.class)
public class Domain extends AbstractEntity {
    @Id
@@ -37,7 +37,7 @@
    @GeneratedValue(strategy = SEQUENCE, generator = "DomainsSeqGen")
    private long id;
    @FieldValidation("([-a-z0-9]+\\.)+[a-z]{2,}")
    @AnnFieldValidation("([-a-z0-9]+\\.)+[a-z]{2,}")
    @Column(name = "domain_name", columnDefinition = "character varying(256)", nullable = false)
    private String name;
@@ -45,7 +45,7 @@
    @ManyToOne(fetch = EAGER)
    private UnixUser user;
    @FieldValidation("[a-z]*")
    @AnnFieldValidation("[a-z]*")
    @Column(name = "domain_status", columnDefinition = "character varying(12)", nullable = false)
    private String status;
@@ -65,7 +65,7 @@
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date until;
    @FieldValidation("[a-z0-9\\-\\.]*")
    @AnnFieldValidation("[a-z0-9\\-\\.]*")
    @Column(name = "domain_dns_master", columnDefinition = "character varying(64)")
    private String dnsMaster;
hsarback/src/de/hsadmin/mods/dom/DomainOption.java
@@ -15,7 +15,7 @@
import javax.persistence.Table;
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.FieldValidation;
import de.hsadmin.core.model.AnnFieldValidation;
import de.hsadmin.mods.user.UnixUser;
@Table(name="domain_option")
@@ -28,7 +28,7 @@
    @GeneratedValue(strategy = SEQUENCE, generator = "DomainOptionSeqGen")
    private long id;
    @FieldValidation("[a-z0-9]+")
    @AnnFieldValidation("[a-z0-9]+")
    @Column(name = "domain_option_name", columnDefinition = "character varying(256)", nullable = false)
    private String name;
hsarback/src/de/hsadmin/mods/email/EMailAddress.java
@@ -17,10 +17,9 @@
import javax.persistence.Transient;
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.EntityInfo;
import de.hsadmin.core.model.FieldValidation;
import de.hsadmin.core.model.AnnFieldValidation;
import de.hsadmin.core.model.HSAdminException;
import de.hsadmin.core.model.ModuleImpl;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.core.model.SearchFilter;
import de.hsadmin.mods.dom.Domain;
import de.hsadmin.mods.user.UnixUser;
@@ -31,11 +30,10 @@
@Entity(name = "EMailAddresses")
@Table(name = "emailaddr")
@SequenceGenerator(name = "EMailAddressesSeqGen", sequenceName = "emailaddr_emailaddr_id_seq")
@EntityInfo(name = "E-Mail-Adresse")
@SearchFilter("domain.user = :loginUser OR "
        + "domain.user.pac = :loginUserPac OR "
        + "domain.user.pac.customer.name = :loginUserName")
@ModuleImpl(de.hsadmin.mods.email.EMailAddressModuleImpl.class)
@AnnModuleImpl(de.hsadmin.mods.email.EMailAddressModuleImpl.class)
public class EMailAddress extends AbstractEntity implements Serializable {
    
    private static final long serialVersionUID = -2265500181746604429L;
@@ -45,11 +43,11 @@
    @Column(name = "emailaddr_id", columnDefinition = "integer")
    private long id;
    
    @FieldValidation("[A-Za-z0-9\\_\\-\\.\\+]*")
    @AnnFieldValidation("[A-Za-z0-9\\_\\-\\.\\+]*")
    @Column(name = "localpart", updatable = false, nullable= false)
    private String localpart = "";
    
    @FieldValidation("[a-z0-9\\-\\.]*")
    @AnnFieldValidation("[a-z0-9\\-\\.]*")
    @Column(name = "subdomain")
    private String subdomain;
    
@@ -57,7 +55,7 @@
    @JoinColumn(name = "domain_id", columnDefinition = "integer", updatable = false)
    private Domain domain;
    
    @FieldValidation("[\\x20-\\x7E]*")
    @AnnFieldValidation("[\\x20-\\x7E]*")
    @Column(name = "target", nullable= false)
    private String target;
hsarback/src/de/hsadmin/mods/email/EMailAlias.java
@@ -18,9 +18,8 @@
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.AbstractModuleImpl;
import de.hsadmin.core.model.EntityInfo;
import de.hsadmin.core.model.FieldValidation;
import de.hsadmin.core.model.ModuleImpl;
import de.hsadmin.core.model.AnnFieldValidation;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.core.model.SearchFilter;
import de.hsadmin.mods.pac.Pac;
import de.hsadmin.mods.user.UnixUser;
@@ -32,9 +31,8 @@
@javax.persistence.Entity(name = "EMailAliases")
@Table(name = "emailalias")
@SequenceGenerator(name = "EMailAliasesSeqGen", sequenceName = "emailalias_emailalias_id_seq")
@EntityInfo(name = "E-Mail-Alias")
@SearchFilter("obj.pac = :loginUserPac OR obj.pac.customer.name = :loginUserName")
@ModuleImpl(de.hsadmin.mods.email.EMailAliasModuleImpl.class)
@AnnModuleImpl(de.hsadmin.mods.email.EMailAliasModuleImpl.class)
public class EMailAlias extends AbstractEntity implements Serializable {
    
    private static final long serialVersionUID = -4711415079723587161L;
@@ -48,11 +46,11 @@
    @JoinColumn(name = "pac_id", columnDefinition = "integer")
    private Pac pac;
    @FieldValidation("[a-z0-9\\_\\-\\.\\+]*")
    @AnnFieldValidation("[a-z0-9\\_\\-\\.\\+]*")
    @Column(updatable=false)
    private String name;
    @FieldValidation("[\\x20-\\x7E]*")
    @AnnFieldValidation("[\\x20-\\x7E]*")
    @Column
    private String target;
hsarback/src/de/hsadmin/mods/pac/Pac.java
@@ -25,15 +25,14 @@
import javax.persistence.Transient;
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.EntityInfo;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.mods.cust.Customer;
import de.hsadmin.mods.user.UnixUser;
@Entity(name = "Pacs")
@Table(name = "packet")
@SequenceGenerator(name = "PacsSeqGen", sequenceName = "packet_packet_id_seq")
@EntityInfo(name = "Paket")
//@ModuleImpl(de.hsadmin.mods.pac.PacModuleImpl.class)
@AnnModuleImpl(de.hsadmin.mods.pac.PacModuleImpl.class)
public class Pac extends AbstractEntity implements Serializable {
    
    private static final long serialVersionUID = 1L;
hsarback/src/de/hsadmin/mods/user/UnixUser.java
@@ -17,17 +17,15 @@
import javax.persistence.Transient;
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.EntityInfo;
import de.hsadmin.core.model.FieldValidation;
import de.hsadmin.core.model.ModuleImpl;
import de.hsadmin.core.model.AnnFieldValidation;
import de.hsadmin.core.model.AnnModuleImpl;
import de.hsadmin.core.util.Config;
import de.hsadmin.mods.pac.Pac;
@Entity(name = "UnixUsers")
@Table(name = "unixuser")
@SequenceGenerator(name = "UnixUsersSeqGen", sequenceName = "unixuser_unixuser_id_seq")
@EntityInfo(name = "UNIX-Zugang/Mailbox")
@ModuleImpl(de.hsadmin.mods.user.UnixUserModuleImpl.class)
@AnnModuleImpl(de.hsadmin.mods.user.UnixUserModuleImpl.class)
public class UnixUser extends AbstractEntity implements Serializable {
    
    private static final long serialVersionUID = 7823071611805642906L;
@@ -41,11 +39,11 @@
    @Column(name = "userid", columnDefinition = "integer", nullable = false, updatable=false)
    private long userId;
    @FieldValidation("[a-z0-9\\_\\-\\.]*")
    @AnnFieldValidation("[a-z0-9\\_\\-\\.]*")
    @Column(name = "name", columnDefinition = "character varying(24)", unique = true, updatable=false)
    private String name;
    @FieldValidation("[^:]*")
    @AnnFieldValidation("[^:]*")
    @Transient
    private String password;
@@ -53,15 +51,15 @@
    @ManyToOne(fetch = EAGER)
    private Pac pac;
    @FieldValidation("[a-zA-Z0-9\\_\\-\\.\\,\\ ]*")
    @AnnFieldValidation("[a-zA-Z0-9\\_\\-\\.\\,\\ ]*")
    @Column(name = "comment", columnDefinition = "character varying(128)")
    private String comment;
    @FieldValidation("[a-z\\/]*")
    @AnnFieldValidation("[a-z\\/]*")
    @Column(name = "shell", columnDefinition = "character varying(32)")
    private String shell;
    @FieldValidation("[a-z0-9\\/\\_\\-\\.]*")
    @AnnFieldValidation("[a-z0-9\\/\\_\\-\\.]*")
    @Column(name = "homedir", columnDefinition = "character varying(48)", updatable=false)
    private String homedir;