|
|
|
@ -1,9 +1,26 @@
|
|
|
|
|
package it.tref.liferay.portos.report.messaging; |
|
|
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.shared.util.Constants; |
|
|
|
|
import it.tref.liferay.portos.report.shared.constants.ReportConstants; |
|
|
|
|
import it.tref.liferay.portos.report.shared.constants.ReportConstants.ReportResult; |
|
|
|
|
import it.tref.liferay.portos.report.shared.dto.ReportDto; |
|
|
|
|
import it.tref.liferay.portos.report.shared.dto.ReportResultDto; |
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
|
import java.io.FileOutputStream; |
|
|
|
|
import java.io.InputStream; |
|
|
|
|
import java.io.OutputStream; |
|
|
|
|
import java.io.Serializable; |
|
|
|
|
import java.nio.file.Files; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
import com.itextpdf.text.Element; |
|
|
|
|
import com.itextpdf.text.Font; |
|
|
|
|
import com.itextpdf.text.FontFactory; |
|
|
|
|
import com.itextpdf.text.Phrase; |
|
|
|
|
import com.itextpdf.text.Rectangle; |
|
|
|
|
import com.itextpdf.text.pdf.ColumnText; |
|
|
|
|
import com.itextpdf.text.pdf.PdfContentByte; |
|
|
|
|
import com.itextpdf.text.pdf.PdfLayer; |
|
|
|
@ -35,26 +52,8 @@ import com.liferay.portal.service.RoleLocalServiceUtil;
|
|
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
|
import com.liferay.portal.service.UserLocalServiceUtil; |
|
|
|
|
import com.liferay.portlet.documentlibrary.DuplicateFileException; |
|
|
|
|
import com.liferay.portlet.documentlibrary.model.DLFileEntry; |
|
|
|
|
import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; |
|
|
|
|
import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil; |
|
|
|
|
import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil; |
|
|
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.shared.util.Constants; |
|
|
|
|
import it.tref.liferay.portos.report.shared.constants.ReportConstants; |
|
|
|
|
import it.tref.liferay.portos.report.shared.constants.ReportConstants.ReportResult; |
|
|
|
|
import it.tref.liferay.portos.report.shared.dto.ReportDto; |
|
|
|
|
import it.tref.liferay.portos.report.shared.dto.ReportResultDto; |
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
|
import java.io.FileOutputStream; |
|
|
|
|
import java.io.InputStream; |
|
|
|
|
import java.io.OutputStream; |
|
|
|
|
import java.io.Serializable; |
|
|
|
|
import java.nio.file.Files; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
public class ProtocolloMessageListener extends BaseMessageListener { |
|
|
|
|
|
|
|
|
@ -143,15 +142,16 @@ public class ProtocolloMessageListener extends BaseMessageListener {
|
|
|
|
|
Font font = FontFactory.getFont(FontFactory.COURIER, 9.0f); |
|
|
|
|
|
|
|
|
|
// Gestione stringa protocollo
|
|
|
|
|
float xProtocollo = cb.getPdfDocument().getPageSize().getWidth() - 8; |
|
|
|
|
float yProtocollo = cb.getPdfDocument().getPageSize().getHeight() / 3; |
|
|
|
|
Rectangle pageSize = reader.getPageSize(i); |
|
|
|
|
float xProtocollo = pageSize.getWidth() - 8; |
|
|
|
|
float yProtocollo = pageSize.getHeight() / 3; |
|
|
|
|
|
|
|
|
|
ColumnText.showTextAligned(cb, Element.ALIGN_RIGHT, new Phrase(protocolloToAttach, font), |
|
|
|
|
xProtocollo, yProtocollo, 90); |
|
|
|
|
|
|
|
|
|
// Gestion stringa oggetto
|
|
|
|
|
float xOggetto = cb.getPdfDocument().getPageSize().getWidth() - 8; |
|
|
|
|
float yOggetto = cb.getPdfDocument().getPageSize().getHeight() - 30; |
|
|
|
|
float xOggetto = pageSize.getWidth() - 8; |
|
|
|
|
float yOggetto = pageSize.getHeight() - 30; |
|
|
|
|
|
|
|
|
|
if (oggetto != null) { |
|
|
|
|
if (oggetto.length() >= 75) { |
|
|
|
|