Index: contrib/psync/src/main/java/br/com/prognus/psync/items/dao/PIMContactDAO.java
===================================================================
--- contrib/psync/src/main/java/br/com/prognus/psync/items/dao/PIMContactDAO.java	(revision 1103)
+++ contrib/psync/src/main/java/br/com/prognus/psync/items/dao/PIMContactDAO.java	(revision 1545)
@@ -32,12 +32,18 @@
 import br.com.prognus.psync.exception.PIMDBAccessException;
 import br.com.prognus.psync.items.model.ContactWrapper;
+import br.com.prognus.psync.util.Country;
 import br.com.prognus.psync.util.Def;
-
+import br.com.prognus.psync.util.TypeAddress;
+
+import com.funambol.common.pim.common.Property;
+import com.funambol.common.pim.contact.Address;
 import com.funambol.common.pim.contact.BusinessDetail;
 import com.funambol.common.pim.contact.Contact;
 import com.funambol.common.pim.contact.Email;
 import com.funambol.common.pim.contact.Name;
+import com.funambol.common.pim.contact.Note;
 import com.funambol.common.pim.contact.PersonalDetail;
 import com.funambol.common.pim.contact.Phone;
+import com.funambol.common.pim.contact.Photo;
 import com.funambol.framework.security.Sync4jPrincipal;
 import com.funambol.framework.server.store.NotFoundException;
@@ -55,5 +61,5 @@
 			+ "WHERE id_owner = ?";
 
-	private static final String SQL_GET_CONTACT_BY_ID_USER = "SELECT id_contact, id_owner, last_update, last_status, given_names, family_names, birthdate, category FROM phpgw_cc_contact WHERE id_contact = ? AND id_owner = ? LIMIT 1";
+	private static final String SQL_GET_CONTACT_BY_ID_USER = "SELECT id_contact, id_owner, last_update, last_status, given_names, family_names, birthdate, category, photo, notes, alias FROM phpgw_cc_contact WHERE id_contact = ? AND id_owner = ? LIMIT 1";
 
 	private static final String SQL_GET_CONTACT_ITEM_BY_ID = "SELECT connection_name, connection_value, id_typeof_contact_connection FROM phpgw_cc_connections AS CO LEFT JOIN phpgw_cc_contact_conns AS CC ON CO.id_connection = CC.id_connection WHERE id_contact = ?";
@@ -73,6 +79,6 @@
 
 	private static final String SQL_INSERT_INTO_FNBL_PIM_CONTACT = "INSERT INTO phpgw_cc_contact "
-			+ "(id_contact, id_owner, id_status, given_names, family_names, names_ordered, birthdate, category, last_update, last_status ) "
-			+ "VALUES " + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ";
+			+ "(id_contact, id_owner, id_status, given_names, family_names, names_ordered, birthdate, category, photo, notes, alias, last_update, last_status ) "
+			+ "VALUES " + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ";
 
 	private static final String SQL_INSERT_INTO_CONTACT_ITEM = "INSERT INTO phpgw_cc_connections "
@@ -87,5 +93,28 @@
 
 	private static final String SQL_UPDATE_FNBL_PIM_CONTACT_END = " WHERE id_contact = ? AND id_owner = ? ";
-
+	
+	
+	private static final String SQL_GET_CONTACT_ADDRESS_ITEM = " select ad.complement, ad.address1, ad.postal_code, ca.id_typeof_contact_address, city_name, state_name, cy.id_country from phpgw_cc_addresses AS ad JOIN phpgw_cc_contact_addrs AS ca ON ad.id_address=ca.id_address, phpgw_cc_city AS cy JOIN phpgw_cc_state AS st ON cy.id_state=st.id_state where cy.id_city=ad.id_city and ad.id_address in (select min(ca.id_address) from phpgw_cc_contact AS cc JOIN phpgw_cc_contact_addrs AS ca ON cc.id_contact=ca.id_contact JOIN phpgw_cc_addresses AS ad ON ca.id_address=ad.id_address where cc.id_contact = ? AND cc.id_owner = ? and ca.id_typeof_contact_address = ? )";
+
+	private static final String SQL_GET_STATE_ITEM = "SELECT id_state, id_country, state_name, state_symbol FROM phpgw_cc_state ";
+	
+	private static final String SQL_GET_CITY_ITEM = "SELECT id_city, id_state, id_country, city_timezone, city_geo_location, city_name FROM phpgw_cc_city ";
+
+	private static final String SQL_INSERT_STATE = "INSERT INTO phpgw_cc_state(id_state, id_country, state_name, state_symbol) VALUES (?, ?, ?, ?)";
+	
+	private static final String SQL_INSERT_CITY = "INSERT INTO phpgw_cc_city(id_city, id_state, id_country, city_timezone, city_geo_location, city_name) VALUES (?, ?, ?, ?, ?, ?)";
+	
+	private static final String SQL_INSERT_ADDRESS = "INSERT INTO phpgw_cc_addresses(id_address, id_city, id_state, id_country, address1, complement, postal_code, address_is_default) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
+	
+	private static final String SQL_INSERT_CONTACT_ADDRESS = "INSERT INTO phpgw_cc_contact_addrs(id_contact, id_address, id_typeof_contact_address) VALUES (?, ?, ?)";
+
+	private static final int SQL_ADDRESS_DIM = 60;
+	
+	private static final String SQL_ID_MAX_ADDRESS = "select max(id_address) FROM phpgw_cc_addresses";
+	
+	private static final String SQL_ID_MAX_STATE = "select max(id_state) FROM phpgw_cc_state";
+	
+	private static final String SQL_ID_MAX_CITY = "select max(id_city) FROM phpgw_cc_city";
+	
 	private static final String SQL_EQUALS_QUESTIONMARK = " = ?";
 
@@ -111,4 +140,8 @@
 
 	protected static final String SQL_FIELD_CATEGORY = "category";
+	
+	protected static final String SQL_FIELD_PHOTO = "photo";
+	
+	protected static final String SQL_FIELD_NOTES = "notes";
 
 	protected static final int SQL_FIRSTNAME_DIM = 49;
@@ -121,4 +154,6 @@
 
 	protected static final int SQL_CATEGORY_DIM = 20;
+	
+	protected static final int SQL_NICK_DIM = 30;
 
 	protected static final String TYPE_EMAIL_1_ADDRESS = "Principal";
