1 files renamed
4 files added
33 files modified
| | |
| | | |
| | | import de.hsadmin.cliClientConnector.CLIClientConnectorServlet.FunctionNotKnownException; |
| | | import de.hsadmin.cliClientConnector.CLIClientConnectorServlet.UnknownModuleException; |
| | | import de.hsadmin.core.model.Entity; |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.core.model.ModuleInterface; |
| | | |
| | | /** |
| | |
| | | } else if( type.equals("java.util.Set") ) { |
| | | val = "<Set>"; |
| | | } else try { |
| | | Entity v = (Entity)value; |
| | | AbstractEntity v = (AbstractEntity)value; |
| | | val = v.createStringKey(); |
| | | if( deep && !foundObjects.contains(v) ) { |
| | | foundObjects.add(v); |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import de.hsadmin.core.model.Entity; |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.core.model.GenericModuleImpl; |
| | | import de.hsadmin.core.model.ModuleInterface; |
| | | import de.hsadmin.core.model.TicketAuthentication; |
| | |
| | | String kname = hasGetter(eType, k); |
| | | if (kname != null) { |
| | | rval += (first ? "" : " and ") |
| | | + "(obj." + Entity.escapeString(kname) + " = '" + Entity.escapeString(where.get(k)) + "')"; |
| | | + "(obj." + AbstractEntity.escapeString(kname) + " = '" + AbstractEntity.escapeString(where.get(k)) + "')"; |
| | | first = false; |
| | | } |
| | | } |
| | |
| | | Transaction transaction = module.getTransaction(); |
| | | transaction.beginTransaction(); |
| | | try { |
| | | Method m = module.getClass().getMethod("add", Entity.class); |
| | | Method m = module.getClass().getMethod("add", AbstractEntity.class); |
| | | Object o = cls.newInstance(); |
| | | setValues(o, set, module); |
| | | m.invoke(module, o); |
| | |
| | | } |
| | | |
| | | // / checks wheather all 'oids' are in 'list' |
| | | private void checkOids(List<Entity> list, List<String> oids) { |
| | | private void checkOids(List<AbstractEntity> list, List<String> oids) { |
| | | List<String> oidsNotFound = new ArrayList<String>(); |
| | | for (String id : oids) { |
| | | boolean found = false; |
| | | for (Entity e : list) { |
| | | for (AbstractEntity e : list) { |
| | | String foundKey = e.createStringKey(); |
| | | if (foundKey.equals(id)) { |
| | | found = true; |
| | |
| | | try { |
| | | Method m = module.getClass().getMethod("search", Class.class, |
| | | String.class, String.class); |
| | | List<Entity> list = (List<Entity>) m.invoke(module, cls, |
| | | List<AbstractEntity> list = (List<AbstractEntity>) m.invoke(module, cls, |
| | | buildQuery(cls, where, oids), null); |
| | | checkOids(list, oids); |
| | | Method m2 = module.getClass().getMethod("update", Entity.class); |
| | | Method m2 = module.getClass().getMethod("update", AbstractEntity.class); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Entity entity = list.get(i); |
| | | AbstractEntity entity = list.get(i); |
| | | tx.detach(entity); |
| | | setValues(entity, set, module); |
| | | m2.invoke(module, entity); |
| | |
| | | try { |
| | | Method m = |
| | | module.getClass().getMethod("search", Class.class, String.class, String.class); |
| | | List<Entity> list = |
| | | (List<Entity>) m.invoke(module, cls, buildQuery(cls, where, oids), null); |
| | | List<AbstractEntity> list = |
| | | (List<AbstractEntity>) m.invoke(module, cls, buildQuery(cls, where, oids), null); |
| | | checkOids(list, oids); |
| | | Method m2 = module.getClass().getMethod("delete", Entity.class); |
| | | Method m2 = module.getClass().getMethod("delete", AbstractEntity.class); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Object o = list.get(i); |
| | | m2.invoke(module, o); |
File was renamed from hsarback/src/de/hsadmin/core/model/Entity.java |
| | |
| | | |
| | | import de.hsadmin.mods.user.UnixUser; |
| | | |
| | | public abstract class Entity { |
| | | public abstract class AbstractEntity { |
| | | |
| | | /** |
| | | * trims whitespace from both ends, but a null remains null. |
| | |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public boolean sameIdAs(Entity entity) { |
| | | public boolean sameIdAs(AbstractEntity entity) { |
| | | if (entity == null) |
| | | return false; |
| | | if (getClass() != entity.getClass()) |
| | |
| | | * @param em |
| | | * @param loginUser |
| | | */ |
| | | public Entity merge(EntityManager em, UnixUser loginUser) { |
| | | public AbstractEntity merge(EntityManager em, UnixUser loginUser) { |
| | | return em.merge(this); |
| | | } |
| | | |
| | |
| | | * JBoss 5.1. |
| | | * This is just for testing, it does not use the proper class loader! |
| | | */ |
| | | public <T extends Entity> T replicate() { |
| | | public <T extends AbstractEntity> T replicate() { |
| | | try { |
| | | ByteArrayOutputStream baOut = new ByteArrayOutputStream(); |
| | | ObjectOutputStream oOut = new ObjectOutputStream(baOut); |
| | |
| | | * @return |
| | | */ |
| | | private String restrict(Class<?> entityClass, UnixUser loginUser, String condition) { |
| | | String restriction = Entity.restriction(entityClass, loginUser); |
| | | String restriction = AbstractEntity.restriction(entityClass, loginUser); |
| | | if (restriction == null) |
| | | return condition; |
| | | if (condition != null && condition.length() > 0) |
| | |
| | | return transaction; |
| | | } |
| | | |
| | | public Entity initialize(Entity newEntity) |
| | | public AbstractEntity initialize(AbstractEntity newEntity) |
| | | throws AuthorisationException { |
| | | newEntity.initialize(transaction.getEntityManager(), getLoginUser()); |
| | | return newEntity; |
| | | } |
| | | |
| | | public Entity add(Entity newEntity) throws HSAdminException { |
| | | public AbstractEntity add(AbstractEntity newEntity) throws HSAdminException { |
| | | // get the user who is logged in |
| | | UnixUser loginUser = getLoginUser(); |
| | | |
| | |
| | | return newEntity; |
| | | } |
| | | |
| | | public Entity find(Class<? extends Entity> entityClass, Object key) throws HSAdminException { |
| | | Entity entity = transaction.getEntityManager().find(entityClass, key); |
| | | public AbstractEntity find(Class<? extends AbstractEntity> entityClass, Object key) throws HSAdminException { |
| | | AbstractEntity entity = transaction.getEntityManager().find(entityClass, key); |
| | | |
| | | // check rights |
| | | UnixUser loginUser = getLoginUser(); |
| | |
| | | return entity; |
| | | } |
| | | |
| | | public Entity findByString(Class<? extends Entity> entityClass, String key) throws HSAdminException { |
| | | public AbstractEntity findByString(Class<? extends AbstractEntity> entityClass, String key) throws HSAdminException { |
| | | // find a static method which creates the query |
| | | java.lang.reflect.Method method = null; |
| | | try { |
| | |
| | | method = null; |
| | | } |
| | | |
| | | Entity entity; |
| | | AbstractEntity entity; |
| | | if (method == null) |
| | | entity = transaction.getEntityManager().find(entityClass, key); |
| | | else { |
| | |
| | | } |
| | | |
| | | // perform the query |
| | | List<Entity> result = search(entityClass, query, null); |
| | | List<AbstractEntity> result = search(entityClass, query, null); |
| | | if (result.size() > 1) |
| | | throw new javax.persistence.NonUniqueResultException(); |
| | | if (result.size() == 0) |
| | |
| | | return entity; |
| | | } |
| | | |
| | | public List<Entity> search(Class<? extends Entity> entityClass, String condition, String orderBy) throws HSAdminException { |
| | | public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass, String condition, String orderBy) throws HSAdminException { |
| | | // restrict query |
| | | UnixUser loginUser = getLoginUser(); |
| | | condition = restrict(entityClass, loginUser, condition); |
| | |
| | | |
| | | // Fix problem with queries WHERE .. AND (FALSE) -- pe |
| | | if (condition != null && condition.contains("AND (FALSE)")) { |
| | | return new LinkedList<Entity>(); |
| | | return new LinkedList<AbstractEntity>(); |
| | | } |
| | | |
| | | if (orderBy != null) { |
| | |
| | | // do query |
| | | try { |
| | | List<?> res = query.getResultList(); |
| | | List<Entity> ret = new LinkedList<Entity>(); |
| | | List<AbstractEntity> ret = new LinkedList<AbstractEntity>(); |
| | | |
| | | // remove entities where login user has no access rights |
| | | for (Object entity : res) { |
| | | if (entity instanceof Entity) { |
| | | Entity returnedEntity = (Entity) entity; |
| | | if (entity instanceof AbstractEntity) { |
| | | AbstractEntity returnedEntity = (AbstractEntity) entity; |
| | | if (returnedEntity.isReadAllowedFor(getLoginUser())) { |
| | | ret.add(returnedEntity); |
| | | } |
| | |
| | | // return clean result |
| | | return ret; |
| | | } catch (Exception ex) { |
| | | return null; |
| | | throw new HSAdminException(ex); |
| | | } |
| | | } |
| | | |
| | | public Entity update(Entity existingEntity) throws HSAdminException { |
| | | public AbstractEntity update(AbstractEntity existingEntity) throws HSAdminException { |
| | | // get the user who is logged in |
| | | UnixUser loginUser = getLoginUser(); |
| | | |
| | |
| | | return existingEntity; |
| | | } |
| | | |
| | | public void delete(Entity existingEntity) throws HSAdminException { |
| | | public void delete(AbstractEntity existingEntity) throws HSAdminException { |
| | | // get the user who is logged in |
| | | UnixUser user = getLoginUser(); |
| | | |
| | |
| | | queueProcessor(proc, user, existingEntity, "geloescht"); |
| | | } |
| | | |
| | | public EntityProcessorFactory createProcessorFactory(Class<? extends Entity> entityClass) { |
| | | public EntityProcessorFactory createProcessorFactory(Class<? extends AbstractEntity> entityClass) { |
| | | try { |
| | | String procFactName = entityClass.getCanonicalName() |
| | | + "ProcessorFactory"; |
| | |
| | | return loginUser; |
| | | } |
| | | |
| | | public void queueProcessor(Processor proc, UnixUser user, Entity entity, String action) { |
| | | public void queueProcessor(Processor proc, UnixUser user, AbstractEntity entity, String action) { |
| | | log.debug("queueing processor for user " + user.getId() + "/" |
| | | + user.getUserId() + "/" + user.getName()); |
| | | EntityInfo entityInfo = |
| | |
| | | |
| | | private UnixUser user; |
| | | private String method; |
| | | private Entity entity; |
| | | private AbstractEntity entity; |
| | | private String field; |
| | | |
| | | public UnixUser getUser() { |
| | |
| | | return method; |
| | | } |
| | | |
| | | public Entity getEntity() { |
| | | public AbstractEntity getEntity() { |
| | | return entity; |
| | | } |
| | | |
| | |
| | | this.method = method; |
| | | } |
| | | |
| | | public AuthorisationException(UnixUser user, String method, Entity entity) { |
| | | public AuthorisationException(UnixUser user, String method, AbstractEntity entity) { |
| | | super("nicht authorisiert fuer " + method + "(" |
| | | + entity.createStringKey() + ")"); |
| | | |
| | |
| | | this.entity = entity; |
| | | } |
| | | |
| | | public AuthorisationException(UnixUser user, String method, Entity entity, |
| | | public AuthorisationException(UnixUser user, String method, AbstractEntity entity, |
| | | String field) { |
| | | super("nicht authorisiert fuer " + method + "(" |
| | | + entity.createStringKey() + "." + field + ")"); |
| | |
| | | * @param entityClass |
| | | * @return |
| | | */ |
| | | public static AbstractModuleImpl createEntitySessionWrapper(Class<? extends Entity> entityClass) { |
| | | public static AbstractModuleImpl createEntitySessionWrapper(Class<? extends AbstractEntity> entityClass) { |
| | | // get in instance |
| | | AbstractModuleImpl impl = null; |
| | | try { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Entity initialize(Entity newEntity) throws HSAdminException { |
| | | public AbstractEntity initialize(AbstractEntity newEntity) throws HSAdminException { |
| | | log.trace("initialize(" + newEntity + ")"); |
| | | AbstractModuleImpl wrapper = |
| | | EntitySessionHelper.createEntitySessionWrapper(newEntity.getClass()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Entity add(Entity newEntity) throws HSAdminException { |
| | | public AbstractEntity add(AbstractEntity newEntity) throws HSAdminException { |
| | | if (!newEntity.isNew()) |
| | | throw new HSAdminException("cannot add an already persistent entity"); |
| | | log.trace("add(" + newEntity + ")"); |
| | | AbstractModuleImpl wrapper = |
| | | EntitySessionHelper.createEntitySessionWrapper(newEntity.getClass()); |
| | | wrapper.construct(tx); |
| | | Entity result = null; |
| | | AbstractEntity result = null; |
| | | try { |
| | | result = wrapper.add(newEntity); |
| | | return result; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Entity find(Class<? extends Entity> entityClass, Object key) throws HSAdminException { |
| | | public AbstractEntity find(Class<? extends AbstractEntity> entityClass, Object key) throws HSAdminException { |
| | | log.trace("find(" + entityClass + ", " + key + ")"); |
| | | AbstractModuleImpl wrapper = EntitySessionHelper.createEntitySessionWrapper(entityClass); |
| | | wrapper.construct(tx); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Entity findByString(Class<? extends Entity> entityClass, String key) throws HSAdminException { |
| | | public AbstractEntity findByString(Class<? extends AbstractEntity> entityClass, String key) throws HSAdminException { |
| | | log.trace("find(" + entityClass + ", " + key + ")"); |
| | | AbstractModuleImpl wrapper = EntitySessionHelper.createEntitySessionWrapper(entityClass); |
| | | wrapper.construct(tx); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Entity> search(Class<? extends Entity> entityClass, String condition, String orderBy) throws HSAdminException { |
| | | public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass, String condition, String orderBy) throws HSAdminException { |
| | | log.trace("search(" + entityClass + ", " + condition + ")"); |
| | | AbstractModuleImpl wrapper = EntitySessionHelper.createEntitySessionWrapper(entityClass); |
| | | wrapper.construct(tx); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Entity update(Entity existingEntity) throws HSAdminException { |
| | | public AbstractEntity update(AbstractEntity existingEntity) throws HSAdminException { |
| | | if (existingEntity.isNew()) |
| | | return add(existingEntity); |
| | | log.debug("update(" + existingEntity + ")"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Entity existingEntity) throws HSAdminException { |
| | | public void delete(AbstractEntity existingEntity) throws HSAdminException { |
| | | log.trace("delete(" + existingEntity + ")"); |
| | | AbstractModuleImpl wrapper = |
| | | EntitySessionHelper.createEntitySessionWrapper(existingEntity.getClass()); |
| | |
| | | /** |
| | | * initializes a newly created entity. |
| | | */ |
| | | public Entity initialize(Entity newEntity) throws HSAdminException; |
| | | public AbstractEntity initialize(AbstractEntity newEntity) throws HSAdminException; |
| | | |
| | | /** |
| | | * Adds a new entity instance to the model. |
| | | */ |
| | | public Entity add(Entity newEntity) throws HSAdminException; |
| | | public AbstractEntity add(AbstractEntity newEntity) throws HSAdminException; |
| | | |
| | | /** |
| | | * Finds an entity instance in the model, using its primary key. |
| | | */ |
| | | public Entity find(Class<? extends Entity> entityClass, Object key) throws HSAdminException; |
| | | public AbstractEntity find(Class<? extends AbstractEntity> entityClass, Object key) throws HSAdminException; |
| | | |
| | | /** |
| | | * Finds an entity instance in the model, using its primary key in a String |
| | | * representation. |
| | | */ |
| | | public Entity findByString(Class<? extends Entity> entityClass, String key) throws HSAdminException; |
| | | public AbstractEntity findByString(Class<? extends AbstractEntity> entityClass, String key) throws HSAdminException; |
| | | |
| | | /** |
| | | * Searches entity instances in the model, using a simplified JPA-QL query. |
| | | */ |
| | | public List<Entity> search(Class<? extends Entity> entityClass, String query, String orderBy) throws HSAdminException; |
| | | public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass, String query, String orderBy) throws HSAdminException; |
| | | |
| | | /** |
| | | * Updates an existing entity in the model. |
| | | */ |
| | | public Entity update(Entity existingEntity) throws HSAdminException; |
| | | public AbstractEntity update(AbstractEntity existingEntity) throws HSAdminException; |
| | | |
| | | /** |
| | | * Deletes an existing entity from the model. |
| | | */ |
| | | public void delete(Entity existingEntity) throws HSAdminException; |
| | | public void delete(AbstractEntity existingEntity) throws HSAdminException; |
| | | |
| | | } |
| | |
| | | private static final long serialVersionUID = 4567381515459292565L; |
| | | |
| | | @Override |
| | | public Entity initialize(Entity newEntity) throws AuthorisationException { |
| | | public AbstractEntity initialize(AbstractEntity newEntity) throws AuthorisationException { |
| | | return super.initialize(newEntity); |
| | | } |
| | | |
| | | @Override |
| | | public Entity find(Class<? extends Entity> entityClass, Object key) throws HSAdminException { |
| | | Entity entity = super.find(entityClass, key); |
| | | public AbstractEntity find(Class<? extends AbstractEntity> entityClass, Object key) throws HSAdminException { |
| | | AbstractEntity entity = super.find(entityClass, key); |
| | | if (entity != null && !entity.isReadAllowedFor(getLoginUser())) |
| | | throw new AuthorisationException(getLoginUser(), "find"); |
| | | return entity; |
| | | } |
| | | |
| | | @Override |
| | | public Entity findByString(Class<? extends Entity> entityClass, String key) throws HSAdminException { |
| | | Entity entity = super.findByString(entityClass, key); |
| | | public AbstractEntity findByString(Class<? extends AbstractEntity> entityClass, String key) throws HSAdminException { |
| | | AbstractEntity entity = super.findByString(entityClass, key); |
| | | if (entity != null && !entity.isReadAllowedFor(getLoginUser())) |
| | | throw new AuthorisationException(getLoginUser(), "findByString"); |
| | | return entity; |
| | | } |
| | | |
| | | @Override |
| | | public List<Entity> search(Class<? extends Entity> entityClass, String condition, String orderBy) |
| | | public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass, String condition, String orderBy) |
| | | throws HSAdminException { |
| | | // restrict query to entities where the loginUser could have rights on |
| | | SearchFilter filterAnnot; |
| | |
| | | } |
| | | |
| | | // do query |
| | | List<Entity> res = super.search(entityClass, condition, orderBy); |
| | | List<Entity> ret = new LinkedList<Entity>(); |
| | | List<AbstractEntity> res = super.search(entityClass, condition, orderBy); |
| | | List<AbstractEntity> ret = new LinkedList<AbstractEntity>(); |
| | | |
| | | // remove entities where login user has no access rights |
| | | if (res != null) { |
| | | for (Entity entity : res) { |
| | | Entity returnedEntity = entity; |
| | | for (AbstractEntity entity : res) { |
| | | AbstractEntity returnedEntity = entity; |
| | | if (returnedEntity.isReadAllowedFor(getLoginUser())) |
| | | ret.add(returnedEntity); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Entity add(Entity newEntity) throws HSAdminException { |
| | | public AbstractEntity add(AbstractEntity newEntity) throws HSAdminException { |
| | | // access rights checking is done by base class |
| | | return super.add(newEntity); |
| | | } |
| | | |
| | | @Override |
| | | public Entity update(Entity existingEntity) throws HSAdminException { |
| | | public AbstractEntity update(AbstractEntity existingEntity) throws HSAdminException { |
| | | // access rights checking is done by base class |
| | | return super.update(existingEntity); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Entity detachedEntity) throws HSAdminException { |
| | | public void delete(AbstractEntity detachedEntity) throws HSAdminException { |
| | | // get the entity from the database |
| | | Entity attachedEntity = getTransaction().getEntityManager().find(detachedEntity.getClass(), |
| | | AbstractEntity attachedEntity = getTransaction().getEntityManager().find(detachedEntity.getClass(), |
| | | detachedEntity.id()); |
| | | |
| | | // does the login user have the right to delete? |
| | |
| | | * Used to detach entities before update. Makes it possible to compare |
| | | * old and new attribute values. |
| | | */ |
| | | public void detach(Entity entity) { |
| | | public void detach(AbstractEntity entity) { |
| | | // TODO: replace hibernate specific implmentation |
| | | // org.hibernate.Session hSession = (Session) entityManager.getDelegate(); |
| | | // hSession.evict(entity); |
| | |
| | | |
| | | private Map<String, EntityManagerFactory> persistenceUnits; |
| | | |
| | | public static EntityManager getEntityManager(String persistUnitName) { |
| | | EntityManagerFactory emf = PersistenceManager.getInstance().getEMF(persistUnitName); |
| | | return emf.createEntityManager(); |
| | | } |
| | | |
| | | public static void close() { |
| | | getInstance().closeFactories(); |
| | | } |
| | | |
| | | private PersistenceManager() { |
| | | persistenceUnits = new HashMap<String, EntityManagerFactory>(); |
| | | } |
| | |
| | | return emf; |
| | | } |
| | | |
| | | public static EntityManager getEntityManager(String persistUnitName) { |
| | | PersistenceManager pm = PersistenceManager.getInstance(); |
| | | EntityManagerFactory emf = pm.getEMF(persistUnitName); |
| | | return emf.createEntityManager(); |
| | | } |
| | | |
| | | private static PersistenceManager getInstance() { |
| | | if (instance == null) { |
| | | instance = new PersistenceManager(); |
| | | } |
| | | return instance; |
| | | } |
| | | |
| | | |
| | | |
| | | private void closeFactories() { |
| | | for (String puName : persistenceUnits.keySet()) { |
| | | System.out.println("Persistence Unit: " + puName); |
| | | EntityManagerFactory emf = persistenceUnits.get(puName); |
| | | emf.close(); |
| | | persistenceUnits.remove(puName); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package de.hsadmin.core.model.onetier; |
| | | |
| | | import javax.servlet.ServletContextEvent; |
| | | import javax.servlet.ServletContextListener; |
| | | |
| | | public class PersistenceManagerContextListener implements ServletContextListener { |
| | | |
| | | public PersistenceManagerContextListener() { |
| | | } |
| | | |
| | | @Override |
| | | public void contextDestroyed(ServletContextEvent contextEvent) { |
| | | System.out.println("PersistenceManager.contextDestroyed()"); |
| | | PersistenceManager.close(); |
| | | } |
| | | |
| | | @Override |
| | | public void contextInitialized(ServletContextEvent contextEvent) { |
| | | // do nothing |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import javax.persistence.EntityManager; |
| | | |
| | | import de.hsadmin.core.model.Entity; |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | |
| | | /** |
| | | * Most processor factories need only these methods. |
| | |
| | | * @author peter |
| | | */ |
| | | public interface EntityProcessorFactory { |
| | | public <T extends Entity> Processor createCreateProcessor(EntityManager em, |
| | | public <T extends AbstractEntity> Processor createCreateProcessor(EntityManager em, |
| | | T entity) throws ProcessorException; |
| | | |
| | | public <T extends Entity> Processor createUpdateProcessor(EntityManager em, |
| | | public <T extends AbstractEntity> Processor createUpdateProcessor(EntityManager em, |
| | | T newEntity) throws ProcessorException; |
| | | |
| | | public <T extends Entity> Processor createDeleteProcessor(EntityManager em, |
| | | public <T extends AbstractEntity> Processor createDeleteProcessor(EntityManager em, |
| | | T entity) throws ProcessorException; |
| | | |
| | | } |
| | |
| | | import javax.persistence.FetchType; |
| | | import javax.persistence.GenerationType; |
| | | |
| | | import de.hsadmin.core.model.Entity; |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.core.model.EntityInfo; |
| | | import de.hsadmin.core.model.ModuleImpl; |
| | | import de.hsadmin.mods.qstat.QTaskModuleImpl; |
| | |
| | | @javax.persistence.SequenceGenerator(name = "QueueTaskSeqGen", sequenceName = "queue_task_id_seq") |
| | | @EntityInfo(name = "Systemauftrag") |
| | | @ModuleImpl(QTaskModuleImpl.class) |
| | | public class QueueTask extends Entity implements Serializable { |
| | | public class QueueTask extends AbstractEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 2171870783383767875L; |
| | | |
| | |
| | | |
| | | import static javax.persistence.FetchType.EAGER; |
| | | |
| | | import javax.persistence.EntityManager; |
| | | import java.io.Serializable; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.EntityManager; |
| | | import javax.persistence.GeneratedValue; |
| | | import javax.persistence.GenerationType; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.JoinColumn; |
| | | import javax.persistence.OneToOne; |
| | | import javax.persistence.Table; |
| | | |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.mods.user.UnixUser; |
| | | |
| | | @javax.persistence.Entity(name = "BankAccounts") |
| | | @javax.persistence.Table(name = "bank_account") |
| | | public class BankAccount extends de.hsadmin.core.model.Entity implements |
| | | java.io.Serializable { |
| | | @Entity(name = "BankAccounts") |
| | | @Table(name = "bank_account") |
| | | public class BankAccount extends AbstractEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 2965368183976686458L; |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | @Column(name = "bank_account_id", columnDefinition = "integer") |
| | | private long id; |
| | | |
| | | @JoinColumn(name = "bp_id", columnDefinition = "integer") |
| | | @OneToOne(fetch = EAGER) |
| | | private Customer customer; |
| | | |
| | | @Column(name = "autodebit_ga", columnDefinition = "boolean", nullable = true) |
| | | private Boolean autoDebitGA; |
| | | |
| | | @Column(name = "autodebit_ar", columnDefinition = "boolean", nullable = true) |
| | | private Boolean autoDebitAR; |
| | | |
| | | @Column(name = "autodebit_op", columnDefinition = "boolean", nullable = true) |
| | | private Boolean autoDebitOP; |
| | | |
| | | @Column(name = "bank_customer", columnDefinition = "character varying(50)", nullable = true) |
| | | private String bankCustomer; |
| | | |
| | | @Column(name = "bank_account", columnDefinition = "character varying(10)", nullable = true) |
| | | private String bankAccount; |
| | | |
| | | @Column(name = "bank_code", columnDefinition = "character varying(8)", nullable = true) |
| | | private String bankCode; |
| | | |
| | | @Column(name = "bank_name", columnDefinition = "character varying(50)", nullable = true) |
| | | private String bankName; |
| | | |
| | | public static String createQueryFromStringKey(String humanKey) { |
| | | return "customer.name = " + humanKey; |
| | |
| | | return id; |
| | | } |
| | | |
| | | // attribute id |
| | | @javax.persistence.Id |
| | | @javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.SEQUENCE) |
| | | @javax.persistence.SequenceGenerator(name = "bank_account_id_seq_gen", sequenceName = "bank_account_bank_account_i_seq", allocationSize = 20) |
| | | @javax.persistence.Column(name = "bank_account_id", columnDefinition = "integer") |
| | | private long id; |
| | | |
| | | public long getId() { |
| | | return id; |
| | | } |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | // attribute customer |
| | | @javax.persistence.JoinColumn(name = "bp_id", columnDefinition = "integer") |
| | | @javax.persistence.OneToOne(fetch = EAGER) |
| | | private Customer customer; |
| | | |
| | | public Customer getCustomer() { |
| | | return customer; |
| | | } |
| | |
| | | public void setCustomer(Customer customer) { |
| | | this.customer = customer; |
| | | } |
| | | |
| | | // attribute autoDebitGA |
| | | @javax.persistence.Column(name = "autodebit_ga", columnDefinition = "boolean", nullable = true) |
| | | private Boolean autoDebitGA; |
| | | |
| | | public Boolean isAutoDebitGA() { |
| | | return autoDebitGA; |
| | |
| | | this.autoDebitGA = autoDebitGA; |
| | | } |
| | | |
| | | // attribute autoDebitAR |
| | | @javax.persistence.Column(name = "autodebit_ar", columnDefinition = "boolean", nullable = true) |
| | | private Boolean autoDebitAR; |
| | | |
| | | public Boolean isAutoDebitAR() { |
| | | return autoDebitAR; |
| | | } |
| | |
| | | public void setAutoDebitAR(Boolean autoDebitAR) { |
| | | this.autoDebitAR = autoDebitAR; |
| | | } |
| | | |
| | | // attribute autoDebitOP |
| | | @javax.persistence.Column(name = "autodebit_op", columnDefinition = "boolean", nullable = true) |
| | | private Boolean autoDebitOP; |
| | | |
| | | public Boolean isAutoDebitOP() { |
| | | return autoDebitOP; |
| | |
| | | this.autoDebitOP = autoDebitOP; |
| | | } |
| | | |
| | | // attribute bankCustomer |
| | | @javax.persistence.Column(name = "bank_customer", columnDefinition = "character varying(50)", nullable = true) |
| | | private String bankCustomer; |
| | | |
| | | public String getBankCustomer() { |
| | | return bankCustomer; |
| | | } |
| | |
| | | public void setBankCustomer(String bankCustomer) { |
| | | this.bankCustomer = bankCustomer; |
| | | } |
| | | |
| | | // attribute bankAccount |
| | | @javax.persistence.Column(name = "bank_account", columnDefinition = "character varying(10)", nullable = true) |
| | | private String bankAccount; |
| | | |
| | | public String getBankAccount() { |
| | | return bankAccount; |
| | |
| | | this.bankAccount = bankAccount; |
| | | } |
| | | |
| | | // attribute bankCode |
| | | @javax.persistence.Column(name = "bank_code", columnDefinition = "character varying(8)", nullable = true) |
| | | private String bankCode; |
| | | |
| | | public String getBankCode() { |
| | | return bankCode; |
| | | } |
| | |
| | | public void setBankCode(String bankCode) { |
| | | this.bankCode = bankCode; |
| | | } |
| | | |
| | | // attribute bankName |
| | | @javax.persistence.Column(name = "bank_name", columnDefinition = "character varying(50)", nullable = true) |
| | | private String bankName; |
| | | |
| | | public String getBankName() { |
| | | return bankName; |
| | |
| | | this.bankName = bankName; |
| | | } |
| | | |
| | | // / {$inheritDoc} |
| | | @Override |
| | | public boolean isNew() { |
| | | return id == 0; |
| | | } |
| | | |
| | | // / {@inheritDoc} |
| | | @Override |
| | | public UnixUser owningUser(EntityManager em) { |
| | | return customer.owningUser(em); |
| | |
| | | package de.hsadmin.mods.cust; |
| | | |
| | | import static javax.persistence.FetchType.EAGER; |
| | | import static javax.persistence.GenerationType.SEQUENCE; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | import javax.persistence.EntityManager; |
| | | import javax.persistence.GenerationType; |
| | | |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.mods.user.UnixUser; |
| | | |
| | | @javax.persistence.Entity(name = "Contacts") |
| | | @javax.persistence.Table(name = "contact") |
| | | @javax.persistence.SequenceGenerator(name = "ContactsSeqGen", sequenceName = "contact_contact_id_seq") |
| | | public class Contact extends de.hsadmin.core.model.Entity implements |
| | | java.io.Serializable { |
| | | public class Contact extends AbstractEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 9119607911598098558L; |
| | | |
| | | // attribute id |
| | | @javax.persistence.Id |
| | | @javax.persistence.GeneratedValue(strategy = SEQUENCE, generator = "ContactsSeqGen") |
| | | @javax.persistence.GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | @javax.persistence.Column(name = "contact_id", columnDefinition = "integer") |
| | | private long id; |
| | | |
| | | // attribute customer |
| | | @javax.persistence.JoinColumn(name = "bp_id", columnDefinition = "integer") |
| | | @javax.persistence.ManyToOne(fetch = EAGER) |
| | | private Customer customer; |
| | | |
| | | // attribute salut |
| | | @javax.persistence.Column(name = "salut", columnDefinition = "character varying(30)") |
| | | private String salut; |
| | | |
| | | // attribute firstName |
| | | @javax.persistence.Column(name = "first_name", columnDefinition = "character varying(40)") |
| | | private String firstName; |
| | | |
| | | // attribute lastName |
| | | @javax.persistence.Column(name = "last_name", columnDefinition = "character varying(40)") |
| | | private String lastName; |
| | | |
| | | // attribute title |
| | | @javax.persistence.Column(name = "title", columnDefinition = "character varying(20)") |
| | | private String title; |
| | | |
| | | // attribute firma |
| | | @javax.persistence.Column(name = "firma", columnDefinition = "character varying(120)") |
| | | private String firma; |
| | | |
| | | // attribute co |
| | | @javax.persistence.Column(name = "co", columnDefinition = "character varying(50)") |
| | | private String co; |
| | | |
| | | // attribute street |
| | | @javax.persistence.Column(name = "street", columnDefinition = "character varying(50)") |
| | | private String street; |
| | | |
| | | // attribute zipCode |
| | | @javax.persistence.Column(name = "zipcode", columnDefinition = "character varying(10)") |
| | | private String zipCode; |
| | | |
| | | // attribute city |
| | | @javax.persistence.Column(name = "city", columnDefinition = "character varying(40)") |
| | | private String city; |
| | | |
| | | // attribute country |
| | | @javax.persistence.Column(name = "country", columnDefinition = "character varying(30)") |
| | | private String country; |
| | | |
| | | // attribute phonePrivate |
| | | @javax.persistence.Column(name = "phone_private", columnDefinition = "character varying(30)") |
| | | private String phonePrivate; |
| | | |
| | | // attribute phoneOffice |
| | | @javax.persistence.Column(name = "phone_office", columnDefinition = "character varying(30)") |
| | | private String phoneOffice; |
| | | |
| | | // attribute phoneMobile |
| | | @javax.persistence.Column(name = "phone_mobile", columnDefinition = "character varying(30)") |
| | | private String phoneMobile; |
| | | |
| | | // attribute fax |
| | | @javax.persistence.Column(name = "fax", columnDefinition = "character varying(30)") |
| | | private String fax; |
| | | |
| | | // attribute email |
| | | @javax.persistence.Column(name = "email", columnDefinition = "character varying(50)") |
| | | private String email; |
| | | |
| | |
| | | this.email = email; |
| | | } |
| | | |
| | | // / {@inheritDoc} |
| | | public static String createQueryFromStringKey(String humanKey) { |
| | | return "name='" + humanKey + "'"; |
| | | } |
| | | |
| | | // / {@inheritDoc} |
| | | @Override |
| | | public String createStringKey() { |
| | | return getCustomer().getName(); |
| | | } |
| | | |
| | | // / {@inheritDoc} |
| | | @Override |
| | | public long id() { |
| | | return id; |
| | |
| | | this.email = email; |
| | | } |
| | | |
| | | // / {$inheritDoc} |
| | | @Override |
| | | public boolean isNew() { |
| | | return id == 0; |
| | | } |
| | | |
| | | // / {@inheritDoc} |
| | | @Override |
| | | public UnixUser owningUser(EntityManager em) { |
| | | return null; // TODO: no access yet |
| | |
| | | import static javax.persistence.CascadeType.ALL; |
| | | import static javax.persistence.FetchType.EAGER; |
| | | import static javax.persistence.FetchType.LAZY; |
| | | import static javax.persistence.GenerationType.SEQUENCE; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.EntityManager; |
| | | import javax.persistence.GeneratedValue; |
| | | import javax.persistence.GenerationType; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.OneToMany; |
| | | import javax.persistence.OneToOne; |
| | | import javax.persistence.OrderBy; |
| | | import javax.persistence.Table; |
| | | import javax.persistence.Temporal; |
| | | |
| | | import de.hsadmin.mods.pac.Pac; |
| | | import de.hsadmin.mods.user.UnixUser; |
| | | |
| | | @javax.persistence.Entity(name = "Customers") |
| | | @javax.persistence.Table(name = "business_partner") |
| | | @javax.persistence.SequenceGenerator(name = "CustomersSeqGen", sequenceName = "business_partner_bp_id_seq") |
| | | public class Customer extends de.hsadmin.core.model.Entity implements Serializable { |
| | | @Entity(name = "Customers") |
| | | @Table(name = "business_partner") |
| | | public class Customer extends de.hsadmin.core.model.AbstractEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -7450594652238392616L; |
| | | |
| | | @javax.persistence.Id |
| | | @javax.persistence.GeneratedValue(strategy = SEQUENCE, generator = "CustomersSeqGen") |
| | | @javax.persistence.Column(name = "bp_id", columnDefinition = "integer") |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | @Column(name = "bp_id", columnDefinition = "integer") |
| | | private long id; |
| | | |
| | | @javax.persistence.Column(name = "member_id", columnDefinition = "integer") |
| | | @Column(name = "member_id", columnDefinition = "integer") |
| | | private int memberNo; |
| | | |
| | | @javax.persistence.Column(name = "member_code", columnDefinition = "character varying(20)") |
| | | @Column(name = "member_code", columnDefinition = "character varying(20)") |
| | | private String name; |
| | | |
| | | @javax.persistence.Column(name = "member_since", columnDefinition = "date", nullable = true) |
| | | @Column(name = "member_since", columnDefinition = "date", nullable = true) |
| | | private Date memberSince; |
| | | |
| | | @javax.persistence.Column(name = "member_until", columnDefinition = "date", nullable = true) |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | @Column(name = "member_until", columnDefinition = "date", nullable = true) |
| | | @Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date memberUntil; |
| | | |
| | | @javax.persistence.Column(name = "member_role", columnDefinition = "character varying(100)", nullable = true) |
| | | @Column(name = "member_role", columnDefinition = "character varying(100)", nullable = true) |
| | | private String memberRole; |
| | | |
| | | @javax.persistence.Column(name = "author_contract", columnDefinition = "date", nullable = true) |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | @Column(name = "author_contract", columnDefinition = "date", nullable = true) |
| | | @Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date authorContract; |
| | | |
| | | @javax.persistence.Column(name = "nondisc_contract", columnDefinition = "date", nullable = true) |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | @Column(name = "nondisc_contract", columnDefinition = "date", nullable = true) |
| | | @Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date nonDiscContract; |
| | | |
| | | @javax.persistence.Column(name = "shares_updated", columnDefinition = "date", nullable = true) |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | @Column(name = "shares_updated", columnDefinition = "date", nullable = true) |
| | | @Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date sharesUpdated; |
| | | |
| | | @javax.persistence.Column(name = "shares_signed", columnDefinition = "integer") |
| | | @Column(name = "shares_signed", columnDefinition = "integer") |
| | | private int sharesSigned; |
| | | |
| | | @javax.persistence.Column(name = "uid_vat", columnDefinition = "character varying(20)", nullable = true) |
| | | @Column(name = "uid_vat", columnDefinition = "character varying(20)", nullable = true) |
| | | private String uidVAT; |
| | | |
| | | @javax.persistence.OneToMany(fetch = EAGER, cascade = ALL, mappedBy = "customer") |
| | | @OneToMany(fetch = EAGER, cascade = ALL, mappedBy = "customer") |
| | | private Set<Contact> contacts; |
| | | |
| | | // virtual attribute bankAccount |
| | | @javax.persistence.OneToOne(fetch = EAGER, cascade = ALL, mappedBy = "customer") |
| | | @OneToOne(fetch = EAGER, cascade = ALL, mappedBy = "customer") |
| | | private BankAccount bankAccount; |
| | | |
| | | // virtual attribute billData |
| | | @javax.persistence.OneToOne(fetch = EAGER, cascade = ALL, mappedBy = "customer") |
| | | @OneToOne(fetch = EAGER, cascade = ALL, mappedBy = "customer") |
| | | private CustomersTariff billData; |
| | | |
| | | // virtual attribute pacs |
| | | @javax.persistence.OneToMany(fetch = LAZY, cascade = ALL, mappedBy = "customer") |
| | | @javax.persistence.OrderBy("name") |
| | | @OneToMany(fetch = LAZY, cascade = ALL, mappedBy = "customer") |
| | | @OrderBy("name") |
| | | private Set<Pac> pacs; |
| | | |
| | | public Customer() { |
| | |
| | | } |
| | | |
| | | public static String restriction() { |
| | | return "name=:loginUserName"; |
| | | return "obj.name=:loginUserName"; |
| | | } |
| | | } |
New file |
| | |
| | | package de.hsadmin.mods.cust; |
| | | |
| | | import de.hsadmin.core.model.AbstractModuleImpl; |
| | | |
| | | public class CustomerModuleImpl extends AbstractModuleImpl { |
| | | |
| | | } |
| | |
| | | package de.hsadmin.mods.cust; |
| | | |
| | | import static javax.persistence.FetchType.EAGER; |
| | | import static javax.persistence.GenerationType.SEQUENCE; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import javax.persistence.EntityManager; |
| | | import javax.persistence.GenerationType; |
| | | |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.mods.user.UnixUser; |
| | | |
| | | @javax.persistence.Entity(name = "CustomersTariffs") |
| | | @javax.persistence.Table(name = "billdata") |
| | | @javax.persistence.SequenceGenerator(name = "CustomersTariffsSeqGen", sequenceName = "billdata_billdata_id_seq") |
| | | public class CustomersTariff extends de.hsadmin.core.model.Entity implements |
| | | java.io.Serializable { |
| | | public class CustomersTariff extends AbstractEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -3628577459027111705L; |
| | | |
| | | // / bean ctor |
| | | @javax.persistence.Id |
| | | @javax.persistence.GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | @javax.persistence.Column(name = "billdata_id", columnDefinition = "integer") |
| | | private long id; |
| | | |
| | | @javax.persistence.JoinColumn(name = "bp_id", columnDefinition = "integer") |
| | | @javax.persistence.OneToOne(fetch = EAGER) |
| | | private Customer customer; |
| | | |
| | | @javax.persistence.Column(name = "tariff_domain_discount_since", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date domainDiscountSince; |
| | | |
| | | @javax.persistence.Column(name = "tariff_domain_discount_until", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date domainDiscountUntil; |
| | | |
| | | @javax.persistence.Column(name = "tariff_traffic_discount_since", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date trafficDiscountSince; |
| | | |
| | | @javax.persistence.Column(name = "tariff_traffic_discount_until", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date trafficDiscountUntil; |
| | | |
| | | @javax.persistence.Column(name = "tariff_quota_discount_since", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date quotaDiscountSince; |
| | | |
| | | @javax.persistence.Column(name = "tariff_quota_discount_until", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date quotaDiscountUntil; |
| | | |
| | | @javax.persistence.Column(name = "tariff_discount_since", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date discountSince; |
| | | |
| | | @javax.persistence.Column(name = "tariff_discount_until", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date discountUntil; |
| | | |
| | | public CustomersTariff() { |
| | | } |
| | | |
| | |
| | | this.customer = cust; |
| | | } |
| | | |
| | | // / {@inheritDoc} |
| | | public static String createQueryFromStringKey(String humanKey) { |
| | | return "customer.name = '" + humanKey + "'"; |
| | | } |
| | | |
| | | // / {@inheritDoc} |
| | | @Override |
| | | public String createStringKey() { |
| | | return getCustomer().getName(); |
| | | } |
| | | |
| | | // / {@inheritDoc} |
| | | @Override |
| | | public long id() { |
| | | return id; |
| | | } |
| | | |
| | | // attribute id |
| | | @javax.persistence.Id |
| | | @javax.persistence.GeneratedValue(strategy = SEQUENCE, generator = "CustomersTariffsSeqGen") |
| | | @javax.persistence.Column(name = "billdata_id", columnDefinition = "integer") |
| | | private long id; |
| | | |
| | | public long getId() { |
| | | return id; |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | // attribute customer |
| | | @javax.persistence.JoinColumn(name = "bp_id", columnDefinition = "integer") |
| | | @javax.persistence.OneToOne(fetch = EAGER) |
| | | // TODO: das will ich gar nicht, geht aber nicht ohne?!? |
| | | private Customer customer; |
| | | |
| | | public Customer getCustomer() { |
| | | return customer; |
| | | } |
| | |
| | | public void setCustomer(Customer customer) { |
| | | this.customer = customer; |
| | | } |
| | | |
| | | // attribute domainDiscountSince |
| | | @javax.persistence.Column(name = "tariff_domain_discount_since", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date domainDiscountSince; |
| | | |
| | | public Date getDomainDiscountSince() { |
| | | return domainDiscountSince; |
| | |
| | | this.domainDiscountSince = domainDiscountSince; |
| | | } |
| | | |
| | | // attribute domainDiscountUntil |
| | | @javax.persistence.Column(name = "tariff_domain_discount_until", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date domainDiscountUntil; |
| | | |
| | | public Date getDomainDiscountUntil() { |
| | | return domainDiscountUntil; |
| | | } |
| | |
| | | public void setDomainDiscountUntil(Date domainDiscountUntil) { |
| | | this.domainDiscountUntil = domainDiscountUntil; |
| | | } |
| | | |
| | | // attribute trafficDiscountSince |
| | | @javax.persistence.Column(name = "tariff_traffic_discount_since", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date trafficDiscountSince; |
| | | |
| | | public Date getTrafficDiscountSince() { |
| | | return trafficDiscountSince; |
| | |
| | | this.trafficDiscountSince = trafficDiscountSince; |
| | | } |
| | | |
| | | // attribute trafficDiscountUntil |
| | | @javax.persistence.Column(name = "tariff_traffic_discount_until", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date trafficDiscountUntil; |
| | | |
| | | public Date getTrafficDiscountUntil() { |
| | | return trafficDiscountUntil; |
| | | } |
| | |
| | | public void setTrafficDiscountUntil(Date trafficDiscountUntil) { |
| | | this.trafficDiscountUntil = trafficDiscountUntil; |
| | | } |
| | | |
| | | // attribute quotaDiscountSince |
| | | @javax.persistence.Column(name = "tariff_quota_discount_since", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date quotaDiscountSince; |
| | | |
| | | public Date getQuotaDiscountSince() { |
| | | return quotaDiscountSince; |
| | |
| | | this.quotaDiscountSince = quotaDiscountSince; |
| | | } |
| | | |
| | | // attribute quotaDiscountUntil |
| | | @javax.persistence.Column(name = "tariff_quota_discount_until", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date quotaDiscountUntil; |
| | | |
| | | public Date getQuotaDiscountUntil() { |
| | | return quotaDiscountUntil; |
| | | } |
| | |
| | | public void setQuotaDiscountUntil(Date quotaDiscountUntil) { |
| | | this.quotaDiscountUntil = quotaDiscountUntil; |
| | | } |
| | | |
| | | // attribute discountSince |
| | | @javax.persistence.Column(name = "tariff_discount_since", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date discountSince; |
| | | |
| | | public Date getDiscountSince() { |
| | | return discountSince; |
| | |
| | | this.discountSince = discountSince; |
| | | } |
| | | |
| | | // attribute discountUntil |
| | | @javax.persistence.Column(name = "tariff_discount_until", columnDefinition = "date") |
| | | @javax.persistence.Temporal(javax.persistence.TemporalType.DATE) |
| | | private Date discountUntil; |
| | | |
| | | public Date getDiscountUntil() { |
| | | return discountUntil; |
| | | } |
| | |
| | | this.discountUntil = discountUntil; |
| | | } |
| | | |
| | | // / {$inheritDoc} |
| | | @Override |
| | | public boolean isNew() { |
| | | return id == 0; |
| | | } |
| | | |
| | | // / {@inheritDoc} |
| | | @Override |
| | | public UnixUser owningUser(EntityManager em) { |
| | | return customer.owningUser(em); |
| | |
| | | @javax.persistence.Entity(name = "BaseComponents") |
| | | @javax.persistence.Table(name = " basecomponent") |
| | | @javax.persistence.SequenceGenerator(name = "BaseComponentsSeqGen", sequenceName = "basecomponent_basecomponent_seq") |
| | | public class BaseComponent extends de.hsadmin.core.model.Entity implements Serializable { |
| | | public class BaseComponent extends de.hsadmin.core.model.AbstractEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -8161827018235142603L; |
| | | |
| | |
| | | @javax.persistence.Table(name="hive") |
| | | @javax.persistence.SequenceGenerator(name="HivesSeqGen", sequenceName="hive_hive_id_seq") |
| | | public class Hive |
| | | extends de.hsadmin.core.model.Entity |
| | | extends de.hsadmin.core.model.AbstractEntity |
| | | implements java.io.Serializable |
| | | { |
| | | private static final long serialVersionUID = -2270234313165009590L; |
| | |
| | | @javax.persistence.Table(name="inet_addr") |
| | | @javax.persistence.SequenceGenerator(name="INetAddressesSeqGen", sequenceName="inet_addr_inet_addr_id_seq") |
| | | public class INetAddress |
| | | extends de.hsadmin.core.model.Entity |
| | | extends de.hsadmin.core.model.AbstractEntity |
| | | implements java.io.Serializable |
| | | { |
| | | private static final long serialVersionUID = -5792279453911426607L; |
| | |
| | | @javax.persistence.Table(name = "packet") |
| | | @javax.persistence.SequenceGenerator(name = "PacsSeqGen", sequenceName = "packet_packet_id_seq") |
| | | @de.hsadmin.core.model.EntityInfo(name = "Paket") |
| | | public class Pac extends de.hsadmin.core.model.Entity implements Serializable { |
| | | public class Pac extends de.hsadmin.core.model.AbstractEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1201899873300190132L; |
| | | |
| | |
| | | import java.util.List; |
| | | |
| | | import de.hsadmin.core.model.AbstractModuleImpl; |
| | | import de.hsadmin.core.model.Entity; |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.core.model.HSAdminException; |
| | | import de.hsadmin.mods.user.UnixUser; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Entity> search(Class<? extends Entity> entityClass, String condition, String orderBy) throws HSAdminException { |
| | | public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass, String condition, String orderBy) throws HSAdminException { |
| | | // do query and return result |
| | | if (orderBy == null || orderBy.length() == 0) { |
| | | orderBy = "ORDER BY obj.started DESC"; |
| | |
| | | @Table(name = "unixuser") |
| | | @SequenceGenerator(name = "UnixUsersSeqGen", sequenceName = "unixuser_unixuser_id_seq") |
| | | @EntityInfo(name = "UNIX-Zugang/Mailbox") |
| | | public class UnixUser extends de.hsadmin.core.model.Entity implements Serializable { |
| | | public class UnixUser extends de.hsadmin.core.model.AbstractEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 7823071611805642906L; |
| | | |
| | |
| | | import javax.persistence.Query; |
| | | |
| | | import de.hsadmin.core.model.AuthorisationException; |
| | | import de.hsadmin.core.model.Entity; |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.core.model.AbstractModuleImpl; |
| | | import de.hsadmin.core.model.HSAdminException; |
| | | import de.hsadmin.mods.pac.Pac; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Entity initialize(Entity newEntity) throws AuthorisationException { |
| | | public AbstractEntity initialize(AbstractEntity newEntity) throws AuthorisationException { |
| | | UnixUser newUnixUser = (UnixUser) super.initialize(newEntity); |
| | | newUnixUser.setName(getLoginUser().getPac().getName() + '-'); |
| | | return newUnixUser; |
| | | } |
| | | |
| | | @Override |
| | | public Entity find(Class<? extends Entity> entityClass, Object key) throws HSAdminException { |
| | | public AbstractEntity find(Class<? extends AbstractEntity> entityClass, Object key) throws HSAdminException { |
| | | // do query |
| | | UnixUser res = (UnixUser) super.find(entityClass, key); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Entity findByString(Class<? extends Entity> entityClass, String key) throws HSAdminException { |
| | | public AbstractEntity findByString(Class<? extends AbstractEntity> entityClass, String key) throws HSAdminException { |
| | | // do query |
| | | UnixUser res = (UnixUser) super.findByString(entityClass, key); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Entity> search(Class<? extends Entity> entityClass, String condition, String orderBy) throws HSAdminException { |
| | | public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass, String condition, String orderBy) throws HSAdminException { |
| | | // do query |
| | | if (orderBy == null || orderBy.length() == 0) { |
| | | orderBy = "ORDER BY obj.name ASC"; |
| | | } |
| | | List<Entity> res = super.search(entityClass, condition, orderBy); |
| | | List<Entity> ret = new LinkedList<Entity>(); |
| | | List<AbstractEntity> res = super.search(entityClass, condition, orderBy); |
| | | List<AbstractEntity> ret = new LinkedList<AbstractEntity>(); |
| | | |
| | | // remove entities where login user has no access rights |
| | | if (res != null) { |
| | | for (Entity entity : res) { |
| | | for (AbstractEntity entity : res) { |
| | | try { |
| | | UnixUser returnedUnixUser = (UnixUser) entity; |
| | | needsPartialAccessOnPacOf(returnedUnixUser, "search"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Entity add(Entity newEntity) throws HSAdminException { |
| | | public AbstractEntity add(AbstractEntity newEntity) throws HSAdminException { |
| | | EntityManager em = getEntityManager(); |
| | | // only allow pac which matches the username (TODO: hard coded |
| | | // Hostsharing convention) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Entity update(Entity existingEntity) throws HSAdminException { |
| | | public AbstractEntity update(AbstractEntity existingEntity) throws HSAdminException { |
| | | // get the entity from the database |
| | | UnixUser detachedUnixUser = (UnixUser) existingEntity; |
| | | UnixUser attachedUnixUser = getEntityManager().find(detachedUnixUser.getClass(), |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Entity existingEntity) throws HSAdminException { |
| | | public void delete(AbstractEntity existingEntity) throws HSAdminException { |
| | | // get the entity from the database |
| | | UnixUser detachedUnixUser = (UnixUser) existingEntity; |
| | | UnixUser attachedUnixUser = getEntityManager().find(detachedUnixUser.getClass(), |
| | |
| | | |
| | | import javax.persistence.EntityManager; |
| | | |
| | | import de.hsadmin.core.model.Entity; |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.core.qserv.CompoundProcessor; |
| | | import de.hsadmin.core.qserv.EntityProcessorFactory; |
| | | import de.hsadmin.core.qserv.Processor; |
| | |
| | | /** |
| | | * @return a Processor which creates a new UNIX user account |
| | | */ |
| | | public <T extends Entity> Processor createCreateProcessor(EntityManager em, |
| | | public <T extends AbstractEntity> Processor createCreateProcessor(EntityManager em, |
| | | T entity) { |
| | | UnixUser user = (UnixUser) entity; |
| | | CompoundProcessor aCP = new CompoundProcessor(new ShellProcessor( |
| | |
| | | /** |
| | | * @return a Processor which updates an existing UNIX user account |
| | | */ |
| | | public <T extends Entity> Processor createUpdateProcessor(EntityManager em, |
| | | public <T extends AbstractEntity> Processor createUpdateProcessor(EntityManager em, |
| | | T entity) { |
| | | UnixUser user = (UnixUser) entity; |
| | | CompoundProcessor aCP = new CompoundProcessor(new ShellProcessor( |
| | |
| | | /** |
| | | * @return a Processor which deletes an existing UNIX user account |
| | | */ |
| | | public <T extends Entity> Processor createDeleteProcessor(EntityManager em, |
| | | public <T extends AbstractEntity> Processor createDeleteProcessor(EntityManager em, |
| | | T entity) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyMMdd-HHmm-"); |
| | | String trashPrefix = "/home/trash/" + sdf.format(new Date()); |
| | |
| | | |
| | | import de.hsadmin.core.model.AuthenticationException; |
| | | import de.hsadmin.core.model.AuthorisationException; |
| | | import de.hsadmin.core.model.Entity; |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.core.model.GenericModuleImpl; |
| | | import de.hsadmin.core.model.HSAdminException; |
| | | import de.hsadmin.core.model.ModuleInterface; |
| | |
| | | authentication = new TicketAuthentication(); |
| | | } |
| | | |
| | | protected abstract Class<? extends Entity> getEntityClass(); |
| | | protected abstract Class<? extends AbstractEntity> getEntityClass(); |
| | | |
| | | protected abstract void entity2map(Entity entity, Map<String, String> resultMap); |
| | | protected abstract void entity2map(AbstractEntity entity, Map<String, String> resultMap); |
| | | |
| | | protected abstract void map2entity(Map<String, String> setParams, Entity entity); |
| | | protected abstract void map2entity(Map<String, String> setParams, AbstractEntity entity); |
| | | |
| | | protected abstract void regularizeKeys(Map<String, String> whereParams); |
| | | |
| | | /* (non-Javadoc) |
| | | * @see de.hsadmin.remote.IRemote#search(java.lang.String, java.lang.String, java.util.Map) |
| | | */ |
| | | public List<Map<String, String>> search(String runAsUser, String ticket, |
| | | Map<String, String> whereParams) throws HSAdminException { |
| | | String user = runAsUser; |
| | |
| | | ModuleInterface module = new GenericModuleImpl(transaction); |
| | | UnixUser unixUser = null; |
| | | unixUser = (UnixUser) module.findByString(UnixUser.class, user); |
| | | List<Entity> list = module.search(getEntityClass(), |
| | | List<AbstractEntity> list = module.search(getEntityClass(), |
| | | buildQueryCondition(whereParams), null); |
| | | if (list == null) { |
| | | throw new HSAdminException("result list is null, runtime-error?"); |
| | | } |
| | | ArrayList<Map<String, String>> result = new ArrayList<Map<String, String>>(); |
| | | for (Entity e : list) { |
| | | for (AbstractEntity e : list) { |
| | | HashMap<String, String> entry = new HashMap<String, String>(); |
| | | entity2map(e, entry); |
| | | if (e.isReadAllowedFor(unixUser)) { |
| | |
| | | } |
| | | } |
| | | |
| | | /* (non-Javadoc) |
| | | * @see de.hsadmin.remote.IRemote#add(java.lang.String, java.lang.String, java.util.Map) |
| | | */ |
| | | public Map<String, String> add(String runAsUser, String ticket, |
| | | Map<String, String> setParams) throws HSAdminException { |
| | | String user = runAsUser; |
| | |
| | | try { |
| | | if (authentication.login(user, ticket)) { |
| | | ModuleInterface module = new GenericModuleImpl(transaction); |
| | | Constructor<? extends Entity> constructor = |
| | | Constructor<? extends AbstractEntity> constructor = |
| | | getEntityClass().getConstructor(); |
| | | Entity entity = constructor.newInstance(); |
| | | AbstractEntity entity = constructor.newInstance(); |
| | | map2entity(setParams, entity); |
| | | transaction.beginTransaction(); |
| | | Entity insertedEntity = module.add(entity); |
| | | AbstractEntity insertedEntity = module.add(entity); |
| | | transaction.commitTransaction(); |
| | | HashMap<String, String> entry = new HashMap<String, String>(); |
| | | entity2map(insertedEntity, entry); |
| | |
| | | } |
| | | } |
| | | |
| | | /* (non-Javadoc) |
| | | * @see de.hsadmin.remote.IRemote#delete(java.lang.String, java.lang.String, java.util.Map) |
| | | */ |
| | | public void delete(String runAsUser, String ticket, |
| | | Map<String, String> whereParams) throws HSAdminException { |
| | | String user = runAsUser; |
| | |
| | | throw new HSAdminException( |
| | | "better safe than sorry: no where parameter found"); |
| | | } |
| | | List<Entity> list = module.search(getEntityClass(), |
| | | List<AbstractEntity> list = module.search(getEntityClass(), |
| | | queryCondition, null); |
| | | transaction.beginTransaction(); |
| | | for (Entity e : list) { |
| | | for (AbstractEntity e : list) { |
| | | if (e.isWriteAllowedFor(unixUser)) { |
| | | module.delete(e); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | /* (non-Javadoc) |
| | | * @see de.hsadmin.remote.IRemote#update(java.lang.String, java.lang.String, java.util.Map, java.util.Map) |
| | | */ |
| | | public List<Map<String, String>> update(String runAsUser, String ticket, |
| | | Map<String, String> setParams, Map<String, String> whereParams) |
| | | throws HSAdminException { |
| | |
| | | throw new HSAdminException( |
| | | "better safe than sorry: no where parameter found"); |
| | | } |
| | | List<Entity> list = module.search(getEntityClass(), |
| | | queryCondition, "ORDER BY name ASC"); |
| | | List<AbstractEntity> list = module.search(getEntityClass(), |
| | | queryCondition, "ORDER BY obj.name ASC"); |
| | | transaction.beginTransaction(); |
| | | for (Entity update : list) { |
| | | for (AbstractEntity update : list) { |
| | | if (update.isWriteAllowedFor(unixUser)) { |
| | | transaction.detach(update); |
| | | map2entity(setParams, update); |
New file |
| | |
| | | package de.hsadmin.remote; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.mods.cust.BankAccount; |
| | | import de.hsadmin.mods.cust.Contact; |
| | | import de.hsadmin.mods.cust.Customer; |
| | | |
| | | public class CustomerRemote extends AbstractRemote { |
| | | |
| | | private static final DateFormat df = SimpleDateFormat.getDateInstance(DateFormat.SHORT); |
| | | |
| | | @Override |
| | | protected Class<? extends AbstractEntity> getEntityClass() { |
| | | return Customer.class; |
| | | } |
| | | |
| | | @Override |
| | | protected void entity2map(AbstractEntity entity, |
| | | Map<String, String> resultMap) { |
| | | Customer cust = (Customer) entity; |
| | | resultMap.put("id", Long.toString(cust.getId())); |
| | | resultMap.put("membercode", cust.getName()); |
| | | resultMap.put("memberno", Integer.toString(cust.getMemberNo())); |
| | | Date memberSince = cust.getMemberSince(); |
| | | if (assertNotNull(memberSince)) { |
| | | resultMap.put("membersince", df.format(memberSince)); |
| | | } |
| | | Date memberUntil = cust.getMemberUntil(); |
| | | if (assertNotNull(memberUntil)) { |
| | | resultMap.put("memberuntil", df.format(memberUntil)); |
| | | } |
| | | resultMap.put("memberrole", cust.getMemberRole()); |
| | | Date authorContract = cust.getAuthorContract(); |
| | | if (assertNotNull(authorContract)) { |
| | | resultMap.put("authorcontract", df.format(authorContract)); |
| | | } |
| | | Date nonDiscContract = cust.getNonDiscContract(); |
| | | if (assertNotNull(nonDiscContract)) { |
| | | resultMap.put("nondisccontract", df.format(nonDiscContract)); |
| | | } |
| | | Date sharesUpdated = cust.getSharesUpdated(); |
| | | if (assertNotNull(sharesUpdated)) { |
| | | resultMap.put("sharesupdated", df.format(sharesUpdated)); |
| | | } |
| | | resultMap.put("sharessigned", Integer.toString(cust.getSharesSigned())); |
| | | resultMap.put("uidvat", cust.getUidVAT()); |
| | | BankAccount bank = cust.getBankAccount(); |
| | | if (bank != null) { |
| | | resultMap.put("autodebit_ga", bank.getAutoDebitGA() != null && bank.getAutoDebitGA() ? "Yes" : "No"); |
| | | resultMap.put("autodebit_ar", bank.getAutoDebitAR() != null && bank.getAutoDebitAR() ? "Yes" : "No"); |
| | | resultMap.put("autodebit_op", bank.getAutoDebitOP() != null && bank.getAutoDebitOP() ? "Yes" : "No"); |
| | | resultMap.put("bank_customer", bank.getBankCustomer()); |
| | | resultMap.put("bank_account", bank.getBankAccount()); |
| | | resultMap.put("bank_code", bank.getBankCode()); |
| | | resultMap.put("bank_name", bank.getBankName()); |
| | | } |
| | | Set<Contact> contacts = cust.getContacts(); |
| | | if (contacts != null && !contacts.isEmpty()) { |
| | | Contact c = contacts.iterator().next(); |
| | | resultMap.put("contact_salut", c.getSalut()); |
| | | resultMap.put("contact_title", c.getTitle()); |
| | | resultMap.put("contact_firstname", c.getFirstName()); |
| | | resultMap.put("contact_lastname", c.getLastName()); |
| | | resultMap.put("contact_firma", c.getFirma()); |
| | | resultMap.put("contact_co", c.getCo()); |
| | | resultMap.put("contact_street", c.getStreet()); |
| | | resultMap.put("contact_zipcode", c.getZipCode()); |
| | | resultMap.put("contact_city", c.getCity()); |
| | | resultMap.put("contact_country", c.getCountry()); |
| | | resultMap.put("contact_phone_private", c.getPhonePrivate()); |
| | | resultMap.put("contact_phone_office", c.getPhoneOffice()); |
| | | resultMap.put("contact_phone_mobile", c.getPhoneMobile()); |
| | | resultMap.put("contact_fax", c.getFax()); |
| | | resultMap.put("contact_email", c.getEmail()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void map2entity(Map<String, String> setParams, |
| | | AbstractEntity entity) { |
| | | Customer cust = (Customer) entity; |
| | | String idStr = setParams.get("id"); |
| | | if (assertNotNull(idStr)) { |
| | | cust.setId(Long.parseLong(idStr)); |
| | | } |
| | | String memberCode = setParams.get("membercode"); |
| | | if (assertNotNull(memberCode)) { |
| | | cust.setName(memberCode); |
| | | } |
| | | String memberNo = setParams.get("memberno"); |
| | | if (assertNotNull(memberNo)) { |
| | | cust.setMemberNo(Integer.parseInt(memberNo)); |
| | | } |
| | | String memberSince = setParams.get("membersince"); |
| | | if (assertNotNull(memberSince)) { |
| | | try { |
| | | cust.setMemberSince(df.parse(memberSince)); |
| | | } catch (ParseException e) { |
| | | // don't care |
| | | } |
| | | } |
| | | String memberUntil = setParams.get("memberuntil"); |
| | | if (assertNotNull(memberUntil)) { |
| | | try { |
| | | cust.setMemberUntil(df.parse(memberUntil)); |
| | | } catch (ParseException e) { |
| | | // don't care |
| | | } |
| | | } |
| | | String memberRole = setParams.get("memberrole"); |
| | | if (assertNotNull(memberRole)) { |
| | | cust.setMemberRole(memberRole); |
| | | } |
| | | String authorContract = setParams.get("authorcontract"); |
| | | if (assertNotNull(authorContract)) { |
| | | try { |
| | | cust.setAuthorContract(df.parse(authorContract)); |
| | | } catch (ParseException e) { |
| | | // don't care |
| | | } |
| | | } |
| | | String nonDiscContract = setParams.get("nondisccontract"); |
| | | if (assertNotNull(nonDiscContract)) { |
| | | try { |
| | | cust.setNonDiscContract(df.parse(nonDiscContract)); |
| | | } catch (ParseException e) { |
| | | // don't care |
| | | } |
| | | } |
| | | String sharesUpdated = setParams.get("sharesupdated"); |
| | | if (assertNotNull(sharesUpdated)) { |
| | | try { |
| | | cust.setSharesUpdated(df.parse(sharesUpdated)); |
| | | } catch (ParseException e) { |
| | | // don't care |
| | | } |
| | | } |
| | | String sharesSigned = setParams.get("sharessigned"); |
| | | if (assertNotNull(sharesSigned)) { |
| | | cust.setId(Integer.parseInt(sharesSigned)); |
| | | } |
| | | String uidVat = setParams.get("uidvat"); |
| | | if (assertNotNull(uidVat)) { |
| | | cust.setUidVAT(uidVat); |
| | | } |
| | | BankAccount bank = cust.getBankAccount(); |
| | | if (bank == null) { |
| | | bank = new BankAccount(); |
| | | bank.setCustomer(cust); |
| | | cust.setBankAccount(bank); |
| | | } |
| | | String autoDebitGA = setParams.get("autodebit_ga"); |
| | | if (assertNotNull(autoDebitGA)) { |
| | | autoDebitGA = autoDebitGA.toUpperCase(); |
| | | bank.setAutoDebitGA(new Boolean(autoDebitGA.startsWith("T") || autoDebitGA.startsWith("Y"))); |
| | | } |
| | | String autoDebitAR = setParams.get("autodebit_ar"); |
| | | if (assertNotNull(autoDebitAR)) { |
| | | autoDebitAR = autoDebitAR.toUpperCase(); |
| | | bank.setAutoDebitAR(new Boolean(autoDebitAR.startsWith("T") || autoDebitAR.startsWith("Y"))); |
| | | } |
| | | String autoDebitOP = setParams.get("autodebit_op"); |
| | | if (assertNotNull(autoDebitOP)) { |
| | | autoDebitOP = autoDebitOP.toUpperCase(); |
| | | bank.setAutoDebitOP(new Boolean(autoDebitOP.startsWith("T") || autoDebitOP.startsWith("Y"))); |
| | | } |
| | | String bankCustomer = setParams.get("bank_customer"); |
| | | if (assertNotNull(bankCustomer)) { |
| | | bank.setBankCustomer(bankCustomer); |
| | | } |
| | | String bankAccount = setParams.get("bank_account"); |
| | | if (assertNotNull(bankAccount)) { |
| | | bank.setBankAccount(bankAccount); |
| | | } |
| | | String bankCode = setParams.get("bank_code"); |
| | | if (assertNotNull(bankCode)) { |
| | | bank.setBankCode(bankCode); |
| | | } |
| | | String bankName = setParams.get("bank_name"); |
| | | if (assertNotNull(bankName)) { |
| | | bank.setBankName(bankName); |
| | | } |
| | | Set<Contact> contacts = cust.getContacts(); |
| | | Contact c = null; |
| | | if (contacts == null || contacts.isEmpty()) { |
| | | c = new Contact(cust); |
| | | contacts.add(c); |
| | | } else { |
| | | c = contacts.iterator().next(); |
| | | } |
| | | String salut = setParams.get("contact_salut"); |
| | | if (assertNotNull(salut)) { |
| | | c.setSalut(salut); |
| | | } |
| | | String title = setParams.get("contact_title"); |
| | | if (assertNotNull(title)) { |
| | | c.setTitle(title); |
| | | } |
| | | String firstName = setParams.get("contact_firstname"); |
| | | if (assertNotNull(firstName)) { |
| | | c.setFirstName(firstName); |
| | | } |
| | | String lastName = setParams.get("contact_lastname"); |
| | | if (assertNotNull(lastName)) { |
| | | c.setLastName(lastName); |
| | | } |
| | | String firma = setParams.get("contact_firma"); |
| | | if (assertNotNull(firma)) { |
| | | c.setLastName(firma); |
| | | } |
| | | String co = setParams.get("contact_co"); |
| | | if (assertNotNull(co)) { |
| | | c.setCo(co); |
| | | } |
| | | String street = setParams.get("contact_street"); |
| | | if (assertNotNull(street)) { |
| | | c.setStreet(street); |
| | | } |
| | | String zipCode = setParams.get("contact_zipcode"); |
| | | if (assertNotNull(zipCode)) { |
| | | c.setZipCode(zipCode); |
| | | } |
| | | String city = setParams.get("contact_city"); |
| | | if (assertNotNull(city)) { |
| | | c.setCity(city); |
| | | } |
| | | String country = setParams.get("contact_country"); |
| | | if (assertNotNull(country)) { |
| | | c.setCountry(country); |
| | | } |
| | | String phonePrivate = setParams.get("contact_phone_private"); |
| | | if (assertNotNull(phonePrivate)) { |
| | | c.setPhonePrivate(phonePrivate); |
| | | } |
| | | String phoneOffice = setParams.get("contact_phone_office"); |
| | | if (assertNotNull(phoneOffice)) { |
| | | c.setPhoneOffice(phoneOffice); |
| | | } |
| | | String phoneMobile = setParams.get("contact_phone_mobile"); |
| | | if (assertNotNull(phoneMobile)) { |
| | | c.setPhoneMobile(phoneMobile); |
| | | } |
| | | String fax = setParams.get("contact_fax"); |
| | | if (assertNotNull(fax)) { |
| | | c.setFax(fax); |
| | | } |
| | | String eMail = setParams.get("contact_email"); |
| | | if (assertNotNull(eMail)) { |
| | | c.setEmail(eMail); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void regularizeKeys(Map<String, String> whereParams) { |
| | | // nothing to do |
| | | replaceKey(whereParams, "membercode", "name"); |
| | | replaceKey(whereParams, "memberno", "memberNo"); |
| | | replaceKey(whereParams, "membersince", "memberSince"); |
| | | replaceKey(whereParams, "memberuntil", "memberUntil"); |
| | | } |
| | | |
| | | } |
| | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | import de.hsadmin.core.model.Entity; |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.core.qserv.QueueTask; |
| | | |
| | | public class QueueTaskRemote extends AbstractRemote { |
| | |
| | | private static final DateFormat df = SimpleDateFormat.getDateInstance(DateFormat.SHORT); |
| | | |
| | | @Override |
| | | protected Class<? extends Entity> getEntityClass() { |
| | | protected Class<? extends AbstractEntity> getEntityClass() { |
| | | return QueueTask.class; |
| | | } |
| | | |
| | | @Override |
| | | protected void entity2map(Entity entity, Map<String, String> resultMap) { |
| | | protected void entity2map(AbstractEntity entity, Map<String, String> resultMap) { |
| | | QueueTask task = (QueueTask) entity; |
| | | resultMap.put("id", Long.toString(task.getId())); |
| | | resultMap.put("status", task.getStatus().toString()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected void map2entity(Map<String, String> setParams, Entity entity) { |
| | | protected void map2entity(Map<String, String> setParams, AbstractEntity entity) { |
| | | // never used |
| | | } |
| | | |
| | |
| | | |
| | | import java.util.Map; |
| | | |
| | | import de.hsadmin.core.model.Entity; |
| | | import de.hsadmin.core.model.AbstractEntity; |
| | | import de.hsadmin.mods.user.UnixUser; |
| | | |
| | | public class UnixUserRemote extends AbstractRemote { |
| | | |
| | | @Override |
| | | protected Class<? extends Entity> getEntityClass() { |
| | | protected Class<? extends AbstractEntity> getEntityClass() { |
| | | return UnixUser.class; |
| | | } |
| | | |
| | | @Override |
| | | protected void entity2map(Entity entity, Map<String, String> map) { |
| | | protected void entity2map(AbstractEntity entity, Map<String, String> map) { |
| | | UnixUser user = (UnixUser) entity; |
| | | map.put("id", Long.toString(user.getId())); |
| | | map.put("name", user.getName()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected void map2entity(Map<String, String> map, Entity entity) { |
| | | protected void map2entity(Map<String, String> map, AbstractEntity entity) { |
| | | UnixUser user = (UnixUser) entity; |
| | | String id = map.get("id"); |
| | | if (assertNotNull(id)) { |
| | |
| | | member=de.hsadmin.remote.CustomerRemote |
| | | user=de.hsadmin.remote.UnixUserRemote |
| | | q=de.hsadmin.remote.QueueTaskRemote |
New file |
| | |
| | | package de.hsadmin.remote; |
| | | |
| | | import static org.junit.Assert.assertEquals; |
| | | import static org.junit.Assert.assertTrue; |
| | | import static org.junit.Assert.fail; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.xmlrpc.XmlRpcException; |
| | | import org.apache.xmlrpc.client.XmlRpcClient; |
| | | import org.junit.After; |
| | | import org.junit.Before; |
| | | import org.junit.Test; |
| | | |
| | | public class CustomerTest { |
| | | |
| | | private static final String MODULE = "member"; |
| | | |
| | | private XmlRpcClient client; |
| | | private RemoteCASHelper cas; |
| | | |
| | | @Before |
| | | public void setUp() throws Exception { |
| | | client = RemoteTestHelper.getClient(); |
| | | cas = new RemoteCASHelper(); |
| | | } |
| | | |
| | | @After |
| | | public void tearDown() throws Exception { |
| | | client = null; |
| | | cas = null; |
| | | } |
| | | |
| | | @Test |
| | | public void testAddAsHostmaster() { |
| | | String user = "pe"; |
| | | int membersCount = -9999; |
| | | try { |
| | | membersCount = getMembersCount(user); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> setParams = new HashMap<String, String>(); |
| | | setParams.put("membercode", "hsh00-aaa"); |
| | | setParams.put("memberno", "20001"); |
| | | setParams.put("membersince", "01.10.2010"); |
| | | setParams.put("contact_salut", "Herr"); |
| | | setParams.put("contact_title", "Dr."); |
| | | setParams.put("contact_firstname", "Rainer"); |
| | | setParams.put("contact_lastname", "Mustermann"); |
| | | setParams.put("contact_salut", "Herr"); |
| | | setParams.put("contact_street", "Hauptstr. 1"); |
| | | setParams.put("contact_zipcode", "99998"); |
| | | setParams.put("contact_city", "Musterstadt"); |
| | | setParams.put("contact_country", "D"); |
| | | setParams.put("contact_phone_private", "+49 9999 123456"); |
| | | setParams.put("contact_email", "rainer.mustermann@example.org"); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | | setParams }; |
| | | try { |
| | | client.execute(MODULE + ".add", params); |
| | | // Object execute = client.execute(MODULE + ".add", params); |
| | | // Map<?, ?> result = (Map<?, ?>) execute; |
| | | // System.out.println(result); |
| | | assertEquals(membersCount + 1, getMembersCount(user)); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void testSearchAsHostmaster() { |
| | | String user = "pe"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | | whereParams }; |
| | | try { |
| | | Object execute = client.execute(MODULE + ".search", params); |
| | | Object[] result = (Object[]) execute; |
| | | assertTrue(result.length > 100); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void testSearchAsPacAdmin() { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | | whereParams }; |
| | | try { |
| | | Object execute = client.execute(MODULE + ".search", params); |
| | | Object[] result = (Object[]) execute; |
| | | assertTrue(result.length == 0); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void testSearchAsPacUser() { |
| | | String user = "peh00-phor"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | | whereParams }; |
| | | try { |
| | | Object execute = client.execute(MODULE + ".search", params); |
| | | Object[] result = (Object[]) execute; |
| | | assertTrue(result.length == 0); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void testSearchAsMember() { |
| | | String user = "hsh00-peh"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | | whereParams }; |
| | | try { |
| | | Object execute = client.execute(MODULE + ".search", params); |
| | | Object[] result = (Object[]) execute; |
| | | assertTrue(result.length == 1); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void testDeleteAsMember() { |
| | | String user = "hsh00-aaa"; |
| | | int membersCount = -9999; |
| | | try { |
| | | membersCount = getMembersCount(user); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | whereParams.put("membercode", "hsh00-aaa"); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | | whereParams }; |
| | | try { |
| | | client.execute(MODULE + ".delete", params); |
| | | assertEquals(membersCount - 1, getMembersCount(user)); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void testDeleteAsHostmaster() { |
| | | String user = "pe"; |
| | | int membersCount = -9999; |
| | | try { |
| | | membersCount = getMembersCount(user); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | whereParams.put("membercode", "hsh00-aaa"); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | | whereParams }; |
| | | try { |
| | | client.execute(MODULE + ".delete", params); |
| | | assertEquals(membersCount - 1, getMembersCount(user)); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | private int getMembersCount(String user) throws XmlRpcException { |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | | whereParams }; |
| | | Object execute = client.execute(MODULE + ".search", params); |
| | | Object[] result = (Object[]) execute; |
| | | return result.length; |
| | | } |
| | | } |
| | |
| | | @Test |
| | | public void testSearchAllAsPacAdmin() { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | |
| | | try { |
| | | Object execute = client.execute(MODULE + ".search", params); |
| | | Object[] result = (Object[]) execute; |
| | | assertTrue(result.length > 100); |
| | | assertTrue(result.length > 20); |
| | | for (Object o : result) { |
| | | if (o instanceof Map<?, ?>) { |
| | | Map<?, ?> row = (Map<?, ?>) o; |
| | |
| | | @Test |
| | | public void testUpdate() { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> setParams = new HashMap<String, String>(); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | setParams.put("details", "Test"); |
| | |
| | | @Test |
| | | public void testCreateFails() { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> setParams = new HashMap<String, String>(); |
| | | setParams.put("status", "done"); |
| | | setParams.put("title", "Test"); |
| | |
| | | @Test |
| | | public void testDeleteAsPacAdminFails() { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | whereParams.put("user", "peh00"); |
| | | Object[] params = new Object[] { user, |
| | |
| | | loginURL = config.getProperty("loginURL", LOGIN_URL); |
| | | } |
| | | |
| | | public String getGrantingTicketURL(String user, String pw) { |
| | | if ("peh00".equals(pw)) { |
| | | pw = config.getProperty("peh00.passWord", "-"); |
| | | } |
| | | if ("peh01".equals(pw)) { |
| | | pw = config.getProperty("peh01.passWord", "-"); |
| | | } |
| | | if ("pe".equals(pw)) { |
| | | pw = config.getProperty("pe.passWord", "-"); |
| | | } |
| | | if (user.equals(pw)) { |
| | | System.err.println("Unknown Password for: " + pw); |
| | | return null; |
| | | } |
| | | public String getGrantingTicketURL(String user) { |
| | | String pw = config.getProperty(user + ".passWord", "-"); |
| | | try { |
| | | String encodedParams = URLEncoder.encode("username", "UTF-8") |
| | | + "=" + URLEncoder.encode(user, "UTF-8") |
| | |
| | | |
| | | @RunWith(Suite.class) |
| | | @Suite.SuiteClasses({ |
| | | CustomerTest.class, |
| | | UnixUserTest.class, |
| | | // MySqlDatabaseTest.class, |
| | | // MySqlUserTest.class, |
| | |
| | | @Test |
| | | public void testSearchAsPacAdmin() { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | |
| | | int count = getObjectCount(); |
| | | try { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> setParams = new HashMap<String, String>(); |
| | | setParams.put("name", "peh00-test2"); |
| | | setParams.put("password", "test123"); |
| | |
| | | int count = getObjectCount(); |
| | | try { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> setParams = new HashMap<String, String>(); |
| | | setParams.put("name", "peh01-testfail"); |
| | | setParams.put("password", "test123"); |
| | |
| | | int count = getObjectCount(); |
| | | try { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> setParams = new HashMap<String, String>(); |
| | | setParams.put("name", "peh00-langer-name"); |
| | | setParams.put("password", "test123"); |
| | |
| | | int count = getObjectCount(); |
| | | try { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | Map<String, String> setParams = new HashMap<String, String>(); |
| | | whereParams.put("name", "peh00-test2"); |
| | |
| | | int count = getObjectCount(); |
| | | try { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | whereParams.put("name", "peh00-langer-name"); |
| | | Object[] params = new Object[] { user, |
| | |
| | | int count = getObjectCount(); |
| | | try { |
| | | String user = "peh01"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | whereParams.put("name", "peh00-test2"); |
| | | Object[] params = new Object[] { user, |
| | |
| | | int count = getObjectCount(); |
| | | try { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | whereParams.put("name", "peh00-test2"); |
| | | Object[] params = new Object[] { user, |
| | |
| | | int count = -1; |
| | | try { |
| | | String user = "peh00"; |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user, user); |
| | | String grantingTicketURL = cas.getGrantingTicketURL(user); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | Object[] params = new Object[] { user, |
| | | cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.BACKEND_URL), |
| | |
| | | xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" |
| | | version="2.5"> |
| | | |
| | | <listener> |
| | | <listener-class>de.hsadmin.core.model.onetier.PersistenceManagerContextListener</listener-class> |
| | | </listener> |
| | | |
| | | <servlet> |
| | | <servlet-name>Queue Status Servlet</servlet-name> |
| | | <servlet-class>de.hsadmin.core.qserv.QueueStatusReceiverServlet</servlet-class> |