Salvatore La Manna 4 anni fa
parent
commit
d2153f4aab
  1. 463
      jasper/VIArch_attivazione.jrxml
  2. 463
      jasper/VIArch_conclusione.jrxml
  3. 22
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java
  4. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Language.properties
  5. 84
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java
  6. 47
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerGeneraDocumento.java
  7. 68
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java
  8. 322
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java
  9. 7
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
  10. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  11. 202
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/avvisi/view.jsp
  12. 225
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp
  13. 23
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_avvisi.jsp
  14. 22
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf
  15. 46
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns_completed.jspf
  16. BIN
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/commons-logging.jar
  17. BIN
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/log4j.jar
  18. BIN
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-bridges.jar
  19. BIN
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-java.jar
  20. BIN
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-taglib.jar
  21. 3
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/liferay-plugin-package.properties
  22. 309
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/scheduler/SchedulerKaleoController.java
  23. 4
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/service.properties
  24. 1
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java
  25. 188
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf
  26. 8
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp
  27. 81
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java
  28. 81
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java
  29. 103
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java
  30. 4
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties

463
jasper/VIArch_attivazione.jrxml

@ -0,0 +1,463 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.3.final utlizzo versione della libreria JasperReports6.4.3 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Modello A" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="afafe5d8-778e-4527-a33a-8c04000abd71">
<property name="ireport.zoom" value="1.3636363636363653"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="1180"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<subDataset name="dataset1" whenResourceMissingType="Empty" uuid="a88aaa8a-a8ef-4d30-97a7-683ded039127">
<field name="codiceAllegato" class="java.lang.String"/>
<field name="titoloAllegato" class="java.lang.String"/>
<field name="sha256Allegato" class="java.lang.String"/>
</subDataset>
<parameter name="LOGO_REGIONE" class="java.lang.String"/>
<parameter name="motivazioni" class="java.lang.String"/>
<parameter name="testo_del_documento" class="java.lang.String"/>
<parameter name="LOGO_DIPARTIMENTO" class="java.lang.String"/>
<field name="alCollaudatore" class="java.lang.String"/>
<field name="alDirettoreLavori" class="java.lang.String"/>
<field name="alTitolareDigitale" class="java.lang.String"/>
<field name="committente" class="java.lang.String"/>
<field name="comune" class="java.lang.String"/>
<field name="lavoriDi" class="java.lang.String"/>
<field name="alCommittente" class="java.lang.String"/>
<field name="codiceUnivoco" class="java.lang.String"/>
<field name="dataAvviso" class="java.util.Date"/>
<field name="dataPratica" class="java.util.Date"/>
<field name="numeroProtocollo" class="java.lang.String"/>
<field name="numeroVariante" class="java.lang.String"/>
<field name="sedeGenioCivile" class="java.lang.String"/>
<field name="numeroProgetto" class="java.lang.String"/>
<field name="ubicazione" class="java.lang.String"/>
<field name="allegati" class="java.util.List"/>
<field name="tipoAutorizzazione" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="71" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<image>
<reportElement x="0" y="0" width="224" height="68" uuid="69ba1fba-114d-4d87-afcf-2a121decda52">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<imageExpression><![CDATA[$P{LOGO_REGIONE}]]></imageExpression>
</image>
<textField>
<reportElement x="360" y="49" width="189" height="19" uuid="54537172-6b28-41f4-914e-f4fab36cd4e9">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans Bold" size="8" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Soprintendenza BB.CC.AA"+"\n"+
"di "+$F{sedeGenioCivile}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="360" y="25" width="191" height="24" uuid="1b70a5b6-ea8f-42f7-926a-6afe5791e1f8">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans Bold" size="8" isBold="false"/>
</textElement>
<text><![CDATA[Dipartimento dei beni culturali
e dell'identità siciliana]]></text>
</staticText>
<image>
<reportElement x="430" y="0" width="79" height="25" uuid="847628c6-b81f-4230-a9b0-06a8d5d7442c">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<imageExpression><![CDATA[$P{LOGO_DIPARTIMENTO}]]></imageExpression>
</image>
</band>
</pageHeader>
<detail>
<band height="98">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<line>
<reportElement x="0" y="22" width="555" height="1" uuid="9a12dff4-3c78-4e66-b1b6-13836bb2182b"/>
</line>
<staticText>
<reportElement x="1" y="30" width="56" height="13" uuid="9f68e9a8-cba6-4f14-bfd8-00b5bb45ebcb"/>
<textElement>
<font fontName="DejaVu Sans" isBold="true"/>
</textElement>
<text><![CDATA[Oggetto:]]></text>
</staticText>
<textField>
<reportElement x="59" y="4" width="100" height="12" uuid="db3d08ab-28c7-4bb7-9758-f17e9a87c303"/>
<textElement>
<font fontName="DejaVu Sans" size="8"/>
</textElement>
<textFieldExpression><![CDATA[new SimpleDateFormat("dd/MM/yyyy").format($F{dataAvviso})]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="9" y="4" width="48" height="12" uuid="91b20a71-bc61-45b2-b546-829b214db055"/>
<textElement>
<font fontName="DejaVu Sans" size="8" isBold="false" isItalic="false"/>
</textElement>
<text><![CDATA[Data Avviso]]></text>
</staticText>
<staticText>
<reportElement x="59" y="84" width="130" height="14" uuid="2c29296d-097b-4faa-b4d2-7045cef06f6d">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[Descrizione]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="59" y="30" width="491" height="26" uuid="6cb9f8b8-8715-41ba-a4d4-6eabe2e85408">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{tipoAutorizzazione}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="3" y="63" width="548" height="14" uuid="8c9f5378-8e8d-4655-84b5-eccad49767d5">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Center">
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[ATTIVAZIONE PROCEDURA DI VERIFICA PREVENTIVA]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="190" y="84" width="360" height="14" uuid="877d100e-606b-4eea-960e-f889359577e1">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{lavoriDi}]]></textFieldExpression>
</textField>
</band>
<band height="49">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement x="59" y="0" width="130" height="14" uuid="4f9a8fdf-ffa4-40e1-8243-a75cc00f8200">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[Ubicazione]]></text>
</staticText>
<staticText>
<reportElement x="59" y="14" width="130" height="14" uuid="3f6043ac-d101-498c-b158-050a7240c012">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[Istanza n.]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement x="190" y="0" width="360" height="14" uuid="ac4495b9-44cc-4024-8f86-834e44616dff">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{ubicazione} != null ? $F{ubicazione} : ""]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="190" y="14" width="360" height="14" uuid="cb433646-ff21-4c58-97d7-0cf423a63b23">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{numeroProgetto}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="190" y="28" width="360" height="14" uuid="352ff7ee-5039-4b04-8b75-755272041573">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{numeroProtocollo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="59" y="28" width="130" height="14" uuid="65bd3291-92e6-4348-9d4c-79304aa36c0e">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[Protocollo]]></text>
</staticText>
</band>
<band height="197">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<textField isBlankWhenNull="true">
<reportElement key="" x="285" y="40" width="268" height="14" uuid="b82a2f48-cea2-4ad2-8b76-c443de8a1fe1">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{comune}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" x="170" y="10" width="115" height="14" uuid="c0370045-7e64-47e0-9c03-d9259f814713">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="true"/>
</textElement>
<text><![CDATA[Al Committente]]></text>
</staticText>
<staticText>
<reportElement x="90" y="40" width="195" height="14" uuid="3f554448-d5dc-4075-b6ed-8e7bd10d7998">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[al Sindaco / S.U.E. del Comune di ]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement key="" x="285" y="10" width="268" height="14" uuid="f502c7f9-5ac4-43dd-bd91-cc46b395365e">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{alCommittente}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement key="" x="285" y="24" width="268" height="14" uuid="03b513cf-794b-4cb8-92f4-2c81909cd825">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{alTitolareDigitale}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" x="170" y="24" width="115" height="14" uuid="2a88b2fd-8fcf-4888-a1a1-82919fe0776a">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="true"/>
</textElement>
<text><![CDATA[c/o il suo delegato]]></text>
</staticText>
<staticText>
<reportElement x="3" y="70" width="548" height="60" uuid="e4fec3f3-6651-4474-af2b-5072d857d07e">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans" isBold="false"/>
</textElement>
<text><![CDATA[Con riferimento all’istanza in oggetto
- visto il Codice dei Beni Culturali e del Paesaggio (D.L.vo n. 42 del 22.01.2004 e ss.mm.ii.);
- visto il Piano Paesaggistico degli Ambiti 14 e 17 ricadenti nella provincia di Siracusa, approvato con D.A. n. 5040 del 20.10.2017 e pubblicato nella G.U.R.S. n. 12 del 16.03.2018;
esaminata la documentazione allegata all’istanza;]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="3" y="140" width="548" height="50" uuid="0156b4c7-6c07-4e4a-b8f6-e8ef115f5b1e">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement textAlignment="Justified">
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$P{testo_del_documento}]]></textFieldExpression>
</textField>
</band>
<band height="63">
<componentElement>
<reportElement x="3" y="33" width="548" height="30" uuid="1a359757-dc45-45cb-bdf8-215e91905c39">
<property name="com.jaspersoft.studio.unit.CONTENTS.height" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="dataset1" uuid="c5c63b6d-60a1-4ab0-8a82-0ac6993df639">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{allegati})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="30" width="548">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="20" y="0" width="519" height="14" uuid="6689d4e1-4145-4de3-9faa-7206aab84bdd">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$F{codiceAllegato}+" - "+$F{titoloAllegato}]]></textFieldExpression>
</textField>
<ellipse>
<reportElement x="11" y="5" width="4" height="4" backcolor="#000000" uuid="775a480f-53f2-43e5-ac27-8384f4986c90">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</ellipse>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="20" y="14" width="519" height="14" uuid="0c265a63-dc21-413a-8a3d-8eec3b770a17">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA["SHA256: "+$F{sha256Allegato}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<staticText>
<reportElement x="3" y="0" width="548" height="26" uuid="b1072570-e715-4b6f-bda4-ae4723e17f5d">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
<property name="com.jaspersoft.studio.unit.firstLineIndent" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
<paragraph firstLineIndent="14" leftIndent="0"/>
</textElement>
<text><![CDATA[Viene di seguito riportato l’elenco dei documenti allegati all’istanza ed acquisiti dal sistema informatico “Paesaggistica” della Regione Siciliana.]]></text>
</staticText>
</band>
<band height="130">
<staticText>
<reportElement x="4" y="10" width="547" height="80" uuid="e0eafb80-b8a6-4a02-a365-dbc0fdb746da">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Justified">
<font fontName="DejaVu Sans" size="11" isBold="false"/>
</textElement>
<text><![CDATA[Contro il presente provvedimento è ammesso ricorso gerarchico all’Assessorato Regionale dei Beni Culturali ed Ambientali e dell’Identità Siciliana entro trenta giorni dall’acquisita conoscenza, o al Tribunale Amministrativo Regionale entro sessanta giorni.
L’eventuale ricorso gerarchico, debitamente sottoscritto e regolarizzato in bollo, dovrà riportare le generalità del ricorrente, comprensive di indirizzo di posta elettronica certificata, cui effettuare comunicazioni e notifiche relative al procedimento.]]></text>
</staticText>
<staticText>
<reportElement x="4" y="100" width="547" height="20" uuid="a357f0d4-8217-44d7-b424-b81c836f803a">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Right">
<font fontName="DejaVu Sans" size="12" isBold="false"/>
</textElement>
<text><![CDATA[Il soprintendente]]></text>
</staticText>
<staticText>
<reportElement x="4" y="120" width="547" height="10" uuid="e484cc67-3e66-431a-ad1f-bc7fc56c0836">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Right">
<font fontName="DejaVu Sans" size="8" isBold="false"/>
</textElement>
<text><![CDATA[Firmato digitalmente]]></text>
</staticText>
</band>
<band height="215">
<staticText>
<reportElement x="4" y="10" width="547" height="190" uuid="1b23fa15-1e45-450e-9644-b07ed159627c">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Justified">
<font fontName="DejaVu Sans" isBold="false" isItalic="true"/>
</textElement>
<text><![CDATA[Nel rispetto di quanto prescritto dalla L. 241/1990 e ss. mm. ii. e della L.R. 7/2019, si comunica che, per il presente procedimento amministrativo,
- le Unità Operative che si occupano di provvedimenti autorizzativi in materia di Beni Culturali nelle Soprintendenze dell’Isola, ognuna per le proprie competenze, rappresentano l'unità organizzativa responsabile del procedimento sotto il profilo tecnico-scientifico e di ogni atto procedimentale interlocutorio;
- responsabile dell'adozione del provvedimento finale è il Soprintendente;
- ai fini dell’eventuale richiesta di esercizio dei poteri sostitutivi, il responsabile della correttezza e della celerità è il Dirigente Generale del Dipartimento Beni Culturali e dell’Identità Siciliana.
Responsabile della piattaforma telematica è il Dott. Mario Parlavecchio (mparlavecchio@regione.sicilia.it).
Il titolare del trattamento, definito dall’articolo 4, n. 7 del GDPR - Regolamento generale sulla protezione dei dati (UE/2016/679), è il Dipartimento Beni Culturali e dell’Identità Siciliana.
Responsabili del trattamento, definito all’articolo 4, n.8 del GDPR - Regolamento generale sulla protezione dei dati (UE/2016/679), sono le Soprintendenze di Agrigento, Caltanissetta, Catania, Enna, Messina, Palermo, Ragusa, Siracusa, Trapani, e la Soprintendenza del Mare.]]></text>
</staticText>
</band>
</detail>
<pageFooter>
<band height="109" splitType="Stretch">
<staticText>
<reportElement x="4" y="86" width="301" height="23" uuid="89e43c7c-c4e3-456f-8eba-d21332502699">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans" size="8" isBold="true"/>
</textElement>
<text><![CDATA[www.regione.sicilia.it
https://paesaggistica.sicilia.it]]></text>
</staticText>
<line>
<reportElement x="0" y="83" width="555" height="1" uuid="f2f3ee86-58db-4a77-937b-428b7f419b7b">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
</line>
<componentElement>
<reportElement x="183" y="10" width="188" height="50" uuid="4f9aca65-1cf3-4aae-bc48-c9a0517bf888">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<printWhenExpression><![CDATA[$F{codiceUnivoco} != null]]></printWhenExpression>
</reportElement>
<jr:PDF417 xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" moduleWidth="50.0" textPosition="bottom">
<jr:codeExpression><![CDATA[$F{codiceUnivoco}]]></jr:codeExpression>
</jr:PDF417>
</componentElement>
<textField isBlankWhenNull="true">
<reportElement x="8" y="60" width="538" height="20" uuid="17c484f8-1f60-4ac6-bf04-4b1ef031793a">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement textAlignment="Center">
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{codiceUnivoco}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>

463
jasper/VIArch_conclusione.jrxml

@ -0,0 +1,463 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.4.3.final utlizzo versione della libreria JasperReports6.4.3 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Modello A" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="afafe5d8-778e-4527-a33a-8c04000abd71">
<property name="ireport.zoom" value="1.3636363636363653"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="1180"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<subDataset name="dataset1" whenResourceMissingType="Empty" uuid="a88aaa8a-a8ef-4d30-97a7-683ded039127">
<field name="codiceAllegato" class="java.lang.String"/>
<field name="titoloAllegato" class="java.lang.String"/>
<field name="sha256Allegato" class="java.lang.String"/>
</subDataset>
<parameter name="LOGO_REGIONE" class="java.lang.String"/>
<parameter name="motivazioni" class="java.lang.String"/>
<parameter name="testo_del_documento" class="java.lang.String"/>
<parameter name="LOGO_DIPARTIMENTO" class="java.lang.String"/>
<field name="alCollaudatore" class="java.lang.String"/>
<field name="alDirettoreLavori" class="java.lang.String"/>
<field name="alTitolareDigitale" class="java.lang.String"/>
<field name="committente" class="java.lang.String"/>
<field name="comune" class="java.lang.String"/>
<field name="lavoriDi" class="java.lang.String"/>
<field name="alCommittente" class="java.lang.String"/>
<field name="codiceUnivoco" class="java.lang.String"/>
<field name="dataAvviso" class="java.util.Date"/>
<field name="dataPratica" class="java.util.Date"/>
<field name="numeroProtocollo" class="java.lang.String"/>
<field name="numeroVariante" class="java.lang.String"/>
<field name="sedeGenioCivile" class="java.lang.String"/>
<field name="numeroProgetto" class="java.lang.String"/>
<field name="ubicazione" class="java.lang.String"/>
<field name="allegati" class="java.util.List"/>
<field name="tipoAutorizzazione" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="71" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<image>
<reportElement x="0" y="0" width="224" height="68" uuid="69ba1fba-114d-4d87-afcf-2a121decda52">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<imageExpression><![CDATA[$P{LOGO_REGIONE}]]></imageExpression>
</image>
<textField>
<reportElement x="360" y="49" width="189" height="19" uuid="54537172-6b28-41f4-914e-f4fab36cd4e9">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans Bold" size="8" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Soprintendenza BB.CC.AA"+"\n"+
"di "+$F{sedeGenioCivile}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="360" y="25" width="191" height="24" uuid="1b70a5b6-ea8f-42f7-926a-6afe5791e1f8">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans Bold" size="8" isBold="false"/>
</textElement>
<text><![CDATA[Dipartimento dei beni culturali
e dell'identità siciliana]]></text>
</staticText>
<image>
<reportElement x="430" y="0" width="79" height="25" uuid="847628c6-b81f-4230-a9b0-06a8d5d7442c">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<imageExpression><![CDATA[$P{LOGO_DIPARTIMENTO}]]></imageExpression>
</image>
</band>
</pageHeader>
<detail>
<band height="98">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<line>
<reportElement x="0" y="22" width="555" height="1" uuid="9a12dff4-3c78-4e66-b1b6-13836bb2182b"/>
</line>
<staticText>
<reportElement x="1" y="30" width="56" height="13" uuid="9f68e9a8-cba6-4f14-bfd8-00b5bb45ebcb"/>
<textElement>
<font fontName="DejaVu Sans" isBold="true"/>
</textElement>
<text><![CDATA[Oggetto:]]></text>
</staticText>
<textField>
<reportElement x="59" y="4" width="100" height="12" uuid="db3d08ab-28c7-4bb7-9758-f17e9a87c303"/>
<textElement>
<font fontName="DejaVu Sans" size="8"/>
</textElement>
<textFieldExpression><![CDATA[new SimpleDateFormat("dd/MM/yyyy").format($F{dataAvviso})]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="9" y="4" width="48" height="12" uuid="91b20a71-bc61-45b2-b546-829b214db055"/>
<textElement>
<font fontName="DejaVu Sans" size="8" isBold="false" isItalic="false"/>
</textElement>
<text><![CDATA[Data Avviso]]></text>
</staticText>
<staticText>
<reportElement x="59" y="84" width="130" height="14" uuid="2c29296d-097b-4faa-b4d2-7045cef06f6d">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[Descrizione]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="59" y="30" width="491" height="26" uuid="6cb9f8b8-8715-41ba-a4d4-6eabe2e85408">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{tipoAutorizzazione}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="3" y="63" width="548" height="14" uuid="8c9f5378-8e8d-4655-84b5-eccad49767d5">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Center">
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[CONCLUSIONE PROCEDURA DI VERIFICA PREVENTIVA]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="190" y="84" width="360" height="14" uuid="877d100e-606b-4eea-960e-f889359577e1">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{lavoriDi}]]></textFieldExpression>
</textField>
</band>
<band height="49">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement x="59" y="0" width="130" height="14" uuid="4f9a8fdf-ffa4-40e1-8243-a75cc00f8200">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[Ubicazione]]></text>
</staticText>
<staticText>
<reportElement x="59" y="14" width="130" height="14" uuid="3f6043ac-d101-498c-b158-050a7240c012">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[Istanza n.]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement x="190" y="0" width="360" height="14" uuid="ac4495b9-44cc-4024-8f86-834e44616dff">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{ubicazione} != null ? $F{ubicazione} : ""]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="190" y="14" width="360" height="14" uuid="cb433646-ff21-4c58-97d7-0cf423a63b23">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{numeroProgetto}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="190" y="28" width="360" height="14" uuid="352ff7ee-5039-4b04-8b75-755272041573">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{numeroProtocollo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="59" y="28" width="130" height="14" uuid="65bd3291-92e6-4348-9d4c-79304aa36c0e">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[Protocollo]]></text>
</staticText>
</band>
<band height="197">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<textField isBlankWhenNull="true">
<reportElement key="" x="285" y="40" width="268" height="14" uuid="b82a2f48-cea2-4ad2-8b76-c443de8a1fe1">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{comune}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" x="170" y="10" width="115" height="14" uuid="c0370045-7e64-47e0-9c03-d9259f814713">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="true"/>
</textElement>
<text><![CDATA[Al Committente]]></text>
</staticText>
<staticText>
<reportElement x="90" y="40" width="195" height="14" uuid="3f554448-d5dc-4075-b6ed-8e7bd10d7998">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="false"/>
</textElement>
<text><![CDATA[al Sindaco / S.U.E. del Comune di ]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement key="" x="285" y="10" width="268" height="14" uuid="f502c7f9-5ac4-43dd-bd91-cc46b395365e">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{alCommittente}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement key="" x="285" y="24" width="268" height="14" uuid="03b513cf-794b-4cb8-92f4-2c81909cd825">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{alTitolareDigitale}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" x="170" y="24" width="115" height="14" uuid="2a88b2fd-8fcf-4888-a1a1-82919fe0776a">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans Bold" isBold="true"/>
</textElement>
<text><![CDATA[c/o il suo delegato]]></text>
</staticText>
<staticText>
<reportElement x="3" y="70" width="548" height="60" uuid="e4fec3f3-6651-4474-af2b-5072d857d07e">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans" isBold="false"/>
</textElement>
<text><![CDATA[Con riferimento all’istanza in oggetto
- visto il Codice dei Beni Culturali e del Paesaggio (D.L.vo n. 42 del 22.01.2004 e ss.mm.ii.);
- visto il Piano Paesaggistico degli Ambiti 14 e 17 ricadenti nella provincia di Siracusa, approvato con D.A. n. 5040 del 20.10.2017 e pubblicato nella G.U.R.S. n. 12 del 16.03.2018;
esaminata la documentazione allegata all’istanza;]]></text>
</staticText>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="3" y="140" width="548" height="50" uuid="0156b4c7-6c07-4e4a-b8f6-e8ef115f5b1e">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement textAlignment="Justified">
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$P{testo_del_documento}]]></textFieldExpression>
</textField>
</band>
<band height="63">
<componentElement>
<reportElement x="3" y="33" width="548" height="30" uuid="1a359757-dc45-45cb-bdf8-215e91905c39">
<property name="com.jaspersoft.studio.unit.CONTENTS.height" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="dataset1" uuid="c5c63b6d-60a1-4ab0-8a82-0ac6993df639">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{allegati})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="30" width="548">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="20" y="0" width="519" height="14" uuid="6689d4e1-4145-4de3-9faa-7206aab84bdd">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$F{codiceAllegato}+" - "+$F{titoloAllegato}]]></textFieldExpression>
</textField>
<ellipse>
<reportElement x="11" y="5" width="4" height="4" backcolor="#000000" uuid="775a480f-53f2-43e5-ac27-8384f4986c90">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</ellipse>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="20" y="14" width="519" height="14" uuid="0c265a63-dc21-413a-8a3d-8eec3b770a17">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA["SHA256: "+$F{sha256Allegato}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<staticText>
<reportElement x="3" y="0" width="548" height="26" uuid="b1072570-e715-4b6f-bda4-ae4723e17f5d">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
<property name="com.jaspersoft.studio.unit.firstLineIndent" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans"/>
<paragraph firstLineIndent="14" leftIndent="0"/>
</textElement>
<text><![CDATA[Viene di seguito riportato l’elenco dei documenti allegati all’istanza ed acquisiti dal sistema informatico “Paesaggistica” della Regione Siciliana.]]></text>
</staticText>
</band>
<band height="130">
<staticText>
<reportElement x="4" y="10" width="547" height="80" uuid="e0eafb80-b8a6-4a02-a365-dbc0fdb746da">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Justified">
<font fontName="DejaVu Sans" size="11" isBold="false"/>
</textElement>
<text><![CDATA[Contro il presente provvedimento è ammesso ricorso gerarchico all’Assessorato Regionale dei Beni Culturali ed Ambientali e dell’Identità Siciliana entro trenta giorni dall’acquisita conoscenza, o al Tribunale Amministrativo Regionale entro sessanta giorni.
L’eventuale ricorso gerarchico, debitamente sottoscritto e regolarizzato in bollo, dovrà riportare le generalità del ricorrente, comprensive di indirizzo di posta elettronica certificata, cui effettuare comunicazioni e notifiche relative al procedimento.]]></text>
</staticText>
<staticText>
<reportElement x="4" y="100" width="547" height="20" uuid="a357f0d4-8217-44d7-b424-b81c836f803a">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Right">
<font fontName="DejaVu Sans" size="12" isBold="false"/>
</textElement>
<text><![CDATA[Il soprintendente]]></text>
</staticText>
<staticText>
<reportElement x="4" y="120" width="547" height="10" uuid="e484cc67-3e66-431a-ad1f-bc7fc56c0836">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Right">
<font fontName="DejaVu Sans" size="8" isBold="false"/>
</textElement>
<text><![CDATA[Firmato digitalmente]]></text>
</staticText>
</band>
<band height="215">
<staticText>
<reportElement x="4" y="10" width="547" height="190" uuid="1b23fa15-1e45-450e-9644-b07ed159627c">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Justified">
<font fontName="DejaVu Sans" isBold="false" isItalic="true"/>
</textElement>
<text><![CDATA[Nel rispetto di quanto prescritto dalla L. 241/1990 e ss. mm. ii. e della L.R. 7/2019, si comunica che, per il presente procedimento amministrativo,
- le Unità Operative che si occupano di provvedimenti autorizzativi in materia di Beni Culturali nelle Soprintendenze dell’Isola, ognuna per le proprie competenze, rappresentano l'unità organizzativa responsabile del procedimento sotto il profilo tecnico-scientifico e di ogni atto procedimentale interlocutorio;
- responsabile dell'adozione del provvedimento finale è il Soprintendente;
- ai fini dell’eventuale richiesta di esercizio dei poteri sostitutivi, il responsabile della correttezza e della celerità è il Dirigente Generale del Dipartimento Beni Culturali e dell’Identità Siciliana.
Responsabile della piattaforma telematica è il Dott. Mario Parlavecchio (mparlavecchio@regione.sicilia.it).
Il titolare del trattamento, definito dall’articolo 4, n. 7 del GDPR - Regolamento generale sulla protezione dei dati (UE/2016/679), è il Dipartimento Beni Culturali e dell’Identità Siciliana.
Responsabili del trattamento, definito all’articolo 4, n.8 del GDPR - Regolamento generale sulla protezione dei dati (UE/2016/679), sono le Soprintendenze di Agrigento, Caltanissetta, Catania, Enna, Messina, Palermo, Ragusa, Siracusa, Trapani, e la Soprintendenza del Mare.]]></text>
</staticText>
</band>
</detail>
<pageFooter>
<band height="109" splitType="Stretch">
<staticText>
<reportElement x="4" y="86" width="301" height="23" uuid="89e43c7c-c4e3-456f-8eba-d21332502699">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font fontName="DejaVu Sans" size="8" isBold="true"/>
</textElement>
<text><![CDATA[www.regione.sicilia.it
https://paesaggistica.sicilia.it]]></text>
</staticText>
<line>
<reportElement x="0" y="83" width="555" height="1" uuid="f2f3ee86-58db-4a77-937b-428b7f419b7b">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
</line>
<componentElement>
<reportElement x="183" y="10" width="188" height="50" uuid="4f9aca65-1cf3-4aae-bc48-c9a0517bf888">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<printWhenExpression><![CDATA[$F{codiceUnivoco} != null]]></printWhenExpression>
</reportElement>
<jr:PDF417 xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" moduleWidth="50.0" textPosition="bottom">
<jr:codeExpression><![CDATA[$F{codiceUnivoco}]]></jr:codeExpression>
</jr:PDF417>
</componentElement>
<textField isBlankWhenNull="true">
<reportElement x="8" y="60" width="538" height="20" uuid="17c484f8-1f60-4ac6-bf04-4b1ef031793a">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement textAlignment="Center">
<font fontName="DejaVu Sans"/>
</textElement>
<textFieldExpression><![CDATA[$F{codiceUnivoco}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>

22
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java

@ -151,6 +151,28 @@ public class AvvisoUtil {
return allTipoDocumentoFileTemplateProps; return allTipoDocumentoFileTemplateProps;
} }
public static String getFileTemplateProp(String statoPratica, String tipoProcedura) {
String label = statoPratica;
switch (tipoProcedura) {
// VIArch
case Constants.PROCEDURA_P3:
switch (statoPratica) {
case StatoPraticaConstants.AUTORIZZATA:
case StatoPraticaConstants.CONFORME:
label = "VIARCH2";
break;
case StatoPraticaConstants.INTEGRAZIONE:
label = "VIARCH1";
break;
}
}
switch (statoPratica) {
case StatoPraticaConstants.VIDIMATA:
label = "DP" + tipoProcedura;
}
return allTipoDocumentoFileTemplateProps.get(label);
}
public static Collection<String> getUniqueTipoDocumentoFileTemplateProps() { public static Collection<String> getUniqueTipoDocumentoFileTemplateProps() {
Collection<String> result = new HashSet<>(); Collection<String> result = new HashSet<>();
for (String value : allTipoDocumentoFileTemplateProps.values()) { for (String value : allTipoDocumentoFileTemplateProps.values()) {

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Language.properties

@ -154,6 +154,7 @@ conf.geniocivile.avviso.folder.id.manuale = Cartella Avvisi Manuali
conf.geniocivile.avviso.folder.id.doc_annullamento = Cartella File Annullamento Fascicolo conf.geniocivile.avviso.folder.id.doc_annullamento = Cartella File Annullamento Fascicolo
conf.geniocivile.avviso.folder.id.doc_pagamento = Cartella File Allegati MDB conf.geniocivile.avviso.folder.id.doc_pagamento = Cartella File Allegati MDB
conf.geniocivile.avviso.folder.id.domanda_pdf = Cartella Template Domanda conf.geniocivile.avviso.folder.id.domanda_pdf = Cartella Template Domanda
conf.geniocivile.avviso.folder.id.viarch = Cartella Avvisi VIArch
#Configurazione Templates #Configurazione Templates
conf.geniocivile.template.folder.id = Cartella Template conf.geniocivile.template.folder.id = Cartella Template

84
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
@ -36,14 +36,12 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
import com.liferay.portlet.documentlibrary.util.DLUtil; import com.liferay.portlet.documentlibrary.util.DLUtil;
/** /**
* The extended model implementation for the Avviso service. Represents a row in * The extended model implementation for the Avviso service. Represents a row in the &quot;portos_bo_Avviso&quot;
* the &quot;portos_bo_Avviso&quot; database table, with each column mapped to a * database table, with each column mapped to a property of this class.
* property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Avviso} interface.
* into the {@link it.tref.liferay.portos.bo.model.Avviso} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -55,52 +53,52 @@ public class AvvisoImpl extends AvvisoBaseImpl {
private static final long serialVersionUID = -2350602144741897095L; private static final long serialVersionUID = -2350602144741897095L;
/* /*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a avviso model instance should
* that expect a avviso model instance should use the {@link * use the {@link it.tref.liferay.portos.bo.model.Avviso} interface instead.
* it.tref.liferay.portos.bo.model.Avviso} interface instead.
*/ */
public AvvisoImpl() { public AvvisoImpl() {
} }
@Override
public String getFullDescription() throws PortalException, SystemException { public String getFullDescription() throws PortalException, SystemException {
String fullDescription;
if (Validator.isNull(this.getDescLong())) {
String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil
.getAllTipoDocumento().get(this.getTipoDocumento()) .getAllTipoDocumento().get(this.getTipoDocumento())
: "label.admingeniocivile.avviso.tipoDocumento.avvisomanuale"; : "label.admingeniocivile.avviso.tipoDocumento.avvisomanuale";
fullDescription = LanguageUtil.get(LocaleUtil.ITALIAN, tipoDocumento);
String fullDescription = LanguageUtil.get(LocaleUtil.ITALIAN, tipoDocumento); } else {
fullDescription = this.getDescLong();
}
if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) { if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) {
if (this.getClassName().equals(DettPratica.class.getName())) { if (this.getClassName().equals(DettPratica.class.getName())) {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk()); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk());
if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
.getTipoIntegrazione())) { fullDescription += " di <strong>" + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12")
fullDescription += " di <strong>" + "</strong>";
+ LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") + "</strong>";
} else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica } else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica
.getTipoIntegrazione())) { .getTipoIntegrazione())) {
fullDescription += " di <strong>" fullDescription += " di <strong>" + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05")
+ LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05") + " n° " + " n° " + dettPratica.getIntegrazione() + "</strong>";
+ dettPratica.getIntegrazione() + "</strong>";
} else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { } else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
fullDescription += " di <strong>" fullDescription += " di <strong>" + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-13")
+ LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-13") + " n° " + " n° " + dettPratica.getVarianteNumero() + "</strong>";
+ dettPratica.getVarianteNumero() + "</strong>";
} }
} else if (this.getClassName().equals(FineLavori.class.getName())) { } else if (this.getClassName().equals(FineLavori.class.getName())) {
FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk()); FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk());
fullDescription += " di <strong>" fullDescription += " di <strong>"
+ LanguageUtil.get(LocaleUtil.ITALIAN, + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-"
"label-integrazione-" + (fineLavori.getParziale() ? "09" : "07")) + " n° " + (fineLavori.getParziale() ? "09" : "07")) + " n° " + fineLavori.getNumero()
+ fineLavori.getNumero() + "</strong>"; + "</strong>";
} else if (this.getClassName().equals(Collaudo.class.getName())) { } else if (this.getClassName().equals(Collaudo.class.getName())) {
Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk()); Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk());
fullDescription += " di <strong>" fullDescription += " di <strong>"
+ LanguageUtil.get(LocaleUtil.ITALIAN, + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-"
"label-integrazione-" + (collaudo.getParziale() ? "10" : "08")) + " n° " + (collaudo.getParziale() ? "10" : "08")) + " n° " + collaudo.getNumero() + "</strong>";
+ collaudo.getNumero() + "</strong>";
} }
} else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) {
@ -122,6 +120,7 @@ public class AvvisoImpl extends AvvisoBaseImpl {
return fullDescription; return fullDescription;
} }
@Override
public String getDescriptionOggettoProtocollo() throws PortalException, SystemException { public String getDescriptionOggettoProtocollo() throws PortalException, SystemException {
String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil
@ -134,10 +133,8 @@ public class AvvisoImpl extends AvvisoBaseImpl {
if (this.getClassName().equals(DettPratica.class.getName())) { if (this.getClassName().equals(DettPratica.class.getName())) {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk()); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk());
if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
.getTipoIntegrazione())) { fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") + "";
fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12")
+ "";
} else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica } else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica
.getTipoIntegrazione())) { .getTipoIntegrazione())) {
fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05"); fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05");
@ -147,14 +144,14 @@ public class AvvisoImpl extends AvvisoBaseImpl {
} else if (this.getClassName().equals(FineLavori.class.getName())) { } else if (this.getClassName().equals(FineLavori.class.getName())) {
FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk()); FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk());
fullDescription += " di " fullDescription += " di "
+ LanguageUtil.get(LocaleUtil.ITALIAN, + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-"
"label-integrazione-" + (fineLavori.getParziale() ? "09" : "07")); + (fineLavori.getParziale() ? "09" : "07"));
} else if (this.getClassName().equals(Collaudo.class.getName())) { } else if (this.getClassName().equals(Collaudo.class.getName())) {
Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk()); Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk());
fullDescription += " di " fullDescription += " di "
+ LanguageUtil.get(LocaleUtil.ITALIAN, + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-"
"label-integrazione-" + (collaudo.getParziale() ? "10" : "08")); + (collaudo.getParziale() ? "10" : "08"));
} }
} else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) {
@ -176,18 +173,19 @@ public class AvvisoImpl extends AvvisoBaseImpl {
return fullDescription.replace("Avviso di ", ""); return fullDescription.replace("Avviso di ", "");
} }
@Override
public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException { public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException {
if (Validator.isNotNull(getFileEntryIdInvio())) { if (Validator.isNotNull(getFileEntryIdInvio())) {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getFileEntryIdInvio()); FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getFileEntryIdInvio());
return DLUtil return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true");
.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true");
} }
return null; return null;
} }
@Override
public String translateTipoDocumento() throws PortalException, SystemException { public String translateTipoDocumento() throws PortalException, SystemException {
String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil

47
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerGeneraDocumento.java

@ -49,6 +49,7 @@ public class SchedulerGeneraDocumento implements MessageListener {
private static final int SIZE = 10; private static final int SIZE = 10;
@Override
public void receive(Message message) throws MessageListenerException { public void receive(Message message) throws MessageListenerException {
if (lock.tryLock()) { if (lock.tryLock()) {
@ -56,10 +57,10 @@ public class SchedulerGeneraDocumento implements MessageListener {
try { try {
// campo abilitazione scheduler // campo abilitazione scheduler
for (Company company : CompanyLocalServiceUtil.getCompanies()) { for (Company company : CompanyLocalServiceUtil.getCompanies()) {
String condition = ConfigurazioneLocalServiceUtil.findByC_ChiaveString( String condition = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(company.getCompanyId(),
company.getCompanyId(), ConfigurazioneConstants.SCHEDULER_GENERA_DOCUMENTO); ConfigurazioneConstants.SCHEDULER_GENERA_DOCUMENTO);
_log.debug("SchedulerGeneraDocumento - per company " + company.getCompanyId() _log.debug("SchedulerGeneraDocumento - per company " + company.getCompanyId() + " attivo? "
+ " attivo? " + condition); + condition);
if (Boolean.parseBoolean(condition)) { if (Boolean.parseBoolean(condition)) {
int count = AvvisoLocalServiceUtil.countAvvisiGenerazioneDocumento(); int count = AvvisoLocalServiceUtil.countAvvisiGenerazioneDocumento();
@ -68,8 +69,8 @@ public class SchedulerGeneraDocumento implements MessageListener {
for (int cursor = 0; cursor <= count; cursor += SIZE) { for (int cursor = 0; cursor <= count; cursor += SIZE) {
List<Avviso> avvisi = AvvisoLocalServiceUtil.getAvvisiGenerazioneDocumento( List<Avviso> avvisi = AvvisoLocalServiceUtil.getAvvisiGenerazioneDocumento(cursor,
cursor, cursor + SIZE); cursor + SIZE);
for (Avviso avviso : avvisi) { for (Avviso avviso : avvisi) {
_log.debug("SchedulerGeneraDocumento - avviso " + avviso.getAvvisoId()); _log.debug("SchedulerGeneraDocumento - avviso " + avviso.getAvvisoId());
@ -82,8 +83,7 @@ public class SchedulerGeneraDocumento implements MessageListener {
// bloccato, non esiste file di // bloccato, non esiste file di
// template // template
_log.debug("SchedulerGeneraDocumento - non esiste file template"); _log.debug("SchedulerGeneraDocumento - non esiste file template");
AvvisoLocalServiceUtil.updateAvvisoErrore(avviso.getAvvisoId(), AvvisoLocalServiceUtil.updateAvvisoErrore(avviso.getAvvisoId(), true);
true);
} }
if (fileEntryTemplate != null && avviso.getOldFileEntryIdBase() == 0L) { if (fileEntryTemplate != null && avviso.getOldFileEntryIdBase() == 0L) {
_log.debug("SchedulerGeneraDocumento - inizio genera documento"); _log.debug("SchedulerGeneraDocumento - inizio genera documento");
@ -124,9 +124,10 @@ public class SchedulerGeneraDocumento implements MessageListener {
long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, AvvisoUtil long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, AvvisoUtil
.getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento())); .getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento()));
_log.info("tipoDocumento = " + avviso.getTipoDocumento() + ", prop = "
String fileName = AvvisoLocalServiceUtil.getFileNameAvviso(avviso.getClassPk(), + AvvisoUtil.getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento()));
avviso.getTipoDocumento(), avviso.getAvvisoId(), "B"); String fileName = AvvisoLocalServiceUtil.getFileNameAvviso(avviso.getClassPk(), avviso.getTipoDocumento(),
avviso.getAvvisoId(), "B");
Map<String, Object> parameters = new HashMap<String, Object>(); Map<String, Object> parameters = new HashMap<String, Object>();
if (Validator.isNotNull(avviso.getJsonParameters())) { if (Validator.isNotNull(avviso.getJsonParameters())) {
@ -141,8 +142,7 @@ public class SchedulerGeneraDocumento implements MessageListener {
if (intPratica != null && Validator.isNotNull(intPratica.getStatusByUserId())) { if (intPratica != null && Validator.isNotNull(intPratica.getStatusByUserId())) {
User tecnico = UserLocalServiceUtil.fetchUserById(intPratica.getStatusByUserId()); User tecnico = UserLocalServiceUtil.fetchUserById(intPratica.getStatusByUserId());
if (tecnico != null) { if (tecnico != null) {
parameters.put(WorkflowConstants.WORKFLOW_PARAM_NAME_TECNICO, parameters.put(WorkflowConstants.WORKFLOW_PARAM_NAME_TECNICO, tecnico.getFullName());
tecnico.getFullName());
parameters.put("delegato", tecnico.getFullName()); parameters.put("delegato", tecnico.getFullName());
} }
} }
@ -150,25 +150,11 @@ public class SchedulerGeneraDocumento implements MessageListener {
} }
bean = ReportAvvisoBeanBuilder.build(avviso, parameters); bean = ReportAvvisoBeanBuilder.build(avviso, parameters);
parameters.put(ReportConstants.LOGO_REGIONE, parameters.put(ReportConstants.LOGO_REGIONE, getClass().getResource(ReportConstants.PATH_LOGO_REGIONE)
getClass().getResource(ReportConstants.PATH_LOGO_REGIONE).getPath()); .getPath());
parameters.put(ReportConstants.LOGO_DIPARTIMENTO, parameters.put(ReportConstants.LOGO_DIPARTIMENTO,
getClass().getResource(ReportConstants.PATH_LOGO_DIPARTIMENTO).getPath()); getClass().getResource(ReportConstants.PATH_LOGO_DIPARTIMENTO).getPath());
// avviso = gestioneProtocollazione(avviso, dettPratica);
/*
* Message messageReport = new Message();
* messageReport.put(ReportConstants.FILE_ENTRY_ID_TEMPLATE,
* fileEntryIdTemplate);
* messageReport.put(ReportConstants.FOLDER_ID_REPORT, folderId);
* messageReport.put(ReportConstants.REPORT_NAME, fileName);
* messageReport.put(ReportConstants.SERVICE_CONTEXT,
* serviceContext);
* messageReport.put(ReportConstants.REPORT_PARAMETERS, parameters);
* messageReport.put(ReportConstants.REPORT_DATASOURCE, bean);
*/
ReportDto reportDto = new ReportDto(); ReportDto reportDto = new ReportDto();
reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate }); reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate });
reportDto.setFolderId(folderId); reportDto.setFolderId(folderId);
@ -181,9 +167,6 @@ public class SchedulerGeneraDocumento implements MessageListener {
_log.info("generaDocumento: generateReport: " + fileEntryIdTemplate); _log.info("generaDocumento: generateReport: " + fileEntryIdTemplate);
ReportResultDto result = ReportUtil.generateReport(companyId, userId, reportDto, bean); ReportResultDto result = ReportUtil.generateReport(companyId, userId, reportDto, bean);
idFileEntry = result.getFileEntryIds()[0]; idFileEntry = result.getFileEntryIds()[0];
// idFileEntry = (Long)
// MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SYNC,
// messageReport, 1);
if (Validator.isNotNull(idFileEntry)) { if (Validator.isNotNull(idFileEntry)) {
if (avviso.getTipoAvviso().equalsIgnoreCase(AvvisoUtil.TIPO_AVVISO_DIRETTO)) { if (avviso.getTipoAvviso().equalsIgnoreCase(AvvisoUtil.TIPO_AVVISO_DIRETTO)) {

68
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -43,15 +43,12 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
* The implementation of the allegato manuale local service. * The implementation of the allegato manuale local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.AllegatoManualeLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.AllegatoManualeLocalService}
* interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* checks based on the propagated JAAS credentials because this service can only * credentials because this service can only be accessed from within the same VM.
* be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -63,39 +60,45 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS:
* *
* Never reference this interface directly. Always use {@link * Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.AllegatoManualeLocalServiceUtil} to * it.tref.liferay.portos.bo.service.AllegatoManualeLocalServiceUtil} to access the allegato manuale local service.
* access the allegato manuale local service.
*/ */
@Override
public List<AllegatoManuale> findByIntPratica(long intPraticaId) throws SystemException { public List<AllegatoManuale> findByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualePersistence.findByIntPratica(intPraticaId); return allegatoManualePersistence.findByIntPratica(intPraticaId);
} }
@Override
public List<AllegatoManuale> findByIntPratica(long intPraticaId, int start, int end, public List<AllegatoManuale> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return allegatoManualePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); return allegatoManualePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
} }
@Override
public int countByIntPratica(long intPraticaId) throws SystemException { public int countByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualePersistence.countByIntPratica(intPraticaId); return allegatoManualePersistence.countByIntPratica(intPraticaId);
} }
@Override
public List<AllegatoManuale> findByDettPratica(long dettPraticaId) throws SystemException { public List<AllegatoManuale> findByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualePersistence.findByIntPratica(dettPraticaId); return allegatoManualePersistence.findByIntPratica(dettPraticaId);
} }
@Override
public List<AllegatoManuale> findByDettPratica(long dettPraticaId, int start, int end, public List<AllegatoManuale> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return allegatoManualePersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator); return allegatoManualePersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator);
} }
@Override
public int countByDettPratica(long dettPraticaId) throws SystemException { public int countByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualePersistence.countByIntPratica(dettPraticaId); return allegatoManualePersistence.countByIntPratica(dettPraticaId);
} }
public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, @Override
String descrizione, byte[] content, String sourceFileName, ServiceContext serviceContext) public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione,
throws SystemException, PortalException { byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException,
PortalException {
AllegatoManuale allegatoManuale = allegatoManualePersistence.create(counterLocalService AllegatoManuale allegatoManuale = allegatoManualePersistence.create(counterLocalService
.increment(AllegatoManuale.class.getName())); .increment(AllegatoManuale.class.getName()));
@ -126,8 +129,8 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId()); String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId());
Folder folder = null; Folder folder = null;
try { try {
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
defaultFolder.getFolderId(), folderName); folderName);
} catch (NoSuchFolderException e) { } catch (NoSuchFolderException e) {
// cartella non presente -> creo cartella // cartella non presente -> creo cartella
folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(), folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(),
@ -139,9 +142,9 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
String mimeType = MimeTypesUtil.getContentType(sourceFileName); String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK; String changeLog = StringPool.BLANK;
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog,
mimeType, title, description, changeLog, content, serviceContext); content, serviceContext);
fileEntryId = fileEntry.getFileEntryId(); fileEntryId = fileEntry.getFileEntryId();
allegatoManuale.setFileEntryId(fileEntryId); allegatoManuale.setFileEntryId(fileEntryId);
@ -157,7 +160,7 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
} }
Avviso avviso = avvisoLocalService.addAvviso(intPratica.getIntPraticaId(), descrizione, now, Avviso avviso = avvisoLocalService.addAvviso(intPratica.getIntPraticaId(), descrizione, now,
AvvisoUtil.TIPO_AVVISO_FIRMA, StatoPraticaConstants.INVIO_AVVISO_MANUALE, 0l, dettPraticaId, AvvisoUtil.TIPO_AVVISO_FIRMA, StatoPraticaConstants.INVIO_AVVISO_MANUALE, 0l, dettPraticaId,
DettPratica.class.getName(), codiceFiscalePrimaFirma, fileEntryId, 0l, StringPool.BLANK, 0l, DettPratica.class.getName(), codiceFiscalePrimaFirma, fileEntryId, 0L, StringPool.BLANK, 0L,
serviceContextAvvisi); serviceContextAvvisi);
allegatoManuale.setAvvisoId(avviso.getAvvisoId()); allegatoManuale.setAvvisoId(avviso.getAvvisoId());
@ -168,24 +171,11 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
@Override @Override
public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException { public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException {
// Se si cancella il fileEntryid da qui, va tolto anche nell'avviso
// try {
// if (Validator.isNotNull(allegatoManuale.getFileEntryId())) {
// dlAppLocalService.deleteFileEntry(allegatoManuale.getFileEntryId());
// }
// } catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e)
// {
//
// } catch (PortalException e) {
// throw new SystemException(e);
// }
return super.deleteAllegatoManuale(allegatoManuale); return super.deleteAllegatoManuale(allegatoManuale);
} }
@Override @Override
public AllegatoManuale deleteAllegatoManuale(long allegatoManuale) throws PortalException, public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException {
SystemException { return this.deleteAllegatoManuale(allegatoManualeLocalService.getAllegatoManuale(allegatoManualeId));
return this.deleteAllegatoManuale(allegatoManualeLocalService.getAllegatoManuale(allegatoManuale));
} }
} }

322
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -70,14 +70,12 @@ import com.liferay.util.dao.orm.CustomSQLUtil;
* The implementation of the avviso local service. * The implementation of the avviso local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.AvvisoLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.AvvisoLocalService} interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* checks based on the propagated JAAS credentials because this service can only * credentials because this service can only be accessed from within the same VM.
* be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -86,13 +84,13 @@ import com.liferay.util.dao.orm.CustomSQLUtil;
*/ */
public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* {@link it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil} to * it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil} to access the avviso local service.
* access the avviso local service.
*/ */
private static final Log _log = LogFactoryUtil.getLog(AvvisoLocalServiceImpl.class.getName()); private static final Log _log = LogFactoryUtil.getLog(AvvisoLocalServiceImpl.class.getName());
@Override
public Avviso createStandardAvvisoPratica(IntPratica intPratica, long classPk, String className, public Avviso createStandardAvvisoPratica(IntPratica intPratica, long classPk, String className,
ServiceContext serviceContext, String tipoAvviso, String userCodiceFiscalePrimaFirma, ServiceContext serviceContext, String tipoAvviso, String userCodiceFiscalePrimaFirma,
long controlloPraticaId) throws SystemException, PortalException { long controlloPraticaId) throws SystemException, PortalException {
@ -101,6 +99,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
userCodiceFiscalePrimaFirma, StringPool.BLANK, controlloPraticaId); userCodiceFiscalePrimaFirma, StringPool.BLANK, controlloPraticaId);
} }
@Override
public Avviso createStandardAvvisoPratica(IntPratica intPratica, long classPk, String className, public Avviso createStandardAvvisoPratica(IntPratica intPratica, long classPk, String className,
ServiceContext serviceContext, String tipoAvviso, String userCodiceFiscalePrimaFirma, ServiceContext serviceContext, String tipoAvviso, String userCodiceFiscalePrimaFirma,
String jsonParameters, long controlloPraticaId) throws SystemException, PortalException { String jsonParameters, long controlloPraticaId) throws SystemException, PortalException {
@ -116,95 +115,81 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
} }
} }
String propertiesTemplate = null;
String tipoProcedura = intPratica.getTipoProcedura(); String tipoProcedura = intPratica.getTipoProcedura();
switch (statoPratica) { String propertiesTemplate = AvvisoUtil.getFileTemplateProp(statoPratica, tipoProcedura);
case StatoPraticaConstants.VIDIMATA: long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get( propertiesTemplate);
"DP" + tipoProcedura);
break;
default:
propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(statoPratica);
}
long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(
serviceContext.getCompanyId(), propertiesTemplate);
_log.info("statoPratica=" + statoPratica + ", tipoProcedura=" + tipoProcedura
+ ", propertiesTemplate=" + propertiesTemplate + ", fileEntryIdTemplate="
+ fileEntryIdTemplate);
if (fileEntryIdTemplate != 0) { if (fileEntryIdTemplate != 0) {
return addAvviso(intPratica.getIntPraticaId(), StringPool.BLANK, new Date(), tipoAvviso, return addAvviso(intPratica.getIntPraticaId(), StringPool.BLANK, new Date(), tipoAvviso, statoPratica,
statoPratica, fileEntryIdTemplate, classPk, className, userCodiceFiscalePrimaFirma, fileEntryIdTemplate, classPk, className, userCodiceFiscalePrimaFirma, jsonParameters,
jsonParameters, controlloPraticaId, serviceContext); controlloPraticaId, serviceContext);
} }
} }
return null; return null;
} }
public Avviso createStandardAvvisoPratica(long intPraticaId, String stato, String jsonParameters, @Override
long classPk, String className, ServiceContext serviceContext, String tipoAvviso, public Avviso createStandardAvvisoPratica(long intPraticaId, String stato, String jsonParameters, long classPk,
String userCodiceFiscalePrimaFirma, long controlloPraticaId) throws SystemException, String className, ServiceContext serviceContext, String tipoAvviso, String userCodiceFiscalePrimaFirma,
PortalException { long controlloPraticaId) throws SystemException, PortalException {
IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId);
boolean varianteNonSostanziale = false; boolean varianteNonSostanziale = false;
if (className.equals(DettPratica.class.getName())) { if (className.equals(DettPratica.class.getName())) {
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(classPk); DettPratica dettPratica = dettPraticaLocalService.getDettPratica(classPk);
varianteNonSostanziale = dettPratica.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE) varianteNonSostanziale = dettPratica.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE)
&& !dettPratica.getVarianteSostanziale(); && !dettPratica.getVarianteSostanziale();
} }
String statoPraticaCode = varianteNonSostanziale ? "DPVNS" : PraticaUtil.getStatoPraticaCode(stato, String statoPraticaCode = varianteNonSostanziale ? "DPVNS" : PraticaUtil.getStatoPraticaCode(stato, intPratica);
intPratica); String propertiesTemplate = AvvisoUtil.getFileTemplateProp(statoPraticaCode, intPratica.getTipoProcedura());
String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(statoPraticaCode); long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
propertiesTemplate);
long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong( _log.info("statoPraticaCode=" + statoPraticaCode + ", tipoProcedura=" + intPratica.getTipoProcedura()
serviceContext.getCompanyId(), propertiesTemplate); + ", propertiesTemplate=" + propertiesTemplate + ", fileEntryIdTemplate=" + fileEntryIdTemplate);
return addAvviso(intPraticaId, StringPool.BLANK, new Date(), tipoAvviso, stato, fileEntryIdTemplate, classPk,
_log.info("debugAvviso: " + propertiesTemplate + " (" + statoPraticaCode + ")" className, userCodiceFiscalePrimaFirma, jsonParameters, controlloPraticaId, serviceContext);
+ (varianteNonSostanziale ? " non sostanziale" : ""));
return addAvviso(intPraticaId, StringPool.BLANK, new Date(), tipoAvviso, stato, fileEntryIdTemplate,
classPk, className, userCodiceFiscalePrimaFirma, jsonParameters, controlloPraticaId,
serviceContext);
} }
public Avviso createStandardAvvisoPratica(long intPraticaId, String stato, long classPk, @Override
String className, ServiceContext serviceContext, String tipoAvviso, public Avviso createStandardAvvisoPratica(long intPraticaId, String stato, long classPk, String className,
String userCodiceFiscalePrimaFirma, long controlloPraticaId) throws SystemException, ServiceContext serviceContext, String tipoAvviso, String userCodiceFiscalePrimaFirma,
PortalException { long controlloPraticaId) throws SystemException, PortalException {
return createStandardAvvisoPratica(intPraticaId, stato, null, classPk, className, serviceContext, return createStandardAvvisoPratica(intPraticaId, stato, null, classPk, className, serviceContext, tipoAvviso,
tipoAvviso, userCodiceFiscalePrimaFirma, controlloPraticaId); userCodiceFiscalePrimaFirma, controlloPraticaId);
} }
public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, @Override
String tipoDocumento, long fileEntryIdTemplate, long classPk, String className, public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, String tipoDocumento,
long controlloPraticaId, ServiceContext serviceContext) throws SystemException, PortalException { long fileEntryIdTemplate, long classPk, String className, long controlloPraticaId,
ServiceContext serviceContext) throws SystemException, PortalException {
return addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento, fileEntryIdTemplate, return addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento, fileEntryIdTemplate, classPk,
classPk, className, StringPool.BLANK, StringPool.BLANK, controlloPraticaId, serviceContext); className, StringPool.BLANK, StringPool.BLANK, controlloPraticaId, serviceContext);
} }
public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, @Override
String tipoDocumento, long fileEntryIdTemplate, long classPk, String className, public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, String tipoDocumento,
String userCodiceFiscalePrimaFirma, String jsonParameters, long controlloPraticaId, long fileEntryIdTemplate, long classPk, String className, String userCodiceFiscalePrimaFirma,
ServiceContext serviceContext) throws SystemException, PortalException { String jsonParameters, long controlloPraticaId, ServiceContext serviceContext) throws SystemException,
PortalException {
return addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento, fileEntryIdTemplate, return addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento, fileEntryIdTemplate, classPk,
classPk, className, userCodiceFiscalePrimaFirma, null, 0L, jsonParameters, className, userCodiceFiscalePrimaFirma, null, 0L, jsonParameters, controlloPraticaId, serviceContext);
controlloPraticaId, serviceContext);
} }
public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, @Override
String tipoDocumento, long fileEntryIdTemplate, long classPk, String className, public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, String tipoDocumento,
String userCodiceFiscalePrimaFirma, Long fileEntryIdBase, long fileEntryIdFirma, long fileEntryIdTemplate, long classPk, String className, String userCodiceFiscalePrimaFirma,
String jsonParameters, long controlloPraticaId, ServiceContext serviceContext) Long fileEntryIdBase, long fileEntryIdFirma, String jsonParameters, long controlloPraticaId,
throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
_log.info("addAvviso: descLong=\"" + descLong + "\", tipoAvviso=\"" + tipoAvviso _log.info("addAvviso: intPraticaId=" + intPraticaId + ", descLong=\"" + descLong + "\", dtAvviso=" + dtAvviso
+ "\", tipoDocumento=\"" + tipoDocumento + "\", className=\"" + className + ", tipoAvviso=\"" + tipoAvviso + "\", tipoDocumento=\"" + tipoDocumento + "\", fileEntryIdTemplate="
+ "\", jsonParameters=\"" + jsonParameters + "\", fileEntryIdTemplate=" + fileEntryIdTemplate); + fileEntryIdTemplate + ", classPk=" + classPk + ", className=\"" + className
+ "\", userCodiceFiscalePrimaFirma=\"" + userCodiceFiscalePrimaFirma + "\", fileEntryIdBase="
+ fileEntryIdBase + ", fileEntryIdFirma=" + fileEntryIdFirma + ", jsonParameters=\"" + jsonParameters
+ "\", controlloPraticaId=" + controlloPraticaId + ", serviceContext=\"" + serviceContext + "\"");
if (0 == fileEntryIdTemplate) { if (0 == fileEntryIdTemplate) {
throw new PortalException("fileEntryIdTemplate=" + fileEntryIdTemplate); throw new PortalException("fileEntryIdTemplate=" + fileEntryIdTemplate);
@ -243,6 +228,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return addAvviso(avviso); return addAvviso(avviso);
} }
@Override
public Avviso addAvvisoForImport(String descLong, Date dtAvviso, String tipoAvviso, String tipoDocumento, public Avviso addAvvisoForImport(String descLong, Date dtAvviso, String tipoAvviso, String tipoDocumento,
long fileEntryIdTemplate, long classPk, String className, String userCodiceFiscalePrimaFirma, long fileEntryIdTemplate, long classPk, String className, String userCodiceFiscalePrimaFirma,
long fileEntryIdBase, String jsonParameters, long intPraticaId, long oldAvvisoId, String inviato, long fileEntryIdBase, String jsonParameters, long intPraticaId, long oldAvvisoId, String inviato,
@ -292,6 +278,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return super.addAvviso(avviso); return super.addAvviso(avviso);
} }
@Override
public List<Avviso> search(long[] groupIds, Long classPk, String keywords, int start, int end) public List<Avviso> search(long[] groupIds, Long classPk, String keywords, int start, int end)
throws SystemException { throws SystemException {
@ -300,6 +287,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public int countSearch(long[] groupIds, Long classPk, String keywords) throws SystemException { public int countSearch(long[] groupIds, Long classPk, String keywords) throws SystemException {
return (int) avvisoPersistence.countWithDynamicQuery(searchDynamicQuery(groupIds, classPk, keywords)); return (int) avvisoPersistence.countWithDynamicQuery(searchDynamicQuery(groupIds, classPk, keywords));
@ -330,14 +318,15 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
public List<Avviso> getAvvisiFirmatiByCF(long companyId, String cf, int start, int end) @Override
throws SystemException { public List<Avviso> getAvvisiFirmatiByCF(long companyId, String cf, int start, int end) throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryAvvisiFirmatiByCF(companyId, cf); DynamicQuery dynamicQuery = getDynamicQueryAvvisiFirmatiByCF(companyId, cf);
dynamicQuery.addOrder(OrderFactoryUtil.desc("dtAvviso")); dynamicQuery.addOrder(OrderFactoryUtil.desc("dtAvviso"));
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public int countAvvisiFirmatiByCF(long companyId, String cf) throws SystemException { public int countAvvisiFirmatiByCF(long companyId, String cf) throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryAvvisiFirmatiByCF(companyId, cf); DynamicQuery dynamicQuery = getDynamicQueryAvvisiFirmatiByCF(companyId, cf);
@ -360,6 +349,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public List<Avviso> getAvvisiDaFirmarePrimaFirmaByCF(long companyId, String cf, int start, int end) public List<Avviso> getAvvisiDaFirmarePrimaFirmaByCF(long companyId, String cf, int start, int end)
throws SystemException { throws SystemException {
@ -368,6 +358,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public int countAvvisiDaFirmarePrimaFirmaByCF(long companyId, String cf) throws SystemException { public int countAvvisiDaFirmarePrimaFirmaByCF(long companyId, String cf) throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirmaByCF(companyId, cf); DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirmaByCF(companyId, cf);
@ -427,23 +418,23 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
public List<Avviso> getAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, String cf, @Override
int start, int end) throws SystemException { public List<Avviso> getAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, String cf, int start,
int end) throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirmaByNotCF(companyId, groupIds, cf); DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirmaByNotCF(companyId, groupIds, cf);
dynamicQuery.addOrder(OrderFactoryUtil.desc("dtAvviso")); dynamicQuery.addOrder(OrderFactoryUtil.desc("dtAvviso"));
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
public int countAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, String cf) @Override
throws SystemException { public int countAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, String cf) throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirmaByNotCF(companyId, groupIds, cf); DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirmaByNotCF(companyId, groupIds, cf);
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
} }
private DynamicQuery getDynamicQueryAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, private DynamicQuery getDynamicQueryAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, String cf) {
String cf) {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("companyId").eq(companyId)); dynamicQuery.add(PropertyFactoryUtil.forName("companyId").eq(companyId));
@ -452,8 +443,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
} else { } else {
dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l)); dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l));
} }
dynamicQuery.add(RestrictionsFactoryUtil.not(RestrictionsFactoryUtil.ilike( dynamicQuery.add(RestrictionsFactoryUtil.not(RestrictionsFactoryUtil.ilike("userCodiceFiscalePrimaFirma", cf)));
"userCodiceFiscalePrimaFirma", cf)));
dynamicQuery.add(RestrictionsFactoryUtil.isNotNull("userCodiceFiscalePrimaFirma")); dynamicQuery.add(RestrictionsFactoryUtil.isNotNull("userCodiceFiscalePrimaFirma"));
dynamicQuery.add(RestrictionsFactoryUtil.ne("userCodiceFiscalePrimaFirma", StringPool.BLANK)); dynamicQuery.add(RestrictionsFactoryUtil.ne("userCodiceFiscalePrimaFirma", StringPool.BLANK));
dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdBase").ne(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdBase").ne(0L));
@ -466,6 +456,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public List<Avviso> getAvvisiDaFirmarePrimaFirma(long companyId, long[] groupIds, int start, int end) public List<Avviso> getAvvisiDaFirmarePrimaFirma(long companyId, long[] groupIds, int start, int end)
throws SystemException { throws SystemException {
@ -474,6 +465,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public int countAvvisiDaFirmarePrimaFirma(long companyId, long[] groupIds) throws SystemException { public int countAvvisiDaFirmarePrimaFirma(long companyId, long[] groupIds) throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirma(companyId, groupIds); DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirma(companyId, groupIds);
@ -505,12 +497,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public int countAvvisiGenerazioneDocumento() throws SystemException { public int countAvvisiGenerazioneDocumento() throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiGenerazioneDocumento(); DynamicQuery dynamicQuery = dynamicQueryAvvisiGenerazioneDocumento();
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@Override
public List<Avviso> getAvvisiGenerazioneDocumento(int start, int end) throws SystemException { public List<Avviso> getAvvisiGenerazioneDocumento(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiGenerazioneDocumento(); DynamicQuery dynamicQuery = dynamicQueryAvvisiGenerazioneDocumento();
@ -518,6 +512,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public DynamicQuery dynamicQueryAvvisiGenerazioneDocumento() throws SystemException { public DynamicQuery dynamicQueryAvvisiGenerazioneDocumento() throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
@ -528,12 +523,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public int countAvvisiFirmaDocumento() throws SystemException { public int countAvvisiFirmaDocumento() throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiFirmaDocumento(); DynamicQuery dynamicQuery = dynamicQueryAvvisiFirmaDocumento();
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@Override
public List<Avviso> getAvvisiFirmaDocumento(int start, int end) throws SystemException { public List<Avviso> getAvvisiFirmaDocumento(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiFirmaDocumento(); DynamicQuery dynamicQuery = dynamicQueryAvvisiFirmaDocumento();
@ -541,6 +538,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public DynamicQuery dynamicQueryAvvisiFirmaDocumento() throws SystemException { public DynamicQuery dynamicQueryAvvisiFirmaDocumento() throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
@ -558,12 +556,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public int countAvvisiInvioDocumento() throws SystemException { public int countAvvisiInvioDocumento() throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioDocumento(); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioDocumento();
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@Override
public List<Avviso> getAvvisiInvioDocumento(int start, int end) throws SystemException { public List<Avviso> getAvvisiInvioDocumento(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioDocumento(); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioDocumento();
@ -571,6 +571,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public DynamicQuery dynamicQueryAvvisiInvioDocumento() throws SystemException { public DynamicQuery dynamicQueryAvvisiInvioDocumento() throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
@ -582,12 +583,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public int countAvvisiInvioSignal() throws SystemException { public int countAvvisiInvioSignal() throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(null); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(null);
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@Override
public Avviso getAvvisoInvioSignal(long avvisoId) throws SystemException { public Avviso getAvvisoInvioSignal(long avvisoId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(avvisoId); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(avvisoId);
@ -595,6 +598,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return !avviso.isEmpty() ? avviso.get(0) : null; return !avviso.isEmpty() ? avviso.get(0) : null;
} }
@Override
public List<Avviso> getAvvisiInvioSignal(int start, int end) throws SystemException { public List<Avviso> getAvvisiInvioSignal(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(null); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(null);
@ -602,6 +606,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public DynamicQuery dynamicQueryAvvisiInvioSignal(Long avvisoId) throws SystemException { public DynamicQuery dynamicQueryAvvisiInvioSignal(Long avvisoId) throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
@ -621,12 +626,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public int countAvvisiTempistica() throws SystemException { public int countAvvisiTempistica() throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiTempistica(null); DynamicQuery dynamicQuery = dynamicQueryAvvisiTempistica(null);
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@Override
public Avviso getAvvisoTempistica(long avvisoId) throws SystemException { public Avviso getAvvisoTempistica(long avvisoId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiTempistica(avvisoId); DynamicQuery dynamicQuery = dynamicQueryAvvisiTempistica(avvisoId);
@ -634,6 +641,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return !avviso.isEmpty() ? avviso.get(0) : null; return !avviso.isEmpty() ? avviso.get(0) : null;
} }
@Override
public List<Avviso> getAvvisiTempistica(int start, int end) throws SystemException { public List<Avviso> getAvvisiTempistica(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiTempistica(null); DynamicQuery dynamicQuery = dynamicQueryAvvisiTempistica(null);
@ -641,6 +649,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public DynamicQuery dynamicQueryAvvisiTempistica(Long avvisoId) throws SystemException { public DynamicQuery dynamicQueryAvvisiTempistica(Long avvisoId) throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
@ -655,6 +664,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public Avviso updateAvvisoDlFileEntryFirma(long avvisoId, long fileEntryFirma) throws SystemException { public Avviso updateAvvisoDlFileEntryFirma(long avvisoId, long fileEntryFirma) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -663,8 +673,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
public Avviso updateAvvisoPrimaFirma(long avvisoId, String transactionId) throws PortalException, @Override
SystemException { public Avviso updateAvvisoPrimaFirma(long avvisoId, String transactionId) throws PortalException, SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
if (Validator.isNotNull(avviso.getTransactionIdPrimaFirma())) { if (Validator.isNotNull(avviso.getTransactionIdPrimaFirma())) {
@ -675,6 +685,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso updateAvvisoRollbackPrimaFirma(long avvisoId) throws SystemException { public Avviso updateAvvisoRollbackPrimaFirma(long avvisoId) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -683,6 +694,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso updateAvvisoDlFileEntryIdBase(long avvisoId, long fileEntryIdBase) throws SystemException { public Avviso updateAvvisoDlFileEntryIdBase(long avvisoId, long fileEntryIdBase) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -690,16 +702,17 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
public Avviso updateAvvisoDlFileEntryIdBaseSingola(long avvisoId, long fileEntryIdBase) @Override
throws SystemException { public Avviso updateAvvisoDlFileEntryIdBaseSingola(long avvisoId, long fileEntryIdBase) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
avviso.setFileEntryIdBase(fileEntryIdBase); avviso.setFileEntryIdBase(fileEntryIdBase);
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
public Avviso updateAvvisoDlFileEntryIdBaseAndInvio(long avvisoId, long fileEntryId, @Override
Date dtCreateFileEntryInvio) throws SystemException { public Avviso updateAvvisoDlFileEntryIdBaseAndInvio(long avvisoId, long fileEntryId, Date dtCreateFileEntryInvio)
throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
avviso.setFileEntryIdBase(fileEntryId); avviso.setFileEntryIdBase(fileEntryId);
@ -710,8 +723,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
public Avviso updateAvvisoDlFileEntryIdInvio(long avvisoId, long fileEntryIdInvio, @Override
Date dtCreateFileEntryInvio) throws SystemException { public Avviso updateAvvisoDlFileEntryIdInvio(long avvisoId, long fileEntryIdInvio, Date dtCreateFileEntryInvio)
throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
avviso.setFileEntryIdInvio(fileEntryIdInvio); avviso.setFileEntryIdInvio(fileEntryIdInvio);
@ -720,6 +734,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso updateAvvisoInvio(long avvisoId) throws SystemException { public Avviso updateAvvisoInvio(long avvisoId) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -728,6 +743,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso updateAvvisoErrore(long avvisoId, boolean errore) throws SystemException { public Avviso updateAvvisoErrore(long avvisoId, boolean errore) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -735,6 +751,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso updateAvvisoAnnullato(long avvisoId, boolean annullato) throws SystemException { public Avviso updateAvvisoAnnullato(long avvisoId, boolean annullato) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -742,6 +759,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso updateAvvisoSignal(long avvisoId, Date dtInvioSignal) throws SystemException { public Avviso updateAvvisoSignal(long avvisoId, Date dtInvioSignal) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -749,6 +767,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso updateAvvisoSignal(long avvisoId, boolean signal) throws SystemException { public Avviso updateAvvisoSignal(long avvisoId, boolean signal) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -756,6 +775,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso updateAvvisoTempistica(long avvisoId, Date dtTempistica) throws SystemException { public Avviso updateAvvisoTempistica(long avvisoId, Date dtTempistica) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -763,6 +783,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso updateAvvisoTempistica(long avvisoId, boolean tempistica) throws SystemException { public Avviso updateAvvisoTempistica(long avvisoId, boolean tempistica) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -770,6 +791,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso updateAvvisoProtocollo(long avvisoId, String protocollo) throws SystemException { public Avviso updateAvvisoProtocollo(long avvisoId, String protocollo) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -785,6 +807,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso getAvvisoInvioTecnico(long avvisoId) throws SystemException { public Avviso getAvvisoInvioTecnico(long avvisoId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnico(avvisoId); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnico(avvisoId);
@ -792,12 +815,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisi.isEmpty() ? null : avvisi.get(0); return avvisi.isEmpty() ? null : avvisi.get(0);
} }
@Override
public int countAvvisiInvioTecnico() throws SystemException { public int countAvvisiInvioTecnico() throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnico(null); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnico(null);
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@Override
public List<Avviso> getAvvisiInvioTecnico(int start, int end) throws SystemException { public List<Avviso> getAvvisiInvioTecnico(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnico(null); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnico(null);
@ -809,9 +834,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("inviatoTecnico").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("inviatoTecnico").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento") dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in(
.in(new String[] { StatoPraticaConstants.VIDIMATA, new String[] { StatoPraticaConstants.VIDIMATA, StatoPraticaConstants.INTEGRAZIONE_ACCETTATA }));
StatoPraticaConstants.INTEGRAZIONE_ACCETTATA }));
dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false));
if (Validator.isNotNull(avvisoId)) { if (Validator.isNotNull(avvisoId)) {
@ -820,11 +844,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public Avviso fetchAvvisoByOldAvvisoId(long oldAvvisoId) throws SystemException { public Avviso fetchAvvisoByOldAvvisoId(long oldAvvisoId) throws SystemException {
return avvisoPersistence.fetchByoldAvvisoId(oldAvvisoId); return avvisoPersistence.fetchByoldAvvisoId(oldAvvisoId);
} }
@Override
public Avviso updateAvvisoInviatoTecnico(long avvisoId, boolean inviatoTecnico) throws SystemException { public Avviso updateAvvisoInviatoTecnico(long avvisoId, boolean inviatoTecnico) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -832,26 +858,28 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
public List<Avviso> findByClassPk_tipoDocumento(Long classPk, String tipoDocumento) @Override
throws SystemException { public List<Avviso> findByClassPk_tipoDocumento(Long classPk, String tipoDocumento) throws SystemException {
return avvisoPersistence.findByClassPk_tipoDocumento(classPk, tipoDocumento); return avvisoPersistence.findByClassPk_tipoDocumento(classPk, tipoDocumento);
} }
@Override
public List<Avviso> findByIntPraticaId_tipoDocumento(Long intPraticaId, String tipoDocumento) public List<Avviso> findByIntPraticaId_tipoDocumento(Long intPraticaId, String tipoDocumento)
throws SystemException { throws SystemException {
return avvisoPersistence.findByIntPraticaId_tipoDocumento(intPraticaId, tipoDocumento); return avvisoPersistence.findByIntPraticaId_tipoDocumento(intPraticaId, tipoDocumento);
} }
@Override
public List<Avviso> findByIntPraticaIds_tipoDocumento(long[] intPraticaIds, String tipoDocumento) public List<Avviso> findByIntPraticaIds_tipoDocumento(long[] intPraticaIds, String tipoDocumento)
throws SystemException { throws SystemException {
return avvisoPersistence.findByIntPraticaIds_tipoDocumento(intPraticaIds, tipoDocumento); return avvisoPersistence.findByIntPraticaIds_tipoDocumento(intPraticaIds, tipoDocumento);
} }
public List<Avviso> findByClassPk_ExcludeTipoDocumento(Long classPk, String tipoDocumento) @Override
throws SystemException { public List<Avviso> findByClassPk_ExcludeTipoDocumento(Long classPk, String tipoDocumento) throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.ne("tipoDocumento", tipoDocumento)); dynamicQuery.add(RestrictionsFactoryUtil.ne("tipoDocumento", tipoDocumento));
@ -859,26 +887,28 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery); return avvisoPersistence.findWithDynamicQuery(dynamicQuery);
} }
public List<Avviso> findByIntPratica(long intPraticaId, int start, int end, @Override
OrderByComparator orderByComparator) throws SystemException { public List<Avviso> findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
return avvisoPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); return avvisoPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
} }
@Override
public List<Avviso> findByIntPratica_Inviato(long intPraticaId, String inviato, int start, int end, public List<Avviso> findByIntPratica_Inviato(long intPraticaId, String inviato, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return avvisoPersistence.findByIntPratica_Inviato(intPraticaId, inviato, start, end, return avvisoPersistence.findByIntPratica_Inviato(intPraticaId, inviato, start, end, orderByComparator);
orderByComparator);
} }
@Override
public int countByIntPratica(long intPraticaId) throws SystemException { public int countByIntPratica(long intPraticaId) throws SystemException {
return avvisoPersistence.countByIntPratica(intPraticaId); return avvisoPersistence.countByIntPratica(intPraticaId);
} }
public boolean containsFileEntry(long companyId, long[] groupIds, long fileEntryId) @Override
throws SystemException { public boolean containsFileEntry(long companyId, long[] groupIds, long fileEntryId) throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId));
@ -896,11 +926,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return count > 0; return count > 0;
} }
@Override
public List<Avviso> findByUUID(String uuid, int start, int end) throws SystemException { public List<Avviso> findByUUID(String uuid, int start, int end) throws SystemException {
return avvisoPersistence.findByUuid(uuid, start, end); return avvisoPersistence.findByUuid(uuid, start, end);
} }
@Override
public int countAvvisoByClassPk(long classPk) throws SystemException { public int countAvvisoByClassPk(long classPk) throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
@ -908,6 +940,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@Override
public int countAvvisoByClassPk_ClassName(long classPk, String className) throws SystemException { public int countAvvisoByClassPk_ClassName(long classPk, String className) throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
@ -916,26 +949,28 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@Override
public Avviso findByProtocollo(long companyId, long groupId, String protocollo) throws PortalException, public Avviso findByProtocollo(long companyId, long groupId, String protocollo) throws PortalException,
SystemException { SystemException {
return avvisoPersistence.findByC_G_Protocollo(companyId, groupId, protocollo); return avvisoPersistence.findByC_G_Protocollo(companyId, groupId, protocollo);
} }
@Override
public Avviso fetchByProtocollo(long companyId, long groupId, String protocollo) throws PortalException, public Avviso fetchByProtocollo(long companyId, long groupId, String protocollo) throws PortalException,
SystemException { SystemException {
return avvisoPersistence.fetchByC_G_Protocollo(companyId, groupId, protocollo); return avvisoPersistence.fetchByC_G_Protocollo(companyId, groupId, protocollo);
} }
@Override
public Avviso fetchByProtocollo(String protocollo) throws PortalException, SystemException { public Avviso fetchByProtocollo(String protocollo) throws PortalException, SystemException {
return avvisoPersistence.fetchByProtocollo(protocollo); return avvisoPersistence.fetchByProtocollo(protocollo);
} }
/* /*
* Utilizzato nell'override di update e add per automatizzazione campo * Utilizzato nell'override di update e add per automatizzazione campo signal (default false)
* signal (default false)
*/ */
private void updateSignalAndTempistica(Avviso avviso) { private void updateSignalAndTempistica(Avviso avviso) {
@ -954,6 +989,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
avviso.setTempistica(tempistica); avviso.setTempistica(tempistica);
} }
@Override
public Avviso fetchLastAvvisoByIntPraticaPerStatoFinale(long intPraticaId) throws SystemException { public Avviso fetchLastAvvisoByIntPraticaPerStatoFinale(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
@ -965,8 +1001,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.AUTORIZZATA)); disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.AUTORIZZATA));
disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.NON_AUTORIZZATA)); disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.NON_AUTORIZZATA));
disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.INTEGRAZIONE)); disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.INTEGRAZIONE));
disjunction.add(RestrictionsFactoryUtil disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.PREAVVISO_CONTRARIO));
.eq("tipoDocumento", StatoPraticaConstants.PREAVVISO_CONTRARIO));
disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.ANNULLATA)); disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.ANNULLATA));
dynamicQuery.add(disjunction); dynamicQuery.add(disjunction);
dynamicQuery.addOrder(OrderFactoryUtil.desc("avvisoId")); dynamicQuery.addOrder(OrderFactoryUtil.desc("avvisoId"));
@ -979,6 +1014,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
} }
@Override
public List<Avviso> getListaAvvisiPerApplet(String codFisc) throws SystemException { public List<Avviso> getListaAvvisiPerApplet(String codFisc) throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
@ -990,11 +1026,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery); return avvisoPersistence.findWithDynamicQuery(dynamicQuery);
} }
@Override
public Map<String, String> getAllTipoDocumentoFolderProps() { public Map<String, String> getAllTipoDocumentoFolderProps() {
return AvvisoUtil.getAllTipoDocumentoFolderProps(); return AvvisoUtil.getAllTipoDocumentoFolderProps();
} }
@Override
public String getFileNameAvviso(long classPk, String tipoDocumento, Long idAvviso, String doc) { public String getFileNameAvviso(long classPk, String tipoDocumento, Long idAvviso, String doc) {
// boolean docBase, boolean docFirma, boolean docControfirma // boolean docBase, boolean docFirma, boolean docControfirma
@ -1008,14 +1046,15 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
// } // }
String filename = StringUtils.leftPad(String.valueOf(classPk), 10, '0') String filename = StringUtils.leftPad(String.valueOf(classPk), 10, '0')
+ (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento + (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK)
: StringPool.BLANK) + StringPool.UNDERLINE + doc + StringPool.UNDERLINE + StringPool.UNDERLINE + doc + StringPool.UNDERLINE
+ (Validator.isNotNull(idAvviso) ? idAvviso : System.currentTimeMillis()); + (Validator.isNotNull(idAvviso) ? idAvviso : System.currentTimeMillis());
return filename; return filename;
} }
@Override
public Avviso rilasciaFirma(long avvisoId) throws SystemException { public Avviso rilasciaFirma(long avvisoId) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -1027,6 +1066,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public Avviso assegnaFirma(long avvisoId, String cf) throws SystemException { public Avviso assegnaFirma(long avvisoId, String cf) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
@ -1038,6 +1078,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@Override
public List<Avviso> getAvvisiWithOldFileEntryIdInvio(int start, int end) throws SystemException { public List<Avviso> getAvvisiWithOldFileEntryIdInvio(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class);
@ -1047,6 +1088,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.dynamicQuery(dynamicQuery, start, end); return avvisoLocalService.dynamicQuery(dynamicQuery, start, end);
} }
@Override
public List<Avviso> getAvvisiWithOldFileEntryIdBase(int start, int end) throws SystemException { public List<Avviso> getAvvisiWithOldFileEntryIdBase(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class);
@ -1056,8 +1098,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.dynamicQuery(dynamicQuery, start, end); return avvisoLocalService.dynamicQuery(dynamicQuery, start, end);
} }
public List<Avviso> getAvvisiRifiutatiByControlloPraticaId(long controlloPraticaId) @Override
throws SystemException { public List<Avviso> getAvvisiRifiutatiByControlloPraticaId(long controlloPraticaId) throws SystemException {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class);
dynamicQuery.add(RestrictionsFactoryUtil.eq("controlloPraticaId", controlloPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("controlloPraticaId", controlloPraticaId));
@ -1068,6 +1110,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoLocalService.dynamicQuery(dynamicQuery); return avvisoLocalService.dynamicQuery(dynamicQuery);
} }
@Override
public Avviso addFileFirmato(long avvisoId, long classPk, String fileToSave, ServiceContext serviceContext) public Avviso addFileFirmato(long avvisoId, long classPk, String fileToSave, ServiceContext serviceContext)
throws Exception { throws Exception {
@ -1075,8 +1118,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
// DettPratica dettPratica = // DettPratica dettPratica =
// DettPraticaLocalServiceUtil.fetchDettPratica(dettPraticaId); // DettPraticaLocalServiceUtil.fetchDettPratica(dettPraticaId);
long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(avviso.getCompanyId(), long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(avviso.getCompanyId(), avvisoLocalService
avvisoLocalService.getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento())); .getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento()));
String fileName = getFileNameAvviso(classPk, avviso.getTipoDocumento(), avviso.getAvvisoId(), "F"); String fileName = getFileNameAvviso(classPk, avviso.getTipoDocumento(), avviso.getAvvisoId(), "F");
@ -1086,17 +1129,15 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
if (Validator.isNotNull(folder)) { if (Validator.isNotNull(folder)) {
byte[] bytes = Base64.decode(fileToSave); byte[] bytes = Base64.decode(fileToSave);
FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(avviso.getUserId(), FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(avviso.getUserId(), folder.getRepositoryId(),
folder.getRepositoryId(), folderId, fileName, folderId, fileName, MimeTypesUtil.getContentType(fileName + ".p7m"), fileName + ".p7m", "", "",
MimeTypesUtil.getContentType(fileName + ".p7m"), fileName + ".p7m", "", "", bytes, bytes, serviceContext);
serviceContext);
avviso.setFileEntryIdInvio(fileEntry.getFileEntryId()); avviso.setFileEntryIdInvio(fileEntry.getFileEntryId());
avviso = avvisoLocalService.updateAvviso(avviso); avviso = avvisoLocalService.updateAvviso(avviso);
if (Validator.isNull(avviso.getProtocollo())) { if (Validator.isNull(avviso.getProtocollo())) {
String protocollo = ProtocollazioneUtil.protocollaPartenza(avviso, String protocollo = ProtocollazioneUtil.protocollaPartenza(avviso, fileEntry.getFileEntryId());
fileEntry.getFileEntryId());
avviso = avvisoLocalService.updateAvvisoProtocollo(avviso.getAvvisoId(), protocollo); avviso = avvisoLocalService.updateAvvisoProtocollo(avviso.getAvvisoId(), protocollo);
} }
@ -1111,8 +1152,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
} }
public List<Avviso> protocolliSearch(String dataDa, String dataA, String numeroProtocollo, int start, @Override
int end) throws ParseException, SystemException { public List<Avviso> protocolliSearch(String dataDa, String dataA, String numeroProtocollo, int start, int end)
throws ParseException, SystemException {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
@ -1156,8 +1198,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
} }
if ((numeroProtocollo != null && !numeroProtocollo.equals("")) if ((numeroProtocollo != null && !numeroProtocollo.equals("")) || (dataDa != null && !dataDa.equals(""))
|| (dataDa != null && !dataDa.equals("")) || (dataA != null && !dataA.equals(""))) { || (dataA != null && !dataA.equals(""))) {
Order defaultOrder = OrderFactoryUtil.asc("dtProtocollo"); Order defaultOrder = OrderFactoryUtil.asc("dtProtocollo");
query.addOrder(defaultOrder); query.addOrder(defaultOrder);
@ -1168,8 +1210,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return lista; return lista;
} }
public int countProtocolliSearch(String dataDa, String dataA, String numeroProtocollo) @Override
throws SystemException, ParseException { public int countProtocolliSearch(String dataDa, String dataA, String numeroProtocollo) throws SystemException,
ParseException {
int count = 0; int count = 0;
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
@ -1212,14 +1255,15 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
} }
if ((numeroProtocollo != null && !numeroProtocollo.equals("")) if ((numeroProtocollo != null && !numeroProtocollo.equals("")) || (dataDa != null && !dataDa.equals(""))
|| (dataDa != null && !dataDa.equals("")) || (dataA != null && !dataA.equals(""))) { || (dataA != null && !dataA.equals(""))) {
count = (int) avvisoPersistence.countWithDynamicQuery(query); count = (int) avvisoPersistence.countWithDynamicQuery(query);
} }
return count; return count;
} }
@Override
public List<Avviso> getAvvisiPerAggiuntaProtocollo(int start, int end) throws SystemException { public List<Avviso> getAvvisiPerAggiuntaProtocollo(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAggiuntaProtocollo(); DynamicQuery dynamicQuery = dynamicQueryAggiuntaProtocollo();
@ -1227,6 +1271,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public DynamicQuery dynamicQueryAggiuntaProtocollo() throws SystemException { public DynamicQuery dynamicQueryAggiuntaProtocollo() throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
@ -1241,6 +1286,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public List<Avviso> findByClassPk(long classPk) throws SystemException { public List<Avviso> findByClassPk(long classPk) throws SystemException {
return avvisoPersistence.findByClassPk(classPk); return avvisoPersistence.findByClassPk(classPk);
@ -1253,6 +1299,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
/** /**
* ADT * ADT
*/ */
@Override
public int countAvvisiInvioTecnicoNew() throws SystemException { public int countAvvisiInvioTecnicoNew() throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null);
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
@ -1262,6 +1309,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
* ADT * ADT
* *
*/ */
@Override
public List<Avviso> getAvvisiInvioTecnicoNew(int start, int end) throws SystemException { public List<Avviso> getAvvisiInvioTecnicoNew(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null);
@ -1283,8 +1331,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("inviatoTecnico").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("inviatoTecnico").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in( dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in(
new String[] { StatoPraticaConstants.SOTTOPOSTA_A_PARERE, new String[] { StatoPraticaConstants.SOTTOPOSTA_A_PARERE, StatoPraticaConstants.CAMBIO_ISTRUTTORE }));
StatoPraticaConstants.CAMBIO_ISTRUTTORE }));
dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false));
if (Validator.isNotNull(avvisoId)) { if (Validator.isNotNull(avvisoId)) {
@ -1311,6 +1358,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
* @return * @return
* @throws SystemException * @throws SystemException
*/ */
@Override
public Avviso getAvvisoVidimazione(long intPraticaId, long dettPraticaID) throws SystemException { public Avviso getAvvisoVidimazione(long intPraticaId, long dettPraticaID) throws SystemException {
DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery(); DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery();
@ -1340,12 +1388,12 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
* @return * @return
* @throws SystemException * @throws SystemException
*/ */
@Override
public Avviso getLastAvvisoIntegrazione(long intPraticaId) throws SystemException { public Avviso getLastAvvisoIntegrazione(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery(); DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento") dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in(
.in(new String[] { StatoPraticaConstants.INTEGRAZIONE, new String[] { StatoPraticaConstants.INTEGRAZIONE, StatoPraticaConstants.PREAVVISO_CONTRARIO }));
StatoPraticaConstants.PREAVVISO_CONTRARIO }));
dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdProtocollo").ne(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdProtocollo").ne(0L));
dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false));

7
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java

@ -607,7 +607,12 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
jsonObject.put("esito", jsonArray); jsonObject.put("esito", jsonArray);
JSONObject etichette = JSONFactoryUtil.createJSONObject(); JSONObject etichette = JSONFactoryUtil.createJSONObject();
etichette.put("label", "Attiva VIArch"); etichette.put("label", "Attiva VIArch");
etichette.put("value", StatoPraticaConstants.VIARCH); etichette.put("value", StatoPraticaConstants.INTEGRAZIONE);
etichette.put("default", false);
jsonArray.put(etichette);
etichette = JSONFactoryUtil.createJSONObject();
etichette.put("label", "Concludi VIArch");
etichette.put("value", StatoPraticaConstants.CONFORME);
etichette.put("default", false); etichette.put("default", false);
jsonArray.put(etichette); jsonArray.put(etichette);
etichette = JSONFactoryUtil.createJSONObject(); etichette = JSONFactoryUtil.createJSONObject();

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=portos_bo build.namespace=portos_bo
build.number=2915 build.number=2932
build.date=1616068476446 build.date=1616496884713
build.auto.upgrade=true build.auto.upgrade=true
## ##

202
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/avvisi/view.jsp

@ -1,221 +1,135 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.util.AvvisoUtil"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%>
<%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%> <%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%>
<%@page import="com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil"%> <%@page import="com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.AvvisoUtil"%>
<%@ include file="/html/avvisi/init.jsp" %> <%@ include file="/html/avvisi/init.jsp" %>
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0l); long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0L);
List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica(intPraticaId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
%> %>
<liferay-ui:search-container emptyResultsMessage="no-entries-were-found" orderByType="desc" orderByCol="createDate">
<liferay-ui:search-container-results results="<%= avvisi %>" total="<%= avvisi.size() %>" />
<liferay-ui:search-container <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Avviso" modelVar="avviso">
emptyResultsMessage="no-entries-were-found" <liferay-ui:search-container-column-text cssClass="text-nowrap" name="Data"
orderByType="desc" orderByCol="createDate" value="<%= dateFormatDate.format(avviso.getDtAvviso()) %>" />
>
<liferay-ui:search-container-results
results="<%=AvvisoLocalServiceUtil.findByIntPratica(intPraticaId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null) %>"
total="<%=AvvisoLocalServiceUtil.countByIntPratica(intPraticaId)%>"
>
</liferay-ui:search-container-results>
<liferay-ui:search-container-row
className="it.tref.liferay.portos.bo.model.Avviso"
modelVar="avviso"
>
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Data" value="<%= dateFormatDate.format(avviso.getDtAvviso()) %>" />
<liferay-ui:search-container-column-text name="Tipo Documento"> <liferay-ui:search-container-column-text name="Tipo Documento">
<%= avviso.getFullDescription() %> <%= avviso.getFullDescription() %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Firma In Corso" cssClass="text-nowrap"> <liferay-ui:search-container-column-text name="Firma In Corso" cssClass="text-nowrap">
<%= avviso.getFirmaInCorso() ? "Si" : "No" %> <%= avviso.getFirmaInCorso() ? "Sì" : "No" %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Inviato" cssClass="text-nowrap" value='<%= avviso.getInviato().equalsIgnoreCase("S") ? "Si" : "No"%>'/> <liferay-ui:search-container-column-text name="Inviato" cssClass="text-nowrap"
<liferay-ui:search-container-column-text name="Data Invio" cssClass="text-nowrap" value='<%= Validator.isNotNull(avviso.getDtInvio()) ? dateFormatDate.format(avviso.getDtInvio()) : ""%>'/> value='<%= avviso.getInviato().equalsIgnoreCase(AvvisoUtil.DOCUMENTO_INVIATO) ? "Sì" : "No" %>'/>
<liferay-ui:search-container-column-text name="Data Invio" cssClass="text-nowrap"
value='<%= Validator.isNotNull(avviso.getDtInvio()) ? dateFormatDate.format(avviso.getDtInvio())
: StringPool.BLANK %>'/>
<liferay-ui:search-container-column-text name="Doc Base" cssClass="text-nowrap"> <liferay-ui:search-container-column-text name="Doc Base" cssClass="text-nowrap">
<liferay-ui:icon-menu icon="" showExpanded="true" showWhenSingleIcon="true" cssClass="text-center">
<liferay-ui:icon-menu icon="" showExpanded="<%=true%>" showWhenSingleIcon="<%=true%>" cssClass="text-center">
<% <%
if(Validator.isNotNull(avviso.getFileEntryIdBase())){ if (Validator.isNotNull(avviso.getFileEntryIdBase())) {
%> %>
<liferay-portlet:renderURL var="previewURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL var="previewURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="fileEntryId" value="<%= String.valueOf(avviso.getFileEntryIdBase()) %>" /> <liferay-portlet:param name="fileEntryId"
value="<%= String.valueOf(avviso.getFileEntryIdBase()) %>" />
<liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<div title="Visualizza" class="tooltip-info" style="display: inline-block;"> <div title="Visualizza" class="tooltip-info" style="display: inline-block;">
<liferay-ui:icon id='<%=renderResponse.getNamespace()+"open_base_"+avviso.getAvvisoId() %>' <liferay-ui:icon id='<%= renderResponse.getNamespace() + "open_base_" + avviso.getAvvisoId() %>'
linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" url="<%= previewURL %>"
url="<%=previewURL%>" useDialog="true" useDialog="true" />
/>
</div> </div>
<% <%
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(avviso.getFileEntryIdBase()); FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(avviso.getFileEntryIdBase());
String downloadUrl = DLUtil.getPreviewURL(fileEntry, fileEntry.getLatestFileVersion(), themeDisplay, "&download=true"); String downloadUrl = DLUtil.getPreviewURL(fileEntry, fileEntry.getLatestFileVersion(), themeDisplay,
"&download=true");
%> %>
<div title="Scarica" class="tooltip-info" style="display: inline-block;"> <div title="Scarica" class="tooltip-info" style="display: inline-block;">
<liferay-ui:icon <liferay-ui:icon
id='<%=renderResponse.getNamespace()+"download_base_"+avviso.getAvvisoId() %>' linkCssClass="btn btn-action btn-primary" iconCssClass="fa fa-download" url="<%=downloadUrl%>"/> id='<%= renderResponse.getNamespace() + "download_base_" + avviso.getAvvisoId() %>'
linkCssClass="btn btn-action btn-primary" iconCssClass="fa fa-download"
url="<%= downloadUrl %>" />
</div> </div>
<%
} else if(Validator.isNull(avviso.getFileEntryIdInvio()) && Validator.isNotNull(avviso.getOldAvvisoId())){
String avvisoId = String.valueOf(avviso.getAvvisoId());
String className = Avviso.class.getName();
%>
<liferay-util:include page="/html/common/import_window.jsp" servletContext="<%= application %>" >
<liferay-util:param name="classPk" value="<%= avvisoId %>"></liferay-util:param>
<liferay-util:param name="className" value="<%= className %>"></liferay-util:param>
<liferay-util:param name="tooltip" value="Scarica"></liferay-util:param>
<liferay-util:param name="classButton" value="btn-primary"></liferay-util:param>
</liferay-util:include>
<% <%
} }
%> %>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Doc Protocollo" cssClass="text-nowrap"> <liferay-ui:search-container-column-text name="Doc Protocollo" cssClass="text-nowrap">
<liferay-ui:icon-menu icon="" showExpanded="true" showWhenSingleIcon="false" cssClass="text-center">
<liferay-ui:icon-menu icon="" showExpanded="<%=true %>" showWhenSingleIcon="<%=false%>" cssClass="text-center">
<% <%
if(Validator.isNotNull(avviso.getFileEntryIdProtocollo())){ if (Validator.isNotNull(avviso.getFileEntryIdProtocollo())) {
%> %>
<liferay-portlet:renderURL var="protocolloPreviewURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL var="protocolloPreviewURL"
<liferay-portlet:param name="fileEntryId" value="<%= String.valueOf(avviso.getFileEntryIdProtocollo()) %>" /> windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="fileEntryId"
value="<%= String.valueOf(avviso.getFileEntryIdProtocollo()) %>" />
<liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<div title="Visualizza" class="tooltip-info" style="display: inline-block;"> <div title="Visualizza" class="tooltip-info" style="display: inline-block;">
<liferay-ui:icon id='<%=renderResponse.getNamespace()+"open_protocollo_"+avviso.getAvvisoId() %>' <liferay-ui:icon
id='<%= renderResponse.getNamespace() + "open_protocollo_" + avviso.getAvvisoId() %>'
linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard"
url="<%= protocolloPreviewURL %>" useDialog="true" url="<%= protocolloPreviewURL %>" useDialog="true" />
/>
</div> </div>
<% <%
FileEntry fileEntryProtocollo = DLAppLocalServiceUtil.getFileEntry(avviso.getFileEntryIdProtocollo()); FileEntry fileEntryProtocollo = DLAppLocalServiceUtil.getFileEntry(avviso.getFileEntryIdProtocollo());
String protocolloDownloadUrl = DLUtil.getPreviewURL(fileEntryProtocollo, fileEntryProtocollo.getLatestFileVersion(), themeDisplay, "&download=true"); String protocolloDownloadUrl = DLUtil.getPreviewURL(fileEntryProtocollo,
fileEntryProtocollo.getLatestFileVersion(), themeDisplay, "&download=true");
%> %>
<div title="Scarica" class="tooltip-info" style="display: inline-block;"> <div title="Scarica" class="tooltip-info" style="display: inline-block;">
<liferay-ui:icon id='<%=renderResponse.getNamespace()+"download_protocollo_"+avviso.getAvvisoId() %>' <liferay-ui:icon id='<%= renderResponse.getNamespace() + "download_protocollo_" + avviso.getAvvisoId() %>'
linkCssClass="btn btn-action btn-primary" iconCssClass="fa fa-download" linkCssClass="btn btn-action btn-primary" iconCssClass="fa fa-download"
url="<%= protocolloDownloadUrl %>" url="<%= protocolloDownloadUrl %>" />
/>
</div> </div>
<% <%
} }
%> %>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Doc Inviato" cssClass="text-nowrap"> <liferay-ui:search-container-column-text name="Doc Inviato" cssClass="text-nowrap">
<liferay-ui:icon-menu icon="" showExpanded="true" showWhenSingleIcon="true" cssClass="text-center">
<liferay-ui:icon-menu icon="" showExpanded="<%=true %>" showWhenSingleIcon="<%=true%>" cssClass="text-center">
<% <%
if(Validator.isNotNull(avviso.getFileEntryIdInvio())){ if (Validator.isNotNull(avviso.getFileEntryIdInvio())) {
%> %>
<liferay-portlet:renderURL var="invioPreviewURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL var="invioPreviewURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="fileEntryId" value="<%= String.valueOf(avviso.getFileEntryIdInvio()) %>" /> <liferay-portlet:param name="fileEntryId" value="<%= String.valueOf(avviso.getFileEntryIdInvio()) %>" />
<liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<div title="Visualizza" class="tooltip-info" style="display: inline-block;"> <div title="Visualizza" class="tooltip-info" style="display: inline-block;">
<liferay-ui:icon id='<%=renderResponse.getNamespace()+"open_invio_"+avviso.getAvvisoId() %>' <liferay-ui:icon id='<%= renderResponse.getNamespace() + "open_invio_" + avviso.getAvvisoId() %>'
linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" url="<%= invioPreviewURL %>"
url="<%=invioPreviewURL%>" useDialog="true" useDialog="true" />
/>
</div> </div>
<% <%
FileEntry fileEntryInvio = DLAppLocalServiceUtil.getFileEntry(avviso.getFileEntryIdInvio()); FileEntry fileEntryInvio = DLAppLocalServiceUtil.getFileEntry(avviso.getFileEntryIdInvio());
String invioDownloadUrl = DLUtil.getPreviewURL(fileEntryInvio, fileEntryInvio.getLatestFileVersion(), themeDisplay, "&download=true"); String invioDownloadUrl = DLUtil.getPreviewURL(fileEntryInvio, fileEntryInvio.getLatestFileVersion(),
themeDisplay, "&download=true");
%> %>
<div title="Scarica" class="tooltip-info" style="display: inline-block;"> <div title="Scarica" class="tooltip-info" style="display: inline-block;">
<liferay-ui:icon id='<%=renderResponse.getNamespace()+"download_invio_"+avviso.getAvvisoId() %>' linkCssClass="btn btn-action btn-primary" iconCssClass="fa fa-download" url="<%= invioDownloadUrl %>"/> <liferay-ui:icon id='<%= renderResponse.getNamespace() + "download_invio_" + avviso.getAvvisoId() %>'
</div> linkCssClass="btn btn-action btn-primary" iconCssClass="fa fa-download"
<% url="<%= invioDownloadUrl %>" />
} else if(Validator.isNull(avviso.getFileEntryIdInvio()) && Validator.isNotNull(avviso.getOldAvvisoId())){
String avvisoId = String.valueOf(avviso.getAvvisoId());
String className = Avviso.class.getName();
/* String random = StringUtil.randomId();
String buttonId = "eventButton"+random;
String contentId = "contentDiv"+random;
String titleId = "Importazione File"; */
%>
<%-- <div title="Scarica" class="tooltip-info" style="display: inline-block;">
<liferay-ui:icon
id="<%= buttonId %>"
url='javascript:void(0)'
linkCssClass="btn btn-action btn-primary"
iconCssClass="fa fa-download"
message="download-del-documento"
label="true"
target="_blank"
/>
</div>
<div id="<portlet:namespace /><%= contentId %>" class="hide text-center" >
<p>File non ancora importato</p>
<p>Processo in corso...</p>
<p>Si prega di attendere qualche minuto</p>
<div class="content_loader">
<svg width="64px" height="64px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="lds-double-ring">
<circle cx="50" cy="50" ng-attr-r="{{config.radius}}" ng-attr-stroke-width="{{config.width}}" ng-attr-stroke="{{config.c1}}" ng-attr-stroke-dasharray="{{config.dasharray}}" fill="none" stroke-linecap="round" r="40" stroke-width="4" stroke="#cd2325" stroke-dasharray="62.83185307179586 62.83185307179586" transform="rotate(68 50 50)">
<animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;360 50 50" keyTimes="0;1" dur="1.5s" begin="0s" repeatCount="indefinite"></animateTransform>
</circle>
<circle cx="50" cy="50" ng-attr-r="{{config.radius2}}" ng-attr-stroke-width="{{config.width}}" ng-attr-stroke="{{config.c2}}" ng-attr-stroke-dasharray="{{config.dasharray2}}" ng-attr-stroke-dashoffset="{{config.dashoffset2}}" fill="none" stroke-linecap="round" r="35" stroke-width="4" stroke="#241312" stroke-dasharray="54.97787143782138 54.97787143782138" stroke-dashoffset="54.97787143782138" transform="rotate(-68 50 50)">
<animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;-360 50 50" keyTimes="0;1" dur="1.5s" begin="0s" repeatCount="indefinite"></animateTransform>
</circle>
</svg>
</div>
</div> </div>
<liferay-portlet:resourceURL id="importFile" var="importFileURL"/>
<%
String function = "A.io.request('"+importFileURL+"',{data: {"+renderResponse.getNamespace()+"classPk: "+avvisoId+", "+renderResponse.getNamespace()+"className: '"+className+"'},"+
"dataType: 'json',on: {failure: function() {alert('impossibile importare il file allegato...');},success: function(event, id, obj) {var response = this.get('responseData');content.html(response)}}});";
%>
<liferay-util:include page="/html/common/import_window.jsp" servletContext="<%= application %>" >
<liferay-util:param name="titolo" value="<%= titleId %>"></liferay-util:param>
<liferay-util:param name="buttonId" value="<%=buttonId%>"></liferay-util:param>
<liferay-util:param name="contentDiv" value="<%=contentId%>"></liferay-util:param>
<liferay-util:param name="function" value="<%= function %>"></liferay-util:param>
</liferay-util:include> --%>
<liferay-util:include page="/html/common/import_window.jsp" servletContext="<%= application %>" >
<liferay-util:param name="classPk" value="<%= avvisoId %>"></liferay-util:param>
<liferay-util:param name="className" value="<%= className %>"></liferay-util:param>
<liferay-util:param name="tooltip" value="Scarica"></liferay-util:param>
<liferay-util:param name="classButton" value="btn-primary"></liferay-util:param>
</liferay-util:include>
<% <%
} }
%> %>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
</liferay-ui:search-container-row> </liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="false" />
<liferay-ui:search-iterator paginate="<%= false %>" />
</liferay-ui:search-container> </liferay-ui:search-container>
<script type="text/javascript"> <script type="text/javascript">
YUI().use( YUI().use('aui-tooltip', function(Y) {
'aui-tooltip', new Y.TooltipDelegate({
function(Y) {
new Y.TooltipDelegate(
{
trigger: '.tooltip-info', trigger: '.tooltip-info',
position: 'top', position: 'top',
cssClass: 'tooltip-help', cssClass: 'tooltip-help',
html: true, html: true,
opacity: 1 opacity: 1
} });
); });
}
);
</script> </script>

225
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp

@ -1,169 +1,175 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@page import="java.util.Comparator"%>
<%@page import="java.util.Comparator"%>
<%@page import="java.util.Collections"%> <%@page import="java.util.Collections"%>
<%@page import="com.liferay.portal.model.Organization"%> <%@page import="java.util.Comparator"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@include file="/html/fascicolo/init.jsp"%>
<%@include file="/html/fascicolo/init.jsp" %>
<style> <style>
.praticaApertaContainer{ .praticaApertaContainer{
margin-top : 8%; margin-top: 8%;
} }
</style> </style>
<%
<% String comune = ParamUtil.getString(request, "comune");
String comune = ParamUtil.getString(request, "comune"); String provinciaJS = ParamUtil.getString(request, "provinciaJS");
String provinciaJS = ParamUtil.getString(request, "provinciaJS"); %>
<liferay-ui:panel title="filters" defaultState="closed"
%> id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>' collapsible="true" extended="false"
persistState="true">
<liferay-ui:panel title="filters" defaultState="closed"
id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>'
collapsible="<%= true %>" extended="<%= false %>" persistState="<%= true %>">
<div class="container-fluid" style="padding: 15px;"> <div class="container-fluid" style="padding: 15px;">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="numeroProgetto" label="Numero Progetto"/> <aui:input type="text" name="numeroProgetto" label="Numero Progetto" />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="protocollo" label="Protocollo"/> <aui:input type="text" name="protocollo" label="Protocollo" />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:select name="tipoPratica" label="Tipo Pratica"> <aui:select name="tipoPratica" label="Tipo Pratica">
<aui:option value="-1">Seleziona il tipo di pratica</aui:option> <aui:option value="-1">Seleziona il tipo di pratica</aui:option>
<aui:option value="01"><liferay-ui:message key="deposito"/></aui:option> <aui:option value="01"><liferay-ui:message key="deposito"/></aui:option>
<aui:option value="02"><liferay-ui:message key="autorizzazione"/></aui:option> <aui:option value="02"><liferay-ui:message key="autorizzazione"/></aui:option>
<aui:option value="03"><liferay-ui:message key="sanatoria"/></aui:option> <aui:option value="03"><liferay-ui:message key="sanatoria"/></aui:option>
<aui:option value="sorteggio"><liferay-ui:message key="sorteggiata"/></aui:option>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:select name="statoPratica" label="Stato Procedimento"> <aui:select name="statoPratica" label="Stato Procedimento">
<aui:option value="-1">Stato Pratica</aui:option> <aui:option value="-1">Stato Pratica</aui:option>
<!-- ADT BUG-ID=15 Sezione Ricerca / Filtro Stato Pratica --> <aui:option value="<%= StatoPraticaConstants.ANNULLATA %>">
<%-- <aui:option value="VI"><liferay-ui:message key="vidimata"/></aui:option> --%> <liferay-ui:message key="annullata"/>
<%-- <aui:option value="RI"><liferay-ui:message key="rifiutata"/></aui:option> --%> </aui:option>
<%-- <aui:option value="SO"><liferay-ui:message key="sorteggiata"/></aui:option> --%> <aui:option value="<%= StatoPraticaConstants.AUTORIZZATA %>">
<liferay-ui:message key="autorizzata"/>
<aui:option value="<%= StatoPraticaConstants.ANNULLATA %>"><liferay-ui:message key="annullata"/></aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.AUTORIZZATA %>"><liferay-ui:message key="autorizzata"/></aui:option> <aui:option value="<%= StatoPraticaConstants.NON_AUTORIZZATA %>">
<aui:option value="<%= StatoPraticaConstants.NON_AUTORIZZATA %>"><liferay-ui:message key="non autorizzata"/></aui:option> <liferay-ui:message key="non autorizzata"/>
<aui:option value="<%= StatoPraticaConstants.COLLAUDO %>"><liferay-ui:message key="collaudo"/></aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>"><liferay-ui:message key="collaudo parziale"/></aui:option> <aui:option value="<%= StatoPraticaConstants.COLLAUDO %>">
<aui:option value="<%= StatoPraticaConstants.CONFORME %>"><liferay-ui:message key="conforme"/></aui:option> <liferay-ui:message key="collaudo"/>
<aui:option value="<%= StatoPraticaConstants.NON_CONFORME %>"><liferay-ui:message key="non conforme"/></aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI %>"><liferay-ui:message key="fine lavori"/></aui:option> <aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>">
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI_PARZIALE %>"><liferay-ui:message key="fine lavori parziali"/></aui:option> <liferay-ui:message key="collaudo parziale"/>
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>"><liferay-ui:message key="integrazione in corso"/></aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.CONFORME %>">
<liferay-ui:message key="conforme"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.NON_CONFORME %>">
<liferay-ui:message key="non conforme"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI %>">
<liferay-ui:message key="fine lavori"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI_PARZIALE %>">
<liferay-ui:message key="fine lavori parziali"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">
<liferay-ui:message key="integrazione in corso"/>
</aui:option>
<aui:option value="sospesa"><liferay-ui:message key="sospesa"/></aui:option> <aui:option value="sospesa"><liferay-ui:message key="sospesa"/></aui:option>
<aui:option value="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE %>"><liferay-ui:message key="sottoposta a parere"/></aui:option> <aui:option value="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE %>">
<aui:option value="VA"><liferay-ui:message key="variata"/></aui:option> <liferay-ui:message key="sottoposta a parere"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.VARIATA %>">
<liferay-ui:message key="variata"/>
</aui:option>
</aui:select> </aui:select>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6"> <div class="col-xs-12 col-md-6">
<aui:input <aui:input label="Descrizione Intervento" name="descIntervento" type="text" placeholder="" />
label="Descrizione Intervento"
name="descIntervento" type="text" placeholder="" />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:select name="tipoIntervento" label="Tipo Intervento"> <aui:select name="tipoIntervento" label="Tipo Intervento">
<aui:option value="-1">Tipo Intervento</aui:option> <aui:option value="-1">Tipo Intervento</aui:option>
<aui:option value="interventoLocale"><liferay-ui:message key="Intervento Locale"/></aui:option> <aui:option value="interventoLocale"><liferay-ui:message key="Intervento Locale" /></aui:option>
<aui:option value="miglioramento"><liferay-ui:message key="Miglioramento Sismico"/></aui:option> <aui:option value="miglioramento"><liferay-ui:message key="Miglioramento Sismico" /></aui:option>
<aui:option value="adeguamento"><liferay-ui:message key="Adeguamento Sismico"/></aui:option> <aui:option value="adeguamento"><liferay-ui:message key="Adeguamento Sismico" /></aui:option>
<aui:option value="nuovaCostruzione"><liferay-ui:message key="Nuova Costruzione"/></aui:option> <aui:option value="nuovaCostruzione"><liferay-ui:message key="Nuova Costruzione" /></aui:option>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:column cssClass="praticaApertaContainer"> <aui:column cssClass="praticaApertaContainer">
<span style="font-weight: bold;">Pratica Aperta : </span> <span style="font-weight: bold;">Pratica Aperta : </span>
<aui:input checked="true" inlineField="true" type="radio" name="praticaAperta" value="tutte" label="Tutte"/> <aui:input checked="true" inlineField="true" type="radio" name="praticaAperta" value="tutte"
<aui:input inlineField="true" type="radio" name="praticaAperta" value="aperta" label="Si"/> label="Tutte" />
<aui:input inlineField="true" type="radio" name="praticaAperta" value="chiusa" label="No"/> <aui:input inlineField="true" type="radio" name="praticaAperta" value="aperta" label="Sì" />
<aui:input inlineField="true" type="radio" name="praticaAperta" value="chiusa" label="No" />
</aui:column> </aui:column>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:select name="provincia" label="Provincia" cssClass="provinciaSelect"> <aui:select name="provincia" label="Provincia" cssClass="provinciaSelect">
<aui:option value="000"> </aui:option> <aui:option value="000"> </aui:option>
<% <%
List<String> province = TerritorioLocalServiceUtil.getActiveProvince(); List<String> province = TerritorioLocalServiceUtil.getActiveProvince();
//ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro //ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro
List<Provincia> provinceList = new ArrayList<Provincia>(); List<Provincia> provinceList = new ArrayList<Provincia>();
for (String codiceProvincia : province) { for (String codiceProvincia : province) {
Provincia provinciaToStamp = ProvinciaLocalServiceUtil.fetchByC_C(company.getCompanyId(), codiceProvincia); Provincia provinciaToStamp = ProvinciaLocalServiceUtil.fetchByC_C(company.getCompanyId(),
codiceProvincia);
provinceList.add(provinciaToStamp); provinceList.add(provinciaToStamp);
} }
Collections.sort(provinceList, new Comparator<Provincia>() {
Collections.sort(provinceList, new Comparator<Provincia>(){
public int compare(Provincia o1, Provincia o2){ public int compare(Provincia o1, Provincia o2){
return o1.getProvincia().compareTo(o2.getProvincia()); return o1.getProvincia().compareTo(o2.getProvincia());
} }
}); });
for (Provincia provincia : provinceList) { for (Provincia provincia : provinceList) {
%> %>
<aui:option value="<%=provincia.getCodiceProvincia() %>" ><%=provincia.getProvincia() %></aui:option> <aui:option value="<%= provincia.getCodiceProvincia() %>">
<%= provincia.getProvincia() %>
</aui:option>
<% <%
} }
%> %>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:select name="comune" label="Comune" cssClass="comuneSelect"> <aui:select name="comune" label="Comune" cssClass="comuneSelect">
<aui:option value="000"></aui:option> <aui:option value="000" />
<% <%
if(provinciaJS != null && !provinciaJS.equals("") && !provinciaJS.equals("000")){ if (Validator.isNotNull(provinciaJS) && !provinciaJS.equals("000")) {
List<Long> comuni = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaJS); List<Long> comuni = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaJS);
for (long comuneId : comuni) { for (long comuneId : comuni) {
Comune comuneToStamp = ComuneLocalServiceUtil.getComune(comuneId); Comune comuneToStamp = ComuneLocalServiceUtil.getComune(comuneId);
%> %>
<aui:option value="<%=comuneToStamp.getComuneId()%>"><%=comuneToStamp.getDenominazione()%></aui:option> <aui:option value="<%= comuneToStamp.getComuneId() %>">
<%= comuneToStamp.getDenominazione() %>
</aui:option>
<% <%
} }
} }
%> %>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="indirizzo" label="Indirizzo"/> <aui:input type="text" name="indirizzo" label="Indirizzo" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="tecnicoIstruttore" label="Tecnico Istruttore"/> <aui:input type="text" name="tecnicoIstruttore" label="Tecnico Istruttore" />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="titolareDigitale" label="Titolare Digitale"/> <aui:input type="text" name="titolareDigitale" label="Titolare Digitale" />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="committente" label="Committente"/> <aui:input type="text" name="committente" label="Committente" />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="soggettiInterconnessi" label="Soggetti Interconnessi"/> <aui:input type="text" name="soggettiInterconnessi" label="Soggetti Interconnessi" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4"> <div class="col-xs-12 col-md-4">
<aui:field-wrapper label="Data richiesta da" inlineField="<%= true %>"> <aui:field-wrapper label="Data richiesta da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaInizio" /> <liferay-util:param name="field" value="dataRichiestaInizio" />
</liferay-util:include> </liferay-util:include>
</aui:field-wrapper> </aui:field-wrapper>
<aui:field-wrapper label="a" inlineField="<%= true %>"> <aui:field-wrapper label="a" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaFine" /> <liferay-util:param name="field" value="dataRichiestaFine" />
</liferay-util:include> </liferay-util:include>
@ -171,16 +177,16 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4"> <div class="col-xs-12 col-md-4">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6"> <div class="col-xs-12 col-md-6">
<aui:select name="ordinaPer" label="Ordina Per"> <aui:select name="ordinaPer" label="Ordina Per">
<aui:option selected="true" value="numeroProgetto">Numero Progetto</aui:option> <aui:option selected="true" value="numeroProgetto">Numero Progetto</aui:option>
<aui:option value="protocollo">Protocollo</aui:option> <aui:option value="protocollo">Protocollo</aui:option>
<aui:option value="dataCreazione">Data Invio</aui:option> <aui:option value="dataCreazione">Data Invio</aui:option>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6"> <div class="col-xs-12 col-md-6">
<aui:select name="ordinaTipo" label="Tipo Ordine"> <aui:select name="ordinaTipo" label="Tipo Ordine">
<aui:option selected="true" value="dec">Dec</aui:option> <aui:option selected="true" value="dec">Dec</aui:option>
<aui:option value="asc">Asc</aui:option> <aui:option value="asc">Asc</aui:option>
@ -189,65 +195,48 @@
</div> </div>
</div> </div>
</div> </div>
<aui:button type="submit" value="search" /> <aui:button type="submit" value="search" />
</div> </div>
</liferay-ui:panel>
</liferay-ui:panel>
<liferay-portlet:resourceURL id="comuni" var="getComuniURL" /> <liferay-portlet:resourceURL id="comuni" var="getComuniURL" />
<aui:script use="aui-base, aui-io-request"> <aui:script use="aui-base, aui-io-request">
var getComuni = function(provinciaId, comuneId, comuneValue) { var getComuni = function(provinciaId, comuneId, comuneValue) {
var comuneSelect = A.one("#"+comuneId); var comuneSelect = A.one("#"+comuneId);
if (provinciaId == "" || provinciaId == "000") {
if(provinciaId == "" || provinciaId == "000"){
comuneSelect.html("<option value='000' label=''></option>") comuneSelect.html("<option value='000' label=''></option>")
comuneSelect.addClass("disabled").set("disabled", true); comuneSelect.addClass("disabled").set("disabled", true);
} else { } else {
A.io.request( A.io.request('<%= getComuniURL %>', {
'<%= getComuniURL %>',
{
data: { data: {
<portlet:namespace />provinciaId: provinciaId <portlet:namespace />provinciaId: provinciaId
},dataType: 'json', },
dataType: 'json',
on: { on: {
success: function() { success: function() {
var response = this.get('responseData'); var response = this.get('responseData');
comuneSelect.html("<option value='000' label=''></option>") comuneSelect.html("<option value='000' label=''></option>")
for( index in response ){ for (index in response) {
var code ='<option value="'+response[index].comuneId+'" label="'+response[index].descLong+'" class="comuneItem" '+(comuneValue==response[index].comuneId ? "selected=\"true\"" : "")+'>'+response[index].descLong+'</option>'; var code = '<option value="' + response[index].comuneId + '" label="' + response[index].descLong
+ '" class="comuneItem" ' + (comuneValue==response[index].comuneId ? "selected=\"true\""
: "")
+ '>' + response[index].descLong + '</option>';
comuneSelect.append(code); comuneSelect.append(code);
} }
if (provinciaId != "" && provinciaId != "000") {
if(provinciaId!="" && provinciaId!="000" ){
comuneSelect.removeClass("disabled").set("disabled", false); comuneSelect.removeClass("disabled").set("disabled", false);
} }
} }
} }
} });
);
} }
}; };
A.ready(function() {
A.ready(function(){ A.one(".provinciaSelect").on('change', function(event) {
A.one(".provinciaSelect").on('change', function(event){
var provinciaId = event.currentTarget.get('value'), var provinciaId = event.currentTarget.get('value'),
comuneId = event.currentTarget.attr("id").replace("provincia","comune"), comuneId = event.currentTarget.attr("id").replace("provincia","comune"),
comuneValue = "000"; comuneValue = "000";
getComuni(provinciaId, comuneId, comuneValue) getComuni(provinciaId, comuneId, comuneValue)
}); });
}); });
</aui:script> </aui:script>

23
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_avvisi.jsp

@ -1,24 +1,19 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@ include file="/html/fascicolo/init.jsp" %> <%@include file="/html/fascicolo/init.jsp"%>
<liferay-util:include page="/html/fascicolo/navigator/header.jsp" servletContext="<%=application %>"/> <liferay-util:include page="/html/fascicolo/navigator/header.jsp" servletContext="<%= application %>"/>
<h2 class="fasciolo_page_title"><liferay-ui:message key="page_avvisi"></liferay-ui:message></h2> <h2 class="fasciolo_page_title"><liferay-ui:message key="page_avvisi" /></h2>
<% <%
DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica.lastData"); DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica.lastData");
IntPratica intPratica = (IntPratica)request.getAttribute("bean.intPratica"); IntPratica intPratica = (IntPratica) request.getAttribute("bean.intPratica");
%> %>
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-12 fascicolo-avvisi-tab"> <div class="col-sm-12 fascicolo-avvisi-tab">
<liferay-util:include page="/html/avvisi/view.jsp" servletContext="<%= application %>">
<liferay-util:include page="/html/avvisi/view.jsp" servletContext="<%=application %>"> <liferay-util:param name="intPraticaId" value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" />
<liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"/>
</liferay-util:include> </liferay-util:include>
</div> </div>
</div> </div>
</div> </div>

22
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf

@ -28,9 +28,8 @@
<%@page import="it.tref.liferay.portos.bo.util.WorkflowUtil"%> <%@page import="it.tref.liferay.portos.bo.util.WorkflowUtil"%>
<%@page import="java.util.List"%> <%@page import="java.util.List"%>
<% <%
String rowUrl = StringPool.BLANK;
//ADT - BUG-12 Aggiunta colonna Data Esito //ADT - BUG-12 Aggiunta colonna Data Esito
String currentTab = (String)request.getAttribute("tabs1"); String currentTab = (String) request.getAttribute("tabs1");
//Informazioni relative alla pratica //Informazioni relative alla pratica
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica.getIntPraticaId());
DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId()); DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId());
@ -40,14 +39,11 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP
ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId()); ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId());
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica.getTerritorioId());
Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId()); Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId());
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia());
//Informazioni relative al workflow //Informazioni relative al workflow
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(
controlloPratica.getCompanyId(), controlloPratica.getGroupId(), ControlloPratica.class.getName(), controlloPratica.getCompanyId(), controlloPratica.getGroupId(), ControlloPratica.class.getName(),
controlloPratica.getPrimaryKey()); controlloPratica.getPrimaryKey());
List<WorkflowTask> listaTask = null; List<WorkflowTask> listaTask = null;
WorkflowInstance workflowInstance = null; WorkflowInstance workflowInstance = null;
if (workflowInstanceLink != null) { if (workflowInstanceLink != null) {
@ -87,10 +83,7 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Esito"> <liferay-ui:search-container-column-text name="Esito">
<% <%= ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()) %>
String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId());
out.print(LanguageUtil.get(pageContext, tipoEsito));
%>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<%-- ADT - BUG-12 Aggiunta colonna Data Esito --%> <%-- ADT - BUG-12 Aggiunta colonna Data Esito --%>
<c:if test='<%= "Tab_TaskCompletati".equals(currentTab) %>'> <c:if test='<%= "Tab_TaskCompletati".equals(currentTab) %>'>
@ -131,7 +124,7 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP
if (tecnico != null) { if (tecnico != null) {
out.print(tecnico.getFullName()); out.print(tecnico.getFullName());
} else { } else {
out.print(" [" + intPratica.getStatusByUserId() + StringPool.CLOSE_BRACKET); out.print(StringPool.OPEN_BRACKET + intPratica.getStatusByUserId() + StringPool.CLOSE_BRACKET);
} }
%> %>
</c:if> </c:if>
@ -152,13 +145,9 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP
User approvatore = UserLocalServiceUtil.fetchUser(workflowTask.getAssigneeUserId()); User approvatore = UserLocalServiceUtil.fetchUser(workflowTask.getAssigneeUserId());
if (approvatore!=null) { if (approvatore!=null) {
out.print(approvatore.getFullName()); out.print(approvatore.getFullName());
} else {
if (workflowTask.getAssigneeUserId() == -1) {
out.print( " [Portos 1]");
} else { } else {
out.print( " [" + workflowTask.getAssigneeUserId() + StringPool.CLOSE_BRACKET); out.print( " [" + workflowTask.getAssigneeUserId() + StringPool.CLOSE_BRACKET);
} }
}
out.print(" (" + workflowTask.getName() + StringPool.CLOSE_PARENTHESIS); out.print(" (" + workflowTask.getName() + StringPool.CLOSE_PARENTHESIS);
%> %>
</c:if> </c:if>
@ -172,10 +161,7 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP
<%= provincia.getProvincia() + " - " + comune.getDenominazione() %> <%= provincia.getProvincia() + " - " + comune.getDenominazione() %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="GG*" cssClass="text-center"> <liferay-ui:search-container-column-text name="GG*" cssClass="text-center">
<% <%= ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId()) %>
long days = ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId());
%>
<%= days %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-jsp path="/html/gestioneattivita/action_button.jsp" align="right" <liferay-ui:search-container-column-jsp path="/html/gestioneattivita/action_button.jsp" align="right"
cssClass="text-center"/> cssClass="text-center"/>