@@ -159,4 +194,22 @@
 
 	protected static final String SQL_FIELD_ITEM_TYPE = "id_typeof_contact_connection";
+	
+	protected static final String SQL_FIELD_TYPEOF = "id_typeof_contact_address";
+	
+	protected static final String SQL_FIELD_COMPLEMENT = "complement";
+	
+	protected static final String SQL_FIELD_ADDRESS1 = "address1";
+		
+	protected static final String SQL_FIELD_POSTALCODE = "postal_code";
+	
+	protected static final String SQL_FIELD_CITY_NAME = "city_name";
+	
+	protected static final String SQL_FIELD_STATE_NAME = "state_name";
+	
+	protected static final String SQL_FIELD_COUNTRY_ID = "id_country";
+	
+	protected static final String SQL_FIELD_STATE_ID = "id_state";
+	
+	protected static final String SQL_FIELD_CITY_ID = "id_city";
 
 	private Sync4jPrincipal principal = null;
@@ -193,4 +246,5 @@
 	 * @see ContactWrapper
 	 */
+	@SuppressWarnings("unchecked")
 	public void addItem(ContactWrapper cw) throws PIMDBAccessException {
 
@@ -223,4 +277,7 @@
 		StringBuffer fullName = null;
 		Date anniversary = null;
+		byte[] imagePhoto = null;
+		String note = null;
+		String alias = null;
 
 		try {
@@ -232,4 +289,15 @@
 			Timestamp lastUpdate = cw.getLastUpdate();
 
+			try {
+				List<Note> notes = c.getNotes();
+				int i = notes.size() - 1;
+				note = notes.get(i).getPropertyValueAsString();
+			} catch (Exception e) {
+//				log.error(e.getMessage(),e);
+			}
+			if(note==null) {
+				note="";
+			}
+			
 			personalDetail = c.getPersonalDetail();
 			businessDetail = c.getBusinessDetail();
@@ -244,4 +312,5 @@
 				birthday = personalDetail.getBirthday();
 				category = stringFrom(c.getCategories());
+				imagePhoto = personalDetail.getPhotoObject().getImage();
 			}
 
@@ -254,4 +323,5 @@
 				firstName = stringFrom(name.getFirstName());
 				lastName = stringFrom(name.getLastName());
+				alias = stringFrom(name.getNickname());
 			}
 
@@ -297,6 +367,9 @@
 			ps.setDate(7, anniversary); // birthdate
 			ps.setString(8, truncate(category, SQL_CATEGORY_DIM)); // category
-			ps.setLong(9, lastUpdate.getTime()); // last_update
-			ps.setString(10, String.valueOf(Def.PIM_STATE_NEW)); // last_status
+			ps.setBytes(9, imagePhoto); // photo
+			ps.setString(10, note); // note
+			ps.setString(11, truncate(alias, SQL_NICK_DIM)); // alias
+			ps.setLong(12, lastUpdate.getTime()); // last_update
+			ps.setString(13, String.valueOf(Def.PIM_STATE_NEW)); // last_status
 			ps.executeUpdate();
 
@@ -483,4 +556,9 @@
 		String category = null;
 		Date anniversary = null;
+		byte[] imagePhoto = null;
+		String note = null;
+		String alias = null;
+		Address persoAddress = null;
+		Address businAddress = null;
 
 		try {
@@ -495,4 +573,15 @@
 			Contact c = cw.getContact();
 
+			try {
+				List<Note> notes = c.getNotes();
+				int i = notes.size() - 1;
+				note = notes.get(i).getPropertyValueAsString();
+			} catch (Exception e) {
+//				log.error(e.getMessage(),e);
+			}
+			if(note==null) {
+				note="";
+			}
+			
 			personalDetail = c.getPersonalDetail();
 			businessDetail = c.getBusinessDetail();
@@ -505,4 +594,6 @@
 				birthday = personalDetail.getBirthday();
 				category = stringFrom(c.getCategories());
+				imagePhoto = personalDetail.getPhotoObject().getImage();
+				persoAddress = personalDetail.getAddress();
 			}
 
@@ -510,4 +601,5 @@
 				emails.addAll(businessDetail.getEmails());
 				phones.addAll(businessDetail.getPhones());
+				businAddress = businessDetail.getAddress();
 			}
 
@@ -515,4 +607,5 @@
 				firstName = stringFrom(name.getFirstName());
 				lastName = stringFrom(name.getLastName());
+				alias = stringFrom(name.getNickname());
 			}
 
@@ -525,4 +618,7 @@
 			if (category != null && category.length() > SQL_CATEGORY_DIM) {
 				category = category.substring(0, SQL_CATEGORY_DIM);
+			}
+			if (alias != null && alias.length() > SQL_NICK_DIM) {
+				alias = alias.substring(0, SQL_NICK_DIM);
 			}
 
@@ -563,4 +659,10 @@
 			queryUpdateFunPimContact.append(SQL_FIELD_CATEGORY
 					+ SQL_EQUALS_QUESTIONMARK_COMMA);
+			queryUpdateFunPimContact.append(SQL_FIELD_PHOTO
+					+ SQL_EQUALS_QUESTIONMARK_COMMA);
+			queryUpdateFunPimContact.append(SQL_FIELD_NOTES
+					+ SQL_EQUALS_QUESTIONMARK_COMMA);
+			queryUpdateFunPimContact.append(SQL_FIELD_NICK
+					+ SQL_EQUALS_QUESTIONMARK_COMMA);
 			queryUpdateFunPimContact
 					.append(SQL_FIELD_STATUS + SQL_EQUALS_QUESTIONMARK
@@ -575,7 +677,10 @@
 			ps.setDate(5, anniversary); // birthdate
 			ps.setString(6, category); // category
-			ps.setString(7, String.valueOf(Def.PIM_STATE_UPDATED)); // last_status
-			ps.setLong(8, id_contact); // id_contact
-			ps.setLong(9, Long.parseLong(userId)); // id_owner
+			ps.setBytes(7, imagePhoto); // photo
+			ps.setString(8, note); // notes
+			ps.setString(9, alias); // alias
+			ps.setString(10, String.valueOf(Def.PIM_STATE_UPDATED)); // last_status
+			ps.setLong(11, id_contact); // id_contact
+			ps.setLong(12, Long.parseLong(userId)); // id_owner
 			ps.executeUpdate();
 
@@ -730,4 +835,88 @@
 			}
 
