Salome HOME
Merge branch 'permissions' of /media/mordicus/git/salome-gde into permissions
authorBojnourdi <kavoos.bojnourdi@edf.fr>
Sun, 9 Aug 2015 11:49:50 +0000 (13:49 +0200)
committerBojnourdi <kavoos.bojnourdi@edf.fr>
Sun, 9 Aug 2015 11:49:50 +0000 (13:49 +0200)
29 files changed:
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/ChunkDao.java [new file with mode: 0644]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/FileDao.java [new file with mode: 0644]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/MetadataDao.java [new file with mode: 0644]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/StudyDao.java [new file with mode: 0644]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/UserDao.java [new file with mode: 0644]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/ChunkDAO.java [deleted file]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/ChunkEJB.java [new file with mode: 0644]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/FileDAO.java [deleted file]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/FileEJB.java [new file with mode: 0644]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/MetadataDAO.java [deleted file]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/MetadataEJB.java [new file with mode: 0644]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/StudyDAO.java [deleted file]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/StudyEJB.java [new file with mode: 0644]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/UserDAO.java [deleted file]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/UserEJB.java [new file with mode: 0644]
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Attribute.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/AttributeGroup.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Chunk.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/GDEFile.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Group.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Profile.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/ProfileAttribute.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Study.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/User.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/UserGroup.java
projects/GDE_App/GDE-war/nbproject/build-impl.xml~ [new file with mode: 0644]
projects/GDE_App/GDE-war/nbproject/genfiles.properties
projects/GDE_App/GDE-war/nbproject/project.properties
projects/GDE_App/GDE-war/src/java/com/edf/gde/services/UserService.java

diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/ChunkDao.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/ChunkDao.java
new file mode 100644 (file)
index 0000000..a8625dd
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * (C) 2015 EDF
+ */
+package com.edf.gde.dao;
+
+import com.edf.gde.entities.Chunk;
+import com.edf.gde.transferables.ChunkTO;
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+
+/**
+ *
+ * @author Kavoos
+ */
+public class ChunkDao {
+
+    private final EntityManager em;
+
+    public ChunkDao(EntityManager em) {
+        this.em = em;
+    }
+
+    public ChunkTO createChunk(ChunkTO cto) {
+        Chunk c = Chunk.fromChunkTO(cto);
+        em.persist(c);
+        return c.toChunkTO();
+    }
+
+    public void deleteChunk(ChunkTO cto) {
+        Chunk c = Chunk.fromChunkTO(cto);
+        em.remove(c);
+    }
+
+    public ChunkTO updateChunk(ChunkTO cto) {
+        Chunk c = Chunk.fromChunkTO(cto);
+        Chunk up = em.merge(c);
+        return up.toChunkTO();
+    }
+
+    public ChunkTO findChunk(ChunkTO cto) {
+        Chunk found = em.find(Chunk.class, cto.getId());
+        return found.toChunkTO();
+    }
+
+    public ChunkTO findById(long id) {
+        Chunk found = (Chunk) em.createNamedQuery("Chunk.findById")
+                .setParameter("id", id)
+                .getSingleResult();
+        return found.toChunkTO();
+    }
+
+    public ChunkTO findByFileId(long fileId) {
+        Chunk found = (Chunk) em.createNamedQuery("Chunk.findByFileId")
+                .setParameter("fileId", fileId)
+                .getSingleResult();
+        return found.toChunkTO();
+    }
+
+}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/FileDao.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/FileDao.java
new file mode 100644 (file)
index 0000000..d18eebd
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * (C) 2015 EDF
+ */
+package com.edf.gde.dao;
+
+import com.edf.gde.entities.GDEFile;
+import com.edf.gde.transferables.FileTO;
+import java.util.Date;
+import javax.persistence.EntityManager;
+
+/**
+ *
+ * @author Kavoos
+ */
+public class FileDao {
+
+    private EntityManager em;
+
+    public FileDao(EntityManager em) {
+        this.em = em;
+    }
+
+    public FileTO createFile(FileTO fto) {
+        GDEFile f = GDEFile.fromFileTO(fto);
+        em.persist(f);
+        return f.toFileTO();
+    }
+
+    public void deleteFile(FileTO fto) {
+        GDEFile f = GDEFile.fromFileTO(fto);
+        em.remove(f);
+    }
+
+    public FileTO updateFile(FileTO fto) {
+        GDEFile f = GDEFile.fromFileTO(fto);
+        GDEFile up = em.merge(f);
+        return up.toFileTO();
+    }
+
+    public FileTO findFile(FileTO fto) {
+        GDEFile found = em.find(GDEFile.class, fto.getId());
+        return found.toFileTO();
+    }
+
+    private <T> FileTO findBy(String queryName, String varName, T value) {
+        GDEFile found = (GDEFile) em.createNamedQuery(queryName)
+                .setParameter(varName, value)
+                .getSingleResult();
+        return found.toFileTO();
+    }
+
+    public FileTO findById(long id) {
+        return findBy("File.findById", "id", id);
+    }
+
+    public FileTO findByName(String name) {
+        return findBy("File.findByName", "name", name);
+    }
+
+    public FileTO findByCreationDate(Date creationDate) {
+        return findBy("File.findByCreationDate", "creationDate", creationDate);
+    }
+
+    public FileTO findByUpdateDate(Date updateDate) {
+        return findBy("File.findByUpdateDate", "updateDate", updateDate);
+    }
+
+    public FileTO findByDeletionDate(Date deletionDate) {
+        return findBy("File.findByDeletionDate", "deletionDate", deletionDate);
+    }
+
+}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/MetadataDao.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/MetadataDao.java
new file mode 100644 (file)
index 0000000..e36e4a8
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * (C) 2015 EDF
+ */
+package com.edf.gde.dao;
+
+import com.edf.gde.entities.Attribute;
+import com.edf.gde.entities.AttributeGroup;
+import com.edf.gde.transferables.AttributeGroupTO;
+import com.edf.gde.transferables.AttributeTO;
+import javax.persistence.EntityManager;
+
+/**
+ *
+ * @author Kavoos
+ */
+public class MetadataDao {
+
+    private EntityManager em;
+
+    public MetadataDao(EntityManager em) {
+        this.em = em;
+    }
+
+    public AttributeTO createAttribute(AttributeTO ato) {
+        Attribute a = Attribute.fromAttributeTO(ato);
+        em.persist(a);
+        return a.toAttributeTO();
+    }
+
+    public void deleteAttribute(AttributeTO ato) {
+        Attribute a = Attribute.fromAttributeTO(ato);
+        em.remove(a);
+    }
+
+    public AttributeTO updateAttribute(AttributeTO ato) {
+        Attribute a = Attribute.fromAttributeTO(ato);
+        Attribute up = em.merge(a);
+        return up.toAttributeTO();
+    }
+
+    public AttributeTO findAttribute(AttributeTO ato) {
+        Attribute found = em.find(Attribute.class, ato.getId());
+        return found.toAttributeTO();
+    }
+
+    private <T> AttributeTO findBy(String queryName, String varName, T value) {
+        Attribute found = (Attribute) em.createNamedQuery(queryName)
+                .setParameter(varName, value)
+                .getSingleResult();
+        return found.toAttributeTO();
+    }
+
+    public AttributeTO findById(long id) {
+        return findBy("Attribute.findById", "id", id);
+    }
+
+    public AttributeTO findByName(String name) {
+        return findBy("Attribute.findByName", "name", name);
+    }
+
+    public AttributeTO findByType(String type) {
+        return findBy("Attribute.findByType", "type", type);
+    }
+
+    public AttributeTO findByValue(String value) {
+        return findBy("Attribute.findByValue", "value", value);
+    }
+
+    /* Attributes Groups */
+    public AttributeGroupTO createAttributeGroup(AttributeGroupTO agto) {
+        AttributeGroup group = AttributeGroup.fromAttributeGroupTO(agto);
+        em.persist(group);
+        return group.toAttributeGroupTO();
+    }
+
+    public void deleteAttributeGroup(AttributeGroupTO agto) {
+        AttributeGroup group = AttributeGroup.fromAttributeGroupTO(agto);
+        em.remove(group);
+    }
+
+    public AttributeGroupTO updateAttributeGroup(AttributeGroupTO agto) {
+        AttributeGroup group = AttributeGroup.fromAttributeGroupTO(agto);
+        AttributeGroup up = em.merge(group);
+        return up.toAttributeGroupTO();
+    }
+
+    public AttributeGroupTO findAttributeGroup(AttributeGroupTO agto) {
+        AttributeGroup found = em.find(AttributeGroup.class, agto.getId());
+        return found.toAttributeGroupTO();
+    }
+
+    public AttributeGroupTO findGroupById(long groupId) {
+        AttributeGroup found = (AttributeGroup) em.createNamedQuery("AttributeGroup.findById")
+                .setParameter("id", groupId)
+                .getSingleResult();
+        return found.toAttributeGroupTO();
+    }
+}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/StudyDao.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/StudyDao.java
new file mode 100644 (file)
index 0000000..17a1e12
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * (C) 2015 EDF
+ */
+package com.edf.gde.dao;
+
+import com.edf.gde.entities.Study;
+import com.edf.gde.transferables.StudyTO;
+import java.util.Date;
+import javax.persistence.EntityManager;
+
+/**
+ *
+ * @author Kavoos
+ */
+public class StudyDao {
+
+    private final EntityManager em;
+
+    public StudyDao(EntityManager em) {
+        this.em = em;
+    }
+
+    public StudyTO createStudy(StudyTO sto) {
+        Study s = Study.fromStudyTO(sto);
+        em.persist(s);
+        return s.toStudyTO();
+    }
+
+    public void deleteStudy(StudyTO sto) {
+        Study s = Study.fromStudyTO(sto);
+        em.remove(s);
+    }
+
+    public StudyTO updateStudy(StudyTO sto) {
+        Study s = Study.fromStudyTO(sto);
+        Study up = em.merge(s);
+        return up.toStudyTO();
+    }
+
+    public StudyTO findStudy(StudyTO sto) {
+        Study found = em.find(Study.class, sto.getId());
+        return found.toStudyTO();
+    }
+
+    private <T> StudyTO findBy(String queryName, String varName, T value) {
+        Study found = (Study) em.createNamedQuery(queryName)
+                .setParameter(varName, value)
+                .getSingleResult();
+        return found.toStudyTO();
+    }
+
+    public StudyTO findById(long id) {
+        return findBy("Study.findById", "id", id);
+    }
+
+    public StudyTO findByName(String name) {
+        return findBy("Study.findByName", "name", name);
+    }
+
+    public StudyTO findByCreationDate(Date creationDate) {
+        return findBy("Study.findByCreationDate", "creationDate", creationDate);
+    }
+
+    public StudyTO findByUpdateDate(Date updateDate) {
+        return findBy("Study.findByUpdateDate", "updateDate", updateDate);
+    }
+
+    public StudyTO findByDeletionDate(Date deletionDate) {
+        return findBy("Study.findByDeletionDate", "deletionDate", deletionDate);
+    }
+
+}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/UserDao.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/UserDao.java
new file mode 100644 (file)
index 0000000..fbdb007
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * (C) 2015 EDF
+ */
+package com.edf.gde.dao;
+
+import com.edf.gde.entities.Group;
+import com.edf.gde.entities.User;
+import com.edf.gde.entities.UserGroup;
+import java.util.List;
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+
+/**
+ *
+ * @author Kavoos
+ */
+public class UserDao {
+    private final EntityManager em;
+    public UserDao(EntityManager em) {
+        this.em = em;
+    }
+
+    /**
+     * Create a new user
+     *
+     * @param userName
+     * @param password
+     * @return the new User or null if user exists or on error
+     */
+    public User createUser(String userName, String password) {
+
+        if (userExists(userName)) {
+            throw new RuntimeException("Unable to create user " + userName);
+        }
+        User user = new User();
+        user.setName(userName);
+        user.setPassword(password);
+        em.persist(user);
+        return user;
+    }
+
+    /**
+     * Create a new group
+     *
+     * @param groupName
+     * @return the new created Group or null on error
+     */
+    public Group createGroup(String groupName) {
+        if (groupExists(groupName)) {
+            throw new RuntimeException("Unable to create group " + groupName);
+        }
+        Group group = new Group();
+        group.setName(groupName);
+        em.persist(group);
+        return group;
+    }
+
+    /**
+     * Find group
+     *
+     * @param name
+     * @return null if the group does not exists
+     */
+    public Group findGroup(String name) {
+        Group group = null;
+        Query q = em.createNamedQuery("Group.findByName");
+        q.setParameter("name", name);
+        group = (Group) q.getSingleResult();
+        return group;
+    }
+
+    /**
+     *
+     * @param id
+     * @return
+     */
+    public Group findGroup(long id) {
+        Group group = null;
+        Query q = em.createNamedQuery("Group.findById");
+        q.setParameter("id", id);
+        group = (Group) q.getSingleResult();
+        return group;
+    }
+
+    /**
+     *
+     * @param name
+     * @return
+     */
+    private boolean groupExists(String name) {
+        Group group = null;
+        Query q = em.createNamedQuery("Group.findByName");
+        q.setParameter("name", name);
+        try {
+            group = (Group) q.getSingleResult();
+        } catch (Exception ex) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Add a user to a group
+     *
+     * @param groupId
+     * @param userId
+     * @return
+     */
+    public void addToGroup(long groupId, long userId) {
+        if (!isInGroup(groupId, userId)) {
+            UserGroup userGroup = new UserGroup();
+            userGroup.setGroupId(groupId);
+            userGroup.setUserId(userId);
+            em.persist(userGroup);
+        } else {
+            throw new RuntimeException("Unable to add " + userId + " to group " + groupId);
+        }
+    }
+
+    /**
+     * Add users to a group in one transaction
+     *
+     * @param groupId
+     * @param userIds
+     * @return
+     */
+    public void addToGroup(long groupId, List<Long> userIds) {
+        for (Long id : userIds) {
+            addToGroup(groupId, id);
+        }
+    }
+
+    /**
+     *
+     * @param groupId
+     * @param userId
+     * @return
+     */
+    public void removeFromGroup(long groupId, long userId) {
+        Query q = em.createNamedQuery("UserGroup.findByGroupIdUserId");
+        q.setParameter("groupId", groupId);
+        q.setParameter("userId", userId);
+        List<UserGroup> l = q.getResultList();
+        if (l.isEmpty()) {
+            throw new RuntimeException("UserGroup not found");
+        }
+        UserGroup ug = l.get(0);
+        em.remove(ug);
+    }
+
+    /**
+     *
+     * @param groupId
+     * @param userId
+     * @return
+     */
+    public boolean isInGroup(long groupId, long userId) {
+        Query q = em.createNamedQuery("UserGroup.findByGroupIdUserId");
+        q.setParameter("groupId", groupId);
+        q.setParameter("userId", userId);
+        List<UserGroup> l = q.getResultList();
+        return !l.isEmpty();
+    }
+
+    /**
+     * Find user by user name (login)
+     *
+     * @param userName
+     * @return
+     */
+    public User findUser(String userName) {
+        Query q = em.createNamedQuery("User.findByName");
+        q.setParameter("username", userName);
+        User user = null;
+        user = (User) q.getSingleResult();
+        return user;
+    }
+
+    /**
+     *
+     * @param userName
+     * @return
+     */
+    private boolean userExists(String userName) {
+        Query q = em.createNamedQuery("User.findByName");
+        q.setParameter("username", userName);
+        User user = null;
+        try {
+            user = (User) q.getSingleResult();
+        } catch (Exception ex) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     *
+     * @param id
+     * @return
+     */
+    public User findUser(long id) {
+        return em.find(User.class, id);
+    }
+
+    /**
+     *
+     * @param userId
+     * @return
+     */
+    public boolean deleteUser(long userId) {
+        User user = findUser(userId);
+        if (user != null) {
+            em.remove(user);
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     *
+     * @param groupId
+     * @return
+     */
+    public boolean deleteGroup(long groupId) {
+        Group group = findGroup(groupId);
+        if (group != null) {
+            em.remove(group);
+            return true;
+        }
+        return false;
+    }
+
+}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/ChunkDAO.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/ChunkDAO.java
deleted file mode 100644 (file)
index d55c6bb..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-package com.edf.gde.ejb;
-
-import com.edf.gde.entities.Chunk;
-import com.edf.gde.transferables.ChunkTO;
-import javax.ejb.Stateless;
-import javax.ejb.LocalBean;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-/**
- *
- * @author F62173
- */
-@Stateless
-@LocalBean
-public class ChunkDAO {
-    @PersistenceContext(unitName = "GDE-ejbPU")
-    private EntityManager em;
-
-    public ChunkTO createChunk(ChunkTO cto) {
-        Chunk c = Chunk.fromChunkTO(cto);
-        em.persist(c);
-        return c.toChunkTO();
-    }
-
-    public void deleteChunk(ChunkTO cto) {
-        Chunk c = Chunk.fromChunkTO(cto);
-        em.remove(c);
-    }
-    public ChunkTO updateChunk(ChunkTO cto) {
-        Chunk c = Chunk.fromChunkTO(cto);
-        Chunk up = em.merge(c);
-        return up.toChunkTO();
-    }
-    
-    public ChunkTO findChunk(ChunkTO cto) {
-        Chunk found = em.find(Chunk.class, cto.getId());
-        return found.toChunkTO();
-    }
-    
-    public ChunkTO findById(long id) {
-        try {
-            Chunk found = (Chunk) em.createNamedQuery("Chunk.findById")
-                                    .setParameter("id", id)
-                                    .getSingleResult();
-            return found.toChunkTO();
-        }
-        catch (Exception e) {
-            return null;
-        }
-    }
-    
-    public ChunkTO findByFileId(long fileId) {
-        try {
-            Chunk found = (Chunk) em.createNamedQuery("Chunk.findByFileId")
-                                    .setParameter("fileId", fileId)
-                                    .getSingleResult();
-            return found.toChunkTO();
-        }
-        catch (Exception e) {
-            return null;
-        }
-    }
-    
-}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/ChunkEJB.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/ChunkEJB.java
new file mode 100644 (file)
index 0000000..0a86ff7
--- /dev/null
@@ -0,0 +1,51 @@
+package com.edf.gde.ejb;
+
+import com.edf.gde.dao.ChunkDao;
+import com.edf.gde.transferables.ChunkTO;
+import javax.ejb.Stateless;
+import javax.ejb.LocalBean;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+/**
+ *
+ * @author F62173
+ */
+@Stateless
+@LocalBean
+public class ChunkEJB {
+
+    @PersistenceContext(unitName = "GDE-ejbPU")
+    private EntityManager em;
+
+    public ChunkTO createChunk(ChunkTO cto) {
+        ChunkDao dao = new ChunkDao(em);
+        return dao.createChunk(cto);
+    }
+
+    public void deleteChunk(ChunkTO cto) {
+        ChunkDao dao = new ChunkDao(em);
+        dao.deleteChunk(cto);
+    }
+
+    public ChunkTO updateChunk(ChunkTO cto) {
+        ChunkDao dao = new ChunkDao(em);
+        return dao.updateChunk(cto);
+    }
+
+    public ChunkTO findChunk(ChunkTO cto) {
+        ChunkDao dao = new ChunkDao(em);
+        return dao.findChunk(cto);
+    }
+
+    public ChunkTO findById(long id) {
+        ChunkDao dao = new ChunkDao(em);
+        return dao.findById(id);
+    }
+
+    public ChunkTO findByFileId(long fileId) {
+        ChunkDao dao = new ChunkDao(em);
+        return dao.findByFileId(fileId);
+    }
+
+}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/FileDAO.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/FileDAO.java
deleted file mode 100644 (file)
index e8c30b1..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.edf.gde.ejb;
-
-import com.edf.gde.entities.GDEFile;
-import com.edf.gde.transferables.FileTO;
-import java.util.Date;
-import javax.ejb.Stateless;
-import javax.ejb.LocalBean;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-/**
- *
- * @author F62173
- */
-@Stateless
-@LocalBean
-public class FileDAO {
-    @PersistenceContext(unitName = "GDE-ejbPU")
-    private EntityManager em;
-
-    public FileTO createFile(FileTO fto) {
-        GDEFile f = GDEFile.fromFileTO(fto);
-        em.persist(f);
-        return f.toFileTO();
-    }
-
-    public void deleteFile(FileTO fto) {
-        GDEFile f = GDEFile.fromFileTO(fto);
-        em.remove(f);
-    }
-    public FileTO updateFile(FileTO fto) {
-        GDEFile f = GDEFile.fromFileTO(fto);
-        GDEFile up = em.merge(f);
-        return up.toFileTO();
-    }
-    
-    public FileTO findFile(FileTO fto) {
-        GDEFile found = em.find(GDEFile.class, fto.getId());
-        return found.toFileTO();
-    }
-    
-    private <T> FileTO findBy(String queryName, String varName, T value) {
-        try {
-            GDEFile found = (GDEFile) em.createNamedQuery(queryName)
-                                        .setParameter(varName, value)
-                                        .getSingleResult();
-            return found.toFileTO();
-        }
-        catch (Exception e) {
-            return null;
-        }
-    }
-    
-    public FileTO findById(long id) {
-        return findBy("File.findById", "id", id);
-    }
-    
-    public FileTO findByName(String name) {
-        return findBy("File.findByName", "name", name);
-    }
-    
-    public FileTO findByCreationDate(Date creationDate) {
-        return findBy("File.findByCreationDate", "creationDate", creationDate);
-    }
-    
-    public FileTO findByUpdateDate(Date updateDate) {
-        return findBy("File.findByUpdateDate", "updateDate", updateDate);
-    }
-    
-    public FileTO findByDeletionDate(Date deletionDate) {
-        return findBy("File.findByDeletionDate", "deletionDate", deletionDate);
-    }
-    
-}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/FileEJB.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/FileEJB.java
new file mode 100644 (file)
index 0000000..73abd4a
--- /dev/null
@@ -0,0 +1,67 @@
+package com.edf.gde.ejb;
+
+import com.edf.gde.dao.FileDao;
+import com.edf.gde.transferables.FileTO;
+import java.util.Date;
+import javax.ejb.Stateless;
+import javax.ejb.LocalBean;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+/**
+ *
+ * @author F62173
+ */
+@Stateless
+@LocalBean
+public class FileEJB {
+
+    @PersistenceContext(unitName = "GDE-ejbPU")
+    private EntityManager em;
+
+    public FileTO createFile(FileTO fto) {
+        FileDao dao = new FileDao(em);
+        return dao.createFile(fto);
+    }
+
+    public void deleteFile(FileTO fto) {
+        FileDao dao = new FileDao(em);
+        dao.deleteFile(fto);
+    }
+
+    public FileTO updateFile(FileTO fto) {
+        FileDao dao = new FileDao(em);
+        return dao.updateFile(fto);
+    }
+
+    public FileTO findFile(FileTO fto) {
+        FileDao dao = new FileDao(em);
+        return dao.findFile(fto);
+    }
+
+    public FileTO findById(long id) {
+        FileDao dao = new FileDao(em);
+        return dao.findById(id);
+    }
+
+    public FileTO findByName(String name) {
+        FileDao dao = new FileDao(em);
+        return dao.findByName(name);
+    }
+
+    public FileTO findByCreationDate(Date creationDate) {
+        FileDao dao = new FileDao(em);
+        return dao.findByCreationDate(creationDate);
+    }
+
+    public FileTO findByUpdateDate(Date updateDate) {
+        FileDao dao = new FileDao(em);
+        return dao.findByUpdateDate(updateDate);
+    }
+
+    public FileTO findByDeletionDate(Date deletionDate) {
+        FileDao dao = new FileDao(em);
+        return dao.findByDeletionDate(deletionDate);
+    }
+
+}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/MetadataDAO.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/MetadataDAO.java
deleted file mode 100644 (file)
index f053bbc..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-package com.edf.gde.ejb;
-
-import com.edf.gde.entities.Attribute;
-import com.edf.gde.entities.AttributeGroup;
-import com.edf.gde.transferables.AttributeGroupTO;
-import com.edf.gde.transferables.AttributeTO;
-import javax.ejb.Stateless;
-import javax.ejb.LocalBean;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-/**
- *
- * @author F62173
- */
-@Stateless
-@LocalBean
-public class MetadataDAO {
-    @PersistenceContext(unitName = "GDE-ejbPU")
-    private EntityManager em;
-
-    /* Attributes */
-    
-    public AttributeTO createAttribute(AttributeTO ato) {
-        Attribute a = Attribute.fromAttributeTO(ato);
-        em.persist(a);
-        return a.toAttributeTO();
-    }
-
-    public void deleteAttribute(AttributeTO ato) {
-        Attribute a = Attribute.fromAttributeTO(ato);
-        em.remove(a);
-    }
-    public AttributeTO updateAttribute(AttributeTO ato) {
-        Attribute a = Attribute.fromAttributeTO(ato);
-        Attribute up = em.merge(a);
-        return up.toAttributeTO();
-    }
-    
-    public AttributeTO findAttribute(AttributeTO ato) {
-        Attribute found = em.find(Attribute.class, ato.getId());
-        return found.toAttributeTO();
-    }
-    
-    private <T> AttributeTO findBy(String queryName, String varName, T value) {
-        try {
-            Attribute found = (Attribute) em.createNamedQuery(queryName)
-                                          .setParameter(varName, value)
-                                          .getSingleResult();
-            return found.toAttributeTO();
-        }
-        catch (Exception e) {
-            return null;
-        }
-    }
-    
-    public AttributeTO findById(long id) {
-        return findBy("Attribute.findById", "id", id);
-    }
-    
-    public AttributeTO findByName(String name) {
-        return findBy("Attribute.findByName", "name", name);
-    }
-    
-    public AttributeTO findByType(String type) {
-        return findBy("Attribute.findByType", "type", type);
-    }
-    
-    public AttributeTO findByValue(String value) {
-        return findBy("Attribute.findByValue", "value", value);
-    }
-
-    /* Attributes Groups */
-    
-    public AttributeGroupTO createAttributeGroup(AttributeGroupTO agto) {
-        AttributeGroup group = AttributeGroup.fromAttributeGroupTO(agto);
-        em.persist(group);
-        return group.toAttributeGroupTO();
-    }
-
-    public void deleteAttributeGroup(AttributeGroupTO agto) {
-        AttributeGroup group = AttributeGroup.fromAttributeGroupTO(agto);
-        em.remove(group);
-    }
-    public AttributeGroupTO updateAttributeGroup(AttributeGroupTO agto) {
-        AttributeGroup group = AttributeGroup.fromAttributeGroupTO(agto);
-        AttributeGroup up = em.merge(group);
-        return up.toAttributeGroupTO();
-    }
-    
-    public AttributeGroupTO findAttributeGroup(AttributeGroupTO agto) {
-        AttributeGroup found = em.find(AttributeGroup.class, agto.getId());
-        return found.toAttributeGroupTO();
-    }
-    
-    public AttributeGroupTO findGroupById(long groupId) {
-        try {
-            AttributeGroup found = (AttributeGroup) em.createNamedQuery("AttributeGroup.findById")
-                                    .setParameter("id", groupId)
-                                    .getSingleResult();
-            return found.toAttributeGroupTO();
-        }
-        catch (Exception e) {
-            return null;
-        }
-    }
-    
-}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/MetadataEJB.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/MetadataEJB.java
new file mode 100644 (file)
index 0000000..437f1e6
--- /dev/null
@@ -0,0 +1,89 @@
+package com.edf.gde.ejb;
+
+import com.edf.gde.dao.MetadataDao;
+import com.edf.gde.transferables.AttributeGroupTO;
+import com.edf.gde.transferables.AttributeTO;
+import javax.ejb.Stateless;
+import javax.ejb.LocalBean;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+/**
+ *
+ * @author F62173
+ */
+@Stateless
+@LocalBean
+public class MetadataEJB {
+
+    @PersistenceContext(unitName = "GDE-ejbPU")
+    private EntityManager em;
+
+    /* Attributes */
+    public AttributeTO createAttribute(AttributeTO ato) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.createAttribute(ato);
+    }
+
+    public void deleteAttribute(AttributeTO ato) {
+        MetadataDao dao = new MetadataDao(em);
+        dao.deleteAttribute(ato);
+    }
+
+    public AttributeTO updateAttribute(AttributeTO ato) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.updateAttribute(ato);
+    }
+
+    public AttributeTO findAttribute(AttributeTO ato) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.findAttribute(ato);
+    }
+
+    public AttributeTO findById(long id) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.findById(id);
+    }
+
+    public AttributeTO findByName(String name) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.findByName(name);
+    }
+
+    public AttributeTO findByType(String type) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.findByType(type);
+    }
+
+    public AttributeTO findByValue(String value) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.findByValue(value);
+    }
+
+    /* Attributes Groups */
+    public AttributeGroupTO createAttributeGroup(AttributeGroupTO agto) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.createAttributeGroup(agto);
+    }
+
+    public void deleteAttributeGroup(AttributeGroupTO agto) {
+        MetadataDao dao = new MetadataDao(em);
+        dao.deleteAttributeGroup(agto);
+    }
+
+    public AttributeGroupTO updateAttributeGroup(AttributeGroupTO agto) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.updateAttributeGroup(agto);
+    }
+
+    public AttributeGroupTO findAttributeGroup(AttributeGroupTO agto) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.findAttributeGroup(agto);
+    }
+
+    public AttributeGroupTO findGroupById(long groupId) {
+        MetadataDao dao = new MetadataDao(em);
+        return dao.findGroupById(groupId);
+    }
+
+}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/StudyDAO.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/StudyDAO.java
deleted file mode 100644 (file)
index 4dacf5f..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.edf.gde.ejb;
-
-import com.edf.gde.entities.Study;
-import com.edf.gde.transferables.StudyTO;
-import java.util.Date;
-import javax.ejb.Stateless;
-import javax.ejb.LocalBean;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-/**
- *
- * @author F62173
- */
-@Stateless
-@LocalBean
-public class StudyDAO {
-    @PersistenceContext(unitName = "GDE-ejbPU")
-    private EntityManager em;
-    
-    public StudyTO createStudy(StudyTO sto) {
-        Study s = Study.fromStudyTO(sto);
-        em.persist(s);
-        return s.toStudyTO();
-    }
-
-    public void deleteStudy(StudyTO sto) {
-        Study s = Study.fromStudyTO(sto);
-        em.remove(s);
-    }
-    public StudyTO updateStudy(StudyTO sto) {
-        Study s = Study.fromStudyTO(sto);
-        Study up = em.merge(s);
-        return up.toStudyTO();
-    }
-    
-    public StudyTO findStudy(StudyTO sto) {
-        Study found = em.find(Study.class, sto.getId());
-        return found.toStudyTO();
-    }
-    
-    private <T> StudyTO findBy(String queryName, String varName, T value) {
-        try {
-            Study found = (Study) em.createNamedQuery(queryName)
-                                    .setParameter(varName, value)
-                                    .getSingleResult();
-            return found.toStudyTO();
-        }
-        catch (Exception e) {
-            return null;
-        }
-    }
-    
-    public StudyTO findById(long id) {
-        return findBy("Study.findById", "id", id);
-    }
-    
-    public StudyTO findByName(String name) {
-        return findBy("Study.findByName", "name", name);
-    }
-    
-    public StudyTO findByCreationDate(Date creationDate) {
-        return findBy("Study.findByCreationDate", "creationDate", creationDate);
-    }
-    
-    public StudyTO findByUpdateDate(Date updateDate) {
-        return findBy("Study.findByUpdateDate", "updateDate", updateDate);
-    }
-    
-    public StudyTO findByDeletionDate(Date deletionDate) {
-        return findBy("Study.findByDeletionDate", "deletionDate", deletionDate);
-    }
-    
-}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/StudyEJB.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/StudyEJB.java
new file mode 100644 (file)
index 0000000..7a28660
--- /dev/null
@@ -0,0 +1,67 @@
+package com.edf.gde.ejb;
+
+import com.edf.gde.dao.StudyDao;
+import com.edf.gde.transferables.StudyTO;
+import java.util.Date;
+import javax.ejb.Stateless;
+import javax.ejb.LocalBean;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+/**
+ *
+ * @author F62173
+ */
+@Stateless
+@LocalBean
+public class StudyEJB {
+
+    @PersistenceContext(unitName = "GDE-ejbPU")
+    private EntityManager em;
+
+    public StudyTO createStudy(StudyTO sto) {
+        StudyDao dao = new StudyDao(em);
+        return dao.createStudy(sto);
+    }
+
+    public void deleteStudy(StudyTO sto) {
+        StudyDao dao = new StudyDao(em);
+        dao.deleteStudy(sto);
+    }
+
+    public StudyTO updateStudy(StudyTO sto) {
+        StudyDao dao = new StudyDao(em);
+        return dao.updateStudy(sto);
+    }
+
+    public StudyTO findStudy(StudyTO sto) {
+        StudyDao dao = new StudyDao(em);
+        return dao.findStudy(sto);
+    }
+
+    public StudyTO findById(long id) {
+        StudyDao dao = new StudyDao(em);
+        return dao.findById(id);
+    }
+
+    public StudyTO findByName(String name) {
+        StudyDao dao = new StudyDao(em);
+        return dao.findByName(name);
+    }
+
+    public StudyTO findByCreationDate(Date creationDate) {
+        StudyDao dao = new StudyDao(em);
+        return dao.findByCreationDate(creationDate);
+    }
+
+    public StudyTO findByUpdateDate(Date updateDate) {
+        StudyDao dao = new StudyDao(em);
+        return dao.findByUpdateDate(updateDate);
+    }
+
+    public StudyTO findByDeletionDate(Date deletionDate) {
+        StudyDao dao = new StudyDao(em);
+        return dao.findByDeletionDate(deletionDate);
+    }
+
+}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/UserDAO.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/UserDAO.java
deleted file mode 100644 (file)
index ac57a6c..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-package com.edf.gde.ejb;
-
-import com.edf.gde.entities.Group;
-import com.edf.gde.entities.User;
-import com.edf.gde.entities.UserGroup;
-import java.util.List;
-import javax.ejb.Stateless;
-import javax.ejb.LocalBean;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-/**
- *
- * @author Kavoos
- */
-@Stateless
-@LocalBean
-public class UserDAO {
-
-    @PersistenceContext(unitName = "GDE-ejbPU")
-    private EntityManager em;
-
-    /**
-     * Create a new user
-     *
-     * @param userName
-     * @param password
-     * @return the new User or null if user exists or on error
-     */
-    public User createUser(String userName, String password) {
-
-        if (userExists(userName)) {
-            throw new RuntimeException("Unable to create user " + userName);
-        }
-        User user = new User();
-        user.setName(userName);
-        user.setPassword(password);
-        em.persist(user);
-        return user;
-    }
-
-    /**
-     * Create a new group
-     *
-     * @param groupName
-     * @return the new created Group or null on error
-     */
-    public Group createGroup(String groupName) {
-        if (groupExists(groupName)) {
-            throw new RuntimeException("Unable to create group " + groupName);
-        }
-        Group group = new Group();
-        group.setName(groupName);
-        em.persist(group);
-        return group;
-    }
-
-    /**
-     * Find group
-     *
-     * @param name
-     * @return null if the group does not exists
-     */
-    public Group findGroup(String name) {
-        Group group = null;
-        Query q = em.createNamedQuery("Group.findByName");
-        q.setParameter("name", name);
-        group = (Group) q.getSingleResult();
-        return group;
-    }
-
-    /**
-     *
-     * @param id
-     * @return
-     */
-    public Group findGroup(long id) {
-        Group group = null;
-        Query q = em.createNamedQuery("Group.findById");
-        q.setParameter("id", id);
-        group = (Group) q.getSingleResult();
-        return group;
-    }
-
-    /**
-     *
-     * @param name
-     * @return
-     */
-    private boolean groupExists(String name) {
-        Group group = null;
-        Query q = em.createNamedQuery("Group.findByName");
-        q.setParameter("name", name);
-        try {
-            group = (Group) q.getSingleResult();
-        } catch (Exception ex) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Add a user to a group
-     *
-     * @param groupId
-     * @param userId
-     * @return
-     */
-    public void addToGroup(long groupId, long userId) {
-        if (!isInGroup(groupId, userId)) {
-            UserGroup userGroup = new UserGroup();
-            userGroup.setGroupId(groupId);
-            userGroup.setUserId(userId);
-            em.persist(userGroup);
-        } else {
-            throw new RuntimeException("Unable to add " + userId + " to group " + groupId);
-        }
-    }
-
-    /**
-     * Add users to a group in one transaction
-     *
-     * @param groupId
-     * @param userIds
-     * @return
-     */
-    public void addToGroup(long groupId, List<Long> userIds) {
-        for (Long id : userIds) {
-            addToGroup(groupId, id);
-        }
-    }
-
-    /**
-     *
-     * @param groupId
-     * @param userId
-     * @return
-     */
-    public void removeFromGroup(long groupId, long userId) {
-        Query q = em.createNamedQuery("UserGroup.findByGroupIdUserId");
-        q.setParameter("groupId", groupId);
-        q.setParameter("userId", userId);
-        List<UserGroup> l = q.getResultList();
-        if (l.isEmpty()) {
-            throw new RuntimeException("UserGroup not found");
-        }
-        UserGroup ug = l.get(0);
-        em.remove(ug);
-    }
-
-    /**
-     *
-     * @param groupId
-     * @param userId
-     * @return
-     */
-    public boolean isInGroup(long groupId, long userId) {
-        Query q = em.createNamedQuery("UserGroup.findByGroupIdUserId");
-        q.setParameter("groupId", groupId);
-        q.setParameter("userId", userId);
-        List<UserGroup> l = q.getResultList();
-        return !l.isEmpty();
-    }
-
-    /**
-     * Find user by user name (login)
-     *
-     * @param userName
-     * @return
-     */
-    public User findUser(String userName) {
-        Query q = em.createNamedQuery("User.findByName");
-        q.setParameter("username", userName);
-        User user = null;
-        user = (User) q.getSingleResult();
-        return user;
-    }
-
-    /**
-     *
-     * @param userName
-     * @return
-     */
-    private boolean userExists(String userName) {
-        Query q = em.createNamedQuery("User.findByName");
-        q.setParameter("username", userName);
-        User user = null;
-        try {
-            user = (User) q.getSingleResult();
-        } catch (Exception ex) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     *
-     * @param id
-     * @return
-     */
-    public User findUser(long id) {
-        return em.find(User.class, id);
-    }
-
-    /**
-     *
-     * @param userId
-     * @return
-     */
-    public boolean deleteUser(long userId) {
-        User user = findUser(userId);
-        if (user != null) {
-            em.remove(user);
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     *
-     * @param groupId
-     * @return
-     */
-    public boolean deleteGroup(long groupId) {
-        Group group = findGroup(groupId);
-        if (group != null) {
-            em.remove(group);
-            return true;
-        }
-        return false;
-    }
-}
diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/UserEJB.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/UserEJB.java
new file mode 100644 (file)
index 0000000..a72aa84
--- /dev/null
@@ -0,0 +1,153 @@
+package com.edf.gde.ejb;
+
+import com.edf.gde.dao.UserDao;
+import com.edf.gde.entities.Group;
+import com.edf.gde.entities.User;
+import java.util.List;
+import javax.ejb.Stateless;
+import javax.ejb.LocalBean;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+/**
+ *
+ * @author Kavoos
+ */
+@Stateless
+@LocalBean
+public class UserEJB {
+
+    @PersistenceContext(unitName = "GDE-ejbPU")
+    private EntityManager em;
+
+    /**
+     * Create a new user
+     *
+     * @param userName
+     * @param password
+     * @return the new User or null if user exists or on error
+     */
+    public User createUser(String userName, String password) {
+        UserDao dao = new UserDao(em);
+        return dao.createUser(userName, password);
+    }
+
+    /**
+     * Create a new group
+     *
+     * @param groupName
+     * @return the new created Group or null on error
+     */
+    public Group createGroup(String groupName) {
+        UserDao dao = new UserDao(em);
+        return dao.createGroup(groupName);
+    }
+
+    /**
+     * Find group
+     *
+     * @param name
+     * @return null if the group does not exists
+     */
+    public Group findGroup(String name) {
+        UserDao dao = new UserDao(em);
+        return dao.findGroup(name);
+    }
+
+    /**
+     *
+     * @param id
+     * @return
+     */
+    public Group findGroup(long id) {
+        UserDao dao = new UserDao(em);
+        return dao.findGroup(id);
+    }
+
+    /**
+     * Add a user to a group
+     *
+     * @param groupId
+     * @param userId
+     * @return
+     */
+    public void addToGroup(long groupId, long userId) {
+        UserDao dao = new UserDao(em);
+        dao.addToGroup(groupId, userId);
+    }
+
+    /**
+     * Add users to a group in one transaction
+     *
+     * @param groupId
+     * @param userIds
+     * @return
+     */
+    public void addToGroup(long groupId, List<Long> userIds) {
+        UserDao dao = new UserDao(em);
+        dao.addToGroup(groupId, userIds);
+    }
+
+    /**
+     *
+     * @param groupId
+     * @param userId
+     * @return
+     */
+    public void removeFromGroup(long groupId, long userId) {
+        UserDao dao = new UserDao(em);
+        dao.removeFromGroup(groupId, userId);
+    }
+
+    /**
+     *
+     * @param groupId
+     * @param userId
+     * @return
+     */
+    public boolean isInGroup(long groupId, long userId) {
+        UserDao dao = new UserDao(em);
+        return dao.isInGroup(groupId, userId);
+    }
+
+    /**
+     * Find user by user name (login)
+     *
+     * @param userName
+     * @return
+     */
+    public User findUser(String userName) {
+        UserDao dao = new UserDao(em);
+        return dao.findUser(userName);
+    }
+
+    /**
+     *
+     * @param id
+     * @return
+     */
+    public User findUser(long id) {
+        UserDao dao = new UserDao(em);
+        return dao.findUser(id);
+    }
+
+    /**
+     *
+     * @param userId
+     * @return
+     */
+    public boolean deleteUser(long userId) {
+        UserDao dao = new UserDao(em);
+        return dao.deleteUser(userId);
+    }
+
+    /**
+     *
+     * @param groupId
+     * @return
+     */
+    public boolean deleteGroup(long groupId) {
+        UserDao dao = new UserDao(em);
+        return deleteGroup(groupId);
+    }
+}
index 78c421d692f8fe4db1400c2b2226412b2b4add2b..ae6d036a25d49066c822afe9ea1058ce05d10a5d 100644 (file)
@@ -1,7 +1,5 @@
 /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
+ * (C) 2015 EDF
  */
 package com.edf.gde.entities;
 
@@ -34,8 +32,7 @@ import javax.xml.bind.annotation.XmlRootElement;
     @NamedQuery(name = "Attribute.findById", query = "SELECT a FROM Attribute a WHERE a.id = :id"),
     @NamedQuery(name = "Attribute.findByName", query = "SELECT a FROM Attribute a WHERE a.name = :name"),
     @NamedQuery(name = "Attribute.findByType", query = "SELECT a FROM Attribute a WHERE a.type = :type"),
-    @NamedQuery(name = "Attribute.findByValue", query = "SELECT a FROM Attribute a WHERE a.value = :value"),
-    //@NamedQuery(name = "Attribute.findByMandatory", query = "SELECT a FROM Attribute a WHERE a.mandatory = :mandatory")
+    @NamedQuery(name = "Attribute.findByValue", query = "SELECT a FROM Attribute a WHERE a.value = :value")
 })
 public class Attribute implements Serializable {
     private static final long serialVersionUID = 1L;
index b69d6a61fe65f4291bd736c4175df6fdda083f4e..60ce8bf3785a8e44627e492369bd260e9e026c30 100644 (file)
@@ -1,7 +1,5 @@
 /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
+ * (C) 2015 EDF
  */
 package com.edf.gde.entities;
 
index 67223e2a872164376b7662ea28b896b8913aa43b..2fc2ac89f654a167efa43a0233acefcd369b4ff4 100644 (file)
@@ -1,7 +1,5 @@
 /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
+ * (C) 2015 EDF
  */
 package com.edf.gde.entities;
 
@@ -34,10 +32,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @NamedQueries({
     @NamedQuery(name = "Chunk.findAll", query = "SELECT c FROM Chunk c"),
     @NamedQuery(name = "Chunk.findById", query = "SELECT c FROM Chunk c WHERE c.id = :id"),
-    @NamedQuery(name = "Chunk.findByFileId", query = "SELECT c FROM Chunk c WHERE c.fileId = :fileId"),
-    //@NamedQuery(name = "Chunk.findByRank", query = "SELECT c FROM Chunk c WHERE c.rank = :rank"),
-    //@NamedQuery(name = "Chunk.findByChecksum", query = "SELECT c FROM Chunk c WHERE c.checksum = :checksum"),
-    //@NamedQuery(name = "Chunk.findBySize", query = "SELECT c FROM Chunk c WHERE c.size = :size")
+    @NamedQuery(name = "Chunk.findByFileId", query = "SELECT c FROM Chunk c WHERE c.fileId = :fileId")
 })
 public class Chunk implements Serializable {
     private static final long serialVersionUID = 1L;
index 948aba6ffd0ab13fb7958284594b0d6dead976c0..e74bcee0bbdd0c8061f6d2a609528a7aa4dc9294 100644 (file)
@@ -1,3 +1,6 @@
+/*
+ * (C) 2015 EDF
+ */
 package com.edf.gde.entities;
 
 import com.edf.gde.transferables.FileTO;
@@ -31,12 +34,8 @@ import javax.xml.bind.annotation.XmlRootElement;
     @NamedQuery(name = "File.findAll", query = "SELECT f FROM File f"),
     @NamedQuery(name = "File.findById", query = "SELECT f FROM File f WHERE f.id = :id"),
     @NamedQuery(name = "File.findByName", query = "SELECT f FROM File f WHERE f.name = :name"),
-    //@NamedQuery(name = "File.findByLength", query = "SELECT f FROM File f WHERE f.length = :length"),
-    //@NamedQuery(name = "File.findByChecksum", query = "SELECT f FROM File f WHERE f.checksum = :checksum"),
     @NamedQuery(name = "File.findByCreationDate", query = "SELECT f FROM File f WHERE f.creationDate = :creationDate"),
     @NamedQuery(name = "File.findByUpdateDate", query = "SELECT f FROM File f WHERE f.updateDate = :updateDate"),
-    //@NamedQuery(name = "File.findByValid", query = "SELECT f FROM File f WHERE f.valid = :valid"),
-    //@NamedQuery(name = "File.findByDeleted", query = "SELECT f FROM File f WHERE f.deleted = :deleted"),
     @NamedQuery(name = "File.findByDeletionDate", query = "SELECT f FROM File f WHERE f.deletionDate = :deletionDate")
 })
 public class GDEFile implements Serializable {
index 64bb3ee043a9cd5a637422b600bfa3ff056d39c4..9a35c4782d43c0e257bf63f9f3fb73b46c898f8d 100644 (file)
@@ -1,3 +1,6 @@
+/*
+ * (C) 2015 EDF
+ */
 package com.edf.gde.entities;
 
 import com.edf.gde.transferables.GroupTO;
index 8acdcfa2c49aacddaed1949c6c13c4b75d42621c..d215437f79553394100194f2049b2596ca587d6e 100644 (file)
@@ -1,7 +1,5 @@
 /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
+ * (C) 2015 EDF
  */
 package com.edf.gde.entities;
 
index d3114a7750a32d0049102f40bd1c0c8299e9338a..66f4da9adfdac457f18715d66f6b7a38b8ec2db1 100644 (file)
@@ -1,7 +1,5 @@
 /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
+ * (C) 2015 EDF
  */
 package com.edf.gde.entities;
 
@@ -34,8 +32,7 @@ import javax.xml.bind.annotation.XmlRootElement;
     @NamedQuery(name = "ProfileAttribute.findAll", query = "SELECT p FROM ProfileAttribute p"),
     @NamedQuery(name = "ProfileAttribute.findById", query = "SELECT p FROM ProfileAttribute p WHERE p.id = :id"),
     @NamedQuery(name = "ProfileAttribute.findByName", query = "SELECT p FROM ProfileAttribute p WHERE p.name = :name"),
-    @NamedQuery(name = "ProfileAttribute.findByType", query = "SELECT p FROM ProfileAttribute p WHERE p.type = :type"),
-    //@NamedQuery(name = "ProfileAttribute.findByMandatory", query = "SELECT p FROM ProfileAttribute p WHERE p.mandatory = :mandatory")
+    @NamedQuery(name = "ProfileAttribute.findByType", query = "SELECT p FROM ProfileAttribute p WHERE p.type = :type")
 })
 public class ProfileAttribute implements Serializable {
     private static final long serialVersionUID = 1L;
index 75f2d7503547399eb558a972bfcd51c9dabb9338..6f5eea76e766a272ce8ff73cf7d7d237d197c59e 100644 (file)
@@ -38,8 +38,6 @@ import javax.xml.bind.annotation.XmlRootElement;
     @NamedQuery(name = "Study.findByName", query = "SELECT s FROM Study s WHERE s.name = :name"),
     @NamedQuery(name = "Study.findByCreationDate", query = "SELECT s FROM Study s WHERE s.creationDate = :creationDate"),
     @NamedQuery(name = "Study.findByUpdateDate", query = "SELECT s FROM Study s WHERE s.updateDate = :updateDate"),
-    //@NamedQuery(name = "Study.findByValid", query = "SELECT s FROM Study s WHERE s.valid = :valid"),
-    //@NamedQuery(name = "Study.findByDeleted", query = "SELECT s FROM Study s WHERE s.deleted = :deleted"),
     @NamedQuery(name = "Study.findByDeletionDate", query = "SELECT s FROM Study s WHERE s.deletionDate = :deletionDate")
 })
 public class Study implements Serializable {
index 0f34fc8f9ef0ce630d9def2b7fd380238e2f4155..fa77c99fa7352a8ef538f5ef672de17ee8a2ea09 100644 (file)
@@ -1,3 +1,6 @@
+/*
+ * (C) 2015 EDF
+ */
 package com.edf.gde.entities;
 
 import com.edf.gde.transferables.UserTO;
index a2fc70004f3fa734587be1d478acbfbe2bc9f0d0..43c0fc05ddf8d8dd96859608fad577332fadb7fe 100644 (file)
@@ -1,3 +1,6 @@
+/*
+ * (C) 2015 EDF
+ */
 package com.edf.gde.entities;
 
 import javax.persistence.Basic;
diff --git a/projects/GDE_App/GDE-war/nbproject/build-impl.xml~ b/projects/GDE_App/GDE-war/nbproject/build-impl.xml~
new file mode 100644 (file)
index 0000000..1cf395f
--- /dev/null
@@ -0,0 +1,1456 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+        *** GENERATED FROM project.xml - DO NOT EDIT  ***
+        ***         EDIT ../build.xml INSTEAD         ***
+
+        For the purpose of easier reading the script
+        is divided into following sections:
+        - initialization
+        - compilation
+        - dist
+        - execution
+        - debugging
+        - javadoc
+        - test compilation
+        - test execution
+        - test debugging
+        - cleanup
+
+        -->
+<project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="GDE-war-impl">
+    <import file="ant-deploy.xml"/>
+    <fail message="Please build using Ant 1.7.1 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.7.1"/>
+            </not>
+        </condition>
+    </fail>
+    <target depends="dist,javadoc" description="Build whole project." name="default"/>
+    <!--
+                INITIALIZATION SECTION
+            -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init" name="-init-private">
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private" name="-init-user">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.4"/>
+        <property name="default.javac.target" value="1.4"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" if="dist.ear.dir" name="-do-ear-init"/>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <condition property="have.tests">
+            <or>
+                <available file="${test.src.dir}"/>
+            </or>
+        </condition>
+        <condition property="have.sources">
+            <or>
+                <available file="${src.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <isfalse value="${javadoc.preview}"/>
+        </condition>
+        <property name="javac.compilerargs" value=""/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+        <condition property="no.dist.ear.dir">
+            <not>
+                <isset property="dist.ear.dir"/>
+            </not>
+        </condition>
+        <property name="build.web.excludes" value="${build.classes.excludes}"/>
+        <condition property="do.compile.jsps">
+            <istrue value="${compile.jsps}"/>
+        </condition>
+        <condition property="do.debug.server">
+            <or>
+                <not>
+                    <isset property="debug.server"/>
+                </not>
+                <istrue value="${debug.server}"/>
+                <and>
+                    <not>
+                        <istrue value="${debug.server}"/>
+                    </not>
+                    <not>
+                        <istrue value="${debug.client}"/>
+                    </not>
+                </and>
+            </or>
+        </condition>
+        <condition property="do.debug.client">
+            <istrue value="${debug.client}"/>
+        </condition>
+        <condition property="do.display.browser">
+            <istrue value="${display.browser}"/>
+        </condition>
+        <condition property="do.display.browser.debug.old">
+            <and>
+                <isset property="do.display.browser"/>
+                <not>
+                    <isset property="do.debug.client"/>
+                </not>
+                <not>
+                    <isset property="browser.context"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="do.display.browser.debug">
+            <and>
+                <isset property="do.display.browser"/>
+                <not>
+                    <isset property="do.debug.client"/>
+                </not>
+                <isset property="browser.context"/>
+            </and>
+        </condition>
+        <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
+        <available file="${persistence.xml.dir}/persistence.xml" property="has.persistence.xml"/>
+        <condition property="do.war.package.with.custom.manifest">
+            <isset property="has.custom.manifest"/>
+        </condition>
+        <condition property="do.war.package.without.custom.manifest">
+            <not>
+                <isset property="has.custom.manifest"/>
+            </not>
+        </condition>
+        <condition property="do.tmp.war.package.with.custom.manifest">
+            <and>
+                <isset property="has.custom.manifest"/>
+                <or>
+                    <isfalse value="${directory.deployment.supported}"/>
+                    <isset property="dist.ear.dir"/>
+                </or>
+            </and>
+        </condition>
+        <condition property="do.tmp.war.package.without.custom.manifest">
+            <and>
+                <not>
+                    <isset property="has.custom.manifest"/>
+                </not>
+                <or>
+                    <isfalse value="${directory.deployment.supported}"/>
+                    <isset property="dist.ear.dir"/>
+                </or>
+            </and>
+        </condition>
+        <condition property="do.tmp.war.package">
+            <or>
+                <isfalse value="${directory.deployment.supported}"/>
+                <isset property="dist.ear.dir"/>
+            </or>
+        </condition>
+        <property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/>
+        <condition else="" property="application.args.param" value="${application.args}">
+            <and>
+                <isset property="application.args"/>
+                <not>
+                    <equals arg1="${application.args}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <property name="source.encoding" value="${file.encoding}"/>
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+            <and>
+                <isset property="javadoc.encoding"/>
+                <not>
+                    <equals arg1="${javadoc.encoding}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>
+        <property name="includes" value="**"/>
+        <property name="excludes" value=""/>
+        <property name="runmain.jvmargs" value=""/>
+        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+            <and>
+                <isset property="endorsed.classpath"/>
+                <length length="0" string="${endorsed.classpath}" when="greater"/>
+            </and>
+        </condition>
+        <condition else="false" property="jdkBug6558476">
+            <and>
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
+                <not>
+                    <os family="unix"/>
+                </not>
+            </and>
+        </condition>
+        <property name="javac.fork" value="${jdkBug6558476}"/>
+        <condition property="junit.available">
+            <or>
+                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
+                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
+            </or>
+        </condition>
+        <condition property="testng.available">
+            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
+        </condition>
+        <condition property="junit+testng.available">
+            <and>
+                <istrue value="${junit.available}"/>
+                <istrue value="${testng.available}"/>
+            </and>
+        </condition>
+        <condition else="testng" property="testng.mode" value="mixed">
+            <istrue value="${junit+testng.available}"/>
+        </condition>
+        <condition else="" property="testng.debug.mode" value="-mixed">
+            <istrue value="${junit+testng.available}"/>
+        </condition>
+    </target>
+    <target depends="init" name="-init-cos" unless="deploy.on.save">
+        <condition property="deploy.on.save" value="true">
+            <or>
+                <istrue value="${j2ee.deploy.on.save}"/>
+                <istrue value="${j2ee.compile.on.save}"/>
+            </or>
+        </condition>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.dir">Must set src.dir</fail>
+        <fail unless="test.src.dir">Must set test.src.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="build.web.dir">Must set build.web.dir</fail>
+        <fail unless="build.generated.dir">Must set build.generated.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+        <fail unless="dist.war">Must set dist.war</fail>
+        <condition property="missing.j2ee.server.home">
+            <and>
+                <matches pattern="j2ee.server.home" string="${j2ee.platform.classpath}"/>
+                <not>
+                    <isset property="j2ee.server.home"/>
+                </not>
+            </and>
+        </condition>
+        <fail if="missing.j2ee.server.home">
+The Java EE server classpath is not correctly set up - server home directory is missing.
+Either open the project in the IDE and assign the server or setup the server classpath manually.
+For example like this:
+   ant -Dj2ee.server.home=&lt;app_server_installation_directory&gt;
+                </fail>
+        <fail unless="j2ee.platform.classpath">
+The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.
+Either open the project in the IDE and assign the server or setup the server classpath manually.
+For example like this:
+   ant -Duser.properties.file=&lt;path_to_property_file&gt; (where you put the property "j2ee.platform.classpath" in a .properties file)
+or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties file is used)
+                </fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${@{value}}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <mkdir dir="@{apgeneratedsrcdir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <compilerarg value="-processorpath"/>
+                    <compilerarg path="@{processorpath}:${empty.dir}"/>
+                    <compilerarg line="${ap.processors.internal}"/>
+                    <compilerarg value="-s"/>
+                    <compilerarg path="@{apgeneratedsrcdir}"/>
+                    <compilerarg line="${ap.proc.none.internal}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+            <sequential>
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </depend>
+            </sequential>
+        </macrodef>
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <sequential>
+                <fail unless="javac.includes">Must set javac.includes</fail>
+                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
+                    <path>
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>
+                    </path>
+                    <globmapper from="*.java" to="*.class"/>
+                </pathconvert>
+                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
+                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
+                <delete>
+                    <files includesfile="${javac.includesfile.binary}"/>
+                </delete>
+                <delete file="${javac.includesfile.binary}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${junit.available}" name="-init-macrodef-junit-init">
+        <condition else="false" property="nb.junit.batch" value="true">
+            <and>
+                <istrue value="${junit.available}"/>
+                <not>
+                    <isset property="test.method"/>
+                </not>
+            </and>
+        </condition>
+        <condition else="false" property="nb.junit.single" value="true">
+            <and>
+                <istrue value="${junit.available}"/>
+                <isset property="test.method"/>
+            </and>
+        </condition>
+    </target>
+    <target name="-init-test-properties">
+        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
+        <property name="test.binarytestincludes" value=""/>
+        <property name="test.binaryexcludes" value=""/>
+    </target>
+    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
+                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="run.jvmargs.ide" value=""/>
+                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                            <filename name="${test.binarytestincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
+    <target if="${testng.available}" name="-init-macrodef-testng">
+        <macrodef name="testng" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
+                    <isset property="test.method"/>
+                </condition>
+                <union id="test.set">
+                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
+                        <filename name="@{testincludes}"/>
+                    </fileset>
+                </union>
+                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
+                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="GDE-war" testname="TestNG tests" workingDir="${basedir}">
+                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
+                    <propertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </propertyset>
+                    <customize/>
+                </testng>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-test-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <echo>No tests executed.</echo>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <webproject2:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </webproject2:junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <webproject2:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </webproject2:testng>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
+        <macrodef name="test" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <sequential>
+                <webproject2:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize>
+                        <classpath>
+                            <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
+                        </classpath>
+                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                        <jvmarg line="${runmain.jvmargs}"/>
+                    </customize>
+                </webproject2:test-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
+        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
+                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
+        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="run.jvmargs.ide" value=""/>
+                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                            <filename name="${test.binarytestincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
+        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <webproject2:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </webproject2:junit-debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${testng.available}" name="-init-macrodef-testng-debug">
+        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <element name="customize2" optional="true"/>
+            <sequential>
+                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
+                    <isset property="test.method"/>
+                </condition>
+                <condition else="-suitename GDE-war -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
+                    <matches pattern=".*\.xml" string="@{testClass}"/>
+                </condition>
+                <delete dir="${build.test.results.dir}" quiet="true"/>
+                <mkdir dir="${build.test.results.dir}"/>
+                <webproject1:debug args="${testng.cmd.args}" classname="org.testng.TestNG" classpath="${debug.test.classpath}:${j2ee.platform.embeddableejb.classpath}">
+                    <customize>
+                        <customize2/>
+                        <jvmarg value="-ea"/>
+                        <arg line="${testng.debug.mode}"/>
+                        <arg line="-d ${build.test.results.dir}"/>
+                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
+                    </customize>
+                </webproject1:debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
+        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <element implicit="true" name="customize2" optional="true"/>
+            <sequential>
+                <webproject2:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
+                    <customize2/>
+                </webproject2:testng-debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
+        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <sequential>
+                <webproject2:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize>
+                        <classpath>
+                            <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
+                        </classpath>
+                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                        <jvmarg line="${runmain.jvmargs}"/>
+                    </customize>
+                </webproject2:test-debug-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
+        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <sequential>
+                <webproject2:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
+                    <customize2>
+                        <syspropertyset>
+                            <propertyref prefix="test-sys-prop."/>
+                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                        </syspropertyset>
+                    </customize2>
+                </webproject2:testng-debug-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
+    <target name="-init-macrodef-java">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${runmain.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}:${j2ee.platform.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-nbjsdebug">
+        <macrodef name="nbjsdebugstart" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute default="${client.url}" name="webUrl"/>
+            <sequential>
+                <nbjsdebugstart urlPart="${client.urlPart}" webUrl="@{webUrl}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute default="${main.class}" name="name"/>
+            <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+            <sequential>
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" transport="${debug-transport}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute default="${build.classes.dir}" name="dir"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset dir="@{dir}" includes="${fix.classes}">
+                        <include name="${fix.includes}*.class"/>
+                    </fileset>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdaappreloaded" uri="http://www.netbeans.org/ns/web-project/1">
+            <sequential>
+                <nbjpdaappreloaded/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-debug-args">
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+            <os family="windows"/>
+        </condition>
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/web-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
+            <attribute default="${application.args.param}" name="args"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <jvmarg line="${runmain.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <arg line="@{args}"/>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-taskdefs">
+        <fail unless="libs.CopyLibs.classpath">
+The libs.CopyLibs.classpath property is not set up.
+This property must point to 
+org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
+of NetBeans IDE installation and is usually located at 
+&lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
+Either open the project in the IDE and make sure CopyLibs library
+exists or setup the property manually. For example like this:
+ ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
+                </fail>
+        <taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/>
+    </target>
+    <target name="-init-ap-cmdline-properties">
+        <property name="annotation.processing.enabled" value="true"/>
+        <property name="annotation.processing.processors.list" value=""/>
+        <property name="annotation.processing.run.all.processors" value="true"/>
+        <property name="javac.processorpath" value="${javac.classpath}"/>
+        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+        <condition property="ap.supported.internal" value="true">
+            <not>
+                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+            <isfalse value="${annotation.processing.run.all.processors}"/>
+        </condition>
+        <condition else="" property="ap.proc.none.internal" value="-proc:none">
+            <isfalse value="${annotation.processing.enabled}"/>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+        <property name="ap.cmd.line.internal" value=""/>
+    </target>
+    <!--
+                pre NB7.2 profiling section; consider it deprecated
+            -->
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
+    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init" if="profiler.info.jvmargs.agent" name="-profile-init-check">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+    </target>
+    <!--
+                end of pre NB7.2 profiling section
+            -->
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-java,-init-macrodef-nbjpda,-init-macrodef-nbjsdebug,-init-macrodef-debug,-init-taskdefs,-init-ap-cmdline" name="init"/>
+    <!--
+                COMPILATION SECTION
+            -->
+    <target depends="init" if="no.dist.ear.dir" name="deps-module-jar" unless="no.deps">
+        <ant antfile="${project.GDE-ejb}/build.xml" inheritall="false" target="dist"/>
+    </target>
+    <target depends="init" if="dist.ear.dir" name="deps-ear-jar" unless="no.deps">
+        <ant antfile="${project.GDE-ejb}/build.xml" inheritall="false" target="dist-ear">
+            <property location="${build.dir}" name="dist.ear.dir"/>
+        </ant>
+    </target>
+    <target depends="init, deps-module-jar, deps-ear-jar" name="deps-jar" unless="no.deps"/>
+    <target depends="init,deps-jar" name="-pre-pre-compile">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-copy-webdir">
+        <copy todir="${build.web.dir}">
+            <fileset dir="${web.docbase.dir}" excludes="${build.web.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+        <copy todir="${build.web.dir}/WEB-INF">
+            <fileset dir="${webinf.dir}" excludes="${build.web.excludes}"/>
+        </copy>
+    </target>
+    <target depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest" if="have.sources" name="-do-compile">
+        <webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target if="has.custom.manifest" name="-copy-manifest">
+        <mkdir dir="${build.meta.inf.dir}"/>
+        <copy todir="${build.meta.inf.dir}">
+            <fileset dir="${conf.dir}" includes="MANIFEST.MF"/>
+        </copy>
+    </target>
+    <target if="has.persistence.xml" name="-copy-persistence-xml">
+        <mkdir dir="${build.web.dir}/WEB-INF/classes/META-INF"/>
+        <copy todir="${build.web.dir}/WEB-INF/classes/META-INF">
+            <fileset dir="${persistence.xml.dir}" includes="persistence.xml orm.xml"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <webproject2:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+    <property name="jspc.schemas" value="/resources/schemas/"/>
+    <property name="jspc.dtds" value="/resources/dtds/"/>
+    <target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps">
+        <mkdir dir="${build.generated.dir}/src"/>
+        <java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true">
+            <arg value="-uriroot"/>
+            <arg file="${basedir}/${build.web.dir}"/>
+            <arg value="-d"/>
+            <arg file="${basedir}/${build.generated.dir}/src"/>
+            <arg value="-die1"/>
+            <arg value="-schemas ${jspc.schemas}"/>
+            <arg value="-dtds ${jspc.dtds}"/>
+            <arg value="-compilerSourceVM ${javac.source}"/>
+            <arg value="-compilerTargetVM ${javac.target}"/>
+            <arg value="-javaEncoding ${source.encoding}"/>
+            <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
+            <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
+        </java>
+        <mkdir dir="${build.generated.dir}/classes"/>
+        <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/>
+    </target>
+    <target depends="compile" if="jsp.includes" name="-do-compile-single-jsp">
+        <fail unless="javac.jsp.includes">Must select some files in the IDE or set javac.jsp.includes</fail>
+        <mkdir dir="${build.generated.dir}/src"/>
+        <java classname="org.netbeans.modules.web.project.ant.JspCSingle" failonerror="true" fork="true">
+            <arg value="-uriroot"/>
+            <arg file="${basedir}/${build.web.dir}"/>
+            <arg value="-d"/>
+            <arg file="${basedir}/${build.generated.dir}/src"/>
+            <arg value="-die1"/>
+            <arg value="-schemas ${jspc.schemas}"/>
+            <arg value="-dtds ${jspc.dtds}"/>
+            <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
+            <arg value="-jspc.files"/>
+            <arg path="${jsp.includes}"/>
+            <arg value="-compilerSourceVM ${javac.source}"/>
+            <arg value="-compilerTargetVM ${javac.target}"/>
+            <arg value="-javaEncoding ${source.encoding}"/>
+            <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
+        </java>
+        <mkdir dir="${build.generated.dir}/classes"/>
+        <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src">
+            <customize>
+                <patternset includes="${javac.jsp.includes}"/>
+            </customize>
+        </webproject2:javac>
+    </target>
+    <target name="compile-single-jsp">
+        <fail unless="jsp.includes">Must select a file in the IDE or set jsp.includes</fail>
+        <antcall target="-do-compile-single-jsp"/>
+    </target>
+    <!--
+                DIST BUILDING SECTION
+            -->
+    <target name="-pre-dist">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.without.custom.manifest" name="-do-dist-without-manifest">
+        <dirname file="${dist.war}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+        <jar compress="${jar.compress}" jarfile="${dist.war}">
+            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
+        </jar>
+    </target>
+    <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest">
+        <dirname file="${dist.war}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+        <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
+            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
+        </jar>
+    </target>
+    <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest">
+        <dirname file="${dist.war}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+        <jar compress="${jar.compress}" jarfile="${dist.war}">
+            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
+        </jar>
+    </target>
+    <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest">
+        <dirname file="${dist.war}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+        <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
+            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
+        </jar>
+    </target>
+    <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
+    <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
+        <copyfiles files="${file.reference.gson-2.3.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${reference.GDE-ejb.dist}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}"/>
+        <copyfiles files="${libs.junit_4.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <mkdir dir="${build.web.dir}/META-INF"/>
+        <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
+    </target>
+    <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
+        <copyfiles files="${file.reference.gson-2.3.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${reference.GDE-ejb.dist}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${libs.junit_4.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
+    </target>
+    <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
+        <delete dir="${build.web.dir}/WEB-INF/lib"/>
+    </target>
+    <target depends="init,-clean-webinf-lib,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist">
+        <dirname file="${dist.ear.war}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+        <jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
+            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
+        </jar>
+    </target>
+    <target name="-post-dist">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-dist,do-dist,-post-dist" description="Build distribution (WAR)." name="dist"/>
+    <target depends="init,-clean-webinf-lib,-init-cos,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR." name="dist-ear"/>
+    <!--
+                EXECUTION SECTION
+            -->
+    <target depends="run-deploy,run-display-browser" description="Deploy to server and show in browser." name="run"/>
+    <target name="-pre-run-deploy">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-post-run-deploy">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-pre-nbmodule-run-deploy">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
+    </target>
+    <target name="-post-nbmodule-run-deploy">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
+    </target>
+    <target name="-run-deploy-am">
+        <!-- Task to deploy to the Access Manager runtime. -->
+    </target>
+    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy,-do-update-breakpoints" name="run-deploy"/>
+    <target if="netbeans.home" name="-run-deploy-nb">
+        <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
+    </target>
+    <target name="-init-deploy-ant" unless="netbeans.home">
+        <property name="deploy.ant.archive" value="${dist.war}"/>
+        <property name="deploy.ant.docbase.dir" value="${web.docbase.dir}"/>
+        <property name="deploy.ant.resource.dir" value="${resource.dir}"/>
+        <property name="deploy.ant.enabled" value="true"/>
+    </target>
+    <target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
+    <target if="netbeans.home" name="-run-undeploy-nb">
+        <fail message="Undeploy is not supported from within the IDE"/>
+    </target>
+    <target depends="init,-pre-dist,dist,-post-dist" name="verify">
+        <nbverify file="${dist.war}"/>
+    </target>
+    <target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
+    <target if="do.display.browser" name="-init-display-browser">
+        <condition property="do.display.browser.nb.old">
+            <and>
+                <isset property="netbeans.home"/>
+                <not>
+                    <isset property="browser.context"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="do.display.browser.nb">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="browser.context"/>
+            </and>
+        </condition>
+        <condition property="do.display.browser.cl">
+            <isset property="deploy.ant.enabled"/>
+        </condition>
+    </target>
+    <target if="do.display.browser.nb.old" name="-display-browser-nb-old">
+        <nbbrowse url="${client.url}"/>
+    </target>
+    <target if="do.display.browser.nb" name="-display-browser-nb">
+        <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
+    </target>
+    <target if="do.display.browser.cl" name="-get-browser" unless="browser">
+        <condition property="browser" value="rundll32">
+            <os family="windows"/>
+        </condition>
+        <condition else="" property="browser.args" value="url.dll,FileProtocolHandler">
+            <os family="windows"/>
+        </condition>
+        <condition property="browser" value="/usr/bin/open">
+            <os family="mac"/>
+        </condition>
+        <property environment="env"/>
+        <condition property="browser" value="${env.BROWSER}">
+            <isset property="env.BROWSER"/>
+        </condition>
+        <condition property="browser" value="/usr/bin/firefox">
+            <available file="/usr/bin/firefox"/>
+        </condition>
+        <condition property="browser" value="/usr/local/firefox/firefox">
+            <available file="/usr/local/firefox/firefox"/>
+        </condition>
+        <condition property="browser" value="/usr/bin/mozilla">
+            <available file="/usr/bin/mozilla"/>
+        </condition>
+        <condition property="browser" value="/usr/local/mozilla/mozilla">
+            <available file="/usr/local/mozilla/mozilla"/>
+        </condition>
+        <condition property="browser" value="/usr/sfw/lib/firefox/firefox">
+            <available file="/usr/sfw/lib/firefox/firefox"/>
+        </condition>
+        <condition property="browser" value="/opt/csw/bin/firefox">
+            <available file="/opt/csw/bin/firefox"/>
+        </condition>
+        <condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
+            <available file="/usr/sfw/lib/mozilla/mozilla"/>
+        </condition>
+        <condition property="browser" value="/opt/csw/bin/mozilla">
+            <available file="/opt/csw/bin/mozilla"/>
+        </condition>
+    </target>
+    <target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl">
+        <fail unless="browser">
+                    Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
+                </fail>
+        <property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
+        <echo>Launching ${browse.url}</echo>
+        <exec executable="${browser}" spawn="true">
+            <arg line="${browser.args} ${browse.url}"/>
+        </exec>
+    </target>
+    <target depends="init,-init-cos,compile-single" name="run-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <webproject1:java classname="${run.class}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" name="run-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <webproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-do-update-breakpoints">
+        <webproject1:nbjpdaappreloaded/>
+    </target>
+    <!--
+                DEBUGGING SECTION
+            -->
+    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" description="Debug project in IDE." if="netbeans.home" name="debug">
+        <nbstartserver debugmode="true"/>
+        <antcall target="connect-debugger"/>
+        <nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
+        <antcall target="debug-display-browser-old"/>
+        <antcall target="debug-display-browser"/>
+        <antcall target="connect-client-debugger"/>
+    </target>
+    <target if="do.debug.server" name="connect-debugger" unless="is.debugged">
+        <condition property="listeningcp" value="sourcepath">
+            <istrue value="${j2ee.compile.on.save}"/>
+        </condition>
+        <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" listeningcp="${listeningcp}" name="${name}" transport="${jpda.transport}">
+            <classpath>
+                <path path="${debug.classpath}:${j2ee.platform.classpath}"/>
+            </classpath>
+            <sourcepath>
+                <path path="${web.docbase.dir}"/>
+            </sourcepath>
+        </nbjpdaconnect>
+    </target>
+    <target if="do.display.browser.debug.old" name="debug-display-browser-old">
+        <nbbrowse url="${client.url}"/>
+    </target>
+    <target if="do.display.browser.debug" name="debug-display-browser">
+        <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
+    </target>
+    <target if="do.debug.client" name="connect-client-debugger">
+        <webproject1:nbjsdebugstart webUrl="${client.url}"/>
+    </target>
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <webproject1:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+    <target depends="init,compile,compile-jsps,-do-compile-single-jsp,debug" if="netbeans.home" name="debug-single"/>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+        <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+        <webproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <webproject1:debug classname="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single-main"/>
+    <target depends="init" name="-pre-debug-fix">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+        <webproject1:nbjpdareload/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+    <!--
+            =================
+            PROFILING SECTION
+            =================
+            -->
+    <!--
+                pre NB7.2 profiling section; consider it deprecated
+            -->
+    <target description="Profile a J2EE project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
+        <condition else="start-profiled-server" property="profiler.startserver.target" value="start-profiled-server-extraargs">
+            <isset property="profiler.info.jvmargs.extra"/>
+        </condition>
+        <antcall target="${profiler.startserver.target}"/>
+        <antcall target="run"/>
+        <antcall target="-profile-start-loadgen"/>
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="start-profiled-server">
+        <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg value="${profiler.j2ee.agentID}"/>
+        </nbstartprofiledserver>
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="start-profiled-server-extraargs">
+        <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
+            <jvmarg value="${profiler.info.jvmargs.extra}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg value="${profiler.j2ee.agentID}"/>
+        </nbstartprofiledserver>
+    </target>
+    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+                <path path="${j2ee.platform.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg line="${profiler.info.jvmargs}"/>
+            <test name="${profile.class}"/>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+                <path path="${j2ee.platform.classpath}"/>
+            </classpath>
+            <syspropertyset>
+                <propertyref prefix="test-sys-prop."/>
+                <mapper from="test-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+    <target if="netbeans.home" name="-profile-check">
+        <condition property="profiler.configured">
+            <or>
+                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
+                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
+            </or>
+        </condition>
+    </target>
+    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" name="-do-profile">
+        <startprofiler/>
+        <nbstartserver profilemode="true"/>
+        <nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/>
+        <antcall target="debug-display-browser-old"/>
+        <antcall target="debug-display-browser"/>
+        <antcall target="-profile-start-loadgen"/>
+    </target>
+    <target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
+        <antcall target="-do-profile"/>
+    </target>
+    <target depends="-profile-test-single-pre72" name="profile-test-single"/>
+    <target depends="-profile-check" if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs.agent">
+        <startprofiler/>
+        <antcall target="test-single"/>
+    </target>
+    <target if="profiler.loadgen.path" name="-profile-start-loadgen">
+        <loadgenstart path="${profiler.loadgen.path}"/>
+    </target>
+    <!--
+                JAVADOC SECTION
+            -->
+    <target depends="init" if="have.sources" name="javadoc-build">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+            <classpath>
+                <path path="${javac.classpath}:${j2ee.platform.classpath}"/>
+            </classpath>
+            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/*.java"/>
+            </fileset>
+        </javadoc>
+        <copy todir="${dist.javadoc.dir}">
+            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/doc-files/**"/>
+            </fileset>
+        </copy>
+    </target>
+    <target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/>
+    <!--
+                
+                TEST COMPILATION SECTION
+            -->
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+        <mkdir dir="${build.test.classes.dir}"/>
+        <property name="j2ee.platform.embeddableejb.classpath" value=""/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test">
+        <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+    <target name="-pre-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" srcdir="${test.src.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+    <!--
+                
+                TEST EXECUTION SECTION
+            -->
+    <target depends="init" if="have.tests" name="-pre-test-run">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+        <webproject2:test includes="${includes}" testincludes="**/*Test.java"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init" if="have.tests" name="test-report"/>
+    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+    <target depends="init" if="have.tests" name="-pre-test-run-single">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <webproject2:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
+        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
+        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
+        <webproject2:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
+    <!--
+                
+                TEST DEBUGGING SECTION
+            -->
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
+        <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
+    </target>
+    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+        <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+    </target>
+    <target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
+    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+        <webproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+    <!--
+                
+                CLEANUP SECTION
+            -->
+    <target depends="init" name="deps-clean" unless="no.deps">
+        <ant antfile="${project.GDE-ejb}/build.xml" inheritall="false" target="clean"/>
+    </target>
+    <target depends="init" name="do-clean">
+        <condition property="build.dir.to.clean" value="${build.web.dir}">
+            <isset property="dist.ear.dir"/>
+        </condition>
+        <property name="build.dir.to.clean" value="${build.web.dir}"/>
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
+        </delete>
+        <delete dir="${build.dir}"/>
+        <available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
+        <delete dir="${dist.dir}"/>
+    </target>
+    <target depends="do-clean" if="status.clean-failed" name="check-clean">
+        <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
+        <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
+    </target>
+    <target depends="init" if="netbeans.home" name="undeploy-clean">
+        <nbundeploy failOnError="false" startServer="false"/>
+    </target>
+    <target name="-post-clean">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
+    <target depends="clean" description="Clean build products." name="clean-ear"/>
+</project>
index b67f4b443846380021da5227687a39753e039946..99898629c4163880bd5305783a353b972b0e1635 100644 (file)
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=7ba8d26a
+build.xml.data.CRC32=60648d1e
 build.xml.script.CRC32=aa84c400
 build.xml.stylesheet.CRC32=651128d4@1.68.1.1
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=7ba8d26a
-nbproject/build-impl.xml.script.CRC32=40da7894
+nbproject/build-impl.xml.data.CRC32=60648d1e
+nbproject/build-impl.xml.script.CRC32=c7df2aa1
 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1
index a4b358ca5063c1aca5c48287f6703c94799e0035..71d35c5878843590d1db44d60738bb72d3072c4a 100644 (file)
@@ -44,7 +44,8 @@ j2ee.server.type=gfv3ee6
 jar.compress=false
 javac.classpath=\
     ${file.reference.gson-2.3.1.jar}:\
-    ${reference.GDE-ejb.dist}
+    ${reference.GDE-ejb.dist}:\
+    ${libs.junit_4.classpath}
 # Space-separated list of extra javac options
 javac.compilerargs=
 javac.debug=true
index 1715d1ca27092794eecebb754a479411fe64d332..b08b626d88be557d12ea4a69665cbbeddcd6072c 100644 (file)
@@ -1,6 +1,6 @@
 package com.edf.gde.services;
 
-import com.edf.gde.ejb.UserDAO;
+import com.edf.gde.ejb.UserEJB;
 import com.edf.gde.entities.Group;
 import com.edf.gde.entities.User;
 import com.edf.gde.transferables.CommandTO;
@@ -28,7 +28,7 @@ public class UserService extends BaseService {
     public static final int FINDGROUP = 8;
 
     @EJB
-    UserDAO userDAO;
+    UserEJB userDAO;
 
     @Override
     public void processRequest(HttpServletRequest request, HttpServletResponse response) {