toCacheModel() {
+ EmailTemplateAttachmentCacheModel emailTemplateAttachmentCacheModel = new EmailTemplateAttachmentCacheModel();
+
+ emailTemplateAttachmentCacheModel.emailTemplateId = getEmailTemplateId();
+
+ emailTemplateAttachmentCacheModel.fileEntryId = getFileEntryId();
+
+ return emailTemplateAttachmentCacheModel;
+ }
+
+ @Override
+ public String toString() {
+ StringBundler sb = new StringBundler(5);
+
+ sb.append("{emailTemplateId=");
+ sb.append(getEmailTemplateId());
+ sb.append(", fileEntryId=");
+ sb.append(getFileEntryId());
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ @Override
+ public String toXmlString() {
+ StringBundler sb = new StringBundler(10);
+
+ sb.append("");
+ sb.append(
+ "it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment");
+ sb.append("");
+
+ sb.append(
+ "emailTemplateId");
+ sb.append(
+ "fileEntryId");
+
+ sb.append("");
+
+ return sb.toString();
+ }
+
+ private static ClassLoader _classLoader = EmailTemplateAttachment.class.getClassLoader();
+ private static Class>[] _escapedModelInterfaces = new Class[] {
+ EmailTemplateAttachment.class
+ };
+ private long _emailTemplateId;
+ private long _originalEmailTemplateId;
+ private boolean _setOriginalEmailTemplateId;
+ private long _fileEntryId;
+ private long _originalFileEntryId;
+ private boolean _setOriginalFileEntryId;
+ private long _columnBitmask;
+ private EmailTemplateAttachment _escapedModel;
+}
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/base/EmailTemplateAttachmentLocalServiceBaseImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/base/EmailTemplateAttachmentLocalServiceBaseImpl.java
new file mode 100644
index 00000000..26fdc98f
--- /dev/null
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/base/EmailTemplateAttachmentLocalServiceBaseImpl.java
@@ -0,0 +1,797 @@
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package it.tref.liferay.portos.mailmanager.service.base;
+
+import com.liferay.portal.kernel.bean.BeanReference;
+import com.liferay.portal.kernel.bean.IdentifiableBean;
+import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
+import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
+import com.liferay.portal.kernel.dao.orm.DynamicQuery;
+import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
+import com.liferay.portal.kernel.dao.orm.Projection;
+import com.liferay.portal.kernel.exception.PortalException;
+import com.liferay.portal.kernel.exception.SystemException;
+import com.liferay.portal.kernel.search.Indexable;
+import com.liferay.portal.kernel.search.IndexableType;
+import com.liferay.portal.kernel.util.OrderByComparator;
+import com.liferay.portal.model.PersistedModel;
+import com.liferay.portal.service.BaseLocalServiceImpl;
+import com.liferay.portal.service.PersistedModelLocalServiceRegistryUtil;
+import com.liferay.portal.service.persistence.CompanyPersistence;
+import com.liferay.portal.service.persistence.UserPersistence;
+
+import it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment;
+import it.tref.liferay.portos.mailmanager.service.EmailTemplateAttachmentLocalService;
+import it.tref.liferay.portos.mailmanager.service.persistence.EmailAttachmentPersistence;
+import it.tref.liferay.portos.mailmanager.service.persistence.EmailPersistence;
+import it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplateAttachmentPK;
+import it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplateAttachmentPersistence;
+import it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplatePersistence;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+import javax.sql.DataSource;
+
+/**
+ * Provides the base implementation for the email template attachment local service.
+ *
+ *
+ * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link it.tref.liferay.portos.mailmanager.service.impl.EmailTemplateAttachmentLocalServiceImpl}.
+ *
+ *
+ * @author
+ * @see it.tref.liferay.portos.mailmanager.service.impl.EmailTemplateAttachmentLocalServiceImpl
+ * @see it.tref.liferay.portos.mailmanager.service.EmailTemplateAttachmentLocalServiceUtil
+ * @generated
+ */
+public abstract class EmailTemplateAttachmentLocalServiceBaseImpl
+ extends BaseLocalServiceImpl implements EmailTemplateAttachmentLocalService,
+ IdentifiableBean {
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. Always use {@link it.tref.liferay.portos.mailmanager.service.EmailTemplateAttachmentLocalServiceUtil} to access the email template attachment local service.
+ */
+
+ /**
+ * Adds the email template attachment to the database. Also notifies the appropriate model listeners.
+ *
+ * @param emailTemplateAttachment the email template attachment
+ * @return the email template attachment that was added
+ * @throws SystemException if a system exception occurred
+ */
+ @Indexable(type = IndexableType.REINDEX)
+ @Override
+ public EmailTemplateAttachment addEmailTemplateAttachment(
+ EmailTemplateAttachment emailTemplateAttachment)
+ throws SystemException {
+ emailTemplateAttachment.setNew(true);
+
+ return emailTemplateAttachmentPersistence.update(emailTemplateAttachment);
+ }
+
+ /**
+ * Creates a new email template attachment with the primary key. Does not add the email template attachment to the database.
+ *
+ * @param emailTemplateAttachmentPK the primary key for the new email template attachment
+ * @return the new email template attachment
+ */
+ @Override
+ public EmailTemplateAttachment createEmailTemplateAttachment(
+ EmailTemplateAttachmentPK emailTemplateAttachmentPK) {
+ return emailTemplateAttachmentPersistence.create(emailTemplateAttachmentPK);
+ }
+
+ /**
+ * Deletes the email template attachment with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param emailTemplateAttachmentPK the primary key of the email template attachment
+ * @return the email template attachment that was removed
+ * @throws PortalException if a email template attachment with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Indexable(type = IndexableType.DELETE)
+ @Override
+ public EmailTemplateAttachment deleteEmailTemplateAttachment(
+ EmailTemplateAttachmentPK emailTemplateAttachmentPK)
+ throws PortalException, SystemException {
+ return emailTemplateAttachmentPersistence.remove(emailTemplateAttachmentPK);
+ }
+
+ /**
+ * Deletes the email template attachment from the database. Also notifies the appropriate model listeners.
+ *
+ * @param emailTemplateAttachment the email template attachment
+ * @return the email template attachment that was removed
+ * @throws SystemException if a system exception occurred
+ */
+ @Indexable(type = IndexableType.DELETE)
+ @Override
+ public EmailTemplateAttachment deleteEmailTemplateAttachment(
+ EmailTemplateAttachment emailTemplateAttachment)
+ throws SystemException {
+ return emailTemplateAttachmentPersistence.remove(emailTemplateAttachment);
+ }
+
+ @Override
+ public DynamicQuery dynamicQuery() {
+ Class> clazz = getClass();
+
+ return DynamicQueryFactoryUtil.forClass(EmailTemplateAttachment.class,
+ clazz.getClassLoader());
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns the matching rows.
+ *
+ * @param dynamicQuery the dynamic query
+ * @return the matching rows
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ @SuppressWarnings("rawtypes")
+ public List dynamicQuery(DynamicQuery dynamicQuery)
+ throws SystemException {
+ return emailTemplateAttachmentPersistence.findWithDynamicQuery(dynamicQuery);
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns a range of the matching rows.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.tref.liferay.portos.mailmanager.model.impl.EmailTemplateAttachmentModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
+ *
+ *
+ * @param dynamicQuery the dynamic query
+ * @param start the lower bound of the range of model instances
+ * @param end the upper bound of the range of model instances (not inclusive)
+ * @return the range of matching rows
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ @SuppressWarnings("rawtypes")
+ public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
+ throws SystemException {
+ return emailTemplateAttachmentPersistence.findWithDynamicQuery(dynamicQuery,
+ start, end);
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns an ordered range of the matching rows.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.tref.liferay.portos.mailmanager.model.impl.EmailTemplateAttachmentModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
+ *
+ *
+ * @param dynamicQuery the dynamic query
+ * @param start the lower bound of the range of model instances
+ * @param end the upper bound of the range of model instances (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null)
+ * @return the ordered range of matching rows
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ @SuppressWarnings("rawtypes")
+ public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
+ OrderByComparator orderByComparator) throws SystemException {
+ return emailTemplateAttachmentPersistence.findWithDynamicQuery(dynamicQuery,
+ start, end, orderByComparator);
+ }
+
+ /**
+ * Returns the number of rows that match the dynamic query.
+ *
+ * @param dynamicQuery the dynamic query
+ * @return the number of rows that match the dynamic query
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public long dynamicQueryCount(DynamicQuery dynamicQuery)
+ throws SystemException {
+ return emailTemplateAttachmentPersistence.countWithDynamicQuery(dynamicQuery);
+ }
+
+ /**
+ * Returns the number of rows that match the dynamic query.
+ *
+ * @param dynamicQuery the dynamic query
+ * @param projection the projection to apply to the query
+ * @return the number of rows that match the dynamic query
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public long dynamicQueryCount(DynamicQuery dynamicQuery,
+ Projection projection) throws SystemException {
+ return emailTemplateAttachmentPersistence.countWithDynamicQuery(dynamicQuery,
+ projection);
+ }
+
+ @Override
+ public EmailTemplateAttachment fetchEmailTemplateAttachment(
+ EmailTemplateAttachmentPK emailTemplateAttachmentPK)
+ throws SystemException {
+ return emailTemplateAttachmentPersistence.fetchByPrimaryKey(emailTemplateAttachmentPK);
+ }
+
+ /**
+ * Returns the email template attachment with the primary key.
+ *
+ * @param emailTemplateAttachmentPK the primary key of the email template attachment
+ * @return the email template attachment
+ * @throws PortalException if a email template attachment with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment getEmailTemplateAttachment(
+ EmailTemplateAttachmentPK emailTemplateAttachmentPK)
+ throws PortalException, SystemException {
+ return emailTemplateAttachmentPersistence.findByPrimaryKey(emailTemplateAttachmentPK);
+ }
+
+ @Override
+ public PersistedModel getPersistedModel(Serializable primaryKeyObj)
+ throws PortalException, SystemException {
+ return emailTemplateAttachmentPersistence.findByPrimaryKey(primaryKeyObj);
+ }
+
+ /**
+ * Returns a range of all the email template attachments.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.tref.liferay.portos.mailmanager.model.impl.EmailTemplateAttachmentModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
+ *
+ *
+ * @param start the lower bound of the range of email template attachments
+ * @param end the upper bound of the range of email template attachments (not inclusive)
+ * @return the range of email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public List getEmailTemplateAttachments(
+ int start, int end) throws SystemException {
+ return emailTemplateAttachmentPersistence.findAll(start, end);
+ }
+
+ /**
+ * Returns the number of email template attachments.
+ *
+ * @return the number of email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public int getEmailTemplateAttachmentsCount() throws SystemException {
+ return emailTemplateAttachmentPersistence.countAll();
+ }
+
+ /**
+ * Updates the email template attachment in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
+ *
+ * @param emailTemplateAttachment the email template attachment
+ * @return the email template attachment that was updated
+ * @throws SystemException if a system exception occurred
+ */
+ @Indexable(type = IndexableType.REINDEX)
+ @Override
+ public EmailTemplateAttachment updateEmailTemplateAttachment(
+ EmailTemplateAttachment emailTemplateAttachment)
+ throws SystemException {
+ return emailTemplateAttachmentPersistence.update(emailTemplateAttachment);
+ }
+
+ /**
+ * Returns the email local service.
+ *
+ * @return the email local service
+ */
+ public it.tref.liferay.portos.mailmanager.service.EmailLocalService getEmailLocalService() {
+ return emailLocalService;
+ }
+
+ /**
+ * Sets the email local service.
+ *
+ * @param emailLocalService the email local service
+ */
+ public void setEmailLocalService(
+ it.tref.liferay.portos.mailmanager.service.EmailLocalService emailLocalService) {
+ this.emailLocalService = emailLocalService;
+ }
+
+ /**
+ * Returns the email remote service.
+ *
+ * @return the email remote service
+ */
+ public it.tref.liferay.portos.mailmanager.service.EmailService getEmailService() {
+ return emailService;
+ }
+
+ /**
+ * Sets the email remote service.
+ *
+ * @param emailService the email remote service
+ */
+ public void setEmailService(
+ it.tref.liferay.portos.mailmanager.service.EmailService emailService) {
+ this.emailService = emailService;
+ }
+
+ /**
+ * Returns the email persistence.
+ *
+ * @return the email persistence
+ */
+ public EmailPersistence getEmailPersistence() {
+ return emailPersistence;
+ }
+
+ /**
+ * Sets the email persistence.
+ *
+ * @param emailPersistence the email persistence
+ */
+ public void setEmailPersistence(EmailPersistence emailPersistence) {
+ this.emailPersistence = emailPersistence;
+ }
+
+ /**
+ * Returns the email attachment local service.
+ *
+ * @return the email attachment local service
+ */
+ public it.tref.liferay.portos.mailmanager.service.EmailAttachmentLocalService getEmailAttachmentLocalService() {
+ return emailAttachmentLocalService;
+ }
+
+ /**
+ * Sets the email attachment local service.
+ *
+ * @param emailAttachmentLocalService the email attachment local service
+ */
+ public void setEmailAttachmentLocalService(
+ it.tref.liferay.portos.mailmanager.service.EmailAttachmentLocalService emailAttachmentLocalService) {
+ this.emailAttachmentLocalService = emailAttachmentLocalService;
+ }
+
+ /**
+ * Returns the email attachment persistence.
+ *
+ * @return the email attachment persistence
+ */
+ public EmailAttachmentPersistence getEmailAttachmentPersistence() {
+ return emailAttachmentPersistence;
+ }
+
+ /**
+ * Sets the email attachment persistence.
+ *
+ * @param emailAttachmentPersistence the email attachment persistence
+ */
+ public void setEmailAttachmentPersistence(
+ EmailAttachmentPersistence emailAttachmentPersistence) {
+ this.emailAttachmentPersistence = emailAttachmentPersistence;
+ }
+
+ /**
+ * Returns the email template local service.
+ *
+ * @return the email template local service
+ */
+ public it.tref.liferay.portos.mailmanager.service.EmailTemplateLocalService getEmailTemplateLocalService() {
+ return emailTemplateLocalService;
+ }
+
+ /**
+ * Sets the email template local service.
+ *
+ * @param emailTemplateLocalService the email template local service
+ */
+ public void setEmailTemplateLocalService(
+ it.tref.liferay.portos.mailmanager.service.EmailTemplateLocalService emailTemplateLocalService) {
+ this.emailTemplateLocalService = emailTemplateLocalService;
+ }
+
+ /**
+ * Returns the email template remote service.
+ *
+ * @return the email template remote service
+ */
+ public it.tref.liferay.portos.mailmanager.service.EmailTemplateService getEmailTemplateService() {
+ return emailTemplateService;
+ }
+
+ /**
+ * Sets the email template remote service.
+ *
+ * @param emailTemplateService the email template remote service
+ */
+ public void setEmailTemplateService(
+ it.tref.liferay.portos.mailmanager.service.EmailTemplateService emailTemplateService) {
+ this.emailTemplateService = emailTemplateService;
+ }
+
+ /**
+ * Returns the email template persistence.
+ *
+ * @return the email template persistence
+ */
+ public EmailTemplatePersistence getEmailTemplatePersistence() {
+ return emailTemplatePersistence;
+ }
+
+ /**
+ * Sets the email template persistence.
+ *
+ * @param emailTemplatePersistence the email template persistence
+ */
+ public void setEmailTemplatePersistence(
+ EmailTemplatePersistence emailTemplatePersistence) {
+ this.emailTemplatePersistence = emailTemplatePersistence;
+ }
+
+ /**
+ * Returns the email template attachment local service.
+ *
+ * @return the email template attachment local service
+ */
+ public it.tref.liferay.portos.mailmanager.service.EmailTemplateAttachmentLocalService getEmailTemplateAttachmentLocalService() {
+ return emailTemplateAttachmentLocalService;
+ }
+
+ /**
+ * Sets the email template attachment local service.
+ *
+ * @param emailTemplateAttachmentLocalService the email template attachment local service
+ */
+ public void setEmailTemplateAttachmentLocalService(
+ it.tref.liferay.portos.mailmanager.service.EmailTemplateAttachmentLocalService emailTemplateAttachmentLocalService) {
+ this.emailTemplateAttachmentLocalService = emailTemplateAttachmentLocalService;
+ }
+
+ /**
+ * Returns the email template attachment persistence.
+ *
+ * @return the email template attachment persistence
+ */
+ public EmailTemplateAttachmentPersistence getEmailTemplateAttachmentPersistence() {
+ return emailTemplateAttachmentPersistence;
+ }
+
+ /**
+ * Sets the email template attachment persistence.
+ *
+ * @param emailTemplateAttachmentPersistence the email template attachment persistence
+ */
+ public void setEmailTemplateAttachmentPersistence(
+ EmailTemplateAttachmentPersistence emailTemplateAttachmentPersistence) {
+ this.emailTemplateAttachmentPersistence = emailTemplateAttachmentPersistence;
+ }
+
+ /**
+ * Returns the counter local service.
+ *
+ * @return the counter local service
+ */
+ public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
+ return counterLocalService;
+ }
+
+ /**
+ * Sets the counter local service.
+ *
+ * @param counterLocalService the counter local service
+ */
+ public void setCounterLocalService(
+ com.liferay.counter.service.CounterLocalService counterLocalService) {
+ this.counterLocalService = counterLocalService;
+ }
+
+ /**
+ * Returns the company local service.
+ *
+ * @return the company local service
+ */
+ public com.liferay.portal.service.CompanyLocalService getCompanyLocalService() {
+ return companyLocalService;
+ }
+
+ /**
+ * Sets the company local service.
+ *
+ * @param companyLocalService the company local service
+ */
+ public void setCompanyLocalService(
+ com.liferay.portal.service.CompanyLocalService companyLocalService) {
+ this.companyLocalService = companyLocalService;
+ }
+
+ /**
+ * Returns the company remote service.
+ *
+ * @return the company remote service
+ */
+ public com.liferay.portal.service.CompanyService getCompanyService() {
+ return companyService;
+ }
+
+ /**
+ * Sets the company remote service.
+ *
+ * @param companyService the company remote service
+ */
+ public void setCompanyService(
+ com.liferay.portal.service.CompanyService companyService) {
+ this.companyService = companyService;
+ }
+
+ /**
+ * Returns the company persistence.
+ *
+ * @return the company persistence
+ */
+ public CompanyPersistence getCompanyPersistence() {
+ return companyPersistence;
+ }
+
+ /**
+ * Sets the company persistence.
+ *
+ * @param companyPersistence the company persistence
+ */
+ public void setCompanyPersistence(CompanyPersistence companyPersistence) {
+ this.companyPersistence = companyPersistence;
+ }
+
+ /**
+ * Returns the resource local service.
+ *
+ * @return the resource local service
+ */
+ public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
+ return resourceLocalService;
+ }
+
+ /**
+ * Sets the resource local service.
+ *
+ * @param resourceLocalService the resource local service
+ */
+ public void setResourceLocalService(
+ com.liferay.portal.service.ResourceLocalService resourceLocalService) {
+ this.resourceLocalService = resourceLocalService;
+ }
+
+ /**
+ * Returns the user local service.
+ *
+ * @return the user local service
+ */
+ public com.liferay.portal.service.UserLocalService getUserLocalService() {
+ return userLocalService;
+ }
+
+ /**
+ * Sets the user local service.
+ *
+ * @param userLocalService the user local service
+ */
+ public void setUserLocalService(
+ com.liferay.portal.service.UserLocalService userLocalService) {
+ this.userLocalService = userLocalService;
+ }
+
+ /**
+ * Returns the user remote service.
+ *
+ * @return the user remote service
+ */
+ public com.liferay.portal.service.UserService getUserService() {
+ return userService;
+ }
+
+ /**
+ * Sets the user remote service.
+ *
+ * @param userService the user remote service
+ */
+ public void setUserService(
+ com.liferay.portal.service.UserService userService) {
+ this.userService = userService;
+ }
+
+ /**
+ * Returns the user persistence.
+ *
+ * @return the user persistence
+ */
+ public UserPersistence getUserPersistence() {
+ return userPersistence;
+ }
+
+ /**
+ * Sets the user persistence.
+ *
+ * @param userPersistence the user persistence
+ */
+ public void setUserPersistence(UserPersistence userPersistence) {
+ this.userPersistence = userPersistence;
+ }
+
+ /**
+ * Returns the d l app local service.
+ *
+ * @return the d l app local service
+ */
+ public com.liferay.portlet.documentlibrary.service.DLAppLocalService getDLAppLocalService() {
+ return dlAppLocalService;
+ }
+
+ /**
+ * Sets the d l app local service.
+ *
+ * @param dlAppLocalService the d l app local service
+ */
+ public void setDLAppLocalService(
+ com.liferay.portlet.documentlibrary.service.DLAppLocalService dlAppLocalService) {
+ this.dlAppLocalService = dlAppLocalService;
+ }
+
+ /**
+ * Returns the d l app remote service.
+ *
+ * @return the d l app remote service
+ */
+ public com.liferay.portlet.documentlibrary.service.DLAppService getDLAppService() {
+ return dlAppService;
+ }
+
+ /**
+ * Sets the d l app remote service.
+ *
+ * @param dlAppService the d l app remote service
+ */
+ public void setDLAppService(
+ com.liferay.portlet.documentlibrary.service.DLAppService dlAppService) {
+ this.dlAppService = dlAppService;
+ }
+
+ public void afterPropertiesSet() {
+ Class> clazz = getClass();
+
+ _classLoader = clazz.getClassLoader();
+
+ PersistedModelLocalServiceRegistryUtil.register("it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment",
+ emailTemplateAttachmentLocalService);
+ }
+
+ public void destroy() {
+ PersistedModelLocalServiceRegistryUtil.unregister(
+ "it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment");
+ }
+
+ /**
+ * Returns the Spring bean ID for this bean.
+ *
+ * @return the Spring bean ID for this bean
+ */
+ @Override
+ public String getBeanIdentifier() {
+ return _beanIdentifier;
+ }
+
+ /**
+ * Sets the Spring bean ID for this bean.
+ *
+ * @param beanIdentifier the Spring bean ID for this bean
+ */
+ @Override
+ public void setBeanIdentifier(String beanIdentifier) {
+ _beanIdentifier = beanIdentifier;
+ }
+
+ @Override
+ public Object invokeMethod(String name, String[] parameterTypes,
+ Object[] arguments) throws Throwable {
+ Thread currentThread = Thread.currentThread();
+
+ ClassLoader contextClassLoader = currentThread.getContextClassLoader();
+
+ if (contextClassLoader != _classLoader) {
+ currentThread.setContextClassLoader(_classLoader);
+ }
+
+ try {
+ return _clpInvoker.invokeMethod(name, parameterTypes, arguments);
+ }
+ finally {
+ if (contextClassLoader != _classLoader) {
+ currentThread.setContextClassLoader(contextClassLoader);
+ }
+ }
+ }
+
+ protected Class> getModelClass() {
+ return EmailTemplateAttachment.class;
+ }
+
+ protected String getModelClassName() {
+ return EmailTemplateAttachment.class.getName();
+ }
+
+ /**
+ * Performs an SQL query.
+ *
+ * @param sql the sql query
+ */
+ protected void runSQL(String sql) throws SystemException {
+ try {
+ DataSource dataSource = emailTemplateAttachmentPersistence.getDataSource();
+
+ SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
+ sql, new int[0]);
+
+ sqlUpdate.update();
+ }
+ catch (Exception e) {
+ throw new SystemException(e);
+ }
+ }
+
+ @BeanReference(type = it.tref.liferay.portos.mailmanager.service.EmailLocalService.class)
+ protected it.tref.liferay.portos.mailmanager.service.EmailLocalService emailLocalService;
+ @BeanReference(type = it.tref.liferay.portos.mailmanager.service.EmailService.class)
+ protected it.tref.liferay.portos.mailmanager.service.EmailService emailService;
+ @BeanReference(type = EmailPersistence.class)
+ protected EmailPersistence emailPersistence;
+ @BeanReference(type = it.tref.liferay.portos.mailmanager.service.EmailAttachmentLocalService.class)
+ protected it.tref.liferay.portos.mailmanager.service.EmailAttachmentLocalService emailAttachmentLocalService;
+ @BeanReference(type = EmailAttachmentPersistence.class)
+ protected EmailAttachmentPersistence emailAttachmentPersistence;
+ @BeanReference(type = it.tref.liferay.portos.mailmanager.service.EmailTemplateLocalService.class)
+ protected it.tref.liferay.portos.mailmanager.service.EmailTemplateLocalService emailTemplateLocalService;
+ @BeanReference(type = it.tref.liferay.portos.mailmanager.service.EmailTemplateService.class)
+ protected it.tref.liferay.portos.mailmanager.service.EmailTemplateService emailTemplateService;
+ @BeanReference(type = EmailTemplatePersistence.class)
+ protected EmailTemplatePersistence emailTemplatePersistence;
+ @BeanReference(type = it.tref.liferay.portos.mailmanager.service.EmailTemplateAttachmentLocalService.class)
+ protected it.tref.liferay.portos.mailmanager.service.EmailTemplateAttachmentLocalService emailTemplateAttachmentLocalService;
+ @BeanReference(type = EmailTemplateAttachmentPersistence.class)
+ protected EmailTemplateAttachmentPersistence emailTemplateAttachmentPersistence;
+ @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
+ protected com.liferay.counter.service.CounterLocalService counterLocalService;
+ @BeanReference(type = com.liferay.portal.service.CompanyLocalService.class)
+ protected com.liferay.portal.service.CompanyLocalService companyLocalService;
+ @BeanReference(type = com.liferay.portal.service.CompanyService.class)
+ protected com.liferay.portal.service.CompanyService companyService;
+ @BeanReference(type = CompanyPersistence.class)
+ protected CompanyPersistence companyPersistence;
+ @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
+ protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
+ @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
+ protected com.liferay.portal.service.UserLocalService userLocalService;
+ @BeanReference(type = com.liferay.portal.service.UserService.class)
+ protected com.liferay.portal.service.UserService userService;
+ @BeanReference(type = UserPersistence.class)
+ protected UserPersistence userPersistence;
+ @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLAppLocalService.class)
+ protected com.liferay.portlet.documentlibrary.service.DLAppLocalService dlAppLocalService;
+ @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLAppService.class)
+ protected com.liferay.portlet.documentlibrary.service.DLAppService dlAppService;
+ private String _beanIdentifier;
+ private ClassLoader _classLoader;
+ private EmailTemplateAttachmentLocalServiceClpInvoker _clpInvoker = new EmailTemplateAttachmentLocalServiceClpInvoker();
+}
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/base/EmailTemplateAttachmentLocalServiceClpInvoker.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/base/EmailTemplateAttachmentLocalServiceClpInvoker.java
new file mode 100644
index 00000000..63c9b89d
--- /dev/null
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/base/EmailTemplateAttachmentLocalServiceClpInvoker.java
@@ -0,0 +1,266 @@
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package it.tref.liferay.portos.mailmanager.service.base;
+
+import it.tref.liferay.portos.mailmanager.service.EmailTemplateAttachmentLocalServiceUtil;
+
+import java.util.Arrays;
+
+/**
+ * @author
+ * @generated
+ */
+public class EmailTemplateAttachmentLocalServiceClpInvoker {
+ public EmailTemplateAttachmentLocalServiceClpInvoker() {
+ _methodName0 = "addEmailTemplateAttachment";
+
+ _methodParameterTypes0 = new String[] {
+ "it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment"
+ };
+
+ _methodName1 = "createEmailTemplateAttachment";
+
+ _methodParameterTypes1 = new String[] {
+ "it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplateAttachmentPK"
+ };
+
+ _methodName2 = "deleteEmailTemplateAttachment";
+
+ _methodParameterTypes2 = new String[] {
+ "it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplateAttachmentPK"
+ };
+
+ _methodName3 = "deleteEmailTemplateAttachment";
+
+ _methodParameterTypes3 = new String[] {
+ "it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment"
+ };
+
+ _methodName4 = "dynamicQuery";
+
+ _methodParameterTypes4 = new String[] { };
+
+ _methodName5 = "dynamicQuery";
+
+ _methodParameterTypes5 = new String[] {
+ "com.liferay.portal.kernel.dao.orm.DynamicQuery"
+ };
+
+ _methodName6 = "dynamicQuery";
+
+ _methodParameterTypes6 = new String[] {
+ "com.liferay.portal.kernel.dao.orm.DynamicQuery", "int", "int"
+ };
+
+ _methodName7 = "dynamicQuery";
+
+ _methodParameterTypes7 = new String[] {
+ "com.liferay.portal.kernel.dao.orm.DynamicQuery", "int", "int",
+ "com.liferay.portal.kernel.util.OrderByComparator"
+ };
+
+ _methodName8 = "dynamicQueryCount";
+
+ _methodParameterTypes8 = new String[] {
+ "com.liferay.portal.kernel.dao.orm.DynamicQuery"
+ };
+
+ _methodName9 = "dynamicQueryCount";
+
+ _methodParameterTypes9 = new String[] {
+ "com.liferay.portal.kernel.dao.orm.DynamicQuery",
+ "com.liferay.portal.kernel.dao.orm.Projection"
+ };
+
+ _methodName10 = "fetchEmailTemplateAttachment";
+
+ _methodParameterTypes10 = new String[] {
+ "it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplateAttachmentPK"
+ };
+
+ _methodName11 = "getEmailTemplateAttachment";
+
+ _methodParameterTypes11 = new String[] {
+ "it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplateAttachmentPK"
+ };
+
+ _methodName12 = "getPersistedModel";
+
+ _methodParameterTypes12 = new String[] { "java.io.Serializable" };
+
+ _methodName13 = "getEmailTemplateAttachments";
+
+ _methodParameterTypes13 = new String[] { "int", "int" };
+
+ _methodName14 = "getEmailTemplateAttachmentsCount";
+
+ _methodParameterTypes14 = new String[] { };
+
+ _methodName15 = "updateEmailTemplateAttachment";
+
+ _methodParameterTypes15 = new String[] {
+ "it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment"
+ };
+
+ _methodName58 = "getBeanIdentifier";
+
+ _methodParameterTypes58 = new String[] { };
+
+ _methodName59 = "setBeanIdentifier";
+
+ _methodParameterTypes59 = new String[] { "java.lang.String" };
+ }
+
+ public Object invokeMethod(String name, String[] parameterTypes,
+ Object[] arguments) throws Throwable {
+ if (_methodName0.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes0, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.addEmailTemplateAttachment((it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment)arguments[0]);
+ }
+
+ if (_methodName1.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes1, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.createEmailTemplateAttachment((it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplateAttachmentPK)arguments[0]);
+ }
+
+ if (_methodName2.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes2, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.deleteEmailTemplateAttachment((it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplateAttachmentPK)arguments[0]);
+ }
+
+ if (_methodName3.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes3, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.deleteEmailTemplateAttachment((it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment)arguments[0]);
+ }
+
+ if (_methodName4.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes4, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.dynamicQuery();
+ }
+
+ if (_methodName5.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes5, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0]);
+ }
+
+ if (_methodName6.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes6, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0],
+ ((Integer)arguments[1]).intValue(),
+ ((Integer)arguments[2]).intValue());
+ }
+
+ if (_methodName7.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes7, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0],
+ ((Integer)arguments[1]).intValue(),
+ ((Integer)arguments[2]).intValue(),
+ (com.liferay.portal.kernel.util.OrderByComparator)arguments[3]);
+ }
+
+ if (_methodName8.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes8, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.dynamicQueryCount((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0]);
+ }
+
+ if (_methodName9.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes9, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.dynamicQueryCount((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0],
+ (com.liferay.portal.kernel.dao.orm.Projection)arguments[1]);
+ }
+
+ if (_methodName10.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes10, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.fetchEmailTemplateAttachment((it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplateAttachmentPK)arguments[0]);
+ }
+
+ if (_methodName11.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes11, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.getEmailTemplateAttachment((it.tref.liferay.portos.mailmanager.service.persistence.EmailTemplateAttachmentPK)arguments[0]);
+ }
+
+ if (_methodName12.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes12, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.getPersistedModel((java.io.Serializable)arguments[0]);
+ }
+
+ if (_methodName13.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes13, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.getEmailTemplateAttachments(((Integer)arguments[0]).intValue(),
+ ((Integer)arguments[1]).intValue());
+ }
+
+ if (_methodName14.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes14, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.getEmailTemplateAttachmentsCount();
+ }
+
+ if (_methodName15.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes15, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.updateEmailTemplateAttachment((it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment)arguments[0]);
+ }
+
+ if (_methodName58.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes58, parameterTypes)) {
+ return EmailTemplateAttachmentLocalServiceUtil.getBeanIdentifier();
+ }
+
+ if (_methodName59.equals(name) &&
+ Arrays.deepEquals(_methodParameterTypes59, parameterTypes)) {
+ EmailTemplateAttachmentLocalServiceUtil.setBeanIdentifier((java.lang.String)arguments[0]);
+
+ return null;
+ }
+
+ throw new UnsupportedOperationException();
+ }
+
+ private String _methodName0;
+ private String[] _methodParameterTypes0;
+ private String _methodName1;
+ private String[] _methodParameterTypes1;
+ private String _methodName2;
+ private String[] _methodParameterTypes2;
+ private String _methodName3;
+ private String[] _methodParameterTypes3;
+ private String _methodName4;
+ private String[] _methodParameterTypes4;
+ private String _methodName5;
+ private String[] _methodParameterTypes5;
+ private String _methodName6;
+ private String[] _methodParameterTypes6;
+ private String _methodName7;
+ private String[] _methodParameterTypes7;
+ private String _methodName8;
+ private String[] _methodParameterTypes8;
+ private String _methodName9;
+ private String[] _methodParameterTypes9;
+ private String _methodName10;
+ private String[] _methodParameterTypes10;
+ private String _methodName11;
+ private String[] _methodParameterTypes11;
+ private String _methodName12;
+ private String[] _methodParameterTypes12;
+ private String _methodName13;
+ private String[] _methodParameterTypes13;
+ private String _methodName14;
+ private String[] _methodParameterTypes14;
+ private String _methodName15;
+ private String[] _methodParameterTypes15;
+ private String _methodName58;
+ private String[] _methodParameterTypes58;
+ private String _methodName59;
+ private String[] _methodParameterTypes59;
+}
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/persistence/EmailTemplateAttachmentPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/persistence/EmailTemplateAttachmentPersistenceImpl.java
new file mode 100644
index 00000000..e4b7375a
--- /dev/null
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/persistence/EmailTemplateAttachmentPersistenceImpl.java
@@ -0,0 +1,1491 @@
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package it.tref.liferay.portos.mailmanager.service.persistence;
+
+import com.liferay.portal.kernel.cache.CacheRegistryUtil;
+import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
+import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
+import com.liferay.portal.kernel.dao.orm.FinderPath;
+import com.liferay.portal.kernel.dao.orm.Query;
+import com.liferay.portal.kernel.dao.orm.QueryPos;
+import com.liferay.portal.kernel.dao.orm.QueryUtil;
+import com.liferay.portal.kernel.dao.orm.Session;
+import com.liferay.portal.kernel.exception.SystemException;
+import com.liferay.portal.kernel.log.Log;
+import com.liferay.portal.kernel.log.LogFactoryUtil;
+import com.liferay.portal.kernel.util.GetterUtil;
+import com.liferay.portal.kernel.util.InstanceFactory;
+import com.liferay.portal.kernel.util.OrderByComparator;
+import com.liferay.portal.kernel.util.PropsKeys;
+import com.liferay.portal.kernel.util.PropsUtil;
+import com.liferay.portal.kernel.util.StringBundler;
+import com.liferay.portal.kernel.util.StringPool;
+import com.liferay.portal.kernel.util.StringUtil;
+import com.liferay.portal.kernel.util.UnmodifiableList;
+import com.liferay.portal.model.CacheModel;
+import com.liferay.portal.model.ModelListener;
+import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
+
+import it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException;
+import it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment;
+import it.tref.liferay.portos.mailmanager.model.impl.EmailTemplateAttachmentImpl;
+import it.tref.liferay.portos.mailmanager.model.impl.EmailTemplateAttachmentModelImpl;
+
+import java.io.Serializable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * The persistence implementation for the email template attachment service.
+ *
+ *
+ * Caching information and settings can be found in portal.properties
+ *
+ *
+ * @author
+ * @see EmailTemplateAttachmentPersistence
+ * @see EmailTemplateAttachmentUtil
+ * @generated
+ */
+public class EmailTemplateAttachmentPersistenceImpl extends BasePersistenceImpl
+ implements EmailTemplateAttachmentPersistence {
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. Always use {@link EmailTemplateAttachmentUtil} to access the email template attachment persistence. Modify service.xml and rerun ServiceBuilder to regenerate this class.
+ */
+ public static final String FINDER_CLASS_NAME_ENTITY = EmailTemplateAttachmentImpl.class.getName();
+ public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
+ ".List1";
+ public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
+ ".List2";
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentModelImpl.FINDER_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
+ public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentModelImpl.FINDER_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
+ public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_EMAILTEMPLATEID =
+ new FinderPath(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentModelImpl.FINDER_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByEmailTemplateId",
+ new String[] {
+ Long.class.getName(),
+
+ Integer.class.getName(), Integer.class.getName(),
+ OrderByComparator.class.getName()
+ });
+ public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_EMAILTEMPLATEID =
+ new FinderPath(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentModelImpl.FINDER_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByEmailTemplateId",
+ new String[] { Long.class.getName() },
+ EmailTemplateAttachmentModelImpl.EMAILTEMPLATEID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_EMAILTEMPLATEID = new FinderPath(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "countByEmailTemplateId", new String[] { Long.class.getName() });
+
+ /**
+ * Returns all the email template attachments where emailTemplateId = ?.
+ *
+ * @param emailTemplateId the email template ID
+ * @return the matching email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public List findByEmailTemplateId(
+ long emailTemplateId) throws SystemException {
+ return findByEmailTemplateId(emailTemplateId, QueryUtil.ALL_POS,
+ QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the email template attachments where emailTemplateId = ?.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.tref.liferay.portos.mailmanager.model.impl.EmailTemplateAttachmentModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
+ *
+ *
+ * @param emailTemplateId the email template ID
+ * @param start the lower bound of the range of email template attachments
+ * @param end the upper bound of the range of email template attachments (not inclusive)
+ * @return the range of matching email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public List findByEmailTemplateId(
+ long emailTemplateId, int start, int end) throws SystemException {
+ return findByEmailTemplateId(emailTemplateId, start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the email template attachments where emailTemplateId = ?.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.tref.liferay.portos.mailmanager.model.impl.EmailTemplateAttachmentModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
+ *
+ *
+ * @param emailTemplateId the email template ID
+ * @param start the lower bound of the range of email template attachments
+ * @param end the upper bound of the range of email template attachments (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null)
+ * @return the ordered range of matching email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public List findByEmailTemplateId(
+ long emailTemplateId, int start, int end,
+ OrderByComparator orderByComparator) throws SystemException {
+ boolean pagination = true;
+ FinderPath finderPath = null;
+ Object[] finderArgs = null;
+
+ if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
+ (orderByComparator == null)) {
+ pagination = false;
+ finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_EMAILTEMPLATEID;
+ finderArgs = new Object[] { emailTemplateId };
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_EMAILTEMPLATEID;
+ finderArgs = new Object[] {
+ emailTemplateId,
+
+ start, end, orderByComparator
+ };
+ }
+
+ List list = (List)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if ((list != null) && !list.isEmpty()) {
+ for (EmailTemplateAttachment emailTemplateAttachment : list) {
+ if ((emailTemplateId != emailTemplateAttachment.getEmailTemplateId())) {
+ list = null;
+
+ break;
+ }
+ }
+ }
+
+ if (list == null) {
+ StringBundler query = null;
+
+ if (orderByComparator != null) {
+ query = new StringBundler(3 +
+ (orderByComparator.getOrderByFields().length * 3));
+ }
+ else {
+ query = new StringBundler(3);
+ }
+
+ query.append(_SQL_SELECT_EMAILTEMPLATEATTACHMENT_WHERE);
+
+ query.append(_FINDER_COLUMN_EMAILTEMPLATEID_EMAILTEMPLATEID_2);
+
+ if (orderByComparator != null) {
+ appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
+ orderByComparator);
+ }
+ else
+ if (pagination) {
+ query.append(EmailTemplateAttachmentModelImpl.ORDER_BY_JPQL);
+ }
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(emailTemplateId);
+
+ if (!pagination) {
+ list = (List)QueryUtil.list(q,
+ getDialect(), start, end, false);
+
+ Collections.sort(list);
+
+ list = new UnmodifiableList(list);
+ }
+ else {
+ list = (List)QueryUtil.list(q,
+ getDialect(), start, end);
+ }
+
+ cacheResult(list);
+
+ FinderCacheUtil.putResult(finderPath, finderArgs, list);
+ }
+ catch (Exception e) {
+ FinderCacheUtil.removeResult(finderPath, finderArgs);
+
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ return list;
+ }
+
+ /**
+ * Returns the first email template attachment in the ordered set where emailTemplateId = ?.
+ *
+ * @param emailTemplateId the email template ID
+ * @param orderByComparator the comparator to order the set by (optionally null)
+ * @return the first matching email template attachment
+ * @throws it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException if a matching email template attachment could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment findByEmailTemplateId_First(
+ long emailTemplateId, OrderByComparator orderByComparator)
+ throws NoSuchEmailTemplateAttachmentException, SystemException {
+ EmailTemplateAttachment emailTemplateAttachment = fetchByEmailTemplateId_First(emailTemplateId,
+ orderByComparator);
+
+ if (emailTemplateAttachment != null) {
+ return emailTemplateAttachment;
+ }
+
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("emailTemplateId=");
+ msg.append(emailTemplateId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchEmailTemplateAttachmentException(msg.toString());
+ }
+
+ /**
+ * Returns the first email template attachment in the ordered set where emailTemplateId = ?.
+ *
+ * @param emailTemplateId the email template ID
+ * @param orderByComparator the comparator to order the set by (optionally null)
+ * @return the first matching email template attachment, or null if a matching email template attachment could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment fetchByEmailTemplateId_First(
+ long emailTemplateId, OrderByComparator orderByComparator)
+ throws SystemException {
+ List list = findByEmailTemplateId(emailTemplateId,
+ 0, 1, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the last email template attachment in the ordered set where emailTemplateId = ?.
+ *
+ * @param emailTemplateId the email template ID
+ * @param orderByComparator the comparator to order the set by (optionally null)
+ * @return the last matching email template attachment
+ * @throws it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException if a matching email template attachment could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment findByEmailTemplateId_Last(
+ long emailTemplateId, OrderByComparator orderByComparator)
+ throws NoSuchEmailTemplateAttachmentException, SystemException {
+ EmailTemplateAttachment emailTemplateAttachment = fetchByEmailTemplateId_Last(emailTemplateId,
+ orderByComparator);
+
+ if (emailTemplateAttachment != null) {
+ return emailTemplateAttachment;
+ }
+
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("emailTemplateId=");
+ msg.append(emailTemplateId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchEmailTemplateAttachmentException(msg.toString());
+ }
+
+ /**
+ * Returns the last email template attachment in the ordered set where emailTemplateId = ?.
+ *
+ * @param emailTemplateId the email template ID
+ * @param orderByComparator the comparator to order the set by (optionally null)
+ * @return the last matching email template attachment, or null if a matching email template attachment could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment fetchByEmailTemplateId_Last(
+ long emailTemplateId, OrderByComparator orderByComparator)
+ throws SystemException {
+ int count = countByEmailTemplateId(emailTemplateId);
+
+ if (count == 0) {
+ return null;
+ }
+
+ List list = findByEmailTemplateId(emailTemplateId,
+ count - 1, count, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the email template attachments before and after the current email template attachment in the ordered set where emailTemplateId = ?.
+ *
+ * @param emailTemplateAttachmentPK the primary key of the current email template attachment
+ * @param emailTemplateId the email template ID
+ * @param orderByComparator the comparator to order the set by (optionally null)
+ * @return the previous, current, and next email template attachment
+ * @throws it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException if a email template attachment with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment[] findByEmailTemplateId_PrevAndNext(
+ EmailTemplateAttachmentPK emailTemplateAttachmentPK,
+ long emailTemplateId, OrderByComparator orderByComparator)
+ throws NoSuchEmailTemplateAttachmentException, SystemException {
+ EmailTemplateAttachment emailTemplateAttachment = findByPrimaryKey(emailTemplateAttachmentPK);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ EmailTemplateAttachment[] array = new EmailTemplateAttachmentImpl[3];
+
+ array[0] = getByEmailTemplateId_PrevAndNext(session,
+ emailTemplateAttachment, emailTemplateId,
+ orderByComparator, true);
+
+ array[1] = emailTemplateAttachment;
+
+ array[2] = getByEmailTemplateId_PrevAndNext(session,
+ emailTemplateAttachment, emailTemplateId,
+ orderByComparator, false);
+
+ return array;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ protected EmailTemplateAttachment getByEmailTemplateId_PrevAndNext(
+ Session session, EmailTemplateAttachment emailTemplateAttachment,
+ long emailTemplateId, OrderByComparator orderByComparator,
+ boolean previous) {
+ StringBundler query = null;
+
+ if (orderByComparator != null) {
+ query = new StringBundler(6 +
+ (orderByComparator.getOrderByFields().length * 6));
+ }
+ else {
+ query = new StringBundler(3);
+ }
+
+ query.append(_SQL_SELECT_EMAILTEMPLATEATTACHMENT_WHERE);
+
+ query.append(_FINDER_COLUMN_EMAILTEMPLATEID_EMAILTEMPLATEID_2);
+
+ if (orderByComparator != null) {
+ String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
+
+ if (orderByConditionFields.length > 0) {
+ query.append(WHERE_AND);
+ }
+
+ for (int i = 0; i < orderByConditionFields.length; i++) {
+ query.append(_ORDER_BY_ENTITY_ALIAS);
+ query.append(orderByConditionFields[i]);
+
+ if ((i + 1) < orderByConditionFields.length) {
+ if (orderByComparator.isAscending() ^ previous) {
+ query.append(WHERE_GREATER_THAN_HAS_NEXT);
+ }
+ else {
+ query.append(WHERE_LESSER_THAN_HAS_NEXT);
+ }
+ }
+ else {
+ if (orderByComparator.isAscending() ^ previous) {
+ query.append(WHERE_GREATER_THAN);
+ }
+ else {
+ query.append(WHERE_LESSER_THAN);
+ }
+ }
+ }
+
+ query.append(ORDER_BY_CLAUSE);
+
+ String[] orderByFields = orderByComparator.getOrderByFields();
+
+ for (int i = 0; i < orderByFields.length; i++) {
+ query.append(_ORDER_BY_ENTITY_ALIAS);
+ query.append(orderByFields[i]);
+
+ if ((i + 1) < orderByFields.length) {
+ if (orderByComparator.isAscending() ^ previous) {
+ query.append(ORDER_BY_ASC_HAS_NEXT);
+ }
+ else {
+ query.append(ORDER_BY_DESC_HAS_NEXT);
+ }
+ }
+ else {
+ if (orderByComparator.isAscending() ^ previous) {
+ query.append(ORDER_BY_ASC);
+ }
+ else {
+ query.append(ORDER_BY_DESC);
+ }
+ }
+ }
+ }
+ else {
+ query.append(EmailTemplateAttachmentModelImpl.ORDER_BY_JPQL);
+ }
+
+ String sql = query.toString();
+
+ Query q = session.createQuery(sql);
+
+ q.setFirstResult(0);
+ q.setMaxResults(2);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(emailTemplateId);
+
+ if (orderByComparator != null) {
+ Object[] values = orderByComparator.getOrderByConditionValues(emailTemplateAttachment);
+
+ for (Object value : values) {
+ qPos.add(value);
+ }
+ }
+
+ List list = q.list();
+
+ if (list.size() == 2) {
+ return list.get(1);
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Removes all the email template attachments where emailTemplateId = ? from the database.
+ *
+ * @param emailTemplateId the email template ID
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public void removeByEmailTemplateId(long emailTemplateId)
+ throws SystemException {
+ for (EmailTemplateAttachment emailTemplateAttachment : findByEmailTemplateId(
+ emailTemplateId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
+ remove(emailTemplateAttachment);
+ }
+ }
+
+ /**
+ * Returns the number of email template attachments where emailTemplateId = ?.
+ *
+ * @param emailTemplateId the email template ID
+ * @return the number of matching email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public int countByEmailTemplateId(long emailTemplateId)
+ throws SystemException {
+ FinderPath finderPath = FINDER_PATH_COUNT_BY_EMAILTEMPLATEID;
+
+ Object[] finderArgs = new Object[] { emailTemplateId };
+
+ Long count = (Long)FinderCacheUtil.getResult(finderPath, finderArgs,
+ this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(2);
+
+ query.append(_SQL_COUNT_EMAILTEMPLATEATTACHMENT_WHERE);
+
+ query.append(_FINDER_COLUMN_EMAILTEMPLATEID_EMAILTEMPLATEID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(emailTemplateId);
+
+ count = (Long)q.uniqueResult();
+
+ FinderCacheUtil.putResult(finderPath, finderArgs, count);
+ }
+ catch (Exception e) {
+ FinderCacheUtil.removeResult(finderPath, finderArgs);
+
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ private static final String _FINDER_COLUMN_EMAILTEMPLATEID_EMAILTEMPLATEID_2 =
+ "emailTemplateAttachment.id.emailTemplateId = ?";
+ public static final FinderPath FINDER_PATH_FETCH_BY_FILEENTRYID = new FinderPath(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentModelImpl.FINDER_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class, FINDER_CLASS_NAME_ENTITY,
+ "fetchByFileEntryId", new String[] { Long.class.getName() },
+ EmailTemplateAttachmentModelImpl.FILEENTRYID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_FILEENTRYID = new FinderPath(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByFileEntryId",
+ new String[] { Long.class.getName() });
+
+ /**
+ * Returns the email template attachment where fileEntryId = ? or throws a {@link it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException} if it could not be found.
+ *
+ * @param fileEntryId the file entry ID
+ * @return the matching email template attachment
+ * @throws it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException if a matching email template attachment could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment findByFileEntryId(long fileEntryId)
+ throws NoSuchEmailTemplateAttachmentException, SystemException {
+ EmailTemplateAttachment emailTemplateAttachment = fetchByFileEntryId(fileEntryId);
+
+ if (emailTemplateAttachment == null) {
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("fileEntryId=");
+ msg.append(fileEntryId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ if (_log.isWarnEnabled()) {
+ _log.warn(msg.toString());
+ }
+
+ throw new NoSuchEmailTemplateAttachmentException(msg.toString());
+ }
+
+ return emailTemplateAttachment;
+ }
+
+ /**
+ * Returns the email template attachment where fileEntryId = ? or returns null if it could not be found. Uses the finder cache.
+ *
+ * @param fileEntryId the file entry ID
+ * @return the matching email template attachment, or null if a matching email template attachment could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment fetchByFileEntryId(long fileEntryId)
+ throws SystemException {
+ return fetchByFileEntryId(fileEntryId, true);
+ }
+
+ /**
+ * Returns the email template attachment where fileEntryId = ? or returns null if it could not be found, optionally using the finder cache.
+ *
+ * @param fileEntryId the file entry ID
+ * @param retrieveFromCache whether to use the finder cache
+ * @return the matching email template attachment, or null if a matching email template attachment could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment fetchByFileEntryId(long fileEntryId,
+ boolean retrieveFromCache) throws SystemException {
+ Object[] finderArgs = new Object[] { fileEntryId };
+
+ Object result = null;
+
+ if (retrieveFromCache) {
+ result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_FILEENTRYID,
+ finderArgs, this);
+ }
+
+ if (result instanceof EmailTemplateAttachment) {
+ EmailTemplateAttachment emailTemplateAttachment = (EmailTemplateAttachment)result;
+
+ if ((fileEntryId != emailTemplateAttachment.getFileEntryId())) {
+ result = null;
+ }
+ }
+
+ if (result == null) {
+ StringBundler query = new StringBundler(3);
+
+ query.append(_SQL_SELECT_EMAILTEMPLATEATTACHMENT_WHERE);
+
+ query.append(_FINDER_COLUMN_FILEENTRYID_FILEENTRYID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(fileEntryId);
+
+ List list = q.list();
+
+ if (list.isEmpty()) {
+ FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_FILEENTRYID,
+ finderArgs, list);
+ }
+ else {
+ if ((list.size() > 1) && _log.isWarnEnabled()) {
+ _log.warn(
+ "EmailTemplateAttachmentPersistenceImpl.fetchByFileEntryId(long, boolean) with parameters (" +
+ StringUtil.merge(finderArgs) +
+ ") yields a result set with more than 1 result. This violates the logical unique restriction. There is no order guarantee on which result is returned by this finder.");
+ }
+
+ EmailTemplateAttachment emailTemplateAttachment = list.get(0);
+
+ result = emailTemplateAttachment;
+
+ cacheResult(emailTemplateAttachment);
+
+ if ((emailTemplateAttachment.getFileEntryId() != fileEntryId)) {
+ FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_FILEENTRYID,
+ finderArgs, emailTemplateAttachment);
+ }
+ }
+ }
+ catch (Exception e) {
+ FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_FILEENTRYID,
+ finderArgs);
+
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ if (result instanceof List>) {
+ return null;
+ }
+ else {
+ return (EmailTemplateAttachment)result;
+ }
+ }
+
+ /**
+ * Removes the email template attachment where fileEntryId = ? from the database.
+ *
+ * @param fileEntryId the file entry ID
+ * @return the email template attachment that was removed
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment removeByFileEntryId(long fileEntryId)
+ throws NoSuchEmailTemplateAttachmentException, SystemException {
+ EmailTemplateAttachment emailTemplateAttachment = findByFileEntryId(fileEntryId);
+
+ return remove(emailTemplateAttachment);
+ }
+
+ /**
+ * Returns the number of email template attachments where fileEntryId = ?.
+ *
+ * @param fileEntryId the file entry ID
+ * @return the number of matching email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public int countByFileEntryId(long fileEntryId) throws SystemException {
+ FinderPath finderPath = FINDER_PATH_COUNT_BY_FILEENTRYID;
+
+ Object[] finderArgs = new Object[] { fileEntryId };
+
+ Long count = (Long)FinderCacheUtil.getResult(finderPath, finderArgs,
+ this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(2);
+
+ query.append(_SQL_COUNT_EMAILTEMPLATEATTACHMENT_WHERE);
+
+ query.append(_FINDER_COLUMN_FILEENTRYID_FILEENTRYID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(fileEntryId);
+
+ count = (Long)q.uniqueResult();
+
+ FinderCacheUtil.putResult(finderPath, finderArgs, count);
+ }
+ catch (Exception e) {
+ FinderCacheUtil.removeResult(finderPath, finderArgs);
+
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ private static final String _FINDER_COLUMN_FILEENTRYID_FILEENTRYID_2 = "emailTemplateAttachment.id.fileEntryId = ?";
+
+ public EmailTemplateAttachmentPersistenceImpl() {
+ setModelClass(EmailTemplateAttachment.class);
+ }
+
+ /**
+ * Caches the email template attachment in the entity cache if it is enabled.
+ *
+ * @param emailTemplateAttachment the email template attachment
+ */
+ @Override
+ public void cacheResult(EmailTemplateAttachment emailTemplateAttachment) {
+ EntityCacheUtil.putResult(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class,
+ emailTemplateAttachment.getPrimaryKey(), emailTemplateAttachment);
+
+ FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_FILEENTRYID,
+ new Object[] { emailTemplateAttachment.getFileEntryId() },
+ emailTemplateAttachment);
+
+ emailTemplateAttachment.resetOriginalValues();
+ }
+
+ /**
+ * Caches the email template attachments in the entity cache if it is enabled.
+ *
+ * @param emailTemplateAttachments the email template attachments
+ */
+ @Override
+ public void cacheResult(
+ List emailTemplateAttachments) {
+ for (EmailTemplateAttachment emailTemplateAttachment : emailTemplateAttachments) {
+ if (EntityCacheUtil.getResult(
+ EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class,
+ emailTemplateAttachment.getPrimaryKey()) == null) {
+ cacheResult(emailTemplateAttachment);
+ }
+ else {
+ emailTemplateAttachment.resetOriginalValues();
+ }
+ }
+ }
+
+ /**
+ * Clears the cache for all email template attachments.
+ *
+ *
+ * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
+ *
+ */
+ @Override
+ public void clearCache() {
+ if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
+ CacheRegistryUtil.clear(EmailTemplateAttachmentImpl.class.getName());
+ }
+
+ EntityCacheUtil.clearCache(EmailTemplateAttachmentImpl.class.getName());
+
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ /**
+ * Clears the cache for the email template attachment.
+ *
+ *
+ * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
+ *
+ */
+ @Override
+ public void clearCache(EmailTemplateAttachment emailTemplateAttachment) {
+ EntityCacheUtil.removeResult(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class,
+ emailTemplateAttachment.getPrimaryKey());
+
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+
+ clearUniqueFindersCache(emailTemplateAttachment);
+ }
+
+ @Override
+ public void clearCache(
+ List emailTemplateAttachments) {
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+
+ for (EmailTemplateAttachment emailTemplateAttachment : emailTemplateAttachments) {
+ EntityCacheUtil.removeResult(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class,
+ emailTemplateAttachment.getPrimaryKey());
+
+ clearUniqueFindersCache(emailTemplateAttachment);
+ }
+ }
+
+ protected void cacheUniqueFindersCache(
+ EmailTemplateAttachment emailTemplateAttachment) {
+ if (emailTemplateAttachment.isNew()) {
+ Object[] args = new Object[] {
+ emailTemplateAttachment.getFileEntryId()
+ };
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_FILEENTRYID, args,
+ Long.valueOf(1));
+ FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_FILEENTRYID, args,
+ emailTemplateAttachment);
+ }
+ else {
+ EmailTemplateAttachmentModelImpl emailTemplateAttachmentModelImpl = (EmailTemplateAttachmentModelImpl)emailTemplateAttachment;
+
+ if ((emailTemplateAttachmentModelImpl.getColumnBitmask() &
+ FINDER_PATH_FETCH_BY_FILEENTRYID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ emailTemplateAttachment.getFileEntryId()
+ };
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_FILEENTRYID,
+ args, Long.valueOf(1));
+ FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_FILEENTRYID,
+ args, emailTemplateAttachment);
+ }
+ }
+ }
+
+ protected void clearUniqueFindersCache(
+ EmailTemplateAttachment emailTemplateAttachment) {
+ EmailTemplateAttachmentModelImpl emailTemplateAttachmentModelImpl = (EmailTemplateAttachmentModelImpl)emailTemplateAttachment;
+
+ Object[] args = new Object[] { emailTemplateAttachment.getFileEntryId() };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_FILEENTRYID, args);
+ FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_FILEENTRYID, args);
+
+ if ((emailTemplateAttachmentModelImpl.getColumnBitmask() &
+ FINDER_PATH_FETCH_BY_FILEENTRYID.getColumnBitmask()) != 0) {
+ args = new Object[] {
+ emailTemplateAttachmentModelImpl.getOriginalFileEntryId()
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_FILEENTRYID, args);
+ FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_FILEENTRYID, args);
+ }
+ }
+
+ /**
+ * Creates a new email template attachment with the primary key. Does not add the email template attachment to the database.
+ *
+ * @param emailTemplateAttachmentPK the primary key for the new email template attachment
+ * @return the new email template attachment
+ */
+ @Override
+ public EmailTemplateAttachment create(
+ EmailTemplateAttachmentPK emailTemplateAttachmentPK) {
+ EmailTemplateAttachment emailTemplateAttachment = new EmailTemplateAttachmentImpl();
+
+ emailTemplateAttachment.setNew(true);
+ emailTemplateAttachment.setPrimaryKey(emailTemplateAttachmentPK);
+
+ return emailTemplateAttachment;
+ }
+
+ /**
+ * Removes the email template attachment with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param emailTemplateAttachmentPK the primary key of the email template attachment
+ * @return the email template attachment that was removed
+ * @throws it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException if a email template attachment with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment remove(
+ EmailTemplateAttachmentPK emailTemplateAttachmentPK)
+ throws NoSuchEmailTemplateAttachmentException, SystemException {
+ return remove((Serializable)emailTemplateAttachmentPK);
+ }
+
+ /**
+ * Removes the email template attachment with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param primaryKey the primary key of the email template attachment
+ * @return the email template attachment that was removed
+ * @throws it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException if a email template attachment with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment remove(Serializable primaryKey)
+ throws NoSuchEmailTemplateAttachmentException, SystemException {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ EmailTemplateAttachment emailTemplateAttachment = (EmailTemplateAttachment)session.get(EmailTemplateAttachmentImpl.class,
+ primaryKey);
+
+ if (emailTemplateAttachment == null) {
+ if (_log.isWarnEnabled()) {
+ _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
+ }
+
+ throw new NoSuchEmailTemplateAttachmentException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
+ primaryKey);
+ }
+
+ return remove(emailTemplateAttachment);
+ }
+ catch (NoSuchEmailTemplateAttachmentException nsee) {
+ throw nsee;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ @Override
+ protected EmailTemplateAttachment removeImpl(
+ EmailTemplateAttachment emailTemplateAttachment)
+ throws SystemException {
+ emailTemplateAttachment = toUnwrappedModel(emailTemplateAttachment);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ if (!session.contains(emailTemplateAttachment)) {
+ emailTemplateAttachment = (EmailTemplateAttachment)session.get(EmailTemplateAttachmentImpl.class,
+ emailTemplateAttachment.getPrimaryKeyObj());
+ }
+
+ if (emailTemplateAttachment != null) {
+ session.delete(emailTemplateAttachment);
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+
+ if (emailTemplateAttachment != null) {
+ clearCache(emailTemplateAttachment);
+ }
+
+ return emailTemplateAttachment;
+ }
+
+ @Override
+ public EmailTemplateAttachment updateImpl(
+ it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment emailTemplateAttachment)
+ throws SystemException {
+ emailTemplateAttachment = toUnwrappedModel(emailTemplateAttachment);
+
+ boolean isNew = emailTemplateAttachment.isNew();
+
+ EmailTemplateAttachmentModelImpl emailTemplateAttachmentModelImpl = (EmailTemplateAttachmentModelImpl)emailTemplateAttachment;
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ if (emailTemplateAttachment.isNew()) {
+ session.save(emailTemplateAttachment);
+
+ emailTemplateAttachment.setNew(false);
+ }
+ else {
+ session.merge(emailTemplateAttachment);
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+
+ if (isNew || !EmailTemplateAttachmentModelImpl.COLUMN_BITMASK_ENABLED) {
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ else {
+ if ((emailTemplateAttachmentModelImpl.getColumnBitmask() &
+ FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_EMAILTEMPLATEID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ emailTemplateAttachmentModelImpl.getOriginalEmailTemplateId()
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_EMAILTEMPLATEID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_EMAILTEMPLATEID,
+ args);
+
+ args = new Object[] {
+ emailTemplateAttachmentModelImpl.getEmailTemplateId()
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_EMAILTEMPLATEID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_EMAILTEMPLATEID,
+ args);
+ }
+ }
+
+ EntityCacheUtil.putResult(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class,
+ emailTemplateAttachment.getPrimaryKey(), emailTemplateAttachment);
+
+ clearUniqueFindersCache(emailTemplateAttachment);
+ cacheUniqueFindersCache(emailTemplateAttachment);
+
+ return emailTemplateAttachment;
+ }
+
+ protected EmailTemplateAttachment toUnwrappedModel(
+ EmailTemplateAttachment emailTemplateAttachment) {
+ if (emailTemplateAttachment instanceof EmailTemplateAttachmentImpl) {
+ return emailTemplateAttachment;
+ }
+
+ EmailTemplateAttachmentImpl emailTemplateAttachmentImpl = new EmailTemplateAttachmentImpl();
+
+ emailTemplateAttachmentImpl.setNew(emailTemplateAttachment.isNew());
+ emailTemplateAttachmentImpl.setPrimaryKey(emailTemplateAttachment.getPrimaryKey());
+
+ emailTemplateAttachmentImpl.setEmailTemplateId(emailTemplateAttachment.getEmailTemplateId());
+ emailTemplateAttachmentImpl.setFileEntryId(emailTemplateAttachment.getFileEntryId());
+
+ return emailTemplateAttachmentImpl;
+ }
+
+ /**
+ * Returns the email template attachment with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
+ *
+ * @param primaryKey the primary key of the email template attachment
+ * @return the email template attachment
+ * @throws it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException if a email template attachment with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment findByPrimaryKey(Serializable primaryKey)
+ throws NoSuchEmailTemplateAttachmentException, SystemException {
+ EmailTemplateAttachment emailTemplateAttachment = fetchByPrimaryKey(primaryKey);
+
+ if (emailTemplateAttachment == null) {
+ if (_log.isWarnEnabled()) {
+ _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
+ }
+
+ throw new NoSuchEmailTemplateAttachmentException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
+ primaryKey);
+ }
+
+ return emailTemplateAttachment;
+ }
+
+ /**
+ * Returns the email template attachment with the primary key or throws a {@link it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException} if it could not be found.
+ *
+ * @param emailTemplateAttachmentPK the primary key of the email template attachment
+ * @return the email template attachment
+ * @throws it.tref.liferay.portos.mailmanager.NoSuchEmailTemplateAttachmentException if a email template attachment with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment findByPrimaryKey(
+ EmailTemplateAttachmentPK emailTemplateAttachmentPK)
+ throws NoSuchEmailTemplateAttachmentException, SystemException {
+ return findByPrimaryKey((Serializable)emailTemplateAttachmentPK);
+ }
+
+ /**
+ * Returns the email template attachment with the primary key or returns null if it could not be found.
+ *
+ * @param primaryKey the primary key of the email template attachment
+ * @return the email template attachment, or null if a email template attachment with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment fetchByPrimaryKey(Serializable primaryKey)
+ throws SystemException {
+ EmailTemplateAttachment emailTemplateAttachment = (EmailTemplateAttachment)EntityCacheUtil.getResult(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class, primaryKey);
+
+ if (emailTemplateAttachment == _nullEmailTemplateAttachment) {
+ return null;
+ }
+
+ if (emailTemplateAttachment == null) {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ emailTemplateAttachment = (EmailTemplateAttachment)session.get(EmailTemplateAttachmentImpl.class,
+ primaryKey);
+
+ if (emailTemplateAttachment != null) {
+ cacheResult(emailTemplateAttachment);
+ }
+ else {
+ EntityCacheUtil.putResult(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class, primaryKey,
+ _nullEmailTemplateAttachment);
+ }
+ }
+ catch (Exception e) {
+ EntityCacheUtil.removeResult(EmailTemplateAttachmentModelImpl.ENTITY_CACHE_ENABLED,
+ EmailTemplateAttachmentImpl.class, primaryKey);
+
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ return emailTemplateAttachment;
+ }
+
+ /**
+ * Returns the email template attachment with the primary key or returns null if it could not be found.
+ *
+ * @param emailTemplateAttachmentPK the primary key of the email template attachment
+ * @return the email template attachment, or null if a email template attachment with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public EmailTemplateAttachment fetchByPrimaryKey(
+ EmailTemplateAttachmentPK emailTemplateAttachmentPK)
+ throws SystemException {
+ return fetchByPrimaryKey((Serializable)emailTemplateAttachmentPK);
+ }
+
+ /**
+ * Returns all the email template attachments.
+ *
+ * @return the email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public List findAll() throws SystemException {
+ return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the email template attachments.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.tref.liferay.portos.mailmanager.model.impl.EmailTemplateAttachmentModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
+ *
+ *
+ * @param start the lower bound of the range of email template attachments
+ * @param end the upper bound of the range of email template attachments (not inclusive)
+ * @return the range of email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public List findAll(int start, int end)
+ throws SystemException {
+ return findAll(start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the email template attachments.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.tref.liferay.portos.mailmanager.model.impl.EmailTemplateAttachmentModelImpl}. If both orderByComparator and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
+ *
+ *
+ * @param start the lower bound of the range of email template attachments
+ * @param end the upper bound of the range of email template attachments (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null)
+ * @return the ordered range of email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public List findAll(int start, int end,
+ OrderByComparator orderByComparator) throws SystemException {
+ boolean pagination = true;
+ FinderPath finderPath = null;
+ Object[] finderArgs = null;
+
+ if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
+ (orderByComparator == null)) {
+ pagination = false;
+ finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
+ finderArgs = FINDER_ARGS_EMPTY;
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
+ finderArgs = new Object[] { start, end, orderByComparator };
+ }
+
+ List list = (List)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if (list == null) {
+ StringBundler query = null;
+ String sql = null;
+
+ if (orderByComparator != null) {
+ query = new StringBundler(2 +
+ (orderByComparator.getOrderByFields().length * 3));
+
+ query.append(_SQL_SELECT_EMAILTEMPLATEATTACHMENT);
+
+ appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
+ orderByComparator);
+
+ sql = query.toString();
+ }
+ else {
+ sql = _SQL_SELECT_EMAILTEMPLATEATTACHMENT;
+
+ if (pagination) {
+ sql = sql.concat(EmailTemplateAttachmentModelImpl.ORDER_BY_JPQL);
+ }
+ }
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ if (!pagination) {
+ list = (List)QueryUtil.list(q,
+ getDialect(), start, end, false);
+
+ Collections.sort(list);
+
+ list = new UnmodifiableList(list);
+ }
+ else {
+ list = (List)QueryUtil.list(q,
+ getDialect(), start, end);
+ }
+
+ cacheResult(list);
+
+ FinderCacheUtil.putResult(finderPath, finderArgs, list);
+ }
+ catch (Exception e) {
+ FinderCacheUtil.removeResult(finderPath, finderArgs);
+
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ return list;
+ }
+
+ /**
+ * Removes all the email template attachments from the database.
+ *
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public void removeAll() throws SystemException {
+ for (EmailTemplateAttachment emailTemplateAttachment : findAll()) {
+ remove(emailTemplateAttachment);
+ }
+ }
+
+ /**
+ * Returns the number of email template attachments.
+ *
+ * @return the number of email template attachments
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public int countAll() throws SystemException {
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
+ FINDER_ARGS_EMPTY, this);
+
+ if (count == null) {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(_SQL_COUNT_EMAILTEMPLATEATTACHMENT);
+
+ count = (Long)q.uniqueResult();
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
+ FINDER_ARGS_EMPTY, count);
+ }
+ catch (Exception e) {
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL,
+ FINDER_ARGS_EMPTY);
+
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ /**
+ * Initializes the email template attachment persistence.
+ */
+ public void afterPropertiesSet() {
+ String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
+ com.liferay.util.service.ServiceProps.get(
+ "value.object.listener.it.tref.liferay.portos.mailmanager.model.EmailTemplateAttachment")));
+
+ if (listenerClassNames.length > 0) {
+ try {
+ List> listenersList = new ArrayList>();
+
+ for (String listenerClassName : listenerClassNames) {
+ listenersList.add((ModelListener)InstanceFactory.newInstance(
+ getClassLoader(), listenerClassName));
+ }
+
+ listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
+ }
+ catch (Exception e) {
+ _log.error(e);
+ }
+ }
+ }
+
+ public void destroy() {
+ EntityCacheUtil.removeCache(EmailTemplateAttachmentImpl.class.getName());
+ FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
+ FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ private static final String _SQL_SELECT_EMAILTEMPLATEATTACHMENT = "SELECT emailTemplateAttachment FROM EmailTemplateAttachment emailTemplateAttachment";
+ private static final String _SQL_SELECT_EMAILTEMPLATEATTACHMENT_WHERE = "SELECT emailTemplateAttachment FROM EmailTemplateAttachment emailTemplateAttachment WHERE ";
+ private static final String _SQL_COUNT_EMAILTEMPLATEATTACHMENT = "SELECT COUNT(emailTemplateAttachment) FROM EmailTemplateAttachment emailTemplateAttachment";
+ private static final String _SQL_COUNT_EMAILTEMPLATEATTACHMENT_WHERE = "SELECT COUNT(emailTemplateAttachment) FROM EmailTemplateAttachment emailTemplateAttachment WHERE ";
+ private static final String _ORDER_BY_ENTITY_ALIAS = "emailTemplateAttachment.";
+ private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No EmailTemplateAttachment exists with the primary key ";
+ private static final String _NO_SUCH_ENTITY_WITH_KEY = "No EmailTemplateAttachment exists with the key {";
+ private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get(
+ PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE));
+ private static Log _log = LogFactoryUtil.getLog(EmailTemplateAttachmentPersistenceImpl.class);
+ private static EmailTemplateAttachment _nullEmailTemplateAttachment = new EmailTemplateAttachmentImpl() {
+ @Override
+ public Object clone() {
+ return this;
+ }
+
+ @Override
+ public CacheModel toCacheModel() {
+ return _nullEmailTemplateAttachmentCacheModel;
+ }
+ };
+
+ private static CacheModel _nullEmailTemplateAttachmentCacheModel =
+ new CacheModel() {
+ @Override
+ public EmailTemplateAttachment toEntityModel() {
+ return _nullEmailTemplateAttachment;
+ }
+ };
+}
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailEngine.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailEngine.java
index 7f750744..c6594938 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailEngine.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailEngine.java
@@ -370,6 +370,8 @@ public class MailEngine {
if (smtpAuth && Validator.isNotNull(user) && Validator.isNotNull(password)) {
String protocol = GetterUtil.getString(session.getProperty("mail.transport.protocol"),
Account.PROTOCOL_SMTP);
+ _log.info("Protocol: " + protocol + ", connect(" + smtpHost + ", " + smtpPort + ", " + user + ", "
+ + password + ")");
Transport transport = session.getTransport(protocol);
transport.connect(smtpHost, smtpPort, user, password);
Address[] addresses = null;
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailManagerUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailManagerUtil.java
index 196e668b..c83e1081 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailManagerUtil.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailManagerUtil.java
@@ -1,16 +1,9 @@
package it.tref.liferay.portos.mailmanager.util;
-import it.tref.liferay.portos.mailmanager.model.Email;
-import it.tref.liferay.portos.mailmanager.model.EmailTemplate;
-import it.tref.liferay.portos.mailmanager.service.EmailLocalServiceUtil;
-import it.tref.liferay.portos.mailmanager.service.EmailTemplateLocalServiceUtil;
-import it.tref.liferay.portos.mailmanager.shared.util.MailManagerConstants;
-import it.tref.liferay.portos.mailmanager.shared.util.MailUtil;
-
-import java.util.List;
-
import com.liferay.mail.model.FileAttachment;
import com.liferay.portal.kernel.json.JSONObject;
+import com.liferay.portal.kernel.log.Log;
+import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.mail.MailMessage;
import com.liferay.portal.kernel.mail.SMTPAccount;
import com.liferay.portal.kernel.util.StringPool;
@@ -20,43 +13,50 @@ import com.liferay.portal.model.Company;
import com.liferay.portal.service.CompanyLocalServiceUtil;
import com.liferay.portal.service.ServiceContext;
+import it.tref.liferay.portos.mailmanager.model.Email;
+import it.tref.liferay.portos.mailmanager.model.EmailTemplate;
+import it.tref.liferay.portos.mailmanager.service.EmailLocalServiceUtil;
+import it.tref.liferay.portos.mailmanager.service.EmailTemplateLocalServiceUtil;
+import it.tref.liferay.portos.mailmanager.shared.util.MailManagerConstants;
+import it.tref.liferay.portos.mailmanager.shared.util.MailUtil;
+
+import java.util.List;
+
public class MailManagerUtil {
public static Email addEmailByTemplate(String className, long classPK, long emailTemplateId,
JSONObject templateParamJSON, List fileAttachments, ServiceContext serviceContext)
throws Exception {
-
- return addEmailByTemplate(className, classPK, emailTemplateId, templateParamJSON, fileAttachments, false,
- serviceContext);
+ return addEmailByTemplate(className, classPK, emailTemplateId, templateParamJSON, fileAttachments,
+ false, serviceContext);
}
public static Email addEmailByTemplate(String className, long classPK, long emailTemplateId,
JSONObject templateParamJSON, ServiceContext serviceContext) throws Exception {
-
- return addEmailByTemplate(className, classPK, emailTemplateId, templateParamJSON, null, false, serviceContext);
+ return addEmailByTemplate(className, classPK, emailTemplateId, templateParamJSON, null, false,
+ serviceContext);
}
public static Email addEmailByTemplate(String className, long classPK, long emailTemplateId,
JSONObject templateParamJSON, List fileAttachments, boolean sendSync,
ServiceContext serviceContext) throws Exception {
-
EmailTemplate emailTemplate = EmailTemplateLocalServiceUtil.getEmailTemplate(emailTemplateId);
- return addEmailByTemplate(className, classPK, emailTemplate, templateParamJSON, fileAttachments, sendSync,
- serviceContext);
+ return addEmailByTemplate(className, classPK, emailTemplate, templateParamJSON, fileAttachments,
+ sendSync, serviceContext);
}
public static Email addEmailByTemplate(String className, long classPK, String emailTemplateName,
JSONObject templateParamJSON, List fileAttachments, ServiceContext serviceContext)
throws Exception {
- return addEmailByTemplate(className, classPK, emailTemplateName, templateParamJSON, fileAttachments, false,
- serviceContext);
+ return addEmailByTemplate(className, classPK, emailTemplateName, templateParamJSON, fileAttachments,
+ false, serviceContext);
}
public static Email addEmailByTemplate(String className, long classPK, String emailTemplateName,
JSONObject templateParamJSON, ServiceContext serviceContext) throws Exception {
-
- return addEmailByTemplate(className, classPK, emailTemplateName, templateParamJSON, null, false, serviceContext);
+ return addEmailByTemplate(className, classPK, emailTemplateName, templateParamJSON, null, false,
+ serviceContext);
}
public static Email addEmailByTemplate(String className, long classPK, String emailTemplateName,
@@ -65,13 +65,15 @@ public class MailManagerUtil {
EmailTemplate emailTemplate = EmailTemplateLocalServiceUtil.fetchByC_GroupId_Name(
serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), emailTemplateName);
+
if (Validator.isNull(emailTemplate)) {
Company company = CompanyLocalServiceUtil.getCompany(serviceContext.getCompanyId());
emailTemplate = EmailTemplateLocalServiceUtil.findByC_GroupId_Name(serviceContext.getCompanyId(),
company.getGroupId(), emailTemplateName);
}
- return addEmailByTemplate(className, classPK, emailTemplate, templateParamJSON, fileAttachments, sendSync,
- serviceContext);
+
+ return addEmailByTemplate(className, classPK, emailTemplate, templateParamJSON, fileAttachments,
+ sendSync, serviceContext);
}
public static Email addEmailByTemplate(String className, long classPK, EmailTemplate emailTemplate,
@@ -82,6 +84,7 @@ public class MailManagerUtil {
templateParamJSON.getJSONObject(MailManagerConstants.TEMPLATE_PARAMETER_VARIABLES_KEY));
String body = VelocityUtil.evaluate(emailTemplate.getBody(),
templateParamJSON.getJSONObject(MailManagerConstants.TEMPLATE_PARAMETER_VARIABLES_KEY));
+
String to = templateParamJSON.getString(MailManagerConstants.TEMPLATE_PARAMETER_TO_KEY);
if (Validator.isNull(to)) {
to = emailTemplate.getTo();
@@ -94,15 +97,16 @@ public class MailManagerUtil {
if (Validator.isNull(ccn)) {
ccn = emailTemplate.getCcn();
}
+
return EmailLocalServiceUtil.addEmail(className, classPK, emailTemplate.getFrom(),
StringUtil.split(to, StringPool.COMMA), StringUtil.split(cc, StringPool.COMMA),
StringUtil.split(ccn, StringPool.COMMA), subject, body, true, fileAttachments, sendSync,
emailTemplate.getTemplateName(), serviceContext);
- }
- public static Email addEmail(String className, long classPK, MailMessage mailMessage, ServiceContext serviceContext)
- throws Exception {
+ }
+ public static Email addEmail(String className, long classPK, MailMessage mailMessage,
+ ServiceContext serviceContext) throws Exception {
return addEmail(className, classPK, mailMessage, false, serviceContext);
}
@@ -114,28 +118,37 @@ public class MailManagerUtil {
String[] cc = MailUtil.fromInternetAddresses(mailMessage.getCC());
String[] bcc = MailUtil.fromInternetAddresses(mailMessage.getBCC());
String[] bulkAddresses = MailUtil.fromInternetAddresses(mailMessage.getBulkAddresses());
+
String subject = mailMessage.getSubject();
String body = mailMessage.getBody();
+
boolean htmlFormat = mailMessage.getHTMLFormat();
String[] replyTo = MailUtil.fromInternetAddresses(mailMessage.getReplyTo());
String messageId = mailMessage.getMessageId();
String inReplyTo = mailMessage.getInReplyTo();
+
List fileAttachments = mailMessage.getFileAttachments();
+
SMTPAccount smtpAccount = mailMessage.getSMTPAccount();
+
String smtpHost = null;
int smtpPort = 0;
boolean smtpSecure = false;
String smtpUsername = null;
String smtpPassword = null;
+
if (smtpAccount != null) {
+
smtpHost = smtpAccount.getHost();
smtpPort = smtpAccount.getPort();
smtpSecure = smtpAccount.isSecure();
smtpUsername = smtpAccount.getUser();
smtpPassword = smtpAccount.getPassword();
}
- return EmailLocalServiceUtil.addEmail(className, classPK, from, to, cc, bcc, bulkAddresses, subject, body,
- htmlFormat, replyTo, messageId, inReplyTo, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword,
- fileAttachments, sendSync, null, serviceContext);
+
+ return EmailLocalServiceUtil.addEmail(className, classPK, from, to, cc, bcc, bulkAddresses, subject,
+ body, htmlFormat, replyTo, messageId, inReplyTo, smtpHost, smtpPort, smtpSecure,
+ smtpUsername, smtpPassword, fileAttachments, sendSync, null, serviceContext);
}
+
}
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties
index 6dc4045d..541bdb74 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties
@@ -13,8 +13,8 @@
##
build.namespace=portos_Mail
- build.number=90
- build.date=1663310360846
+ build.number=91
+ build.date=1762446310836
build.auto.upgrade=true
##
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/tld/aui.tld b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/tld/aui.tld
index a6c7ee04..1eeac884 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/tld/aui.tld
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/tld/aui.tld
@@ -1,10 +1,12 @@
+ aui:.]]>
1.0
aui
http://alloy.liferay.com/tld/aui
+
button-item
com.liferay.taglib.aui.ButtonItemTag
JSP
@@ -884,64 +886,75 @@
true
+
a
com.liferay.taglib.aui.ATag
JSP
+ <p> tag could be used for something other than a paragraph.]]>
ariaRole
false
true
java.lang.String
+
cssClass
false
true
java.lang.String
+ HashMap<"class-name", foo> would render as the attribute data-class-name = foo;.]]>
data
false
true
java.util.Map
+
href
true
true
java.lang.String
+
id
false
true
java.lang.String
+
label
false
true
java.lang.String
+
lang
false
true
java.lang.String
+
onClick
false
true
java.lang.String
+ self. Possible values are blank, self, parent, top, and a unique frame's name.]]>
target
false
true
java.lang.String
+
title
false
true
@@ -954,66 +967,77 @@
com.liferay.taglib.aui.ButtonTag
JSP
+ primary attribute.]]>
cssClass
false
true
java.lang.String
+ HashMap<"class-name", foo> would render as the attribute data-class-name = foo;.]]>
data
false
true
java.lang.Object
+ false.]]>
disabled
false
true
boolean
+
href
false
true
java.lang.String
+ here.]]>
icon
false
true
java.lang.String
+ left.]]>
iconAlign
false
true
java.lang.String
+
name
false
true
java.lang.String
+
onClick
false
true
java.lang.String
+ type attribute is set to submit, this value is set to true. For all other types, the value is set to false by default.]]>
primary
false
true
java.lang.Object
+ button, submit, cancel and reset. The default value is button.]]>
type
false
true
java.lang.String
+ href location when a user clicks the button. The default value is false.]]>
useDialog
false
true
@@ -1028,16 +1052,19 @@
true
+ <div> tag to wrap <aui:button> components and offer additional styling.]]>
button-row
com.liferay.taglib.aui.ButtonRowTag
JSP
+
cssClass
false
true
java.lang.String
+
id
false
true
@@ -1046,16 +1073,19 @@
true
+ <aui:row> component.]]>
col
com.liferay.taglib.aui.ColTag
JSP
+
cssClass
false
true
java.lang.String
+
id
false
true
@@ -1074,12 +1104,14 @@
int
+ 12. For example, a span of 4 would result in a column width 4/12 (or 1/3) of the total width of the containing row.]]>
span
false
true
int
+ span attribute. The width is then converted to a span expressed as ((width/100) x 12), rounded to the nearest whole number. For example, a width of 33 would be converted to 3.96, which would be rounded up to a span value of 4.]]>
width
false
true
@@ -1088,34 +1120,40 @@
true
+ aui:col.]]>
column
com.liferay.taglib.aui.ColumnTag
JSP
+ 20 would be 20%. The default value is 0.]]>
columnWidth
false
true
int
+
cssClass
false
true
java.lang.String
+ false.]]>
first
false
true
boolean
+
id
false
true
java.lang.String
+ false.]]>
last
false
true
@@ -1190,22 +1228,26 @@
true
+ <div> tag to wrap <aui:row> components and offer additional styling.]]>
container
com.liferay.taglib.aui.ContainerTag
JSP
+
cssClass
false
true
java.lang.String
+ true.]]>
fluid
false
true
boolean
+
id
false
true
@@ -1214,64 +1256,75 @@
true
+ <div> tag to wrap form fields and offer additional styling.]]>
field-wrapper
com.liferay.taglib.aui.FieldWrapperTag
JSP
+
cssClass
false
true
java.lang.String
+ HashMap<"class-name", foo> would render as the attribute data-class-name = foo;.]]>
data
false
true
java.lang.Object
+ false.]]>
first
false
true
boolean
+
helpMessage
false
true
java.lang.String
+ false.]]>
inlineField
false
true
boolean
+ right and left.]]>
inlineLabel
false
true
java.lang.String
+
label
false
true
java.lang.String
+ false.]]>
last
false
true
boolean
+
name
false
true
java.lang.String
+
required
false
true
@@ -1279,34 +1332,40 @@
+ <div> tag to group related form elements and offer additional styling.]]>
fieldset
com.liferay.taglib.aui.FieldsetTag
JSP
+
column
false
true
boolean
+
cssClass
false
true
java.lang.String
+
helpMessage
false
true
java.lang.String
+
id
false
true
java.lang.String
+
label
false
true
@@ -1315,58 +1374,68 @@
true
+
form
com.liferay.taglib.aui.FormTag
JSP
+
action
false
true
java.lang.String
+
cssClass
false
true
java.lang.String
+ true.]]>
escapeXml
false
true
boolean
+ false.]]>
inlineLabels
false
true
boolean
+ post. Possible values are get and post.]]>
method
false
true
java.lang.String
+ fm.]]>
name
false
true
java.lang.String
+
onSubmit
false
true
java.lang.String
+
portletNamespace
false
true
java.lang.String
+ true.]]>
useNamespace
false
true
@@ -1375,46 +1444,54 @@
true
+
icon
com.liferay.taglib.aui.IconTag
JSP
+ image attribute.]]>
cssClass
false
true
java.lang.String
+ HashMap<"class-name", foo> would render as the attribute data-class-name = foo;.]]>
data
false
true
java.util.Map
+
id
false
true
java.lang.String
+ icon-edit CSS class by setting the value edit. If an icon image is referenced for cssClass and image, both icons are shown in the component.]]>
image
false
true
java.lang.String
+
label
false
true
java.lang.String
+ self. Possible values are blank, self, parent, top, and a unique frame's name.]]>
target
false
true
java.lang.String
+
url
false
true
@@ -1423,52 +1500,61 @@
true
+
input
com.liferay.taglib.aui.InputTag
JSP
+
autoFocus
false
true
boolean
+
autoSize
false
true
boolean
+
bean
false
true
java.lang.Object
+ false.]]>
changesContext
false
true
boolean
+ type is radio or checkbox.]]>
checked
false
true
boolean
+ 0.]]>
classPK
false
true
long
+
cssClass
false
true
java.lang.String
+ HashMap<"class-name", foo> would render as the attribute data-class-name = foo;.]]>
data
false
true
@@ -1481,12 +1567,14 @@
java.lang.String
+
defaultLanguageId
false
true
java.lang.String
+ false.]]>
disabled
false
true
@@ -1499,60 +1587,70 @@
java.lang.String
+ field of the component.]]>
fieldParam
false
true
java.lang.String
+
first
false
true
boolean
+
formName
false
true
java.lang.String
+
helpMessage
false
true
java.lang.String
+ input-group-addon.]]>
helpTextCssClass
false
true
java.lang.String
+
id
false
true
java.lang.String
+ false.]]>
ignoreRequestValue
false
true
boolean
+ false.]]>
inlineField
false
true
boolean
+ right and left.]]>
inlineLabel
false
true
java.lang.String
+ name attribute's value.]]>
label
false
true
@@ -1565,30 +1663,35 @@
java.lang.String
+
last
false
true
boolean
+ false.]]>
localized
false
true
boolean
+ type is number or range. Note that the max value is inclusive if the input's type is range.]]>
max
false
true
java.lang.Object
+
model
false
true
java.lang.Class
+ type is number or range. Note that the min value is inclusive if the input's type is range.]]>
min
false
true
@@ -1601,84 +1704,98 @@
boolean
+
name
true
true
java.lang.String
+
onChange
false
true
java.lang.String
+
onClick
false
true
java.lang.String
+
placeholder
false
true
java.lang.String
+
prefix
false
true
java.lang.String
+
required
false
true
boolean
+ textarea.]]>
resizable
false
true
boolean
+
showRequiredLabel
false
true
boolean
+
suffix
false
true
java.lang.String
+
title
false
true
java.lang.String
+ text, hidden, assetCategories, assetTags, textarea, timeZone, password, checkbox, radio, submit, button, color, email, number, range, resource, url, and an empty value. If an empty value or no value is set, the input's type is obtained automatically from the input component's bean.]]>
type
false
true
java.lang.String
+ true.]]>
useNamespace
false
true
boolean
+
value
false
true
java.lang.Object
+ div that wraps the input component.]]>
wrapperCssClass
false
true
@@ -1687,10 +1804,12 @@
true
+
layout
com.liferay.taglib.aui.LayoutTag
JSP
+
cssClass
false
true
@@ -1699,22 +1818,26 @@
true
+
model-context
com.liferay.taglib.aui.ModelContextTag
JSP
+
bean
false
true
java.lang.Object
+
defaultLanguageId
false
true
java.lang.String
+
model
false
true
@@ -1722,16 +1845,19 @@
+ <nav:item> components for an <aui:nav-bar> component.]]>
nav
com.liferay.taglib.aui.NavTag
JSP
+
ariaLabel
false
true
java.lang.String
+ <p> tag could be used for something other than a paragraph.]]>
ariaRole
false
true
@@ -1744,6 +1870,7 @@
boolean
+
cssClass
false
true
@@ -1756,12 +1883,14 @@
java.lang.String
+
id
false
true
java.lang.String
+ true.]]>
useNamespace
false
true
@@ -1770,16 +1899,19 @@
true
+
nav-bar
com.liferay.taglib.aui.NavBarTag
JSP
+
cssClass
false
true
java.lang.String
+
id
false
true
@@ -1788,16 +1920,19 @@
true
+ <aui:nav-bar> component.]]>
nav-bar-search
com.liferay.taglib.aui.NavBarSearchTag
JSP
+
cssClass
false
true
java.lang.String
+
id
false
true
@@ -1810,6 +1945,7 @@
java.lang.String
+
searchContainer
false
true
@@ -1818,82 +1954,102 @@
true
+ <aui:nav> component.]]>
nav-item
com.liferay.taglib.aui.NavItemTag
JSP
+ href attribute.]]>
anchorCssClass
false
true
java.lang.String
+ HashMap<"class-name", foo> would render as the attribute data-class-name = foo;.]]>
anchorData
false
true
java.lang.Object
+ href attribute.]]>
anchorId
false
true
java.lang.String
+
ariaLabel
false
true
java.lang.String
+ <p> tag could be used for something other than a paragraph.]]>
ariaRole
false
true
java.lang.String
+
cssClass
false
true
java.lang.String
+ HashMap<"class-name", foo> would render as the attribute data-class-name = foo;.]]>
data
false
true
java.lang.Object
+ false.]]>
dropdown
false
true
boolean
+
href
false
true
java.lang.Object
+
iconCssClass
false
true
java.lang.String
+
id
false
true
java.lang.String
+
label
false
true
java.lang.String
+ localizeLabel
+ false
+ true
+ boolean
+
+
+ false.]]>
selected
false
true
@@ -1906,6 +2062,7 @@
java.lang.String
+
title
false
true
@@ -1918,12 +2075,14 @@
boolean
+ href location when a user clicks the navigation item. The default value is false.]]>
useDialog
false
true
boolean
+ drop-down-menu class. The default value is true.]]>
wrapDropDownMenu
false
true
@@ -1932,40 +2091,47 @@
true
+ <aui:select> component.]]>
option
com.liferay.taglib.aui.OptionTag
JSP
+
cssClass
false
true
java.lang.String
+ HashMap<"class-name", foo> would render as the attribute data-class-name = foo;.]]>
data
false
true
java.util.Map
+ false.]]>
disabled
false
true
boolean
+
label
false
true
java.lang.Object
+ false.]]>
selected
false
true
boolean
+ text-align:right;.]]>
style
false
true
@@ -1978,6 +2144,7 @@
boolean
+ label attribute.]]>
value
false
true
@@ -2015,22 +2182,26 @@
+ <aui:col> components.]]>
row
com.liferay.taglib.aui.RowTag
JSP
+
cssClass
false
true
java.lang.String
+ row-fluid CSS class to the row. The default value is true. If set to false, the row CSS class is assigned.]]>
fluid
false
true
boolean
+
id
false
true
@@ -2039,16 +2210,19 @@
true
+
script
com.liferay.taglib.aui.ScriptTag
JSP
+
position
false
true
java.lang.String
+
use
false
true
@@ -2056,52 +2230,61 @@
+ <aui:option> components.]]>
select
com.liferay.taglib.aui.SelectTag
JSP
+
bean
false
true
java.lang.Object
+ false.]]>
changesContext
false
true
boolean
+
cssClass
false
true
java.lang.String
+ HashMap<"class-name", "foo"> would render as the attribute data-class-name = "foo";.]]>
data
false
true
java.util.Map
+ false.]]>
disabled
false
true
boolean
+ false.]]>
first
false
true
boolean
+
helpMessage
false
true
java.lang.String
+
id
false
true
@@ -2114,30 +2297,35 @@
boolean
+ false.]]>
inlineField
false
true
boolean
+ right and left.]]>
inlineLabel
false
true
java.lang.String
+
label
false
true
java.lang.String
+ false.]]>
last
false
true
boolean
+ ListTypeImpl.java.]]>
listType
false
true
@@ -2150,66 +2338,77 @@
java.lang.String
+ true, the select field expands to allow for multiple selections. The default value is false.]]>
multiple
false
true
boolean
+ label attribute and takes the place of the label.]]>
name
true
true
java.lang.String
+
onChange
false
true
java.lang.String
+
onClick
false
true
java.lang.String
+
prefix
false
true
java.lang.String
+ false.]]>
required
false
true
boolean
+ false.]]>
showEmptyOption
false
true
boolean
+ required attribute is set to true. The default value is false.]]>
showRequiredLabel
false
true
boolean
+
suffix
false
true
java.lang.String
+
title
false
true
java.lang.String
+ true.]]>
useNamespace
false
true
@@ -2218,21 +2417,25 @@
true
+
spacer
com.liferay.taglib.aui.SpacerTag
JSP
+
translation-manager
com.liferay.taglib.aui.TranslationManagerTag
JSP
+
availableLocales
false
true
java.util.Locale[]
+
defaultLanguageId
false
true
@@ -2245,18 +2448,21 @@
java.lang.String
+
id
false
true
java.lang.String
+ true. If this is set to false, the translation manager will not work entirely.]]>
initialize
false
true
boolean
+ false.]]>
readOnly
false
true
@@ -2264,16 +2470,26 @@
+
validator
com.liferay.taglib.aui.ValidatorTagImpl
JSP
+ true.]]>
+ customValidatorRequired
+ false
+ true
+ boolean
+
+
+
errorMessage
false
true
java.lang.String
+ acceptFiles, alpha, alphanum, date, digits, email, equalTo, iri, max, maxLength, min, minLength, number, required, and url.]]>
name
true
true
@@ -2281,58 +2497,68 @@
+
workflow-status
com.liferay.taglib.aui.WorkflowStatusTag
JSP
+
bean
false
true
java.lang.Object
+
helpMessage
false
true
java.lang.String
+
id
false
true
java.lang.String
+
model
false
true
java.lang.Class
+ true.]]>
showIcon
false
true
boolean
+ true.]]>
showLabel
false
true
boolean
+ 0 (Approved), 1 (Pending), 2 (Draft), 3 (Expired), 4 (Denied), 5 (Inactive), 6 (Incomplete), 7 (Scheduled), and 8 (In-Trash). Any other value defaults to status (Any).]]>
status
false
true
java.lang.Integer
+
statusMessage
false
true
java.lang.String
+
version
false
true
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/web.xml b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/web.xml
index 1aa8cdb8..d8b6a17d 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/web.xml
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/web.xml
@@ -1,3 +1,145 @@
-
-
+
+
+
+ portos-mail-manager-portlet
+
+ Invoker Filter - ERROR
+ com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter
+
+ dispatcher
+ ERROR
+
+
+
+ Invoker Filter - FORWARD
+ com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter
+
+ dispatcher
+ FORWARD
+
+
+
+ Invoker Filter - INCLUDE
+ com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter
+
+ dispatcher
+ INCLUDE
+
+
+
+ Invoker Filter - REQUEST
+ com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter
+
+ dispatcher
+ REQUEST
+
+
+
+ Invoker Filter - ERROR
+ /*
+ ERROR
+
+
+ Invoker Filter - FORWARD
+ /*
+ FORWARD
+
+
+ Invoker Filter - INCLUDE
+ /*
+ INCLUDE
+
+
+ Invoker Filter - REQUEST
+ /*
+ REQUEST
+
+
+ com.liferay.portal.kernel.servlet.PluginContextListener
+
+
+ com.liferay.portal.kernel.servlet.SerializableSessionAttributeListener
+
+
+ 1 Servlet
+ com.liferay.portal.kernel.servlet.PortletServlet
+
+ portlet-class
+ it.tref.liferay.portos.mailmanager.portlet.EmailPortlet
+
+ 1
+
+
+ 2 Servlet
+ com.liferay.portal.kernel.servlet.PortletServlet
+
+ portlet-class
+ it.tref.liferay.portos.mailmanager.portlet.EmailTemplatesPortlet
+
+ 1
+
+
+ 3 Servlet
+ com.liferay.portal.kernel.servlet.PortletServlet
+
+ portlet-class
+ it.tref.liferay.portos.mailmanager.portlet.EmailTemplatesPortlet
+
+ 1
+
+
+ Dynamic Resource Servlet
+ com.liferay.portal.kernel.servlet.PortalClassLoaderServlet
+
+ servlet-class
+ com.liferay.portal.webserver.DynamicResourceServlet
+
+ 1
+
+
+ 1 Servlet
+ /1/*
+
+
+ 2 Servlet
+ /2/*
+
+
+ 3 Servlet
+ /3/*
+
+
+ Dynamic Resource Servlet
+ /sprite/*
+
+
+
+ http://liferay.com/tld/aui
+ /WEB-INF/tld/aui.tld
+
+
+ http://java.sun.com/portlet_2_0
+ /WEB-INF/tld/liferay-portlet.tld
+
+
+ http://liferay.com/tld/portlet
+ /WEB-INF/tld/liferay-portlet-ext.tld
+
+
+ http://liferay.com/tld/security
+ /WEB-INF/tld/liferay-security.tld
+
+
+ http://liferay.com/tld/theme
+ /WEB-INF/tld/liferay-theme.tld
+
+
+ http://liferay.com/tld/ui
+ /WEB-INF/tld/liferay-ui.tld
+
+
+ http://liferay.com/tld/util
+ /WEB-INF/tld/liferay-util.tld
+
+
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp
index fdafd350..51c865d9 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp
@@ -1,4 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+
<%@page import="com.liferay.portal.util.PortalUtil"%>
<%@page import="com.liferay.portlet.PortletURLUtil"%>
<%@page import="javax.portlet.PortletURL"%>
@@ -10,23 +11,36 @@
<%@page import="java.util.List"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
+
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
-<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<%@taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
-<%@taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
-<%@taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
-<%@taglib uri="http://liferay.com/tld/security" prefix="liferay-security" %>
-<%@taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
-<%@taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
-<%@taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %>
-<%@taglib uri="http://liferay.com/tld/ddm" prefix="liferay-ddm" %>
+
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
+
+<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
+<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
+<%@ taglib uri="http://liferay.com/tld/security" prefix="liferay-security" %>
+<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
+<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
+<%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %>
+<%@ taglib uri="http://liferay.com/tld/ddm" prefix="liferay-ddm" %>
+
<%@page import="it.tref.liferay.portos.mailmanager.shared.util.MailManagerConstants"%>
+
+<%@ page contentType="text/html; charset=UTF-8" %>
+
<%@page import="com.liferay.portal.kernel.util.GetterUtil"%>
+
+
<%
PortletMode portletMode = liferayPortletRequest.getPortletMode();
WindowState windowState = liferayPortletRequest.getWindowState();
+
PortletURL currentURLObj = PortletURLUtil.getCurrent(liferayPortletRequest, liferayPortletResponse);
+
String currentURL = currentURLObj.toString();
-%>
+
+%>
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/edit.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/edit.jsp
index 639e1b2f..89ef8581 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/edit.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/edit.jsp
@@ -1,11 +1,17 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
-<%@include file="/html/mail_manager/init.jsp"%>
+<%@include file="/html/mail_manager/init.jsp" %>
+
<%
-final String EDITOR_WYSIWYG_IMPL_KEY = "editor.wysiwyg.mail-manager-portlet.docroot.html.mail_manager.edit.jsp";
-long emailId = ParamUtil.getLong(request, "emailId");
-Email email = EmailLocalServiceUtil.getEmail(emailId);
-List emailAttachments = EmailAttachmentLocalServiceUtil.findByEmailId(emailId);
+ final String EDITOR_WYSIWYG_IMPL_KEY = "editor.wysiwyg.mail-manager-portlet.docroot.html.mail_manager.edit.jsp";
+
+ long emailId = ParamUtil.getLong(request, "emailId");
+
+ Email email = EmailLocalServiceUtil.getEmail(emailId);
+
+ List emailAttachments = EmailAttachmentLocalServiceUtil.findByEmailId(emailId);
+
%>
+
@@ -14,49 +20,76 @@ List emailAttachments = EmailAttachmentLocalServiceUtil.findByE
+
-
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
function initEditor() {
return "<%= UnicodeFormatter.toString(email.getBody()) %>";
}
+
- <%
- for(EmailAttachment attachment : emailAttachments){
- %>
- - <%= attachment.getFileEntry().getDescription() %>
- <%
- }
- %>
+ <% for(EmailAttachment attachment : emailAttachments){ %>
+
- <%=attachment.getFileEntry().getDescription() %>
+ <% } %>
+
-
+
+
+
+
-Liferay.provide( window, 'save', function() {
- var A = new AUI();
- var body = window.editor.getHTML();
- document.fm.body.value = body;
- submitForm(document.fm);
-});
+
+ Liferay.provide(
+ window,
+ 'save',
+ function() {
+ var A = new AUI();
+
+ var body = window.editor.getHTML();
+
+ document.fm.body.value = body;
+
+ submitForm(document.fm);
+
+ }
+ );
+
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_action.jsp
index dda35504..43de79f2 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_action.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_action.jsp
@@ -1,29 +1,53 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/mail_manager/init.jsp" %>
+
<%
SearchContainer searchContainer = (SearchContainer) request.getAttribute("liferay-ui:search:searchContainer");
+
String redirect = searchContainer.getIteratorURL().toString();
+
ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
+
Email entry = (Email) row.getObject();
%>
-
+
+
+
+
+
-
+
+
+
-
+
+
+
+
+
+
+
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_history_popup_button.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_history_popup_button.jsp
index 46334425..08210e78 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_history_popup_button.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_history_popup_button.jsp
@@ -1,26 +1,34 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/mail_manager/init.jsp" %>
-
- <%
- String cssClass = ParamUtil.getString(request, "cssClass");
- String buttonValue = ParamUtil.getString(request, "buttonValue","email-history-popup-btn");
- long classNameId = ParamUtil.getLong(request, "classNameId");
- long classPK = ParamUtil.getLong(request, "classPK");
- String templateName = ParamUtil.getString(request, "templateName");
+
+
+
+ <%
+ String cssClass = ParamUtil.getString(request, "cssClass");
+ String buttonValue = ParamUtil.getString(request, "buttonValue","email-history-popup-btn");
+
+ long classNameId = ParamUtil.getLong(request, "classNameId");
+ long classPK = ParamUtil.getLong(request, "classPK");
+ String templateName = ParamUtil.getString(request, "templateName");
%>
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/init.jsp
index 08f67ce2..e1014604 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/init.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/init.jsp
@@ -1,5 +1,6 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/init.jsp" %>
+
<%@page import="com.liferay.portal.kernel.util.TextFormatter"%>
<%@page import="com.liferay.portal.kernel.repository.model.FileVersion"%>
<%@page import="com.liferay.portal.kernel.util.StringBundler"%>
@@ -11,6 +12,7 @@
<%@page import="com.liferay.portal.kernel.util.UnicodeFormatter"%>
<%@page import="it.tref.liferay.portos.mailmanager.model.Email"%>
<%@page import="it.tref.liferay.portos.mailmanager.service.EmailAttachmentLocalServiceUtil"%>
+
<%@page import="it.tref.liferay.portos.mailmanager.RequiredEmailToException"%>
<%@page import="it.tref.liferay.portos.mailmanager.RequiredEmailBodyException"%>
<%@page import="it.tref.liferay.portos.mailmanager.RequiredEmailSubjectException"%>
@@ -20,10 +22,11 @@
<%@page import="it.tref.liferay.portos.mailmanager.EmailFromException"%>
<%@page import="it.tref.liferay.portos.mailmanager.RequiredEmailFromException"%>
<%@page import="com.sun.xml.internal.ws.api.message.Attachment"%>
+
<%@page import="com.liferay.portal.kernel.dao.search.SearchContainer"%>
<%@page import="com.liferay.portal.kernel.util.WebKeys"%>
<%@page import="com.liferay.portal.kernel.dao.search.ResultRow"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="it.tref.liferay.portos.mailmanager.shared.util.PortletKeys"%>
<%@page import="it.tref.liferay.portos.mailmanager.permission.ActionKeys"%>
-<%@page import="it.tref.liferay.portos.mailmanager.permission.EmailPermission"%>
+<%@page import="it.tref.liferay.portos.mailmanager.permission.EmailPermission"%>
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/view.jsp
index ce666fda..5a3f7523 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/view.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/view.jsp
@@ -1,115 +1,165 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
-<%@include file="/html/mail_manager/init.jsp"%>
+<%@include file="/html/mail_manager/init.jsp" %>
+
<%
-long classNameId = ParamUtil.getLong(request, "classNameId");
-long classPK = ParamUtil.getLong(request, "classPK");
-String templateName = ParamUtil.getString(request, "templateName");
-long companyId = company.getCompanyId();
+ long classNameId = ParamUtil.getLong(request, "classNameId");
+ long classPK = ParamUtil.getLong(request, "classPK");
+ String templateName = ParamUtil.getString(request, "templateName");
+
+ long companyId = company.getCompanyId();
+
%>
-
- <%
- List results = null;
- int count = 0;
- if (Validator.isNotNull(classNameId) && Validator.isNotNull(classPK)) {
- results = EmailLocalServiceUtil.findByC_G_C_C(companyId, scopeGroupId, classNameId, classPK,
- searchContainer.getStart(), searchContainer.getEnd());
- count = EmailLocalServiceUtil.countByC_G_C_C(companyId, scopeGroupId, classNameId, classPK);
- } else if (Validator.isNotNull(templateName)) {
- results = EmailLocalServiceUtil.findByC_G_T(companyId, scopeGroupId, templateName, searchContainer.getStart(),
- searchContainer.getEnd());
- count = EmailLocalServiceUtil.countByC_G_T(companyId, scopeGroupId, templateName);
- } else {
- results = EmailLocalServiceUtil.findByCompany(companyId, searchContainer.getStart(), searchContainer.getEnd());
- count = EmailLocalServiceUtil.countByCompany(companyId);
- }
- searchContainer.setResults(results);
- searchContainer.setTotal(count);
+
+
+
+ <%
+ List results = null;
+ int count = 0;
+
+ if(Validator.isNotNull(classNameId) && Validator.isNotNull(classPK)){
+ results = EmailLocalServiceUtil.findByC_G_C_C(companyId, scopeGroupId, classNameId, classPK, searchContainer.getStart(), searchContainer.getEnd());
+ count = EmailLocalServiceUtil.countByC_G_C_C(companyId, scopeGroupId, classNameId, classPK);
+ }else if(Validator.isNotNull(templateName)){
+ results = EmailLocalServiceUtil.findByC_G_T(companyId, scopeGroupId, templateName, searchContainer.getStart(), searchContainer.getEnd());
+ count = EmailLocalServiceUtil.countByC_G_T(companyId, scopeGroupId, templateName);
+ }else{
+ results = EmailLocalServiceUtil.findByCompany(companyId, searchContainer.getStart(), searchContainer.getEnd());
+ count = EmailLocalServiceUtil.countByCompany(companyId);
+ }
+
+ searchContainer.setResults(results);
+ searchContainer.setTotal(count);
%>
-
+
+
+
+
+
<%
String[] to = email.getToArray();
%>
-
+
+
<%= to.length %>
+
+
+
A.one('#toCount<%= email.getEmailId() %>').on('click', function(event) {
- var modal = new A.Modal({
- modal: true,
- centered: true,
- visible: true,
- bodyContent: '<%= getContent(to) %>',
- headerContent: '
',
- render: '#modal',
- width: 300,
- }).render();
+
+ var modal = new A.Modal(
+ {
+ modal: true,
+ centered: true,
+ visible: true,
+
+ bodyContent: '<%= getContent(to) %>',
+ headerContent: '
',
+ render: '#modal',
+ width: 300
+ }
+ ).render();
});
+
+
+
+
<%
String[] cc = email.getCcArray();
%>
-
+
+
<%= cc.length %>
+
+
+
A.one('#ccCount<%= email.getEmailId() %>').on('click', function(event) {
- var modal = new A.Modal({
- modal: true,
- centered: true,
- visible: true,
- bodyContent: '<%= getContent(cc) %>',
- headerContent: '
',
- render: '#modal',
- width: 300,
- }).render();
+
+ var modal = new A.Modal(
+ {
+ modal: true,
+ centered: true,
+ visible: true,
+ bodyContent: '<%= getContent(cc) %>',
+ headerContent: '
',
+ render: '#modal',
+ width: 300
+ }
+ ).render();
});
+
+
+
+
<%
String[] bcc = email.getBccArray();
%>
-
+
+
<%= bcc.length %>
+
+
+
A.one('#bccCount<%= email.getEmailId() %>').on('click', function(event) {
- var modal = new A.Modal({
- modal: true,
- centered: true,
- visible: true,
- bodyContent: '<%= getContent(bcc) %>',
- headerContent: '
',
- render: '#modal',
- width: 300,
- }).render();
+
+ var modal = new A.Modal(
+ {
+ modal: true,
+ centered: true,
+ visible: true,
+ bodyContent: '<%= getContent(bcc) %>',
+ headerContent: '
',
+ render: '#modal',
+ width: 300
+ }
+ ).render();
});
+
+
+
<%= StringUtil.shorten(email.getSubject(), 50) %>
+
- <%= StringUtil.shorten(HtmlUtil.extractText(email.getBody()), 50)%>
+ <%= StringUtil.shorten(HtmlUtil.extractText(email.getBody()), 50) %>
+
+
@@ -117,31 +167,45 @@ long companyId = company.getCompanyId();
+
-
+
+
+
+
+
<%
List emailAttachments = email.getEmailAttachments();
%>
+
-
+
<%= emailAttachments.size() %>
+
+
- <%
- for (EmailAttachment emailAttachment : emailAttachments) {
+
+ <% for (EmailAttachment emailAttachment : emailAttachments) {
FileEntry fileEntry = emailAttachment.getFileEntry();
FileVersion fileVersion = fileEntry.getFileVersion();
%>
+
<%= fileEntry.getTitle() %>
@@ -153,46 +217,72 @@ long companyId = company.getCompanyId();
<%= TextFormatter.formatStorageSize(fileVersion.getSize(), locale) %>
-
+
- <%
- }
- %>
+ <% } %>
+
+
+
A.one('#attachmentCount<%= email.getEmailId() %>').on('click', function(event) {
+
var attachments = A.one('#attachments<%= email.getEmailId() %>');
attachments.show();
- var modal = new A.Modal({
- modal: true,
- centered: true,
- visible: true,
- bodyContent: attachments,
- headerContent: '
',
- render: '#modal',
- width: 550,
- }).render();
+
+ var modal = new A.Modal(
+ {
+ modal: true,
+ centered: true,
+ visible: true,
+ bodyContent: attachments,
+ headerContent: '
',
+ render: '#modal',
+ width: 550
+ }
+ ).render();
});
+
+
+
+
+
+
-
+
+
+
+
+
<%!
+
private String getContent(String[] addresses) {
- StringBundler sb = new StringBundler();
- for (String address : addresses) {
- sb.append("")
- .append(address)
- .append("
");
- }
- return sb.toString();
+
+ StringBundler sb = new StringBundler();
+
+ for (String address : addresses) {
+ sb.append("");
+ sb.append("
");
+ sb.append(address);
+ sb.append("
");
+ sb.append("
");
+ }
+
+ return sb.toString();
}
+
%>
\ No newline at end of file