46
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns_completed.jspf

@ -1,19 +1,20 @@
<%@page import="java.text.DateFormat"%>
<%@page import="java.util.Locale"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%> <%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%>
<%@page import="com.liferay.portal.model.User"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil"%>
<%@page import="com.liferay.portal.workflow.kaleo.service.KaleoInstanceLocalServiceUtil"%>
<%@page import="com.liferay.portal.workflow.kaleo.model.KaleoInstance"%>
<%@page import="java.text.DateFormat"%>
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="it.tref.liferay.portos.bo.util.WorkflowUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.impl.DettPraticaLocalServiceImpl"%> <%@page import="it.tref.liferay.portos.bo.util.WorkflowUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SorteggioLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.User"%>
<%@page import="java.util.concurrent.TimeUnit"%> <%@page import="java.util.concurrent.TimeUnit"%>
<%@page import="java.util.Date"%> <%@page import="java.util.Date"%>
<%@page import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.Provincia"%> <%@page import="it.tref.liferay.portos.bo.model.Provincia"%>
@ -33,7 +34,13 @@
<%@page import="com.liferay.portal.model.WorkflowInstanceLink"%> <%@page import="com.liferay.portal.model.WorkflowInstanceLink"%>
<%@page import="com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil"%> <%@page import="com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil"%>
<% <%
String rowUrl = StringPool.BLANK; ControlloPratica controlloPratica = null;
Locale locale = null;
DateFormat dateFormatDate = null;
String tabs1 = null;
String tabNames = null;
String rowUrl = StringPool.BLANK;
%> %>
<% <%
@ -99,27 +106,14 @@ IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPrat
<liferay-ui:search-container-column-text name="Esito"> <liferay-ui:search-container-column-text name="Esito">
<% <%
if(workflowInstanceId != 0){ if (workflowInstanceId != 0) {
String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()); String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId());
out.print(tipoEsito); out.print(tipoEsito);
} }
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<%-- <liferay-ui:search-container-column-text name="Sorteggiata">
<%
/*boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId())!=null;
String clazz = StringPool.BLANK;
if(sorteggiata){
out.print("<span><i class=\"relative fa fa-check-square txt-green\"></i></span>");
}*/
%>
</liferay-ui:search-container-column-text> --%>
<liferay-ui:search-container-column-text name="Pratica"> <liferay-ui:search-container-column-text name="Pratica">
<% <%
DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId()); DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId());
if(lastDettPratica != null){ if(lastDettPratica != null){
long lastDettPraticaId = lastDettPratica.getDettPraticaId(); long lastDettPraticaId = lastDettPratica.getDettPraticaId();
@ -201,7 +195,7 @@ IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPrat
long diff = now.getTime() - data.getTime(); long diff = now.getTime() - data.getTime();
long days = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS); long days = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);
%> %>
<%=days %> <%= days %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<c:if test='<%= !tabs1.equals(StringUtil.split(tabNames)[3]) %>'> <c:if test='<%= !tabs1.equals(StringUtil.split(tabNames)[3]) %>'>

