E-A B
2 anni fa
89 ha cambiato i file con 160 aggiunte e 106 eliminazioni
@ -1,11 +1,26 @@ |
|||||||
package it.tref.liferay.portos.mailmanager.hook.listener; |
package it.tref.liferay.portos.mailmanager.hook.listener; |
||||||
|
|
||||||
|
import it.tref.liferay.portos.mailmanager.model.EmailAttachment; |
||||||
|
import it.tref.liferay.portos.mailmanager.service.EmailAttachmentLocalServiceUtil; |
||||||
|
|
||||||
import com.liferay.portal.ModelListenerException; |
import com.liferay.portal.ModelListenerException; |
||||||
|
import com.liferay.portal.kernel.exception.SystemException; |
||||||
import com.liferay.portal.model.BaseModelListener; |
import com.liferay.portal.model.BaseModelListener; |
||||||
import com.liferay.portlet.documentlibrary.model.DLFileEntry; |
import com.liferay.portlet.documentlibrary.model.DLFileEntry; |
||||||
|
|
||||||
public class DLFileEntryListener extends BaseModelListener<DLFileEntry> { |
public class DLFileEntryListener extends BaseModelListener<DLFileEntry> { |
||||||
|
|
||||||
@Override |
@Override |
||||||
public void onBeforeRemove(DLFileEntry model) throws ModelListenerException {} |
public void onBeforeRemove(DLFileEntry model) throws ModelListenerException { |
||||||
|
|
||||||
|
try { |
||||||
|
EmailAttachment emailAttachment = EmailAttachmentLocalServiceUtil |
||||||
|
.fetchByFileEntryId(model.getFileEntryId()); |
||||||
|
if (emailAttachment != null) { |
||||||
|
throw new ModelListenerException(); |
||||||
|
} |
||||||
|
} catch (SystemException e) { |
||||||
|
throw new ModelListenerException(e); |
||||||
|
} |
||||||
|
} |
||||||
} |
} |
||||||
|
@ -1,2 +1,2 @@ |
|||||||
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> |
|
||||||
<%@ include file="/html/init.jsp" %> |
<%@ include file="/html/init.jsp" %> |
||||||
|
Caricamento…
Reference in new issue