+			
+			// endereco
+			boolean syncAddress = true;
+			if(syncAddress) {
+			// Apaga os contatos na tabela phpgw_cc_addresses
+			ps = con
+					.prepareStatement("DELETE FROM phpgw_cc_addresses WHERE id_address IN (SELECT id_address FROM phpgw_cc_contact_addrs WHERE id_contact = ?)");
+			ps.setLong(1, id_contact);
+			ps.executeUpdate();
+		
+			// Apaga os contatos na tabela phpgw_cc_contact_addrs
+			ps = con
+					.prepareStatement("DELETE FROM phpgw_cc_contact_addrs WHERE id_contact = ?");
+			ps.setLong(1, id_contact);
+			ps.executeUpdate();
+			
+			// Para cadas tipo de endereco RESIDENCIAL | COMERCIAL
+			for (TypeAddress typeAddress: TypeAddress.values()) {
+				
+				Address address = null;
+				boolean defaultAddress = false;
+				
+				// se ambos sao nulos não faz nada aqui
+				if (persoAddress == null && businAddress == null) {
+					break;
+				}
+				
+				if (typeAddress.equals(TypeAddress.RESIDENCIAL)) {
+					address=persoAddress;
+					defaultAddress = true;
+				} else if (typeAddress.equals(TypeAddress.COMERCIAL)) {
+					address=businAddress;
+				}
+				
+				// Pula para o proximo
+				if(address == null) {
+					continue;
+				}
+				
+				String addressValue = address.getStreet().getPropertyValueAsString();
+				addressValue  = truncate(addressValue, SQL_ADDRESS_DIM);
+	
+				if (addressValue != null && addressValue.length() != 0) {
+
+					// Verifica o id maximo da tabela phpgw_cc_addresses
+					ps = con.prepareStatement(SQL_ID_MAX_ADDRESS);
+					rs = ps.executeQuery();
+					long id_address = 0;
+					
+					if (rs.next()) {
+						long id = rs.getInt(1);
+						id_address = (id == 0) ? 1 : ++id;
+					}
+
+					// Insere o endereco do contato na tabela
+					String idCountry;
+					try {
+						idCountry = Country.getCountryByName(address
+								.getCountry().getPropertyValueAsString()).getCode();
+					} catch (Exception e) {
+						idCountry = "BR";
+					}
+					long idState = searchStateId(con, address.getState().getPropertyValueAsString(), idCountry);
+					long idCity = searchCityId(con, address.getCity().getPropertyValueAsString(), idState, idCountry);
+					
+					ps = con.prepareStatement(SQL_INSERT_ADDRESS);
+					ps.setLong(1, id_address);
+					ps.setLong(2, idCity);
+					ps.setLong(3, idState);
+					ps.setString(4, idCountry);
+					ps.setString(5, addressValue);
+					ps.setString(6, address.getExtendedAddress().getPropertyValueAsString());
+					ps.setString(7, address.getPostalCode().getPropertyValueAsString());
+					ps.setBoolean(8, defaultAddress);
+					ps.executeUpdate();
+
+					ps = con.prepareStatement(SQL_INSERT_CONTACT_ADDRESS);
+					ps.setLong(1, id_contact);
+					ps.setLong(2, id_address);
+					ps.setInt(3, typeAddress.getId());
+					ps.executeUpdate();
+				}
+			}
+			}
 			con.commit();
 			con.setAutoCommit(true);
@@ -743,4 +932,99 @@
 
 		return Long.toString(id_contact);