BIN
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/commons-logging.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/log4j.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-bridges.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-java.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-taglib.jar

File binario non mostrato.

3
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/liferay-plugin-package.properties

@ -10,4 +10,5 @@ author=Liferay, Inc.
licenses=LGPL licenses=LGPL
liferay-versions=6.2.0+ liferay-versions=6.2.0+
required-deployment-contexts=\ required-deployment-contexts=\
portos-bo-portlet portos-bo-portlet,\
portos-kaleo-web

309
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/scheduler/SchedulerKaleoController.java

@ -3,14 +3,6 @@ package it.tref.liferay.portos.kaleo.controller.scheduler;
import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.kaleo.controller.model.KaleoInstance;
import it.tref.liferay.portos.kaleo.controller.model.KaleoInstanceToken;
import it.tref.liferay.portos.kaleo.controller.model.KaleoTaskAssignmentInstance;
import it.tref.liferay.portos.kaleo.controller.model.KaleoTaskInstanceToken;
import it.tref.liferay.portos.kaleo.controller.service.KaleoInstanceLocalServiceUtil;
import it.tref.liferay.portos.kaleo.controller.service.KaleoInstanceTokenLocalServiceUtil;
import it.tref.liferay.portos.kaleo.controller.service.KaleoTaskAssignmentInstanceLocalServiceUtil;
import it.tref.liferay.portos.kaleo.controller.service.KaleoTaskInstanceTokenLocalServiceUtil;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
@ -26,7 +18,6 @@ import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
import com.liferay.portal.kernel.dao.orm.Order; import com.liferay.portal.kernel.dao.orm.Order;
import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil; import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil;
import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.messaging.Message; import com.liferay.portal.kernel.messaging.Message;
@ -36,7 +27,6 @@ import com.liferay.portal.kernel.workflow.WorkflowInstance;
import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil; import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil;
import com.liferay.portal.model.User; import com.liferay.portal.model.User;
public class SchedulerKaleoController implements MessageListener { public class SchedulerKaleoController implements MessageListener {
private static final Log _log = LogFactoryUtil.getLog(SchedulerKaleoController.class); private static final Log _log = LogFactoryUtil.getLog(SchedulerKaleoController.class);
@ -45,155 +35,86 @@ public class SchedulerKaleoController implements MessageListener {
@Override @Override
public void receive(Message message) throws MessageListenerException { public void receive(Message message) throws MessageListenerException {
if (lock.tryLock()) { if (lock.tryLock()) {
try { try {
// Riparazione pratiche con workflow sporco
//Riparazione pratiche con workflow sporco
//riparaLifecycleWorkflow();
riparaLifecycleWorkflowNew(); riparaLifecycleWorkflowNew();
} catch (Exception e) { } catch (Exception e) {
_log.error(e,e); _log.error(e, e);
}finally{ } finally {
lock.unlock(); lock.unlock();
} }
} }
} }
/*private void riparaLifecycleWorkflow() throws SystemException{
List<Object[]> lista = IntPraticaLocalServiceUtil.riparaWorkflow();
for (Object[] objs : lista) {
long kaleotaskinstancetokenid = Long.parseLong(String.valueOf(objs[0]));
long kaleoinstancetokenid = Long.parseLong(String.valueOf(objs[1]));
long controllopraticaid = Long.parseLong(String.valueOf(objs[2]));
long statusbyuserid = Long.parseLong(String.valueOf(objs[3]));
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica(controllopraticaid);
DynamicQuery queryKIT = DynamicQueryFactoryUtil.forClass(KaleoTaskInstanceToken.class);
queryKIT.add(RestrictionsFactoryUtil.eq("classPK", controllopraticaid));
Order defaultOrderDettPrtatica = OrderFactoryUtil.asc("createDate");
queryKIT.addOrder(defaultOrderDettPrtatica);
List<KaleoTaskInstanceToken> listas = KaleoTaskInstanceTokenLocalServiceUtil.dynamicQuery(queryKIT);
if(listas != null && !listas.isEmpty()){
KaleoTaskInstanceToken ktit = listas.get(0);
DynamicQuery queryKAT = DynamicQueryFactoryUtil.forClass(KaleoTaskAssignmentInstance.class);
queryKAT.add(RestrictionsFactoryUtil.eq("kaleoTaskInstanceTokenId", ktit.getKaleoTaskInstanceTokenId()));
List<KaleoTaskAssignmentInstance> listass = KaleoTaskAssignmentInstanceLocalServiceUtil.dynamicQuery(queryKAT);
if(listass != null && !listass.isEmpty()){
KaleoTaskAssignmentInstance assignmentInstanceApp = listass.get(0);
long kaleoTaskAssignementInstanceId = assignmentInstanceApp.getKaleoTaskAssignmentInstanceId() + 1;
// long kaleoTaskAssignementInstanceId = KaleoTaskAssignmentInstanceLocalServiceUtil.getLastKaleoTaskAssignmentInstanceId();
// KaleoTaskAssignmentInstance app = KaleoTaskAssignmentInstanceLocalServiceUtil.fetchKaleoTaskAssignmentInstance(kaleoTaskAssignementInstanceId);
// if(app != null){
// kaleoTaskAssignementInstanceId = KaleoTaskAssignmentInstanceLocalServiceUtil.getLastKaleoTaskAssignmentInstanceId();
// }
KaleoTaskAssignmentInstance assignmentInstance = KaleoTaskAssignmentInstanceLocalServiceUtil.createKaleoTaskAssignmentInstance(
kaleoTaskAssignementInstanceId);
assignmentInstance.setCreateDate(assignmentInstanceApp.getCreateDate());
assignmentInstance.setModifiedDate(assignmentInstanceApp.getModifiedDate());
assignmentInstance.setModifiedDate(assignmentInstanceApp.getModifiedDate());
assignmentInstance.setGroupId(assignmentInstanceApp.getGroupId());
assignmentInstance.setCompanyId(assignmentInstanceApp.getCompanyId());
assignmentInstance.setUserId(assignmentInstanceApp.getUserId());
assignmentInstance.setUserName(assignmentInstanceApp.getUserName());
assignmentInstance.setKaleoDefinitionId(assignmentInstanceApp.getKaleoDefinitionId());
assignmentInstance.setKaleoInstanceId(assignmentInstanceApp.getKaleoInstanceId());
assignmentInstance.setKaleoInstanceTokenId(kaleoinstancetokenid);
assignmentInstance.setKaleoTaskInstanceTokenId(kaleotaskinstancetokenid);
assignmentInstance.setKaleoTaskId(21642L);
assignmentInstance.setKaleoTaskName("Esito");
assignmentInstance.setAssigneeClassName(User.class.getName());
assignmentInstance.setAssigneeClassPK(statusbyuserid);
assignmentInstance.setCompleted(false);
KaleoTaskAssignmentInstanceLocalServiceUtil.updateKaleoTaskAssignmentInstance(assignmentInstance);
if(controlloPratica != null){
_log.debug("Pulisco Workflow ed indicizzo per intPraticaId=" + controlloPratica.getIntPraticaId());
IntPraticaLocalServiceUtil.reIndexFasciolo(controlloPratica.getIntPraticaId(), controlloPratica.getCompanyId());
}
}
}
}
}
*/
/** /**
* ADT * ADT
* @throws Exception
*
*
*
*/ */
private void riparaLifecycleWorkflowNew() throws Exception { private void riparaLifecycleWorkflowNew() throws Exception {
List<Object[]> listaKO=new ArrayList<Object[]>(); List<Object[]> listaKO = new ArrayList<Object[]>();
List<Object[]> lista = IntPraticaLocalServiceUtil.riparaWorkflow(); List<Object[]> lista = IntPraticaLocalServiceUtil.riparaWorkflow();
for (Object[] objs : lista) { for (Object[] objs : lista) {
long kaleotaskinstancetokenid = Long.parseLong(String.valueOf(objs[0])); long kaleotaskinstancetokenid = Long.parseLong(String.valueOf(objs[0]));
long kaleoinstancetokenid = Long.parseLong(String.valueOf(objs[1])); long kaleoinstancetokenid = Long.parseLong(String.valueOf(objs[1]));
long controllopraticaid = (objs[2]!=null)? Long.parseLong(String.valueOf(objs[2])):0; long controllopraticaid = (objs[2] != null) ? Long.parseLong(String.valueOf(objs[2])) : 0;
long statusbyuserid = Long.parseLong(String.valueOf(objs[3])); long statusbyuserid = Long.parseLong(String.valueOf(objs[3]));
_log.info("RIPARA_WORKFLOW inizio lavorazione -- controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid); _log.info("RIPARA_WORKFLOW inizio lavorazione -- controllopraticaid=" + controllopraticaid
+ " statusbyuserid=" + statusbyuserid + " kaleoinstancetokenid=" + kaleoinstancetokenid
+ " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid);
if (controllopraticaid==0){ if (controllopraticaid == 0) {
_log.info("RIPARA_WORKFLOW KO controllopraticaid non valorizzato ="+controllopraticaid); _log.info("RIPARA_WORKFLOW KO controllopraticaid non valorizzato =" + controllopraticaid);
continue; continue;
} }
try{ try {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica(controllopraticaid); ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
.fetchControlloPratica(controllopraticaid);
DynamicQuery queryKIT = DynamicQueryFactoryUtil.forClass(KaleoTaskInstanceToken.class); DynamicQuery queryKIT = DynamicQueryFactoryUtil.forClass(KaleoTaskInstanceToken.class);
queryKIT.add(RestrictionsFactoryUtil.eq("classPK", controllopraticaid)); queryKIT.add(RestrictionsFactoryUtil.eq("classPK", controllopraticaid));
Order defaultOrderDettPrtatica = OrderFactoryUtil.asc("createDate"); Order defaultOrderDettPrtatica = OrderFactoryUtil.asc("createDate");
queryKIT.addOrder(defaultOrderDettPrtatica); queryKIT.addOrder(defaultOrderDettPrtatica);
List<KaleoTaskInstanceToken> listas = KaleoTaskInstanceTokenLocalServiceUtil.dynamicQuery(queryKIT); List<KaleoTaskInstanceToken> listas = KaleoTaskInstanceTokenLocalServiceUtil.dynamicQuery(queryKIT);
if(listas != null && !listas.isEmpty()){ if (listas != null && !listas.isEmpty()) {
KaleoTaskInstanceToken ktit =null; KaleoTaskInstanceToken ktit = null;
for (KaleoTaskInstanceToken k:listas){ for (KaleoTaskInstanceToken k : listas) {
if (k.getKaleoTaskName().equalsIgnoreCase("Assegnazione")){ if (k.getKaleoTaskName().equalsIgnoreCase("Assegnazione")) {
ktit=k; ktit = k;
break; break;
} }
} }
if (ktit!=null){ if (ktit != null) {
WorkflowInstance wfInstance=WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), ktit.getKaleoInstanceId()); WorkflowInstance wfInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(
Serializable wfVariante=wfInstance.getWorkflowContext().get("wf_variante"); controlloPratica.getCompanyId(), ktit.getKaleoInstanceId());
boolean isVariante=false; Serializable wfVariante = wfInstance.getWorkflowContext().get("wf_variante");
if (wfVariante!=null){ boolean isVariante = false;
isVariante=(wfVariante!=null&&wfVariante.toString().length()>0); if (wfVariante != null) {
isVariante = (wfVariante != null && wfVariante.toString().length() > 0);
} }
_log.info("RIPARA_WORKFLOW isVariante="+isVariante+" per controllopraticaid="+controllopraticaid); _log.info("RIPARA_WORKFLOW isVariante=" + isVariante + " per controllopraticaid="
_log.info("RIPARA_WORKFLOW KaleoTaskInstanceTokenId="+ktit.getKaleoTaskInstanceTokenId()+" --controllopraticaid="+controllopraticaid); + controllopraticaid);
_log.info("RIPARA_WORKFLOW KaleoTaskInstanceTokenId=" + ktit.getKaleoTaskInstanceTokenId()
+ " --controllopraticaid=" + controllopraticaid);
DynamicQuery queryKAT = DynamicQueryFactoryUtil.forClass(KaleoTaskAssignmentInstance.class); DynamicQuery queryKAT = DynamicQueryFactoryUtil.forClass(KaleoTaskAssignmentInstance.class);
queryKAT.add(RestrictionsFactoryUtil.eq("kaleoTaskInstanceTokenId", ktit.getKaleoTaskInstanceTokenId())); queryKAT.add(RestrictionsFactoryUtil.eq("kaleoTaskInstanceTokenId",
ktit.getKaleoTaskInstanceTokenId()));
List<KaleoTaskAssignmentInstance> listass = KaleoTaskAssignmentInstanceLocalServiceUtil.dynamicQuery(queryKAT);
_log.info("size lista KaleoTaskAssignmentInstance per kaleoTaskInstanceTokenId="+ ktit.getKaleoTaskInstanceTokenId()+" :"+listass.size()); List<KaleoTaskAssignmentInstance> listass = KaleoTaskAssignmentInstanceLocalServiceUtil
//for (KaleoTaskAssignmentInstance x:listass){ .dynamicQuery(queryKAT);
_log.info("size lista KaleoTaskAssignmentInstance per kaleoTaskInstanceTokenId="
+ ktit.getKaleoTaskInstanceTokenId() + " :" + listass.size());
// for (KaleoTaskAssignmentInstance x:listass){
// _log.info("KaleoTaskAssignmentInstanceId="+x.getKaleoTaskAssignmentInstanceId()+" -- KaleoTaskName:"+x.getKaleoTaskName()); // _log.info("KaleoTaskAssignmentInstanceId="+x.getKaleoTaskAssignmentInstanceId()+" -- KaleoTaskName:"+x.getKaleoTaskName());
//} // }
if(listass != null && !listass.isEmpty()){ if (listass != null && !listass.isEmpty()) {
//creazione record assente sulla tabella KaleoTaskAssignmentInstance // creazione record assente sulla tabella KaleoTaskAssignmentInstance
KaleoTaskAssignmentInstance assignmentInstanceApp = listass.get(0); KaleoTaskAssignmentInstance assignmentInstanceApp = listass.get(0);
long kaleoTaskAssignementInstanceId = CounterLocalServiceUtil.increment("com.liferay.counter.model.Counter"); long kaleoTaskAssignementInstanceId = CounterLocalServiceUtil
KaleoTaskAssignmentInstance assignmentInstance = KaleoTaskAssignmentInstanceLocalServiceUtil.createKaleoTaskAssignmentInstance( .increment("com.liferay.counter.model.Counter");
kaleoTaskAssignementInstanceId); KaleoTaskAssignmentInstance assignmentInstance = KaleoTaskAssignmentInstanceLocalServiceUtil
.createKaleoTaskAssignmentInstance(kaleoTaskAssignementInstanceId);
assignmentInstance.setCreateDate(assignmentInstanceApp.getCreateDate()); assignmentInstance.setCreateDate(assignmentInstanceApp.getCreateDate());
assignmentInstance.setModifiedDate(assignmentInstanceApp.getModifiedDate()); assignmentInstance.setModifiedDate(assignmentInstanceApp.getModifiedDate());
@ -212,60 +133,75 @@ public class SchedulerKaleoController implements MessageListener {
assignmentInstance.setAssigneeClassPK(statusbyuserid); assignmentInstance.setAssigneeClassPK(statusbyuserid);
assignmentInstance.setCompleted(false); assignmentInstance.setCompleted(false);
KaleoTaskAssignmentInstanceLocalServiceUtil.updateKaleoTaskAssignmentInstance(assignmentInstance); KaleoTaskAssignmentInstanceLocalServiceUtil
.updateKaleoTaskAssignmentInstance(assignmentInstance);
//////////////////////////////////////////////////////////////////////////////// // patch per tener contro anche delle varianti create da applicativo portos2: forzo lo stato
//patch per tener contro anche delle varianti create da applicativo portos2: forzo lo stato del WF a ESITO // del WF a ESITO
long kaleoInstanceId=assignmentInstanceApp.getKaleoInstanceId(); long kaleoInstanceId = assignmentInstanceApp.getKaleoInstanceId();
KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(kaleoInstanceId); KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil
.getKaleoInstance(kaleoInstanceId);
long rootKaleoInstanceTokenId=kaleoInstance.getRootKaleoInstanceTokenId(); long rootKaleoInstanceTokenId = kaleoInstance.getRootKaleoInstanceTokenId();
KaleoInstanceToken rootKaleoInstanceToken = KaleoInstanceTokenLocalServiceUtil.getKaleoInstanceToken(rootKaleoInstanceTokenId); KaleoInstanceToken rootKaleoInstanceToken = KaleoInstanceTokenLocalServiceUtil
.getKaleoInstanceToken(rootKaleoInstanceTokenId);
_log.info("rootKaleoInstanceToken="+rootKaleoInstanceToken.getCurrentKaleoNodeName()); _log.info("rootKaleoInstanceToken=" + rootKaleoInstanceToken.getCurrentKaleoNodeName());
rootKaleoInstanceToken.setCurrentKaleoNodeId(21639); rootKaleoInstanceToken.setCurrentKaleoNodeId(21639);
rootKaleoInstanceToken.setCurrentKaleoNodeName("Esito"); rootKaleoInstanceToken.setCurrentKaleoNodeName("Esito");
KaleoInstanceTokenLocalServiceUtil.updateKaleoInstanceToken(rootKaleoInstanceToken); KaleoInstanceTokenLocalServiceUtil.updateKaleoInstanceToken(rootKaleoInstanceToken);
//////////////////// // //////////////////
//task di assegnazione viene inserito a completato: // task di assegnazione viene inserito a completato:
if (!assignmentInstanceApp.isCompleted()){ if (!assignmentInstanceApp.isCompleted()) {
assignmentInstanceApp.setCompleted(true); assignmentInstanceApp.setCompleted(true);
assignmentInstanceApp.setCompletionDate(new Date()); assignmentInstanceApp.setCompletionDate(new Date());
KaleoTaskAssignmentInstanceLocalServiceUtil.updateKaleoTaskAssignmentInstance(assignmentInstanceApp); KaleoTaskAssignmentInstanceLocalServiceUtil
.updateKaleoTaskAssignmentInstance(assignmentInstanceApp);
} }
//solo per le nuove varianti di PORTOS2 // solo per le nuove varianti di PORTOS2
if (isVariante){ if (isVariante) {
_log.info("cancellazione task di assegnazione per controllopraticaid="+controllopraticaid); _log.info("cancellazione task di assegnazione per controllopraticaid="
+ controllopraticaid);
KaleoTaskInstanceTokenLocalServiceUtil.deleteKaleoTaskInstanceToken(ktit); KaleoTaskInstanceTokenLocalServiceUtil.deleteKaleoTaskInstanceToken(ktit);
KaleoTaskAssignmentInstanceLocalServiceUtil.deleteKaleoTaskAssignmentInstance(assignmentInstanceApp); KaleoTaskAssignmentInstanceLocalServiceUtil
}else if (!ktit.isCompleted()){ .deleteKaleoTaskAssignmentInstance(assignmentInstanceApp);
} else if (!ktit.isCompleted()) {
ktit.setCompleted(true); ktit.setCompleted(true);
ktit.setCompletionDate(new Date()); ktit.setCompletionDate(new Date());
KaleoTaskInstanceTokenLocalServiceUtil.updateKaleoTaskInstanceToken(ktit); KaleoTaskInstanceTokenLocalServiceUtil.updateKaleoTaskInstanceToken(ktit);
} }
////////////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////////
if(controlloPratica != null){ if (controlloPratica != null) {
_log.info("RIPARA_WORKFLOW - Pulisco Workflow ed indicizzo per intPraticaId=" + controlloPratica.getIntPraticaId()); _log.info("RIPARA_WORKFLOW - Pulisco Workflow ed indicizzo per intPraticaId="
+ controlloPratica.getIntPraticaId());
CacheRegistryUtil.clear(); CacheRegistryUtil.clear();
IntPraticaLocalServiceUtil.reIndexFasciolo(controlloPratica.getIntPraticaId(), controlloPratica.getCompanyId()); IntPraticaLocalServiceUtil.reIndexFasciolo(controlloPratica.getIntPraticaId(),
controlloPratica.getCompanyId());
} }
} }
_log.info("RIPARA_WORKFLOW fine lavorazione OK -- controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid); _log.info("RIPARA_WORKFLOW fine lavorazione OK -- controllopraticaid=" + controllopraticaid
}else{ + " statusbyuserid=" + statusbyuserid + " kaleoinstancetokenid=" + kaleoinstancetokenid
_log.info("RIPARA_WORKFLOW fine lavorazione KO --task assegnazione non trovato per controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid); + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid);
} else {
_log.info("RIPARA_WORKFLOW fine lavorazione KO --task assegnazione non trovato per controllopraticaid="
+ controllopraticaid
+ " statusbyuserid="
+ statusbyuserid
+ " kaleoinstancetokenid="
+ kaleoinstancetokenid + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid);
listaKO.add(objs); listaKO.add(objs);
} }
} }
} catch (Exception e) {
}catch(Exception e){ _log.error("Errore RIPARA_WORKFLOW -- controllopraticaid=" + controllopraticaid + " statusbyuserid="
_log.error("Errore RIPARA_WORKFLOW -- controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid,e); + statusbyuserid + " kaleoinstancetokenid=" + kaleoinstancetokenid
+ " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid, e);
} }
} }
@ -273,23 +209,24 @@ public class SchedulerKaleoController implements MessageListener {
} }
private void patchTaskEsitiForWF(List<Object[]> lista){ private void patchTaskEsitiForWF(List<Object[]> lista) {
for (Object[] objs : lista) { for (Object[] objs : lista) {
long kaleotaskinstancetokenid = Long.parseLong(String.valueOf(objs[0])); long kaleotaskinstancetokenid = Long.parseLong(String.valueOf(objs[0]));
long kaleoinstancetokenid = Long.parseLong(String.valueOf(objs[1])); long kaleoinstancetokenid = Long.parseLong(String.valueOf(objs[1]));
long controllopraticaid = (objs[2]!=null)? Long.parseLong(String.valueOf(objs[2])):0; long controllopraticaid = (objs[2] != null) ? Long.parseLong(String.valueOf(objs[2])) : 0;
long statusbyuserid = Long.parseLong(String.valueOf(objs[3])); long statusbyuserid = Long.parseLong(String.valueOf(objs[3]));
try{ try {
if (controllopraticaid==0){ if (controllopraticaid == 0) {
continue; continue;
} }
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica(controllopraticaid); ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
if (controlloPratica==null) .fetchControlloPratica(controllopraticaid);
if (controlloPratica == null)
continue; continue;
//KaleoTaskInstanceToken ordinati per dati di creazione decresente // KaleoTaskInstanceToken ordinati per dati di creazione decresente
DynamicQuery queryKIT = DynamicQueryFactoryUtil.forClass(KaleoTaskInstanceToken.class); DynamicQuery queryKIT = DynamicQueryFactoryUtil.forClass(KaleoTaskInstanceToken.class);
queryKIT.add(RestrictionsFactoryUtil.eq("classPK", controllopraticaid)); queryKIT.add(RestrictionsFactoryUtil.eq("classPK", controllopraticaid));
queryKIT.add(RestrictionsFactoryUtil.eq("kaleoTaskName", "Esito")); queryKIT.add(RestrictionsFactoryUtil.eq("kaleoTaskName", "Esito"));
@ -298,23 +235,28 @@ public class SchedulerKaleoController implements MessageListener {
queryKIT.addOrder(defaultOrderDettPrtatica); queryKIT.addOrder(defaultOrderDettPrtatica);
List<KaleoTaskInstanceToken> listas = KaleoTaskInstanceTokenLocalServiceUtil.dynamicQuery(queryKIT); List<KaleoTaskInstanceToken> listas = KaleoTaskInstanceTokenLocalServiceUtil.dynamicQuery(queryKIT);
if (listas != null && !listas.isEmpty()) {
KaleoTaskInstanceToken ktit = null;
if(listas != null && !listas.isEmpty()){ for (KaleoTaskInstanceToken k : listas) {
KaleoTaskInstanceToken ktit =null; if (k.getKaleoTaskName().equalsIgnoreCase("Esito")) {
ktit = k;
for (KaleoTaskInstanceToken k:listas){ _log.info("patchTaskEsitiForWF - task esito senza assegnazione controlloPraticaid = "
if (k.getKaleoTaskName().equalsIgnoreCase("Esito")){ + controllopraticaid + " - KaleoTaskInstanceTokenId= "
ktit=k; + k.getKaleoTaskInstanceTokenId() + " -KaleoTaskId=" + k.getKaleoTaskId()
_log.info("patchTaskEsitiForWF - task esito senza assegnazione controlloPraticaid = "+controllopraticaid+" - KaleoTaskInstanceTokenId= " +k.getKaleoTaskInstanceTokenId()+" -KaleoTaskId="+k.getKaleoTaskId()+" -statusbyuserid="+statusbyuserid); + " -statusbyuserid=" + statusbyuserid);
break; break;
} }
} }
if (ktit!=null){ if (ktit != null) {
//WorkflowInstance wfInstance=WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), ktit.getKaleoInstanceId()); // WorkflowInstance
// wfInstance=WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(),
// ktit.getKaleoInstanceId());
long kaleoTaskAssignementInstanceId = CounterLocalServiceUtil.increment("com.liferay.counter.model.Counter"); long kaleoTaskAssignementInstanceId = CounterLocalServiceUtil
KaleoTaskAssignmentInstance assignmentInstance = KaleoTaskAssignmentInstanceLocalServiceUtil.createKaleoTaskAssignmentInstance( .increment("com.liferay.counter.model.Counter");
kaleoTaskAssignementInstanceId); KaleoTaskAssignmentInstance assignmentInstance = KaleoTaskAssignmentInstanceLocalServiceUtil
.createKaleoTaskAssignmentInstance(kaleoTaskAssignementInstanceId);
assignmentInstance.setCreateDate(ktit.getCreateDate()); assignmentInstance.setCreateDate(ktit.getCreateDate());
assignmentInstance.setModifiedDate(ktit.getModifiedDate()); assignmentInstance.setModifiedDate(ktit.getModifiedDate());
@ -333,22 +275,33 @@ public class SchedulerKaleoController implements MessageListener {
assignmentInstance.setAssigneeClassPK(statusbyuserid); assignmentInstance.setAssigneeClassPK(statusbyuserid);
assignmentInstance.setCompleted(false); assignmentInstance.setCompleted(false);
KaleoTaskAssignmentInstanceLocalServiceUtil.updateKaleoTaskAssignmentInstance(assignmentInstance); KaleoTaskAssignmentInstanceLocalServiceUtil
.updateKaleoTaskAssignmentInstance(assignmentInstance);
if(controlloPratica != null){ if (controlloPratica != null) {
CacheRegistryUtil.clear(); CacheRegistryUtil.clear();
IntPraticaLocalServiceUtil.reIndexFasciolo(controlloPratica.getIntPraticaId(), controlloPratica.getCompanyId()); IntPraticaLocalServiceUtil.reIndexFasciolo(controlloPratica.getIntPraticaId(),
controlloPratica.getCompanyId());
} }
_log.info("patchTaskEsitiForWF fine lavorazione OK -- controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid); _log.info("patchTaskEsitiForWF fine lavorazione OK -- controllopraticaid=" + controllopraticaid
}else{ + " statusbyuserid=" + statusbyuserid + " kaleoinstancetokenid=" + kaleoinstancetokenid
_log.info("patchTaskEsitiForWF fine lavorazione KO --task esito non trovato per controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid); + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid);
} else {
_log.info("patchTaskEsitiForWF fine lavorazione KO --task esito non trovato per controllopraticaid="
+ controllopraticaid
+ " statusbyuserid="
+ statusbyuserid
+ " kaleoinstancetokenid="
+ kaleoinstancetokenid + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid);
} }
} }
}catch(Exception e){ } catch (Exception e) {
_log.error("Errore patchTaskEsitiForWF -- controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid,e); _log.error("Errore patchTaskEsitiForWF -- controllopraticaid=" + controllopraticaid
+ " statusbyuserid=" + statusbyuserid + " kaleoinstancetokenid=" + kaleoinstancetokenid
+ " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid, e);
} }
} }

4
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=portos_kaleo_controller build.namespace=portos_kaleo_controller
build.number=6 build.number=8
build.date=1574151325177 build.date=1616412878684
build.auto.upgrade=true build.auto.upgrade=true
## ##

1
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java

@ -32,7 +32,6 @@ public class StatoPraticaConstants {
public static final String CAMBIO_ISTRUTTORE = "CI"; public static final String CAMBIO_ISTRUTTORE = "CI";
public static final String NON_AUTORIZZATA = "AN"; public static final String NON_AUTORIZZATA = "AN";
public static final String VARIAZIONE_SOGGETTI = "VS"; public static final String VARIAZIONE_SOGGETTI = "VS";
public static final String VIARCH = "IA";
/* /*
* Probabilmente non è il posto più corretto, però si usa dovunque lo stato della pratica per impostare tipo avviso, * Probabilmente non è il posto più corretto, però si usa dovunque lo stato della pratica per impostare tipo avviso,

188
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf

@ -1,30 +1,31 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- <%--
/** Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* Copyright (c) 2000-2013 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.
*/
--%>
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.
--%>
<%@page import="com.liferay.portal.kernel.json.JSONException"%> <%@page import="com.liferay.portal.kernel.json.JSONException"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portal.kernel.json.JSONFactoryUtil"%> <%@page import="com.liferay.portal.kernel.json.JSONFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.json.JSONObject"%> <%@page import="com.liferay.portal.kernel.json.JSONObject"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%>
<table class="table table-striped attivita-table" <%-- id="<portlet:namespace/>_<%= workflowLog.getType() %>" --%>> <%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowLog"%>
<%@page import="com.liferay.portal.model.Role"%>
<%@page import="com.liferay.portal.model.User"%>
<%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="com.liferay.portal.util.PortalUtil"%>
<%@page import="java.util.Map"%>
<table class="table table-striped attivita-table">
<thead class="table-columns attivita-group__head"> <thead class="table-columns attivita-group__head">
<tr> <tr>
<th class="head-date text-center">Data</th> <th class="head-date text-center">Data</th>
@ -34,27 +35,23 @@
</tr> </tr>
</thead> </thead>
<tbody class="attivita-group__body"> <tbody class="attivita-group__body">
<% <%
@SuppressWarnings("unchecked")
//ADT: bug bo id=33 Map<Long, String> historyWorkflowEsitiLogs = (Map<Long, String>) request.getAttribute("historyWorkflowEsitiLogs");
Map<Long,String> historyWorkflowEsitiLogs = (Map<Long,String>)request.getAttribute("historyWorkflowEsitiLogs"); for (WorkflowLog workflowLog : workflowLogs) {
for (WorkflowLog workflowLog : workflowLogs) {
Role curRole = null; Role curRole = null;
User curUser = null; User curUser = null;
String actorName = null; String actorName = null;
if (workflowLog.getRoleId() != 0) { if (workflowLog.getRoleId() != 0) {
curRole = RoleLocalServiceUtil.getRole(workflowLog.getRoleId()); curRole = RoleLocalServiceUtil.getRole(workflowLog.getRoleId());
actorName = curRole.getDescriptiveName(); actorName = HtmlUtil.escape(curRole.getDescriptiveName());
} }
else if (workflowLog.getUserId() != 0) { else if (workflowLog.getUserId() != 0) {
curUser = UserLocalServiceUtil.getUser(workflowLog.getUserId()); curUser = UserLocalServiceUtil.getUser(workflowLog.getUserId());
actorName = curUser.getFullName(); actorName = HtmlUtil.escape(curUser.getFullName());
} }
String kaleoNodeName = null; String kaleoNodeName = null;
String transitionName = null; String transitionName = null;
try { try {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(workflowLog.getState()); JSONObject jsonObject = JSONFactoryUtil.createJSONObject(workflowLog.getState());
kaleoNodeName = jsonObject.getString("kaleoNodeName"); kaleoNodeName = jsonObject.getString("kaleoNodeName");
@ -62,109 +59,96 @@ for (WorkflowLog workflowLog : workflowLogs) {
} catch (JSONException e) { } catch (JSONException e) {
kaleoNodeName = workflowLog.getState(); kaleoNodeName = workflowLog.getState();
} }
%>
%>
<tr> <tr>
<td class="text-center date-col"> <td class="text-center date-col"><%= dateFormatDateTime.format(workflowLog.getCreateDate()) %></td>
<%= dateFormatDateTime.format(workflowLog.getCreateDate()) %>
</td>
<td class="description-col"> <td class="description-col">
<c:choose> <c:choose>
<c:when test="<%= workflowLog.getType() == WorkflowLog.TASK_COMPLETION %>"> <c:when test="<%= workflowLog.getType() == WorkflowLog.TASK_COMPLETION %>">
<div> <div>
<c:choose> <c:choose>
<c:when test="<%= Validator.isNull(transitionName) %>"> <c:when test="<%= Validator.isNull(transitionName) %>">
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName} %>" key="x-completed-the-task-x" /> <liferay-ui:message arguments="<%= new Object[] { actorName, kaleoNodeName } %>"
key="x-completed-the-task-x" />
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<c:if test='<%= "registra-esito".equalsIgnoreCase(transitionName) %>'> <c:if test='<%= "registra-esito".equalsIgnoreCase(transitionName) %>'>
<% <%
//ADT: bug bo id=33
String esito = (String)request.getAttribute("registra-esito-value"); String esito = (String)request.getAttribute("registra-esito-value");
if (historyWorkflowEsitiLogs!=null&& historyWorkflowEsitiLogs.containsKey(workflowLog.getWorkflowLogId()) ){ if (historyWorkflowEsitiLogs != null && historyWorkflowEsitiLogs.containsKey(
workflowLog.getWorkflowLogId())) {
esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId()); esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId());
} }
%> %>
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName, esito} %>" key="x-completed-the-task-y-z" /> <liferay-ui:message arguments="<%= new Object[] { actorName, kaleoNodeName, esito} %>"
key="x-completed-the-task-y-z" />
</c:if> </c:if>
<c:if test='<%= "assegna".equalsIgnoreCase(transitionName) %>'> <c:if test='<%= "assegna".equalsIgnoreCase(transitionName) %>'>
<% <%
String assegna = (String)request.getAttribute("assegna-value"); String assegna = (String) request.getAttribute("assegna-value");
%> %>
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName, assegna} %>" key="x-completed-the-task-y-z" /> <liferay-ui:message arguments="<%= new Object[] { actorName, kaleoNodeName, assegna} %>"
key="x-completed-the-task-y-z" />
</c:if> </c:if>
<c:if test='<%= !"assegna".equalsIgnoreCase(transitionName) && !"registra-esito".equalsIgnoreCase(transitionName) %>'> <c:if test='<%= !"assegna".equalsIgnoreCase(transitionName)
&& !"registra-esito".equalsIgnoreCase(transitionName) %>'>
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName} %>" key="x-completed-the-task-x" /> <liferay-ui:message arguments="<%= new Object[] { actorName, kaleoNodeName} %>"
key="x-completed-the-task-x" />
</c:if> </c:if>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
<portlet:renderURL var="historyFormTaskURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <portlet:renderURL var="historyFormTaskURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="struts_action" value="/workflow_tasks/render_history_form_task" /> <portlet:param name="struts_action" value="/workflow_tasks/render_history_form_task" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowLog.getWorkflowTaskId()) %>" /> <portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowLog
.getWorkflowTaskId()) %>" />
</portlet:renderURL> </portlet:renderURL>
<span>&nbsp;</span> <span>&nbsp;</span>
<liferay-ui:icon image="history" url="<%= historyFormTaskURL %>" useDialog="true" />
<liferay-ui:icon
image="history"
url='<%=historyFormTaskURL %>'
useDialog='<%=true %>'
/>
</div> </div>
</c:when> </c:when>
<c:when test="<%= workflowLog.getType() == WorkflowLog.TASK_UPDATE %>"> <c:when test="<%= workflowLog.getType() == WorkflowLog.TASK_UPDATE %>">
<div> <div>
<liferay-ui:message arguments="<%= HtmlUtil.escape(actorName) %>" key="x-updated-the-due-date" /> <liferay-ui:message arguments="<%= actorName %>" key="x-updated-the-due-date" />
</div> </div>
</c:when> </c:when>
<c:when test="<%= workflowLog.getType() == WorkflowLog.TRANSITION %>"> <c:when test="<%= workflowLog.getType() == WorkflowLog.TRANSITION %>">
<div> <div>
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), workflowLog.getState()} %>" key="x-sent-signal-x" /> <liferay-ui:message arguments="<%= new Object[] { actorName, workflowLog.getState() } %>"
key="x-sent-signal-x" />
</div> </div>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<c:choose> <c:choose>
<c:when test="<%= (curUser != null) && (workflowLog.getAuditUserId() == curUser.getUserId()) %>"> <c:when test="<%= (curUser != null) && (workflowLog.getAuditUserId() == curUser.getUserId()) %>">
<div> <div>
<liferay-ui:message arguments="<%= HtmlUtil.escape(curUser.getFullName()) %>" key='<%= curUser.isMale() ? "x-assigned-the-task-to-himself" : "x-assigned-the-task-to-herself" %>' /> <liferay-ui:message arguments="<%= HtmlUtil.escape(curUser.getFullName()) %>"
key='<%= curUser.isMale() ? "x-assigned-the-task-to-himself"
: "x-assigned-the-task-to-herself" %>' />
</div> </div>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<% <%
if (curRole == null) { if (curRole == null) {
String assignerName = PortalUtil.getUserName(workflowLog.getAuditUserId(), StringPool.BLANK); String assignerName = PortalUtil.getUserName(workflowLog.getAuditUserId(), StringPool.BLANK);
%> %>
<div> <div>
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(assignerName), HtmlUtil.escape(actorName)} %>" key="x-assigned-the-task-to-x" /> <liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(assignerName),
actorName} %>" key="x-assigned-the-task-to-x" />
<c:if test="<%= workflowLog.getPreviousUserId() != 0 %>"> <c:if test="<%= workflowLog.getPreviousUserId() != 0 %>">
<liferay-ui:message arguments="<%= PortalUtil.getUserName(workflowLog.getPreviousUserId(), StringPool.BLANK) %>" key="previous-assignee-was-x" /> <liferay-ui:message arguments="<%= PortalUtil.getUserName(workflowLog
.getPreviousUserId(), StringPool.BLANK) %>" key="previous-assignee-was-x" />
</c:if> </c:if>
</div> </div>
<% <%
} } else {
else {
%> %>
<div> <div>
<liferay-ui:message arguments="<%= HtmlUtil.escape(actorName) %>" key="task-initially-assigned-to-the-x-role" /> <liferay-ui:message arguments="<%= actorName %>"
key="task-initially-assigned-to-the-x-role" />
</div> </div>
<% <%
} }
%> %>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
</c:otherwise> </c:otherwise>
@ -172,35 +156,31 @@ for (WorkflowLog workflowLog : workflowLogs) {
</td> </td>
<td class="text-center activity-col"> <td class="text-center activity-col">
<% <%
if(Validator.isNotNull(kaleoNodeName)){ if (Validator.isNotNull(kaleoNodeName)) {
out.print(kaleoNodeName); out.print(kaleoNodeName);
if(Validator.isNotNull(transitionName)){ if (Validator.isNotNull(transitionName)) {
if("registra-esito".equalsIgnoreCase(transitionName)){ if ("registra-esito".equalsIgnoreCase(transitionName)) {
//out.print(" ( " + (String)request.getAttribute("registra-esito-value") + " ) "); String esito = (String) request.getAttribute("registra-esito-value");
//ADT BUG BO ID=33 if (historyWorkflowEsitiLogs != null && historyWorkflowEsitiLogs.containsKey(workflowLog
String esito = (String)request.getAttribute("registra-esito-value"); .getWorkflowLogId())) {
if (historyWorkflowEsitiLogs!=null&& historyWorkflowEsitiLogs.containsKey(workflowLog.getWorkflowLogId()) ){ esito = historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId());
esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId());
} }
out.print(" ( " + esito + " ) "); out.print(" ( " + esito + " ) ");
} else if ("assegna".equalsIgnoreCase(transitionName)) {
} else if("assegna".equalsIgnoreCase(transitionName)){
out.print(" ( " + (String)request.getAttribute("assegna-value") + " ) "); out.print(" ( " + (String)request.getAttribute("assegna-value") + " ) ");
} }
} }
} }
%> %>
</td> </td>
<td class="activity-note"> <td class="activity-note">
<c:if test='<%= Validator.isNotNull(workflowLog.getComment())
<c:if test='<%=Validator.isNotNull(workflowLog.getComment()) && !"Assigned initial task.".equals(workflowLog.getComment()) %>'> && !"Assigned initial task.".equals(workflowLog.getComment()) %>'>
<div class="post-it-note"> <div class="post-it-note">
<div class="header-post-it"> <div class="header-post-it">
<p class="header-post-it_date"><%= dateFormatDateTime.format(workflowLog.getCreateDate()) %></p> <p class="header-post-it_date"><%= dateFormatDateTime.format(workflowLog.getCreateDate()) %></p>
<p class="header-post-it_name"> <p class="header-post-it_name">
<c:if test="<%=Validator.isNotNull(curUser) %>"> <c:if test="<%= Validator.isNotNull(curUser) %>">
<%= curUser.getFullName() %> <%= curUser.getFullName() %>
</c:if> </c:if>
</p> </p>
@ -210,33 +190,13 @@ for (WorkflowLog workflowLog : workflowLogs) {
</div> </div>
</div> </div>
</c:if> </c:if>
</td> </td>
</tr> </tr>
<%
}
%>
</tbody>
<%-- <div class="task-activity task-type-<%= workflowLog.getType() %>">
<div>
</div>
</div> --%>
<%
}
%>
</tbody>
</table> </table>
<style> <style>
.head-date { .head-date {
width: 120px; width: 120px;
@ -258,7 +218,6 @@ for (WorkflowLog workflowLog : workflowLogs) {
background-color: #812121!important; background-color: #812121!important;
color: white; color: white;
} }
.attivita-table td { .attivita-table td {
border: 1px solid #dddddd; border: 1px solid #dddddd;
} }
@ -269,7 +228,6 @@ for (WorkflowLog workflowLog : workflowLogs) {
min-width: 13em; min-width: 13em;
background: rgb(255,215,7); background: rgb(255,215,7);
position: relative; position: relative;
/* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */
} }
.post-it-note:after { .post-it-note:after {
content: ""; content: "";
@ -290,7 +248,6 @@ for (WorkflowLog workflowLog : workflowLogs) {
border-style: solid; border-style: solid;
border-color: #d3b100 transparent; border-color: #d3b100 transparent;
} }
.header-post-it { .header-post-it {
background-color: rgba(211, 177, 0, 0.30); background-color: rgba(211, 177, 0, 0.30);
display: -webkit-box; display: -webkit-box;
@ -303,7 +260,6 @@ for (WorkflowLog workflowLog : workflowLogs) {
-ms-flex-pack: justify; -ms-flex-pack: justify;
justify-content: space-between; justify-content: space-between;
padding: 5px; padding: 5px;
} }
.header-post-it p { .header-post-it p {
margin: 0; margin: 0;

8
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp

@ -68,11 +68,11 @@ for (Entry<String, List<Map<String, Serializable>>> entry : fieldNameOptions.ent
String select = match.replaceAll("(?s)([?>]*>).*", "$1\n"); String select = match.replaceAll("(?s)([?>]*>).*", "$1\n");
for (Map<String, Serializable> option : entry.getValue()) { for (Map<String, Serializable> option : entry.getValue()) {
String value = option.get("value").toString(); String value = option.get("value").toString();
select += "<option value=\"" + HtmlUtil.escape(value) + "\""; select += "<option value=\"" + HtmlUtil.escape(value) + StringPool.QUOTE;
if ((name.equals("istruttore") && value.equalsIgnoreCase(istruttore)) || MapUtil.getBoolean(option, "default")) { if ((name.equals("istruttore") && value.equalsIgnoreCase(istruttore)) || MapUtil.getBoolean(option, "default")) {
select += " selected=\"selected\""; select += " selected=\"selected\"";
} }
select += ">" + HtmlUtil.escape(option.get("label").toString()) + "</option>\n"; select += StringPool.GREATER_THAN + HtmlUtil.escape(option.get("label").toString()) + "</option>\n";
} }
html = html.replaceAll(regexSelect, "$1" + select + "</select>\n" + "$3"); html = html.replaceAll(regexSelect, "$1" + select + "</select>\n" + "$3");
} else { } else {
@ -89,7 +89,7 @@ for (Entry<String, List<Map<String, Serializable>>> entry : fieldNameOptions.ent
} }
} }
} }
html = html.replaceAll("name=\"" + ns + "(.*?)_INSTANCE_[^\"]+\"", "name=\"" + prefix + "$1" + suffix + "\""); html = html.replaceAll("name=\"" + ns + "(.*?)_INSTANCE_[^\"]+\"", "name=\"" + prefix + "$1" + suffix + StringPool.QUOTE);
html = html.replace("name=\"" + ns + "_fieldsDisplay\"", "name=\"_fieldsDisplay\""); html = html.replace("name=\"" + ns + "_fieldsDisplay\"", "name=\"_fieldsDisplay\"");
for (Entry<String, Serializable> p : parameters.entrySet()) { for (Entry<String, Serializable> p : parameters.entrySet()) {
html = html.replaceAll("(<textarea\\s.*?\\sname=\"" + prefix + p.getKey() + suffix + "\"[^>]*>[^<]*)</textarea>", html = html.replaceAll("(<textarea\\s.*?\\sname=\"" + prefix + p.getKey() + suffix + "\"[^>]*>[^<]*)</textarea>",
@ -97,6 +97,6 @@ for (Entry<String, Serializable> p : parameters.entrySet()) {
} }
// Rimozione valori non utilizzati // Rimozione valori non utilizzati
html = html.replaceAll("(?s)<input[^>]*?value=\"Value[0-9]\"[^>]*>.*?</label>", "</label>"); html = html.replaceAll("(?s)<input[^>]*?value=\"Value[0-9]\"[^>]*>.*?</label>", "</label>");
html = html.replaceAll("(?s)<label[^>]*>[ \t\r\n]*</label>", ""); html = html.replaceAll("(?s)<label[^>]*>[ \t\r\n]*</label>", StringPool.BLANK);
%> %>
<%= html %> <%= html %>

81
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java

@ -90,6 +90,7 @@ import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServ
public class EditWorkflowTaskAction extends BaseStrutsPortletAction { public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
private final static Log _log = LogFactoryUtil.getLog(EditWorkflowTaskAction.class); private final static Log _log = LogFactoryUtil.getLog(EditWorkflowTaskAction.class);
@SuppressWarnings("serial") @SuppressWarnings("serial")
private final static List<String> valoriAmmessi = new ArrayList<String>() { private final static List<String> valoriAmmessi = new ArrayList<String>() {
{ {
@ -99,7 +100,16 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
add(StatoPraticaConstants.NON_CONFORME); add(StatoPraticaConstants.NON_CONFORME);
add(StatoPraticaConstants.NO_PARERE); add(StatoPraticaConstants.NO_PARERE);
add(StatoPraticaConstants.PREAVVISO_CONTRARIO); add(StatoPraticaConstants.PREAVVISO_CONTRARIO);
add(StatoPraticaConstants.VIARCH); }
};
@SuppressWarnings("serial")
private static final List<Integer> logTypes = new ArrayList<Integer>() {
{
add(WorkflowLog.TASK_ASSIGN);
add(WorkflowLog.TASK_COMPLETION);
add(WorkflowLog.TASK_UPDATE);
add(WorkflowLog.TRANSITION);
} }
}; };
@ -144,12 +154,9 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
protected void assignTask(ActionRequest actionRequest) throws Exception { protected void assignTask(ActionRequest actionRequest) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId");
long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId"); long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId");
String comment = ParamUtil.getString(actionRequest, "comment"); String comment = ParamUtil.getString(actionRequest, "comment");
WorkflowTaskManagerUtil.assignWorkflowTaskToUser(themeDisplay.getCompanyId(), themeDisplay.getUserId(), WorkflowTaskManagerUtil.assignWorkflowTaskToUser(themeDisplay.getCompanyId(), themeDisplay.getUserId(),
workflowTaskId, assigneeUserId, comment, null, null); workflowTaskId, assigneeUserId, comment, null, null);
} }
@ -164,17 +171,13 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
// ADT: bug mancata problema assegnazione WF // ADT: bug mancata problema assegnazione WF
checkPresenzaIstruttore(transitionName, workflowTaskId); checkPresenzaIstruttore(transitionName, workflowTaskId);
// ADT: BUG ANOMALIA REGISTRA ESITO // ADT: BUG ANOMALIA REGISTRA ESITO
_log.info("transitionName = " + transitionName);
if (transitionName.equalsIgnoreCase("registra-esito")) { if (transitionName.equalsIgnoreCase("registra-esito")) {
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil
.getHttpServletRequest(actionRequest)); .getHttpServletRequest(actionRequest));
String esito = httpServletRequest.getParameter("kaleo--esito--") != null ? httpServletRequest.getParameter( String esito = httpServletRequest.getParameter("kaleo--esito--") != null ? httpServletRequest.getParameter(
"kaleo--esito--").trim() : ""; "kaleo--esito--").trim() : StringPool.BLANK;
String testoDocumento = httpServletRequest.getParameter("kaleo--testo_del_documento--") != null ? httpServletRequest String testoDocumento = httpServletRequest.getParameter("kaleo--testo_del_documento--") != null ? httpServletRequest
.getParameter("kaleo--testo_del_documento--") : ""; .getParameter("kaleo--testo_del_documento--") : StringPool.BLANK;
if (esito.equals(StatoPraticaConstants.VIARCH)) {
aggiorna = false;
}
if (!valoriAmmessi.contains(esito) if (!valoriAmmessi.contains(esito)
|| ((esito.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE) || esito || ((esito.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE) || esito
.equalsIgnoreCase(StatoPraticaConstants.PREAVVISO_CONTRARIO)) && testoDocumento.isEmpty())) { .equalsIgnoreCase(StatoPraticaConstants.PREAVVISO_CONTRARIO)) && testoDocumento.isEmpty())) {
@ -200,7 +203,6 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
long companyId = controllo.getCompanyId(); long companyId = controllo.getCompanyId();
long roleId = RoleLocalServiceUtil.getRole(companyId, "portos_assegnatore").getRoleId(); long roleId = RoleLocalServiceUtil.getRole(companyId, "portos_assegnatore").getRoleId();
int uo = Integer.parseInt(istruttore.substring(6)); int uo = Integer.parseInt(istruttore.substring(6));
WorkflowTaskManagerUtil.assignWorkflowTaskToRole(companyId, themeDisplay.getUserId(), workflowTaskId, WorkflowTaskManagerUtil.assignWorkflowTaskToRole(companyId, themeDisplay.getUserId(), workflowTaskId,
roleId, "Trasferito all'UO " + uo + " per assegnazione all'istruttore.\n" + comment, null, roleId, "Trasferito all'UO " + uo + " per assegnazione all'istruttore.\n" + comment, null,
WorkflowUtil.getWorkflowContext(controllo)); WorkflowUtil.getWorkflowContext(controllo));
@ -218,8 +220,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
} }
protected void removeUO(ActionRequest actionRequest) throws PortalException, SystemException { protected void removeUO(ActionRequest actionRequest) throws PortalException, SystemException {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId");
String comment = ParamUtil.getString(actionRequest, "comment"); String comment = ParamUtil.getString(actionRequest, "comment");
ControlloPratica controllo = WorkflowUtil.getControlloPratica(workflowTaskId); ControlloPratica controllo = WorkflowUtil.getControlloPratica(workflowTaskId);
@ -228,7 +230,6 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
long userId = themeDisplay.getUserId(); long userId = themeDisplay.getUserId();
Map<String, Serializable> workflowContext = WorkflowUtil.getWorkflowContext(controllo); Map<String, Serializable> workflowContext = WorkflowUtil.getWorkflowContext(controllo);
long roleId = RoleLocalServiceUtil.getRole(companyId, "portos_assegnatore").getRoleId(); long roleId = RoleLocalServiceUtil.getRole(companyId, "portos_assegnatore").getRoleId();
WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, userId, workflowTaskId, userId, StringPool.BLANK, WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, userId, workflowTaskId, userId, StringPool.BLANK,
null, workflowContext); null, workflowContext);
WorkflowTaskManagerUtil WorkflowTaskManagerUtil
@ -241,12 +242,9 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
protected void relaseTask(ActionRequest actionRequest) throws Exception { protected void relaseTask(ActionRequest actionRequest) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId");
long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId"); long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId");
String comment = ParamUtil.getString(actionRequest, "comment"); String comment = ParamUtil.getString(actionRequest, "comment");
WorkflowTaskManagerUtil.assignWorkflowTaskToRole(themeDisplay.getCompanyId(), assigneeUserId, workflowTaskId, WorkflowTaskManagerUtil.assignWorkflowTaskToRole(themeDisplay.getCompanyId(), assigneeUserId, workflowTaskId,
0L, comment, null, null); 0L, comment, null, null);
} }
@ -259,25 +257,19 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
protected void updateTask(ActionRequest actionRequest) throws Exception { protected void updateTask(ActionRequest actionRequest) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId");
String comment = ParamUtil.getString(actionRequest, "comment"); String comment = ParamUtil.getString(actionRequest, "comment");
int dueDateMonth = ParamUtil.getInteger(actionRequest, "dueDateMonth"); int dueDateMonth = ParamUtil.getInteger(actionRequest, "dueDateMonth");
int dueDateDay = ParamUtil.getInteger(actionRequest, "dueDateDay"); int dueDateDay = ParamUtil.getInteger(actionRequest, "dueDateDay");
int dueDateYear = ParamUtil.getInteger(actionRequest, "dueDateYear"); int dueDateYear = ParamUtil.getInteger(actionRequest, "dueDateYear");
int dueDateHour = ParamUtil.getInteger(actionRequest, "dueDateHour"); int dueDateHour = ParamUtil.getInteger(actionRequest, "dueDateHour");
int dueDateMinute = ParamUtil.getInteger(actionRequest, "dueDateMinute"); int dueDateMinute = ParamUtil.getInteger(actionRequest, "dueDateMinute");
int dueDateAmPm = ParamUtil.getInteger(actionRequest, "dueDateAmPm"); int dueDateAmPm = ParamUtil.getInteger(actionRequest, "dueDateAmPm");
if (dueDateAmPm == Calendar.PM) { if (dueDateAmPm == Calendar.PM) {
dueDateHour += 12; dueDateHour += 12;
} }
Date dueDate = PortalUtil.getDate(dueDateMonth, dueDateDay, dueDateYear, dueDateHour, dueDateMinute, Date dueDate = PortalUtil.getDate(dueDateMonth, dueDateDay, dueDateYear, dueDateHour, dueDateMinute,
WorkflowTaskDueDateException.class); WorkflowTaskDueDateException.class);
WorkflowTaskManagerUtil.updateDueDate(themeDisplay.getCompanyId(), themeDisplay.getUserId(), workflowTaskId, WorkflowTaskManagerUtil.updateDueDate(themeDisplay.getCompanyId(), themeDisplay.getUserId(), workflowTaskId,
comment, dueDate); comment, dueDate);
} }
@ -296,45 +288,30 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
if (isDisplaySuccessMessage(actionRequest)) { if (isDisplaySuccessMessage(actionRequest)) {
addSuccessMessage(actionRequest, actionResponse); addSuccessMessage(actionRequest, actionResponse);
} }
if (Validator.isNull(redirect)) { if (Validator.isNull(redirect)) {
redirect = (String) actionRequest.getAttribute(WebKeys.REDIRECT); redirect = (String) actionRequest.getAttribute(WebKeys.REDIRECT);
} }
if (Validator.isNull(redirect)) { if (Validator.isNull(redirect)) {
redirect = ParamUtil.getString(actionRequest, "redirect"); redirect = ParamUtil.getString(actionRequest, "redirect");
} }
if ((portletConfig != null) && Validator.isNotNull(redirect) && Validator.isNotNull(closeRedirect)) { if ((portletConfig != null) && Validator.isNotNull(redirect) && Validator.isNotNull(closeRedirect)) {
redirect = HttpUtil.setParameter(redirect, "closeRedirect", closeRedirect); redirect = HttpUtil.setParameter(redirect, "closeRedirect", closeRedirect);
SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest) SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest)
+ SessionMessages.KEY_SUFFIX_CLOSE_REDIRECT, closeRedirect); + SessionMessages.KEY_SUFFIX_CLOSE_REDIRECT, closeRedirect);
} }
if (Validator.isNull(redirect)) { if (Validator.isNull(redirect)) {
return; return;
} }
// LPS-1928
HttpServletRequest request = PortalUtil.getHttpServletRequest(actionRequest); HttpServletRequest request = PortalUtil.getHttpServletRequest(actionRequest);
if (BrowserSnifferUtil.isIe(request) && (BrowserSnifferUtil.getMajorVersion(request) == 6.0) if (BrowserSnifferUtil.isIe(request) && (BrowserSnifferUtil.getMajorVersion(request) == 6.0)
&& redirect.contains(StringPool.POUND)) { && redirect.contains(StringPool.POUND)) {
String redirectToken = "&#"; String redirectToken = "&#";
if (!redirect.contains(StringPool.QUESTION)) { if (!redirect.contains(StringPool.QUESTION)) {
redirectToken = StringPool.QUESTION + redirectToken; redirectToken = StringPool.QUESTION + redirectToken;
} }
redirect = StringUtil.replace(redirect, StringPool.POUND, redirectToken); redirect = StringUtil.replace(redirect, StringPool.POUND, redirectToken);
} }
redirect = PortalUtil.escapeRedirect(redirect); redirect = PortalUtil.escapeRedirect(redirect);
if (Validator.isNotNull(redirect)) { if (Validator.isNotNull(redirect)) {
actionResponse.sendRedirect(redirect); actionResponse.sendRedirect(redirect);
} }
@ -345,17 +322,12 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
if (!SessionErrors.isEmpty(portletRequest)) { if (!SessionErrors.isEmpty(portletRequest)) {
return false; return false;
} }
ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
Layout layout = themeDisplay.getLayout(); Layout layout = themeDisplay.getLayout();
if (layout.isTypeControlPanel()) { if (layout.isTypeControlPanel()) {
return true; return true;
} }
String portletId = (String) portletRequest.getAttribute(WebKeys.PORTLET_ID); String portletId = (String) portletRequest.getAttribute(WebKeys.PORTLET_ID);
try { try {
LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet(); LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet();
@ -367,29 +339,22 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
_log.debug(pe, pe); _log.debug(pe, pe);
} }
} }
Portlet portlet = PortletLocalServiceUtil.getPortletById(themeDisplay.getCompanyId(), portletId); Portlet portlet = PortletLocalServiceUtil.getPortletById(themeDisplay.getCompanyId(), portletId);
if (portlet.isAddDefaultResource()) { if (portlet.isAddDefaultResource()) {
return true; return true;
} }
return false; return false;
} }
protected void addSuccessMessage(ActionRequest actionRequest, ActionResponse actionResponse) { protected void addSuccessMessage(ActionRequest actionRequest, ActionResponse actionResponse) {
PortletConfig portletConfig = (PortletConfig) actionRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); PortletConfig portletConfig = (PortletConfig) actionRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
boolean addProcessActionSuccessMessage = GetterUtil.getBoolean( boolean addProcessActionSuccessMessage = GetterUtil.getBoolean(
portletConfig.getInitParameter("add-process-action-success-action"), true); portletConfig.getInitParameter("add-process-action-success-action"), true);
if (!addProcessActionSuccessMessage) { if (!addProcessActionSuccessMessage) {
return; return;
} }
String successMessage = ParamUtil.getString(actionRequest, "successMessage"); String successMessage = ParamUtil.getString(actionRequest, "successMessage");
SessionMessages.add(actionRequest, "requestProcessed", successMessage); SessionMessages.add(actionRequest, "requestProcessed", successMessage);
} }
@ -401,9 +366,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
public static String getForwardKey(PortletRequest portletRequest) { public static String getForwardKey(PortletRequest portletRequest) {
String portletId = (String) portletRequest.getAttribute(WebKeys.PORTLET_ID); String portletId = (String) portletRequest.getAttribute(WebKeys.PORTLET_ID);
String portletNamespace = PortalUtil.getPortletNamespace(portletId); String portletNamespace = PortalUtil.getPortletNamespace(portletId);
return portletNamespace.concat(PORTLET_STRUTS_FORWARD); return portletNamespace.concat(PORTLET_STRUTS_FORWARD);
} }
@ -429,11 +392,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
// Gestione permessi action button // Gestione permessi action button
ControlloPratica controllo = getControlloPratica(workflowTask.getWorkflowInstanceId()); ControlloPratica controllo = getControlloPratica(workflowTask.getWorkflowInstanceId());
// ADT BUG BO ID=33
renderRequest.setAttribute("historyWorkflowEsitiLogs", renderRequest.setAttribute("historyWorkflowEsitiLogs",
getHistoryWorkfloLogs(themeDisplay, workflowTask.getWorkflowInstanceId(), renderRequest, controllo)); getHistoryWorkfloLogs(themeDisplay, workflowTask.getWorkflowInstanceId(), renderRequest, controllo));
Group group = GroupLocalServiceUtil.getGroup(controllo.getGroupId()); Group group = GroupLocalServiceUtil.getGroup(controllo.getGroupId());
User user = themeDisplay.getUser(); User user = themeDisplay.getUser();
Organization org = OrganizationLocalServiceUtil.getOrganization(group.getClassPK()); Organization org = OrganizationLocalServiceUtil.getOrganization(group.getClassPK());
@ -463,20 +423,16 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
ClassLoader classLoaderKaleoLog = (ClassLoader) PortletBeanLocatorUtil.locate( ClassLoader classLoaderKaleoLog = (ClassLoader) PortletBeanLocatorUtil.locate(
it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(), "portletClassLoader"); it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery dqKaleoLog = DynamicQueryFactoryUtil.forClass(FormLog.class, classLoaderKaleoLog); DynamicQuery dqKaleoLog = DynamicQueryFactoryUtil.forClass(FormLog.class, classLoaderKaleoLog);
dqKaleoLog.add(RestrictionsFactoryUtil.eq("workflowInstanceId", taskInstanceId)); dqKaleoLog.add(RestrictionsFactoryUtil.eq("workflowInstanceId", taskInstanceId));
dqKaleoLog.add(RestrictionsFactoryUtil.eq("transitionName", transitionName)); dqKaleoLog.add(RestrictionsFactoryUtil.eq("transitionName", transitionName));
List<FormLog> listaKaleoLog = FormLogLocalServiceUtil.dynamicQuery(dqKaleoLog); List<FormLog> listaKaleoLog = FormLogLocalServiceUtil.dynamicQuery(dqKaleoLog);
if (listaKaleoLog != null && !listaKaleoLog.isEmpty()) { if (listaKaleoLog != null && !listaKaleoLog.isEmpty()) {
FormLog formLog = listaKaleoLog.get(0); FormLog formLog = listaKaleoLog.get(0);
JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters()); JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters());
KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId); KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId);
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(kaleoInstance ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(kaleoInstance
.getClassPK()); .getClassPK());
if (json.has("esito")) { if (json.has("esito")) {
String tipoEsito = StringPool.BLANK; String tipoEsito = StringPool.BLANK;
if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) { if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) {
@ -511,11 +467,6 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
Map<Long, String> esitiMapByWorkflowLogID = new HashMap<Long, String>(); Map<Long, String> esitiMapByWorkflowLogID = new HashMap<Long, String>();
try { try {
List<Integer> logTypes = new ArrayList<Integer>();
logTypes.add(WorkflowLog.TASK_ASSIGN);
logTypes.add(WorkflowLog.TASK_COMPLETION);
logTypes.add(WorkflowLog.TASK_UPDATE);
logTypes.add(WorkflowLog.TRANSITION);
List<WorkflowLog> workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance( List<WorkflowLog> workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(
themeDisplay.getCompanyId(), workflowInstanceId, logTypes, QueryUtil.ALL_POS, QueryUtil.ALL_POS, themeDisplay.getCompanyId(), workflowInstanceId, logTypes, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true)); WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true));
@ -586,7 +537,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(controlloPratica.getCompanyId()); serviceContext.setCompanyId(controlloPratica.getCompanyId());
serviceContext.setUserId(controlloPratica.getUserId()); serviceContext.setUserId(controlloPratica.getUserId());
FormLogLocalServiceUtil.addFormLog(kaleoTaskInstanceToken.getKaleoInstanceId(), 0l, FormLogLocalServiceUtil.addFormLog(kaleoTaskInstanceToken.getKaleoInstanceId(), 0L,
"cambio-istruttore", jsonFormParameters, serviceContext); "cambio-istruttore", jsonFormParameters, serviceContext);
_log.info("checkPresenzaIstruttore correttamente eseguito - ControlloPraticaId = " _log.info("checkPresenzaIstruttore correttamente eseguito - ControlloPraticaId = "
+ controlloPratica.getControlloPraticaId()); + controlloPratica.getControlloPraticaId());
@ -598,7 +549,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
} catch (Exception e) { } catch (Exception e) {
_log.error("checkPresenzaIstruttore KO per workflowTaskId = " + workflowTaskId + " [" + e.getMessage() _log.error("checkPresenzaIstruttore KO per workflowTaskId = " + workflowTaskId + " [" + e.getMessage()
+ " , " + e.getCause() + "]"); + " , " + e.getCause() + StringPool.CLOSE_BRACKET);
} }
} }
} }

