001
014
015 package com.liferay.portal.service.impl;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.model.Contact;
020 import com.liferay.portal.service.base.ContactLocalServiceBaseImpl;
021
022
025 public class ContactLocalServiceImpl extends ContactLocalServiceBaseImpl {
026
027 @Override
028 public void deleteContact(long contactId) throws SystemException {
029 Contact contact = contactPersistence.fetchByPrimaryKey(contactId);
030
031 if (contact != null) {
032 deleteContact(contact);
033 }
034 }
035
036 @Override
037 public void deleteContact(Contact contact) throws SystemException {
038
039
040
041 addressLocalService.deleteAddresses(
042 contact.getCompanyId(), Contact.class.getName(),
043 contact.getContactId());
044
045
046
047 emailAddressLocalService.deleteEmailAddresses(
048 contact.getCompanyId(), Contact.class.getName(),
049 contact.getContactId());
050
051
052
053 phoneLocalService.deletePhones(
054 contact.getCompanyId(), Contact.class.getName(),
055 contact.getContactId());
056
057
058
059 websiteLocalService.deleteWebsites(
060 contact.getCompanyId(), Contact.class.getName(),
061 contact.getContactId());
062
063
064
065 contactPersistence.remove(contact);
066 }
067
068 @Override
069 public Contact getContact(long contactId)
070 throws PortalException, SystemException {
071
072 return contactPersistence.findByPrimaryKey(contactId);
073 }
074
075 }