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(Contact contact) throws SystemException {
029
030
031
032 addressLocalService.deleteAddresses(
033 contact.getCompanyId(), Contact.class.getName(),
034 contact.getContactId());
035
036
037
038 emailAddressLocalService.deleteEmailAddresses(
039 contact.getCompanyId(), Contact.class.getName(),
040 contact.getContactId());
041
042
043
044 phoneLocalService.deletePhones(
045 contact.getCompanyId(), Contact.class.getName(),
046 contact.getContactId());
047
048
049
050 websiteLocalService.deleteWebsites(
051 contact.getCompanyId(), Contact.class.getName(),
052 contact.getContactId());
053
054
055
056 contactPersistence.remove(contact);
057 }
058
059 @Override
060 public void deleteContact(long contactId) throws SystemException {
061 Contact contact = contactPersistence.fetchByPrimaryKey(contactId);
062
063 if (contact != null) {
064 deleteContact(contact);
065 }
066 }
067
068 @Override
069 public Contact getContact(long contactId)
070 throws PortalException, SystemException {
071
072 return contactPersistence.findByPrimaryKey(contactId);
073 }
074
075 }