81
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java

@ -53,130 +53,95 @@ import com.liferay.portlet.dynamicdatamapping.util.DDMXSDUtil;
public class RenderFormTaskPortletAction extends BaseStrutsPortletAction { public class RenderFormTaskPortletAction extends BaseStrutsPortletAction {
private static final Log _log = LogFactoryUtil.getLog(RenderFormTaskPortletAction.class);
@Override @Override
public String render(PortletConfig portletConfig, RenderRequest renderRequest, public String render(PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse)
RenderResponse renderResponse) throws Exception { throws Exception {
ServiceContext serviceContext = ServiceContextFactory.getInstance(renderRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(renderRequest);
long companyId = PortalUtil.getCompanyId(renderRequest); long companyId = PortalUtil.getCompanyId(renderRequest);
long workflowTaskId = ParamUtil.getLong(renderRequest, "workflowTaskId"); long workflowTaskId = ParamUtil.getLong(renderRequest, "workflowTaskId");
long assigneeUserId = ParamUtil.getLong(renderRequest, "assigneeUserId"); long assigneeUserId = ParamUtil.getLong(renderRequest, "assigneeUserId");
String transitionName = ParamUtil.getString(renderRequest, "transitionName"); String transitionName = ParamUtil.getString(renderRequest, "transitionName");
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
.getKaleoTaskInstanceToken(workflowTaskId); .getKaleoTaskInstanceToken(workflowTaskId);
KaleoDefinition kaleoDefinition = KaleoDefinitionLocalServiceUtil.getKaleoDefinition(kaleoTaskInstanceToken
KaleoDefinition kaleoDefinition = KaleoDefinitionLocalServiceUtil .getKaleoDefinitionId());
.getKaleoDefinition(kaleoTaskInstanceToken.getKaleoDefinitionId());
KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask();
FormDefinitionLink formDefinitionLink = FormDefinitionLinkLocalServiceUtil FormDefinitionLink formDefinitionLink = FormDefinitionLinkLocalServiceUtil
.fetchByC_DefinitionName_DefinitionVersion(companyId, kaleoDefinition.getName(), .fetchByC_DefinitionName_DefinitionVersion(companyId, kaleoDefinition.getName(),
kaleoDefinition.getVersion()); kaleoDefinition.getVersion());
if (formDefinitionLink == null) { if (formDefinitionLink == null) {
return null; return null;
} }
FormTemplateLink formTemplateLink = FormTemplateLinkLocalServiceUtil FormTemplateLink formTemplateLink = FormTemplateLinkLocalServiceUtil
.fetchByFormDefinitionLinkId_KaleoNodeId_TransitionName( .fetchByFormDefinitionLinkId_KaleoNodeId_TransitionName(formDefinitionLink.getFormDefinitionLinkId(),
formDefinitionLink.getFormDefinitionLinkId(), kaleoTask.getKaleoNodeId(), kaleoTask.getKaleoNodeId(), transitionName);
transitionName);
if (formTemplateLink == null) { if (formTemplateLink == null) {
return null; return null;
} }
long ddmTemplateId = formTemplateLink.getDdmTemplateId(); long ddmTemplateId = formTemplateLink.getDdmTemplateId();
long ddmStructureId = formDefinitionLink.getDdmStructureId(); long ddmStructureId = formDefinitionLink.getDdmStructureId();
/* /*
* Script OnOpenForm * Script OnOpenForm
*/ */
Map<String, Serializable> workflowContext = WorkflowUtil.executeOnOpenForm(companyId, workflowTaskId, Map<String, Serializable> workflowContext = WorkflowUtil.executeOnOpenForm(companyId, workflowTaskId,
assigneeUserId, transitionName); assigneeUserId, transitionName);
Map<String, Serializable> parameters = WorkflowUtil.getFormParameters(companyId, workflowTaskId); Map<String, Serializable> parameters = WorkflowUtil.getFormParameters(companyId, workflowTaskId);
Map<String, List<Map<String, Serializable>>> fieldNameOptions = getOptions(workflowContext, Map<String, List<Map<String, Serializable>>> fieldNameOptions = getOptions(workflowContext,
serviceContext.getLocale()); serviceContext.getLocale());
renderRequest.setAttribute("ddmTemplateId", ddmTemplateId); renderRequest.setAttribute("ddmTemplateId", ddmTemplateId);
renderRequest.setAttribute("ddmStructureId", ddmStructureId); renderRequest.setAttribute("ddmStructureId", ddmStructureId);
renderRequest.setAttribute("parameters", parameters); renderRequest.setAttribute("parameters", parameters);
renderRequest.setAttribute("prefix", WorkflowConstants.PREFIX_NAME_ELEMENT_FORM); renderRequest.setAttribute("prefix", WorkflowConstants.PREFIX_NAME_ELEMENT_FORM);
renderRequest.setAttribute("suffix", WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM); renderRequest.setAttribute("suffix", WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM);
renderRequest.setAttribute("fieldNameOptions", fieldNameOptions); renderRequest.setAttribute("fieldNameOptions", fieldNameOptions);
// ADT BUG BO id = 27
String classPkForCarichiLavoro = ParamUtil.getString(renderRequest, "classPkForCarichiLavoro"); String classPkForCarichiLavoro = ParamUtil.getString(renderRequest, "classPkForCarichiLavoro");
boolean checkVisualizzaCarichiLavoro = (ddmTemplateId == 21699 || ddmTemplateId == 21705); boolean checkVisualizzaCarichiLavoro = (ddmTemplateId == 21699 || ddmTemplateId == 21705);
if (checkVisualizzaCarichiLavoro) { if (checkVisualizzaCarichiLavoro) {
renderRequest.setAttribute("classPkForCarichiLavoro", classPkForCarichiLavoro); renderRequest.setAttribute("classPkForCarichiLavoro", classPkForCarichiLavoro);
} }
// ADT BUG BO ID=32
if (transitionName != null && transitionName.equalsIgnoreCase("registra-esito")) { if (transitionName != null && transitionName.equalsIgnoreCase("registra-esito")) {
parameters.remove("esito"); parameters.remove("esito");
parameters.remove("testo_del_documento"); parameters.remove("testo_del_documento");
} }
return "/portlet/workflow_tasks/render_form_task.jsp"; return "/portlet/workflow_tasks/render_form_task.jsp";
} }
@SuppressWarnings("unchecked")
@Override @Override
public void serveResource(PortletConfig portletConfig, ResourceRequest resourceRequest, public void serveResource(PortletConfig portletConfig, ResourceRequest resourceRequest,
ResourceResponse resourceResponse) throws Exception { ResourceResponse resourceResponse) throws Exception {
ServiceContext serviceContext = ServiceContextFactory.getInstance(resourceRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(resourceRequest);
long companyId = PortalUtil.getCompanyId(resourceRequest); long companyId = PortalUtil.getCompanyId(resourceRequest);
long workflowTaskId = ParamUtil.getLong(resourceRequest, "workflowTaskId"); long workflowTaskId = ParamUtil.getLong(resourceRequest, "workflowTaskId");
long assigneeUserId = ParamUtil.getLong(resourceRequest, "assigneeUserId"); long assigneeUserId = ParamUtil.getLong(resourceRequest, "assigneeUserId");
String transitionName = ParamUtil.getString(resourceRequest, "transitionName"); String transitionName = ParamUtil.getString(resourceRequest, "transitionName");
List<String> errors = new ArrayList<String>(); List<String> errors = new ArrayList<String>();
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
.getKaleoTaskInstanceToken(workflowTaskId); .getKaleoTaskInstanceToken(workflowTaskId);
KaleoDefinition kaleoDefinition = KaleoDefinitionLocalServiceUtil.getKaleoDefinition(kaleoTaskInstanceToken
KaleoDefinition kaleoDefinition = KaleoDefinitionLocalServiceUtil .getKaleoDefinitionId());
.getKaleoDefinition(kaleoTaskInstanceToken.getKaleoDefinitionId());
KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask();
FormDefinitionLink formDefinitionLink = FormDefinitionLinkLocalServiceUtil FormDefinitionLink formDefinitionLink = FormDefinitionLinkLocalServiceUtil
.fetchByC_DefinitionName_DefinitionVersion(companyId, kaleoDefinition.getName(), .fetchByC_DefinitionName_DefinitionVersion(companyId, kaleoDefinition.getName(),
kaleoDefinition.getVersion()); kaleoDefinition.getVersion());
if (formDefinitionLink != null) { if (formDefinitionLink != null) {
FormTemplateLink formTemplateLink = FormTemplateLinkLocalServiceUtil FormTemplateLink formTemplateLink = FormTemplateLinkLocalServiceUtil
.fetchByFormDefinitionLinkId_KaleoNodeId_TransitionName( .fetchByFormDefinitionLinkId_KaleoNodeId_TransitionName(
formDefinitionLink.getFormDefinitionLinkId(), kaleoTask.getKaleoNodeId(), formDefinitionLink.getFormDefinitionLinkId(), kaleoTask.getKaleoNodeId(), transitionName);
transitionName);
if (formTemplateLink != null) { if (formTemplateLink != null) {
Map<String, Serializable> workflowContext = new HashMap<String, Serializable>(); Map<String, Serializable> workflowContext = new HashMap<String, Serializable>();
WorkflowUtil.updateWorkflowContextWithTaskFormParameters(resourceRequest, workflowContext); WorkflowUtil.updateWorkflowContextWithTaskFormParameters(resourceRequest, workflowContext);
DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.getDDMTemplate(formTemplateLink DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.getDDMTemplate(formTemplateLink
.getDdmTemplateId()); .getDdmTemplateId());
String xsd = DDMXSDUtil.getXSD(PortalUtil.getClassNameId(DDMTemplate.class), String xsd = DDMXSDUtil.getXSD(PortalUtil.getClassNameId(DDMTemplate.class),
ddmTemplate.getTemplateId()); ddmTemplate.getTemplateId());
JSONArray jsonArray = DDMXSDUtil.getJSONArray(xsd); JSONArray jsonArray = DDMXSDUtil.getJSONArray(xsd);
@SuppressWarnings("unchecked")
Map<String, String> formParameters = (Map<String, String>) workflowContext Map<String, String> formParameters = (Map<String, String>) workflowContext
.get(WorkflowConstants.CONTEXT_TASK_FORM_PARAMETERS); .get(WorkflowConstants.CONTEXT_TASK_FORM_PARAMETERS);
if (formParameters != null) { if (formParameters != null) {
for (int i = 0; i < jsonArray.length(); i++) { for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i); JSONObject jsonObject = jsonArray.getJSONObject(i);
@ -201,15 +166,13 @@ public class RenderFormTaskPortletAction extends BaseStrutsPortletAction {
} }
} }
} }
/* /*
* Script OnValidation * Script OnValidation
*/ */
workflowContext = WorkflowUtil.executeOnValidation(companyId, workflowTaskId, assigneeUserId, workflowContext = WorkflowUtil.executeOnValidation(companyId, workflowTaskId, assigneeUserId,
transitionName, workflowContext); transitionName, workflowContext);
String json = MapUtil
String json = MapUtil.getString(workflowContext, .getString(workflowContext, WorkflowConstants.CONTEXT_VALIDATION_OUTCOME_PARAMETER);
WorkflowConstants.CONTEXT_VALIDATION_OUTCOME_PARAMETER);
if (Validator.isNotNull(json)) { if (Validator.isNotNull(json)) {
JSONObject validationJSON = JSONFactoryUtil.createJSONObject(json); JSONObject validationJSON = JSONFactoryUtil.createJSONObject(json);
JSONArray validationErrorsJSON = validationJSON.getJSONArray("errors"); JSONArray validationErrorsJSON = validationJSON.getJSONArray("errors");
@ -221,9 +184,7 @@ public class RenderFormTaskPortletAction extends BaseStrutsPortletAction {
} }
} }
} }
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
if (!errors.isEmpty()) { if (!errors.isEmpty()) {
jsonObject.put("valid", false); jsonObject.put("valid", false);
JSONArray jsonMessages = JSONFactoryUtil.createJSONArray(); JSONArray jsonMessages = JSONFactoryUtil.createJSONArray();
@ -234,24 +195,19 @@ public class RenderFormTaskPortletAction extends BaseStrutsPortletAction {
} else { } else {
jsonObject.put("valid", true); jsonObject.put("valid", true);
} }
resourceResponse.setContentType(ContentTypes.APPLICATION_JSON); resourceResponse.setContentType(ContentTypes.APPLICATION_JSON);
HttpServletResponse httpServletResponse = PortalUtil.getHttpServletResponse(resourceResponse); HttpServletResponse httpServletResponse = PortalUtil.getHttpServletResponse(resourceResponse);
ServletResponseUtil.write(httpServletResponse, jsonObject.toString()); ServletResponseUtil.write(httpServletResponse, jsonObject.toString());
resourceResponse.flushBuffer(); resourceResponse.flushBuffer();
} }
private Map<String, List<Map<String, Serializable>>> getOptions( private Map<String, List<Map<String, Serializable>>> getOptions(Map<String, Serializable> workflowContext,
Map<String, Serializable> workflowContext, Locale locale) throws PortalException { Locale locale) throws PortalException {
Map<String, List<Map<String, Serializable>>> fieldNameOptions = Collections.emptyMap(); Map<String, List<Map<String, Serializable>>> fieldNameOptions = Collections.emptyMap();
if (workflowContext.containsKey(WorkflowConstants.CONTEXT_OPEN_FORM_OPTIONS_PARAMETER)) { if (workflowContext.containsKey(WorkflowConstants.CONTEXT_OPEN_FORM_OPTIONS_PARAMETER)) {
String json = MapUtil.getString(workflowContext, String json = MapUtil.getString(workflowContext, WorkflowConstants.CONTEXT_OPEN_FORM_OPTIONS_PARAMETER);
WorkflowConstants.CONTEXT_OPEN_FORM_OPTIONS_PARAMETER);
if (Validator.isNotNull(json)) { if (Validator.isNotNull(json)) {
// field name (ddm) -> map<string, string> // field name (ddm) -> map<string, string>
fieldNameOptions = new HashMap<String, List<Map<String, Serializable>>>(); fieldNameOptions = new HashMap<String, List<Map<String, Serializable>>>();
@ -267,8 +223,7 @@ public class RenderFormTaskPortletAction extends BaseStrutsPortletAction {
for (int i = 0; i < jsonArray.length(); i++) { for (int i = 0; i < jsonArray.length(); i++) {
JSONObject optionJSON = jsonArray.getJSONObject(i); JSONObject optionJSON = jsonArray.getJSONObject(i);
Map<String, Serializable> optionFields = new HashMap<String, Serializable>(); Map<String, Serializable> optionFields = new HashMap<String, Serializable>();
optionFields.put("label", optionFields.put("label", LanguageUtil.get(locale, optionJSON.getString("label")));
LanguageUtil.get(locale, optionJSON.getString("label")));
optionFields.put("value", optionJSON.getString("value")); optionFields.put("value", optionJSON.getString("value"));
optionFields.put("default", optionJSON.getBoolean("default")); optionFields.put("default", optionJSON.getBoolean("default"));
options.add(optionFields); options.add(optionFields);

103
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java

@ -56,8 +56,7 @@ public class WorkflowUtil {
KaleoTaskInstanceToken taskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil KaleoTaskInstanceToken taskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
.getKaleoTaskInstanceToken(workflowTaskId); .getKaleoTaskInstanceToken(workflowTaskId);
if (taskInstanceToken.getClassName().equals(ControlloPratica.class.getName())) { if (taskInstanceToken.getClassName().equals(ControlloPratica.class.getName())) {
controllo = ControlloPraticaLocalServiceUtil.getControlloPratica(taskInstanceToken controllo = ControlloPraticaLocalServiceUtil.getControlloPratica(taskInstanceToken.getClassPK());
.getClassPK());
} }
} catch (PortalException | SystemException e) { } catch (PortalException | SystemException e) {
} }
@ -74,8 +73,8 @@ public class WorkflowUtil {
return pratica; return pratica;
} }
public static Map<String, Serializable> getWorkflowContext(ControlloPratica controllo) public static Map<String, Serializable> getWorkflowContext(ControlloPratica controllo) throws PortalException,
throws PortalException, SystemException { SystemException {
WorkflowInstanceLink link = WorkflowInstanceLinkLocalServiceUtil.getWorkflowInstanceLink( WorkflowInstanceLink link = WorkflowInstanceLinkLocalServiceUtil.getWorkflowInstanceLink(
controllo.getCompanyId(), controllo.getGroupId(), ControlloPratica.class.getName(), controllo.getCompanyId(), controllo.getGroupId(), ControlloPratica.class.getName(),
controllo.getPrimaryKey()); controllo.getPrimaryKey());
@ -84,46 +83,34 @@ public class WorkflowUtil {
return instance.getWorkflowContext(); return instance.getWorkflowContext();
} }
public static Map<String, Serializable> executeOnOpenForm(long companyId, long workflowTaskId, public static Map<String, Serializable> executeOnOpenForm(long companyId, long workflowTaskId, long assigneeUserId,
long assigneeUserId, String transitionName) throws PortalException, SystemException { String transitionName) throws PortalException, SystemException {
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(companyId); serviceContext.setCompanyId(companyId);
serviceContext.setUserId(assigneeUserId); serviceContext.setUserId(assigneeUserId);
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
.getKaleoTaskInstanceToken(workflowTaskId); .getKaleoTaskInstanceToken(workflowTaskId);
KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask();
Map<String, Serializable> workflowContext = new HashMap<String, Serializable>(); Map<String, Serializable> workflowContext = new HashMap<String, Serializable>();
WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil.getWorkflowHandler(kaleoTaskInstanceToken
WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil .getClassName());
.getWorkflowHandler(kaleoTaskInstanceToken.getClassName());
if (workflowHandler != null) { if (workflowHandler != null) {
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE, workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE, workflowHandler.getType(Locale.getDefault()));
workflowHandler.getType(Locale.getDefault()));
} }
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName());
workflowContext
.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName());
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK, workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK,
String.valueOf(kaleoTaskInstanceToken.getClassPK())); String.valueOf(kaleoTaskInstanceToken.getClassPK()));
workflowContext.put(WorkflowConstants.CONTEXT_COMPANY_ID, workflowContext
String.valueOf(kaleoTaskInstanceToken.getCompanyId())); .put(WorkflowConstants.CONTEXT_COMPANY_ID, String.valueOf(kaleoTaskInstanceToken.getCompanyId()));
workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID, workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID, String.valueOf(kaleoTaskInstanceToken.getGroupId()));
String.valueOf(kaleoTaskInstanceToken.getGroupId()));
workflowContext.put(WorkflowConstants.CONTEXT_USER_ID, String.valueOf(assigneeUserId)); workflowContext.put(WorkflowConstants.CONTEXT_USER_ID, String.valueOf(assigneeUserId));
workflowContext.put(WorkflowConstants.CONTEXT_SERVICE_CONTEXT, serviceContext); workflowContext.put(WorkflowConstants.CONTEXT_SERVICE_CONTEXT, serviceContext);
workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName); workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName);
ExecutionContext executionContext = new ExecutionContext(kaleoTaskInstanceToken.getKaleoInstanceToken(),
ExecutionContext executionContext = new ExecutionContext( kaleoTaskInstanceToken, workflowContext, serviceContext);
kaleoTaskInstanceToken.getKaleoInstanceToken(), kaleoTaskInstanceToken, workflowContext,
serviceContext);
ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(), ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(),
ExecutionType.ON_OPEN_FORM, executionContext); ExecutionType.ON_OPEN_FORM, executionContext);
return executionContext.getWorkflowContext(); return executionContext.getWorkflowContext();
} }
@ -140,42 +127,30 @@ public class WorkflowUtil {
if (workflowContext == null) { if (workflowContext == null) {
workflowContext = Collections.<String, Serializable> emptyMap(); workflowContext = Collections.<String, Serializable> emptyMap();
} }
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(companyId); serviceContext.setCompanyId(companyId);
serviceContext.setUserId(assigneeUserId); serviceContext.setUserId(assigneeUserId);
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
.getKaleoTaskInstanceToken(workflowTaskId); .getKaleoTaskInstanceToken(workflowTaskId);
KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask();
WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil.getWorkflowHandler(kaleoTaskInstanceToken
WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil .getClassName());
.getWorkflowHandler(kaleoTaskInstanceToken.getClassName());
if (workflowHandler != null) { if (workflowHandler != null) {
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE, workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE, workflowHandler.getType(Locale.getDefault()));
workflowHandler.getType(Locale.getDefault()));
} }
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName());
workflowContext
.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName());
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK, workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK,
String.valueOf(kaleoTaskInstanceToken.getClassPK())); String.valueOf(kaleoTaskInstanceToken.getClassPK()));
workflowContext.put(WorkflowConstants.CONTEXT_COMPANY_ID, workflowContext
String.valueOf(kaleoTaskInstanceToken.getCompanyId())); .put(WorkflowConstants.CONTEXT_COMPANY_ID, String.valueOf(kaleoTaskInstanceToken.getCompanyId()));
workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID, workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID, String.valueOf(kaleoTaskInstanceToken.getGroupId()));
String.valueOf(kaleoTaskInstanceToken.getGroupId()));
workflowContext.put(WorkflowConstants.CONTEXT_USER_ID, String.valueOf(assigneeUserId)); workflowContext.put(WorkflowConstants.CONTEXT_USER_ID, String.valueOf(assigneeUserId));
workflowContext.put(WorkflowConstants.CONTEXT_SERVICE_CONTEXT, serviceContext); workflowContext.put(WorkflowConstants.CONTEXT_SERVICE_CONTEXT, serviceContext);
workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName); workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName);
ExecutionContext executionContext = new ExecutionContext(kaleoTaskInstanceToken.getKaleoInstanceToken(),
ExecutionContext executionContext = new ExecutionContext( kaleoTaskInstanceToken, workflowContext, serviceContext);
kaleoTaskInstanceToken.getKaleoInstanceToken(), kaleoTaskInstanceToken, workflowContext,
serviceContext);
ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(), ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(),
ExecutionType.ON_VALIDATION, executionContext); ExecutionType.ON_VALIDATION, executionContext);
return executionContext.getWorkflowContext(); return executionContext.getWorkflowContext();
} }
@ -189,26 +164,20 @@ public class WorkflowUtil {
String className, long workflowTaskId) throws PortalException, SystemException { String className, long workflowTaskId) throws PortalException, SystemException {
if (Validator.isNotNull(workflowTaskId)) { if (Validator.isNotNull(workflowTaskId)) {
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
.getKaleoTaskInstanceToken(workflowTaskId); .getKaleoTaskInstanceToken(workflowTaskId);
companyId = kaleoTaskInstanceToken.getCompanyId(); companyId = kaleoTaskInstanceToken.getCompanyId();
groupId = kaleoTaskInstanceToken.getGroupId(); groupId = kaleoTaskInstanceToken.getGroupId();
classPK = kaleoTaskInstanceToken.getClassPK(); classPK = kaleoTaskInstanceToken.getClassPK();
className = kaleoTaskInstanceToken.getClassName(); className = kaleoTaskInstanceToken.getClassName();
} }
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil companyId, groupId, className, classPK);
.fetchWorkflowInstanceLink(companyId, groupId, className, classPK);
if (workflowInstanceLink == null) { if (workflowInstanceLink == null) {
throw new NoSuchWorkflowInstanceLinkException(); throw new NoSuchWorkflowInstanceLinkException();
} }
long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId(); long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId();
Map<String, Serializable> parameters = new HashMap<String, Serializable>(); Map<String, Serializable> parameters = new HashMap<String, Serializable>();
// order asc // order asc
List<FormLog> formLogs = FormLogLocalServiceUtil.findByC_Instance(companyId, workflowInstanceId, List<FormLog> formLogs = FormLogLocalServiceUtil.findByC_Instance(companyId, workflowInstanceId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS); QueryUtil.ALL_POS, QueryUtil.ALL_POS);
@ -220,7 +189,6 @@ public class WorkflowUtil {
parameters.putAll(jsonDeserializer.deserialize(formParameters)); parameters.putAll(jsonDeserializer.deserialize(formParameters));
} }
} }
return parameters; return parameters;
} }
@ -228,23 +196,18 @@ public class WorkflowUtil {
Map<String, Serializable> workflowContext) { Map<String, Serializable> workflowContext) {
Map<String, String> formParameters = null; Map<String, String> formParameters = null;
Enumeration<String> enu = portletRequest.getParameterNames(); Enumeration<String> enu = portletRequest.getParameterNames();
while (enu.hasMoreElements()) { while (enu.hasMoreElements()) {
String name = enu.nextElement(); String name = enu.nextElement();
if (!name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM) if (!name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM)
&& !name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) { && !name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) {
continue; continue;
} }
if (formParameters == null) { if (formParameters == null) {
formParameters = new HashMap<String, String>(); formParameters = new HashMap<String, String>();
} }
String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), name.length()
String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length());
name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length());
String[] values = ParamUtil.getParameterValues(portletRequest, name); String[] values = ParamUtil.getParameterValues(portletRequest, name);
for (int i = 0; i < values.length; i++) { for (int i = 0; i < values.length; i++) {
_log.info(name + "[" + i + "] = \"" + values[i] + "\""); _log.info(name + "[" + i + "] = \"" + values[i] + "\"");
@ -253,37 +216,27 @@ public class WorkflowUtil {
_log.info("Finale \"" + value + "\""); _log.info("Finale \"" + value + "\"");
formParameters.put(parameterName, value); formParameters.put(parameterName, value);
} }
if (formParameters == null) { if (formParameters == null) {
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil
.getHttpServletRequest(portletRequest)); .getHttpServletRequest(portletRequest));
Enumeration<String> enums = httpServletRequest.getParameterNames(); Enumeration<String> enums = httpServletRequest.getParameterNames();
while (enums.hasMoreElements()) { while (enums.hasMoreElements()) {
String name = enums.nextElement(); String name = enums.nextElement();
if (!name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM) if (!name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM)
&& !name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) { && !name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) {
continue; continue;
} }
if (formParameters == null) { if (formParameters == null) {
formParameters = new HashMap<String, String>(); formParameters = new HashMap<String, String>();
} }
String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(),
name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length()); name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length());
String value = StringUtil.merge(ParamUtil.getParameterValues(httpServletRequest, name)); String value = StringUtil.merge(ParamUtil.getParameterValues(httpServletRequest, name));
formParameters.put(parameterName, value); formParameters.put(parameterName, value);
} }
} }
if (formParameters != null) { if (formParameters != null) {
workflowContext workflowContext.put(WorkflowConstants.CONTEXT_TASK_FORM_PARAMETERS, (Serializable) formParameters);
.put(WorkflowConstants.CONTEXT_TASK_FORM_PARAMETERS, (Serializable) formParameters);
} }
} }
} }

4
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=Kaleo build.namespace=Kaleo
build.number=28 build.number=32
build.date=1616063088077 build.date=1616424088204
build.auto.upgrade=true build.auto.upgrade=true
## ##

Caricamento…
Annulla
Salva