Package eu.scape_project.planning.model

Examples of eu.scape_project.planning.model.Notification


            String message = notification.getMessage();
           
            try {
                ut.begin();
                for (User recipient : recipients) {
                    Notification n = new Notification(notificationID, notificationTime, "SCOUT", message, recipient);
                    em.persist(n);
                }
                ut.commit();
                return true;
            } catch (Exception e) {
View Full Code Here


            try {
                String tempFile = binarydataTempPath + "plan.xml";
                projectExportAction
                    .exportComplete(planPropertiesId, new FileOutputStream(tempFile), binarydataTempPath);
                List<Plan> plans = projectImporter.importPlans(new FileInputStream(tempFile));
                Notification notification = null;
                if (newOwner != null) {
                    User user = em.createQuery("Select u from User u where u.username = :username", User.class)
                        .setParameter("username", newOwner).getSingleResult();

                    for (Plan p : plans) {
                        PlanProperties prop = p.getPlanProperties();
                        prop.setDescription(newOwner + "'s copy of: " + prop.getDescription()
                            + " (originally created by " + prop.getOwner() + ")");
                        prop.setOwner(newOwner);
                        // mark this plan as a playground copy
                        prop.setPlayground(true);
                        prop.touch();
                        PrepareChangesForPersist prep = new PrepareChangesForPersist(newOwner);
                        prep.prepare(prop);

                        String message = "A copy has been created: <em>"
                            + prop.getName()
                            + " - "
                            + prop.getDescription()
                            + "</em>"
                            + "<br/>It is marked as playground. If you want to use it for serious planning, please change this in Plan Settings.";
                        notification = new Notification(UUID.randomUUID().toString(), new Date(), "PLATO", message,
                            user);
                    }
                }
                // store project
                storePlans(plans);
View Full Code Here

    public void addNotification(String source, String message) {
        Date now = new Date();
        String uuid = UUID.randomUUID().toString();
        List<User> users = em.createQuery("select p from User p", User.class).getResultList();
        for (User u : users) {
            Notification note = new Notification(uuid, now, source, message, u);
            em.persist(note);
        }

    }
View Full Code Here

            Transport.send(message);
            log.debug("Bug report mail from user {} sent successfully to {}", user.getUsername(), config.getString("mail.feedback"));
           
            String userMessage = "Bugreport sent. Thank you for your feedback. We will try to analyse and resolve the issue as soon as possible.";
            Notification notification = new Notification(UUID.randomUUID().toString(), new Date(), "PLATO", userMessage, user);
            try {
                utx.begin();           
                em.persist(notification);
                utx.commit();
            } catch (Exception e) {
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.Notification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.