+	}
+
+
+	private long searchStateId(Connection con, String stateName, String idCountry) throws Exception {
+		
+		PreparedStatement ps = null;
+		ResultSet rs = null;
+		long stateId = 0;
+		
+		try {
+			String SQL_GET_STATE = SQL_GET_STATE_ITEM + " where upper("
+					+ SQL_FIELD_STATE_NAME + ")" + SQL_EQUALS_QUESTIONMARK
+					+ " and " + SQL_FIELD_COUNTRY_ID + SQL_EQUALS_QUESTIONMARK;
+			ps = con.prepareStatement(SQL_GET_STATE);
+			ps.setString(1, stateName.toUpperCase());
+			ps.setString(2, idCountry);
+			rs = ps.executeQuery();
+			if (rs.next()) {
+				stateId = rs.getInt(SQL_FIELD_STATE_ID);
+				return stateId;
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		ps = con.prepareStatement(SQL_ID_MAX_STATE);
+		rs = ps.executeQuery();
+		
+		if (rs.next()) {
+			long id = rs.getInt(1);
+			stateId = (id == 0) ? 1 : ++id;
+		}
+		else {
+			return 0;
+		}
+		
+		ps = con.prepareStatement(SQL_INSERT_STATE);
+		ps.setLong(1, stateId);
+		ps.setString(2, idCountry);
+		ps.setString(3, stateName);
+		ps.setString(4, stateName.substring(0, 2));
+		if(ps.executeUpdate() > 0) {
+			return stateId;
+		}
+		
+		return 0;
+	}
+
+	private long searchCityId(Connection con, String cityName, long idState, String idCountry) throws Exception {
+		
+		PreparedStatement ps = null;
+		ResultSet rs = null;
+		long cityId = 0;
+		
+		try {
+			String SQL_GET_CITY = SQL_GET_CITY_ITEM + " where "
+					+ SQL_FIELD_STATE_ID + SQL_EQUALS_QUESTIONMARK + " and "
+					+ SQL_FIELD_COUNTRY_ID + SQL_EQUALS_QUESTIONMARK
+					+ " and upper(" + SQL_FIELD_CITY_NAME + ")"
+					+ SQL_EQUALS_QUESTIONMARK;
+			ps = con.prepareStatement(SQL_GET_CITY);
+			ps.setLong(1, idState);
+			ps.setString(2, idCountry);
+			ps.setString(3, cityName.toUpperCase());
+			rs = ps.executeQuery();
+			if (rs.next()) {
+				cityId = rs.getInt(SQL_FIELD_CITY_ID);
+				return cityId;
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		ps = con.prepareStatement(SQL_ID_MAX_CITY);
+		rs = ps.executeQuery();
+		
+		if (rs.next()) {
+			long id = rs.getInt(1);
+			cityId = (id == 0) ? 1 : ++id;
+		}
+		else {
+			return 0;
+		}
+		
+		ps = con.prepareStatement(SQL_INSERT_CITY);
+		ps.setLong(1, cityId);
+		ps.setLong(2, idState);
+		ps.setString(3, idCountry);
+		ps.setNull(4, 0);
+		ps.setString(5, null);
+		ps.setString(6, cityName);
+		if(ps.executeUpdate() > 0) {
+			return cityId;
+		}
+		
+		return 0;
 	}
 
@@ -954,4 +1238,30 @@
 								.getSQLState());
 			}
+			
+			try {
+				ps = con.prepareStatement(SQL_GET_CONTACT_ADDRESS_ITEM);
+				ps.setLong(1, Long.parseLong(uid));
+				ps.setLong(2, Long.parseLong(userId));
+				ps.setInt(3, TypeAddress.RESIDENCIAL.getId());
+				rs = ps.executeQuery();
+				
+				Address address = c.getContact().getPersonalDetail().getAddress();
+				addAddress(address, rs);
+			} catch (Exception e) {
+				throw new SQLException("\nError while adding personal address information");
+			}
+
+			try {
+				ps = con.prepareStatement(SQL_GET_CONTACT_ADDRESS_ITEM);
+				ps.setLong(1, Long.parseLong(uid));
+				ps.setLong(2, Long.parseLong(userId));
+				ps.setInt(3, TypeAddress.COMERCIAL.getId());
+				rs = ps.executeQuery();
+				
+				Address address = c.getContact().getBusinessDetail().getAddress();
+				addAddress(address, rs);
+			} catch (Exception e) {
+				throw new SQLException("\nError while adding business address information");
+			}
 
 		} catch (Exception e) {
@@ -963,4 +1273,46 @@
 
 		return c;
+	}
+	
+	
+	private static void addAddress(Address address, ResultSet rs) throws Exception {
+		
+		ResultSetMetaData rsmd = rs.getMetaData();
+
+		String column = null;
+		int columnCount = 0;
+		
+		while (rs.next()) {
+
+			columnCount = rsmd.getColumnCount();
+			
+			if (rs.getString(SQL_FIELD_ADDRESS1)==null || (rs.getString(SQL_FIELD_ADDRESS1)!=null && "".equals(rs.getString(SQL_FIELD_ADDRESS1).trim()))) {
+				break;
+			}
+
+			for (int i = 1; i <= columnCount; ++i) {
+
+				column = rsmd.getColumnName(i);
+				if (SQL_FIELD_TYPEOF.equalsIgnoreCase(column)) {
+					continue;
+				} else if (SQL_FIELD_COMPLEMENT.equalsIgnoreCase(column)) {
+					address.getExtendedAddress().setPropertyValue(rs.getString(i));
+				} else if (SQL_FIELD_ADDRESS1.equalsIgnoreCase(column)) {
+					address.getStreet().setPropertyValue(rs.getString(i));
+				} else if (SQL_FIELD_POSTALCODE.equalsIgnoreCase(column)) {
+					address.getPostalCode().setPropertyValue(rs.getString(i));
+				} else if (SQL_FIELD_CITY_NAME.equalsIgnoreCase(column)) {
+					address.getCity().setPropertyValue(rs.getString(i));
+				} else if (SQL_FIELD_STATE_NAME.equalsIgnoreCase(column)) {
+					address.getState().setPropertyValue(rs.getString(i));
+				} else if (SQL_FIELD_COUNTRY_ID.equalsIgnoreCase(column)) {
+					Country country = Country.getCountryByCode(rs.getString(i));
+					address.getCountry().setPropertyValue(country.getName());
+				} else {
+					throw new SQLException("\n=> Unhandled column: " + column);
+				}
+				
+			}		
+		}
 	}
 
@@ -1169,4 +1521,35 @@
 			} else if (SQL_FIELD_CATEGORY.equalsIgnoreCase(column)) {
 				c.getCategories().setPropertyValue(rs.getString(i));
+			} else if (SQL_FIELD_PHOTO.equalsIgnoreCase(column)) {
+				if(c.getPersonalDetail()==null) {
+					PersonalDetail pd = new PersonalDetail();
+					c.setPersonalDetail(pd);
+				}
+				Photo photo = new Photo();
+				photo.setImage(rs.getBytes(i));
+				c.getPersonalDetail().setPhotoObject(photo);
+			} else if (SQL_FIELD_NOTES.equalsIgnoreCase(column)) {
+				
+				try {
+					if(rs.getString(i) != null) {
+						if (c.getNotes() == null
+								|| (c.getNotes() != null && c.getNotes().size() != 1)
+								|| (c.getNotes() != null
+										&& c.getNotes().size() == 1 && c.getNotes()
+										.get(0) == null)) {
+							List<Note> l = new ArrayList<Note>(1);
+							l.add(new Note());
+							c.setNotes(l);
+						}
+						Note n = (Note) c.getNotes().get(0);
+						n.setPropertyValue(rs.getString(i));
+						n.setPropertyType("Body"); // HARD CODE
+					}
+				} catch (Exception e) {
+					log.error(e.getMessage(),e);
+				}
+
+			} else if (SQL_FIELD_NICK.equalsIgnoreCase(column)) {
+				c.getName().getNickname().setPropertyValue(rs.getString(i));
 			} else {
 				throw new SQLException("\n=> Unhandled column: " + column);
Index: contrib/psync/src/main/java/br/com/prognus/psync/items/dao/PIMEntityDAO.java
===================================================================
--- contrib/psync/src/main/java/br/com/prognus/psync/items/dao/PIMEntityDAO.java	(revision 1103)
+++ contrib/psync/src/main/java/br/com/prognus/psync/items/dao/PIMEntityDAO.java	(revision 1545)
@@ -23,9 +23,14 @@
 import java.sql.ResultSet;
 import java.sql.Timestamp;
-import java.util.Enumeration;
-import java.util.Iterator;
+import java.util.Hashtable;
 import java.util.List;
 
+import javax.naming.Context;
+import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.sql.DataSource;
 
@@ -38,11 +43,4 @@
 import com.funambol.framework.tools.DBTools;
 import com.funambol.framework.tools.DataSourceTools;
-import com.novell.ldap.LDAPAttribute;
-import com.novell.ldap.LDAPAttributeSet;
-import com.novell.ldap.LDAPConnection;
-import com.novell.ldap.LDAPEntry;
-import com.novell.ldap.LDAPException;
-import com.novell.ldap.LDAPSearchResults;
-import com.novell.ldap.util.Base64;
 
 public abstract class PIMEntityDAO {
@@ -123,73 +121,105 @@
 	// -----------------------------------------------------------Public methods
 
+	@SuppressWarnings("unchecked")
 	protected String LdapUID(String server, String dc, String user)
 			throws Exception {
 
-		LDAPConnection ldap = new LDAPConnection();
-		String searchAttrs[] = { "uidNumber" };
-		String id_owner = null;
-
-		try {
-
-			ldap.connect(server, 389);
-			LDAPSearchResults searchResults = ldap.search(dc,
-					LDAPConnection.SCOPE_SUB, "(uid=" + user + ")",
-					searchAttrs, false);
-
-			while (searchResults.hasMore()) {
-
-				LDAPEntry nextEntry = null;
-				try {
-					nextEntry = searchResults.next();
-				} catch (LDAPException e) {
-					if (e.getResultCode() == LDAPException.LDAP_TIMEOUT
-							|| e.getResultCode() == LDAPException.CONNECT_ERROR)
-						break;
-					else
-						continue;
-				}
-				LDAPAttributeSet attributeSet = nextEntry.getAttributeSet();
-				Iterator allAttributes = attributeSet.iterator();
-
-				while (allAttributes.hasNext()) {
-
-					LDAPAttribute attribute = (LDAPAttribute) allAttributes
-							.next();
-					String attributeName = attribute.getName();
-					Enumeration allValues = attribute.getStringValues();
-
-					if (allValues != null) {
-
-						while (allValues.hasMoreElements()) {
-
-							String Value = (String) allValues.nextElement();
-
-							if (Base64.isLDIFSafe(Value)) {
-							} else {
-								Value = Base64.encode(Value.getBytes());
-							}
-
-							if (attributeName.equalsIgnoreCase("uidNumber")) {
-								id_owner = Value;
-								break;
-							}
-
-						}
-					}
-				}
-			}
-
-			ldap.disconnect();
-
-			if (id_owner == null) {
-				throw new LDAPException();
-			}
-
-		} catch (LDAPException e) {
-			log.info("Error while connecting and binding to LDAP: "
-					+ e.toString());
-		}
-
-		return id_owner;
+		String uidNumber=null;
+		
+		Hashtable env = new Hashtable();
+        env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
+        env.put(Context.PROVIDER_URL, "ldap://" + server + ":" + 389);
+        
+        DirContext ctx = new InitialDirContext(env);
+        // Searching User
+        SearchControls ctls = new SearchControls();
+        ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
+        ctls.setCountLimit(1);
+        ctls.setTimeLimit(10000); // Espera no max 10 segundos
+        String filter = "(uid=" + user + ")";
+        
+        NamingEnumeration answer = ctx.search(dc, filter, ctls);
+        if (answer.hasMore()) {
+            SearchResult sr = (SearchResult) answer.next();
+            try {
+                // Getting User attributes
+                uidNumber = sr.getAttributes().get("uidNumber").get(0).toString();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        ctx.close();
+		if (uidNumber == null) {
+			log.info("Error while connecting and binding to LDAP");
+		}
+
+		return uidNumber;
+
+            
+//		LDAPConnection ldap = new LDAPConnection();
+//		String searchAttrs[] = { "uidNumber" };
+//		String id_owner = null;
+//
+//		try {
+//
+//			ldap.connect(server, 389);
+//			LDAPSearchResults searchResults = ldap.search(dc,
+//					LDAPConnection.SCOPE_SUB, "(uid=" + user + ")",
+//					searchAttrs, false);
+//
+//			while (searchResults.hasMore()) {
+//
+//				LDAPEntry nextEntry = null;
+//				try {
+//					nextEntry = searchResults.next();
+//				} catch (LDAPException e) {
+//					if (e.getResultCode() == LDAPException.LDAP_TIMEOUT
+//							|| e.getResultCode() == LDAPException.CONNECT_ERROR)
+//						break;
+//					else
+//						continue;
+//				}
+//				LDAPAttributeSet attributeSet = nextEntry.getAttributeSet();
+//				Iterator allAttributes = attributeSet.iterator();
+//
+//				while (allAttributes.hasNext()) {
+//
+//					LDAPAttribute attribute = (LDAPAttribute) allAttributes
+//							.next();
+//					String attributeName = attribute.getName();
+//					Enumeration allValues = attribute.getStringValues();
+//
+//					if (allValues != null) {
+//
+//						while (allValues.hasMoreElements()) {
+//
+//							String Value = (String) allValues.nextElement();
+//
+//							if (Base64.isLDIFSafe(Value)) {
+//							} else {
+//								Value = Base64.encode(Value.getBytes());
+//							}
+//
+//							if (attributeName.equalsIgnoreCase("uidNumber")) {
+//								id_owner = Value;
+//								break;
+//							}
+//
+//						}
+//					}
+//				}
+//			}
+//
+//			ldap.disconnect();
+//
+//			if (id_owner == null) {
+//				throw new LDAPException();
+//			}
+//
+//		} catch (LDAPException e) {
+//			log.info("Error while connecting and binding to LDAP: "
+//					+ e.toString());
+//		}
+//		return id_owner;
 	}
 
Index: contrib/psync/src/main/java/br/com/prognus/psync/engine/source/PIMCalendarSyncSource.java
===================================================================
--- contrib/psync/src/main/java/br/com/prognus/psync/engine/source/PIMCalendarSyncSource.java	(revision 1103)
+++ contrib/psync/src/main/java/br/com/prognus/psync/engine/source/PIMCalendarSyncSource.java	(revision 1545)
@@ -77,5 +77,4 @@
 			this.manager = new PIMCalendarManager(JNDI_DATA_SOURCE_NAME, context.getPrincipal(), context.getSourceQuery());
 		} catch (Exception e) {
-			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
@@ -453,81 +452,89 @@
 	private String hackFix(String text) {
 
-		String result, head, title, clas, description, tail, new_title;
-		int p_categories, p_classes, p_location, p_dstart, values1, values2, op1, op2, op3, op4, op5, op6, op7, op8, qt1, qt2;
-
-		qt1 = 0;
-		qt2 = 0;
-
-		// Pega as posicoes das tags
-		p_categories = text.indexOf("CATEGORIES");
-		p_classes = text.indexOf("CLASS");
-
-		p_location = text.indexOf("LOCATION");
-		p_dstart = text.indexOf("DTSTART");
-
-		// Pega as posicoes das varias formas da tag SUMMARY
-		op1 = text.indexOf("SUMMARY:");
-		op2 = text.indexOf("SUMMARY;CHARSET=UTF-8:");
-		op3 = text.indexOf("SUMMARY;ENCODING=QUOTED-PRINTABLE:");
-		op4 = text.indexOf("SUMMARY;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:");
-
-		// Pega as posicoes das varias formas da tag DESCRIPTION
-		op5 = text.indexOf("DESCRIPTION:");
-		op6 = text.indexOf("DESCRIPTION;CHARSET=UTF-8:");
-		op7 = text.indexOf("DESCRIPTION;ENCODING=QUOTED-PRINTABLE:");
-		op8 = text.indexOf("DESCRIPTION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:");
-
-		qt1 += (op1 == -1) ? 0 : op1 + 8;
-		qt1 += (op2 == -1) ? 0 : op2 + 22;
-		qt1 += (op3 == -1) ? 0 : op3 + 34;
-		qt1 += (op4 == -1) ? 0 : op4 + 48;
-
-		qt2 += (op5 == -1) ? 0 : op5 + 12;
-		qt2 += (op6 == -1) ? 0 : op6 + 26;
-		qt2 += (op7 == -1) ? 0 : op7 + 38;
-		qt2 += (op8 == -1) ? 0 : op8 + 52;
-
-		values1 = (p_categories == -1) ? p_classes : p_categories;
-		values2 = (p_location == -1) ? p_dstart : p_location;
-
-		head = text.substring(0, qt1);
-		title = text.substring(qt1, values1);
-		clas = text.substring(values1, qt2);
-		description = text.substring(qt2, values2);
-		tail = text.substring(values2);
-
-		new_title = title.replaceAll("\r\n ", " ");
-
-		// Retira os enters no final do titulo
-		int title_t, title_bl;
-
-		while(true){
-			title_t = new_title.length();
-			title_bl = new_title.lastIndexOf("=0D=0A=\r\n");
-
-			if(title_bl != -1 && title_t == title_bl + 11){
-				new_title = new_title.substring(0, title_bl) + "\r\n";
-			} else {
-				break;
-			}
-		}
-
-		// Retira os enters no final da descricao
-		int description_t, description_bl;
-
-		while(true){
-			description_t = description.length();
-			description_bl = description.lastIndexOf("=0D=0A=\r\n");
-
-			if(description_bl != -1 && description_t == description_bl + 11){
-				description = description.substring(0, description_bl) + "\r\n";
-			} else {
-				break;
-			}
-		}
-
-		result = head + new_title + clas + description + tail;
-
-		return result;
+		try {
+		
+			String result, head, title, clas, description, tail, new_title;
+			int p_categories, p_classes, p_location, p_dstart, values1, values2, op1, op2, op3, op4, op5, op6, op7, op8, qt1, qt2;
+	
+			qt1 = 0;
+			qt2 = 0;
+	
+			// Pega as posicoes das tags
+			p_categories = text.indexOf("CATEGORIES");
+			p_classes = text.indexOf("CLASS");
+	
+			p_location = text.indexOf("LOCATION");
+			p_dstart = text.indexOf("DTSTART");
+	
+			// Pega as posicoes das varias formas da tag SUMMARY
+			op1 = text.indexOf("SUMMARY:");
+			op2 = text.indexOf("SUMMARY;CHARSET=UTF-8:");
+			op3 = text.indexOf("SUMMARY;ENCODING=QUOTED-PRINTABLE:");
+			op4 = text.indexOf("SUMMARY;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:");
+	
+			// Pega as posicoes das varias formas da tag DESCRIPTION
+			op5 = text.indexOf("DESCRIPTION:");
+			op6 = text.indexOf("DESCRIPTION;CHARSET=UTF-8:");
+			op7 = text.indexOf("DESCRIPTION;ENCODING=QUOTED-PRINTABLE:");
+			op8 = text.indexOf("DESCRIPTION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:");
+	
+			qt1 += (op1 == -1) ? 0 : op1 + 8;
+			qt1 += (op2 == -1) ? 0 : op2 + 22;
+			qt1 += (op3 == -1) ? 0 : op3 + 34;
+			qt1 += (op4 == -1) ? 0 : op4 + 48;
+	
+			qt2 += (op5 == -1) ? 0 : op5 + 12;
+			qt2 += (op6 == -1) ? 0 : op6 + 26;
+			qt2 += (op7 == -1) ? 0 : op7 + 38;
+			qt2 += (op8 == -1) ? 0 : op8 + 52;
+	
+			values1 = (p_categories == -1) ? p_classes : p_categories;
+			values2 = (p_location == -1) ? p_dstart : p_location;
+	
+			head = text.substring(0, qt1);
+			title = text.substring(qt1, values1);
+			clas = text.substring(values1, qt2);
+			description = text.substring(qt2, values2);
+			tail = text.substring(values2);
+	
+			new_title = title.replaceAll("\r\n ", " ");
+	
+			// Retira os enters no final do titulo
+			int title_t, title_bl;
+	
+			while(true){
+				title_t = new_title.length();
+				title_bl = new_title.lastIndexOf("=0D=0A=\r\n");
+	
+				if(title_bl != -1 && title_t == title_bl + 11){
+					new_title = new_title.substring(0, title_bl) + "\r\n";
+				} else {
+					break;
+				}
+			}
+	
+			// Retira os enters no final da descricao
+			int description_t, description_bl;
+	
+			while(true){
+				description_t = description.length();
+				description_bl = description.lastIndexOf("=0D=0A=\r\n");
+	
+				if(description_bl != -1 && description_t == description_bl + 11){
+					description = description.substring(0, description_bl) + "\r\n";
+				} else {
+					break;
+				}
+			}
+	
+			result = head + new_title + clas + description + tail;
+
+			return result;
+		}catch (Exception e) {
+			if (log.isTraceEnabled()) {
+				log.trace(e);
+			}
+			return text;
+		}
 	}
 
Index: contrib/psync/src/main/java/br/com/prognus/psync/util/Country.java
===================================================================
--- contrib/psync/src/main/java/br/com/prognus/psync/util/Country.java	(revision 1545)
+++ contrib/psync/src/main/java/br/com/prognus/psync/util/Country.java	(revision 1545)
@@ -0,0 +1,279 @@
+package br.com.prognus.psync.util;
+
+/**
+ * From phpgwapi/inc/class.country.inc.php
+ * From http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html
+ *
+ */
+public enum Country {
+
+	AF ("AFGHANISTAN"),
+	AL ("ALBANIA"),
+	DZ ("ALGERIA"),
+	AS ("AMERICAN SAMOA"),
+	AD ("ANDORRA"),
+	AO ("ANGOLA"),
+	AI ("ANGUILLA"),
+	AQ ("ANTARCTICA"),
+	AG ("ANTIGUA AND BARBUDA"),
+	AR ("ARGENTINA"),
+	AM ("ARMENIA"),
+	AW ("ARUBA"),
+	AU ("AUSTRALIA"),
+	AT ("AUSTRIA"),
+	AZ ("AZERBAIJAN"),
+	BS ("BAHAMAS"),
+	BH ("BAHRAIN"),
+	BD ("BANGLADESH"),
+	BB ("BARBADOS"),
+	BY ("BELARUS"),
+	BE ("BELGIUM"),
+	BZ ("BELIZE"),
+	BJ ("BENIN"),
+	BM ("BERMUDA"),
+	BT ("BHUTAN"),
+	BO ("BOLIVIA"),
+	BA ("BOSNIA AND HERZEGOVINA"),
+	BW ("BOTSWANA"),
+	BV ("BOUVET ISLAND"),
+	BR ("BRAZIL"),
+	IO ("BRITISH INDIAN OCEAN TERRITORY"),
+	BN ("BRUNEI DARUSSALAM"),
+	BG ("BULGARIA"),
+	BF ("BURKINA FASO"),
+	BI ("BURUNDI"),
+	KH ("CAMBODIA"),
+	CM ("CAMEROON"),
+	CA ("CANADA"),
+	CV ("CAPE VERDE"),
+	KY ("CAYMAN ISLANDS"),
+	CF ("CENTRAL AFRICAN REPUBLIC"),
+	TD ("CHAD"),
+	CL ("CHILE"),
+	CN ("CHINA"),
+	CX ("CHRISTMAS ISLAND"),
+	CC ("COCOS (KEELING) ISLANDS"),
+	CO ("COLOMBIA"),
+	KM ("COMOROS"),
+	CG ("CONGO"),
+	CD ("CONGO, THE DEMOCRATIC REPUBLIC OF THE"),
+	CK ("COOK ISLANDS"),
+	CR ("COSTA RICA"),
+	CI ("COTE D IVOIRE"),
+	HR ("CROATIA"),
+	CU ("CUBA"),
+	CY ("CYPRUS"),
+	CZ ("CZECH REPUBLIC"),
+	DK ("DENMARK"),
+	DJ ("DJIBOUTI"),
+	DM ("DOMINICA"),
+	DO ("DOMINICAN REPUBLIC"),
+	TP ("EAST TIMOR"),
+	EC ("ECUADOR"),
+	EG ("EGYPT"),
+	SV ("EL SALVADOR"),
+	GQ ("EQUATORIAL GUINEA"),
+	ER ("ERITREA"),
+	EE ("ESTONIA"),
+	ET ("ETHIOPIA"),
+	FK ("FALKLAND ISLANDS (MALVINAS)"),
+	FO ("FAROE ISLANDS"),
+	FJ ("FIJI"),
+	FI ("FINLAND"),
+	FR ("FRANCE"),
+	GF ("FRENCH GUIANA"),
+	PF ("FRENCH POLYNESIA"),
+	TF ("FRENCH SOUTHERN TERRITORIES"),
+	GA ("GABON"),
+	GM ("GAMBIA"),
+	GE ("GEORGIA"),
+	DE ("GERMANY"),
+	GH ("GHANA"),
+	GI ("GIBRALTAR"),
+	GR ("GREECE"),
+	GL ("GREENLAND"),
+	GD ("GRENADA"),
+	GP ("GUADELOUPE"),
+	GU ("GUAM"),
+	GT ("GUATEMALA"),
+	GN ("GUINEA"),
+	GW ("GUINEA-BISSAU"),
+	GY ("GUYANA"),
+	HT ("HAITI"),
+	HM ("HEARD ISLAND AND MCDONALD ISLANDS"),
+	VA ("HOLY SEE (VATICAN CITY STATE)"),
+	HN ("HONDURAS"),
+	HK ("HONG KONG"),
+	HU ("HUNGARY"),
+	IS ("ICELAND"),
+	IN ("INDIA"),
+	ID ("INDONESIA"),
+	IR ("IRAN, ISLAMIC REPUBLIC OF"),
+	IQ ("IRAQ"),
+	IE ("IRELAND"),
+	IL ("ISRAEL"),
+	IT ("ITALY"),
+	JM ("JAMAICA"),
+	JP ("JAPAN"),
+	JO ("JORDAN"),
+	KZ ("KAZAKSTAN"),
+	KE ("KENYA"),
+	KI ("KIRIBATI"),
+	KP ("KOREA DEMOCRATIC PEOPLES REPUBLIC OF"),
+	KR ("KOREA REPUBLIC OF"),
+	KW ("KUWAIT"),
+	KG ("KYRGYZSTAN"),
+	LA ("LAO PEOPLES DEMOCRATIC REPUBLIC"),
+	LV ("LATVIA"),
+	LB ("LEBANON"),
+	LS ("LESOTHO"),
+	LR ("LIBERIA"),
+	LY ("LIBYAN ARAB JAMAHIRIYA"),
+	LI ("LIECHTENSTEIN"),
+	LT ("LITHUANIA"),
+	LU ("LUXEMBOURG"),
+	MO ("MACAU"),
+	MK ("MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF"),
+	MG ("MADAGASCAR"),
+	MW ("MALAWI"),
+	MY ("MALAYSIA"),
+	MV ("MALDIVES"),
+	ML ("MALI"),
+	MT ("MALTA"),
+	MH ("MARSHALL ISLANDS"),
+	MQ ("MARTINIQUE"),
+	MR ("MAURITANIA"),
+	MU ("MAURITIUS"),
+	YT ("MAYOTTE"),
+	MX ("MEXICO"),
+	FM ("MICRONESIA, FEDERATED STATES OF"),
+	MD ("MOLDOVA, REPUBLIC OF"),
+	MC ("MONACO"),
+	MN ("MONGOLIA"),
+	MS ("MONTSERRAT"),
+	MA ("MOROCCO"),
+	MZ ("MOZAMBIQUE"),
+	MM ("MYANMAR"),
+	NA ("NAMIBIA"),
+	NR ("NAURU"),
+	NP ("NEPAL"),
+	NL ("NETHERLANDS"),
+	AN ("NETHERLANDS ANTILLES"),
+	NC ("NEW CALEDONIA"),
+	NZ ("NEW ZEALAND"),
+	NI ("NICARAGUA"),
+	NE ("NIGER"),
+	NG ("NIGERIA"),
+	NU ("NIUE"),
+	NF ("NORFOLK ISLAND"),
+	MP ("NORTHERN MARIANA ISLANDS"),
+	NO ("NORWAY"),
+	OM ("OMAN"),
+	PK ("PAKISTAN"),
+	PW ("PALAU"),
+	PS ("PALESTINIAN TERRITORY, OCCUPIED"),
+	PA ("PANAMA"),
+	PG ("PAPUA NEW GUINEA"),
+	PY ("PARAGUAY"),
+	PE ("PERU"),
+	PH ("PHILIPPINES"),
+	PN ("PITCAIRN"),
+	PL ("POLAND"),
+	PT ("PORTUGAL"),
+	PR ("PUERTO RICO"),
+	QA ("QATAR"),
+	RE ("REUNION"),
+	RO ("ROMANIA"),
+	RU ("RUSSIAN FEDERATION"),
+	RW ("RWANDA"),
+	SH ("SAINT HELENA"),
+	KN ("SAINT KITTS AND NEVIS"),
+	LC ("SAINT LUCIA"),
+	PM ("SAINT PIERRE AND MIQUELON"),
+	VC ("SAINT VINCENT AND THE GRENADINES"),
+	WS ("SAMOA"),
+	SM ("SAN MARINO"),
+	ST ("SAO TOME AND PRINCIPE"),
+	SA ("SAUDI ARABIA"),
+	SN ("SENEGAL"),
+	SC ("SEYCHELLES"),
+	SL ("SIERRA LEONE"),
+	SG ("SINGAPORE"),
+	SK ("SLOVAKIA"),
+	SI ("SLOVENIA"),
+	SB ("SOLOMON ISLANDS"),
+	SO ("SOMALIA"),
+	ZA ("SOUTH AFRICA"),
+	GS ("SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS"),
+	ES ("SPAIN"),
+	LK ("SRI LANKA"),
+	SD ("SUDAN"),
+	SR ("SURINAME"),
+	SJ ("SVALBARD AND JAN MAYEN"),
+	SZ ("SWAZILAND"),
+	SE ("SWEDEN"),
+	CH ("SWITZERLAND"),
+	SY ("SYRIAN ARAB REPUBLIC"),
+	TW ("TAIWAN"),
+	TJ ("TAJIKISTAN"),
+	TZ ("TANZANIA, UNITED REPUBLIC OF"),
+	TH ("THAILAND"),
+	TG ("TOGO"),
+	TK ("TOKELAU"),
+	TO ("TONGA"),
+	TT ("TRINIDAD AND TOBAGO"),
+	TN ("TUNISIA"),
+	TR ("TURKEY"),
+	TM ("TURKMENISTAN"),
+	TC ("TURKS AND CAICOS ISLANDS"),
+	TV ("TUVALU"),
+	UG ("UGANDA"),
+	UA ("UKRAINE"),
+	AE ("UNITED ARAB EMIRATES"),
+	GB ("UNITED KINGDOM"),
+	US ("UNITED STATES"),
+	UM ("UNITED STATES MINOR OUTLYING ISLANDS"),
+	UY ("URUGUAY"),
+	UZ ("UZBEKISTAN"),
+	VU ("VANUATU"),
+	VE ("VENEZUELA"),
+	VN ("VIET NAM"),
+	VG ("VIRGIN ISLANDS, BRITISH"),
+	VI ("VIRGIN ISLANDS, U.S."),
+	WF ("WALLIS AND FUTUNA"),
+	EH ("WESTERN SAHARA"),
+	YE ("YEMEN"),
+	YU ("YUGOSLAVIA"),
+	ZM ("ZAMBIA"),
+	ZW ("ZIMBABWE");
+
+	private String nameCountry;
+	private String codeCountry;
+	
+	Country(String nameCountry) {
+		this.nameCountry=nameCountry;
+		this.codeCountry=this.name();
+	}
+	
+	public String getCode() {
+		return this.codeCountry;
+	}
+	
+	public String getName() {
+		return this.nameCountry;
+	}
+	
+	public static Country getCountryByCode(String code){
+		return Country.valueOf(code);
+	}
+	
+	public static Country getCountryByName(String name){
+		for (Country country : Country.values()) {
+			if(country.getName().equalsIgnoreCase(name)) {
+				return country;
+			}
+		}
+		return Country.BR;
+	}
+	
+}
Index: contrib/psync/src/main/java/br/com/prognus/psync/util/TypeAddress.java
===================================================================
--- contrib/psync/src/main/java/br/com/prognus/psync/util/TypeAddress.java	(revision 1545)
+++ contrib/psync/src/main/java/br/com/prognus/psync/util/TypeAddress.java	(revision 1545)
@@ -0,0 +1,22 @@
+package br.com.prognus.psync.util;
+
+/**
+ * phpgw_cc_typeof_ct_addrs
+ *
+ */
+public enum TypeAddress {
+
+	RESIDENCIAL(1),
+	COMERCIAL(2);
+	
+	int id;
+	
+	TypeAddress(int num) {
+		this.id = num;
+	}
+	
+	public int getId() {
+		return id;
+	}
+	
+}
