Package org.nxplanner.domain

Examples of org.nxplanner.domain.Person


        msg.setFrom(new InternetAddress(from));
    }

    public void setRecipient(int personId) throws MessagingException {
        try {
            Person person = getPerson(personId);
            if (StringUtils.isEmpty(person.getEmail())) {
                throw new MessagingException("no email address for user: uid=" + person.getUserId() + ",id=" + person.getId());
            }
            setRecipients(person.getEmail());
        } catch (MessagingException e) {
            throw e;
        } catch (Exception e) {
            throw new MessagingException("error setting recipient", e);
        }
View Full Code Here


public class AbstractLoginModule {
    protected Logger log = Logger.getLogger(getClass());

    public void populateSubjectPrincipalFromDatabase(Subject subject, String userId)
            throws AuthenticationException {
        Person person = getPerson(userId);
        if (person == null) {
            throw new AuthenticationException("user " + userId + " not found");
        }
        subject.getPrincipals().add(new PersonPrincipal(person));
View Full Code Here

    public Subject authenticate(String userId, String password) throws AuthenticationException {
        try {
            Session session = ThreadSession.get();
            try {
                log.log(loggingPriority, "attempting to authenticate: " + userId);
                Person person = getPerson(session, userId);
                if (person != null) {
                    if (isPasswordMatched(person, password)) {
                        HashSet principals = new HashSet();
                        principals.add(new PersonPrincipal(person));
                        return new Subject(false, principals, new HashSet(), new HashSet());
View Full Code Here

    public void changePassword(String userId, String password) throws AuthenticationException {
        log.log(loggingPriority, "changing password for " + userId);
        try {
            Session session = ThreadSession.get();
            try {
                Person person = getPerson(session, userId);
                if (person != null) {
                    person.setPassword(encodePassword(password, null));
                    session.flush();
                    session.connection().commit();
                } else {
                    throw new AuthenticationException("couldn't find person.");
                }
View Full Code Here

        }
        request.getSession(true).setAttribute(LOGIN_MODULE, getLoginModule());
        // The following subject is expected to have a Person principal and one or more Role principals
        Subject subject = getLoginModule().authenticate(userId, password);
        ArrayList roles = new ArrayList();
        Person person = getPersonFromDatabase(HibernateHelper.getSessionFromRequest(request), subject);
        if (person == null) {
            throw new AuthenticationException("user is not in database: " + userId);
        } else {
            subject = SecurityHelper.addRolesToSubject(subject, roles);
        }
View Full Code Here

    }

    private void write(UserStory story, Document document, Rectangle pageRectangle, PdfWriter docWriter)
            throws DocumentException {

        Person customer = story.getCustomer();
        String customerName = "";
        if (customer != null) customerName = customer.getName();
        writeCard(document, pageRectangle, docWriter,
                  story.getName(),
                  story.getDescription(),
                  new Field[]{
                      new Field("Customer", customerName),
View Full Code Here

        ArrayList stories = new ArrayList();

        ArrayList tasks = new ArrayList();
        tasks.add(newTask("Task 1", "Description of Task 1", 2.0));
        tasks.add(newTask("Task 2", "Description of Task 2", 3.0));
        stories.add(newStory("Story 1", new Person(), 1.0, tasks));
        iteration.setUserStories(stories);
        exporter.exportToPdf(iteration, stream);
        stream.close();

    }
View Full Code Here

       
        try {
            Session session = ThreadSession.get();
            try {
                log.log(loggingPriority, "looking for user: " + userId);
                Person person = getPerson(session, userId);
                if (person != null) {
                    HashSet principals = new HashSet();
                    principals.add(new PersonPrincipal(person));
                    return new Subject(false, principals, new HashSet(), new HashSet());
                }
View Full Code Here

    public Subject fallbackAuthenticate(String userId, String password) throws AuthenticationException {
        try {
            Session session = ThreadSession.get();
            try {
                log.log(loggingPriority, "attempting to authenticate: " + userId);
                Person person = getPerson(session, userId);
                if (person != null) {
                    if (isPasswordMatched(person, password)) {
                        HashSet principals = new HashSet();
                        principals.add(new PersonPrincipal(person));
                        return new Subject(false, principals, new HashSet(), new HashSet());
View Full Code Here

        if ("StoryName".equals(fieldName)) {
           return story.getName();
        }

        if ("StoryCustomerName".equals(fieldName)) {
           Person cust = story.getCustomer();
           return (cust != null) ? cust.getName() : "<no customer>";
        }

        if ("StoryEstimatedHours".equals(fieldName)) {
           return new Double(story.getEstimatedHours());
        }
View Full Code Here

TOP

Related Classes of org.nxplanner.domain.Person

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.