Subversion Repositories bacoAlunos

Rev

Rev 1306 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package pt.estgp.estgweb.services.email;

import pt.estgp.estgweb.services.common.*;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.DomainObject;
import pt.estgp.estgweb.domain.UserImpl;
import pt.estgp.estgweb.domain.User;
import pt.estgp.estgweb.Globals;

import java.util.List;

import jomm.utils.DesUtils;

/**
 * @author Jorge Machado
 * @date 22/Mai/2008
 * @see pt.estgp.estgweb.services.email
 */

public class EmailCommonServices extends SingleSearchResults implements IModuleCommonServices
{

    public int countSearch(1.5.0/docs/api/java/lang/String.html">String search, SearchTypeEnum searchType, UserSession userSession)
    {
        return 0;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public ISearchResults search(1.5.0/docs/api/java/lang/String.html">String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession)
    {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public ISearchResults search(1.5.0/docs/api/java/lang/String.html">String from, 1.5.0/docs/api/java/lang/String.html">String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession)
    {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public int countToDo(UserSession userSession)
    {
        return 0;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public IToDoCat getToDo(UserSession userSession)
    {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public List<IToDo> getAllToDos(UserSession userSession)
    {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }/*This method is invoked from object creation*/

    public void adviseNew(DomainObject object)
    {
        adviseUpdate(object);
    }

    public void adviseUpdate(DomainObject object)
    {
        if (object instanceof User)
        {
            User user = (User) object;
            if (Globals.POP_USE_DEFAULT_SERVER)
            {
                if (user.getPop3server() == null || user.getPop3server().length() == 0)
                    user.setPop3server(Globals.POP_SERVER);
            }
            if (Globals.POP_USE_USERNAME_AND_PASSWORD_FIRST_AUTH)
            {
                if (user.getUsername() != null && (user.getPop3username() == null || user.getPop3username().length() == 0))
                    user.setPop3username(user.getUsername());
                if (user.getPassword() != null && (user.getPop3password() == null || user.getPop3password().length() == 0))
                    user.setPop3password(DesUtils.getInstance().encrypt(user.getPassword()));
            }
        }
    }
}