Sfoglia il codice sorgente

Migliorata ricerca frontend

master
Salvatore La Manna 2 anni fa
parent
commit
029b2756d2
  1. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/ControlloPraticaIndexer.java
  2. 118
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/IndexerUtil.java
  3. 15
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/IntPraticaIndexer.java
  4. 62
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/BaseSearch.java
  5. 64
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/ControlloPraticaSearch.java
  6. 97
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/IntPraticaSearch.java
  7. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/AmministrazionePortlet.java
  8. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerEstrazioneFirme.java
  9. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerGeneraProtocollo.java
  10. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerInvioDocumento.java
  11. 22
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
  12. 7
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/search.jsp
  13. 32
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/search.jsp
  14. 4
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java
  15. 40
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/search.jsp
  16. 2
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view.jsp
  17. 4
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/mwg/sismica/bo/shared/util/IndexField.java
  18. 1
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java
  19. BIN
      liferay-plugins-sdk-6.2/z.zip

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/ControlloPraticaIndexer.java

@ -86,6 +86,9 @@ public class ControlloPraticaIndexer extends BaseIndexer {
} else { } else {
_log.warn("Received a null ControlloPratica in input."); _log.warn("Received a null ControlloPratica in input.");
} }
if (_log.isDebugEnabled()) {
_log.debug(document);
}
return document; return document;
} }

118
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/IndexerUtil.java

@ -1,37 +1,54 @@
package it.mwg.sismica.bo.indexer; package it.mwg.sismica.bo.indexer;
import it.mwg.sismica.bo.shared.util.AvvisoUtil;
import it.mwg.sismica.bo.shared.util.IndexField; import it.mwg.sismica.bo.shared.util.IndexField;
import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.ParereGeologo; import it.tref.liferay.portos.bo.model.ParereGeologo;
import it.tref.liferay.portos.bo.model.Soggetto; import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.model.Territorio; import it.tref.liferay.portos.bo.model.Territorio;
import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil; import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil; import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import it.tref.liferay.portos.kaleo.model.FormLog;
import it.tref.liferay.portos.kaleo.service.FormLogLocalServiceUtil;
import java.text.Format; import java.text.Format;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.search.Document; import com.liferay.portal.kernel.search.Document;
import com.liferay.portal.kernel.search.Field; import com.liferay.portal.kernel.search.Field;
import com.liferay.portal.kernel.util.FastDateFormatFactoryUtil; import com.liferay.portal.kernel.util.FastDateFormatFactoryUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.workflow.WorkflowException; import com.liferay.portal.kernel.workflow.WorkflowException;
import com.liferay.portal.kernel.workflow.WorkflowInstance; 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.kernel.workflow.WorkflowLog;
import com.liferay.portal.kernel.workflow.WorkflowLogManagerUtil;
import com.liferay.portal.kernel.workflow.WorkflowTask; import com.liferay.portal.kernel.workflow.WorkflowTask;
import com.liferay.portal.kernel.workflow.WorkflowTaskAssignee; import com.liferay.portal.kernel.workflow.WorkflowTaskAssignee;
import com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil; import com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil;
import com.liferay.portal.kernel.workflow.comparator.WorkflowComparatorFactoryUtil;
import com.liferay.portal.model.Role; import com.liferay.portal.model.Role;
import com.liferay.portal.model.User; import com.liferay.portal.model.User;
import com.liferay.portal.model.WorkflowInstanceLink; import com.liferay.portal.model.WorkflowInstanceLink;
@ -42,11 +59,14 @@ public class IndexerUtil {
public static final Format DATE_FORMAT = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd"); public static final Format DATE_FORMAT = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd");
private static final Log _log = LogFactoryUtil.getLog(IndexerUtil.class);
// Manifattura Web Group per Regione Siciliana Modifiche per rendere i campi di testo ricercabili per parole // Manifattura Web Group per Regione Siciliana Modifiche per rendere i campi di testo ricercabili per parole
// contenute e non per corrispondenza esatta. // contenute e non per corrispondenza esatta.
public static Document fillDocument(Document document, IntPratica ip, ControlloPratica cp) throws SystemException, public static Document fillDocument(Document document, IntPratica ip, ControlloPratica cp) throws SystemException,
WorkflowException { WorkflowException {
long intPraticaId = ip.getIntPraticaId();
document.addKeyword(Field.USER_ID, ip.getUserId()); document.addKeyword(Field.USER_ID, ip.getUserId());
User titolare = UserLocalServiceUtil.fetchUser(ip.getUserId()); User titolare = UserLocalServiceUtil.fetchUser(ip.getUserId());
if (Validator.isNotNull(titolare)) { if (Validator.isNotNull(titolare)) {
@ -62,7 +82,6 @@ public class IndexerUtil {
default: default:
document.addKeyword(IndexField.PRATICA_APERTA, true); document.addKeyword(IndexField.PRATICA_APERTA, true);
} }
document.addKeyword(IndexField.IN_COMPILAZIONE, Validator.isNull(ip.getStatoPratica()));
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(ip.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(ip.getTerritorioId());
if (Validator.isNull(territorio)) { if (Validator.isNull(territorio)) {
document.addKeyword(Field.GROUP_ID, ip.getGroupId()); document.addKeyword(Field.GROUP_ID, ip.getGroupId());
@ -74,7 +93,9 @@ public class IndexerUtil {
document.addKeyword(IndexField.CODICE_PROVINCIA, comune.getCodiceProvincia()); document.addKeyword(IndexField.CODICE_PROVINCIA, comune.getCodiceProvincia());
} }
} }
if (Validator.isNotNull(ip.getStatoPratica())) { if (Validator.isNull(ip.getStatoPratica())) {
document.addKeyword(IndexField.STATO_PRATICA, StatoPraticaConstants.IN_COMPILAZIONE);
} else {
document.addKeyword(IndexField.STATO_PRATICA, ip.getStatoPratica()); document.addKeyword(IndexField.STATO_PRATICA, ip.getStatoPratica());
} }
if (Validator.isNotNull(ip.getDtPratica())) { if (Validator.isNotNull(ip.getDtPratica())) {
@ -84,8 +105,8 @@ public class IndexerUtil {
document.addKeywordSortable(IndexField.NUMERO_PROGETTO, ip.getNumeroProgetto()); document.addKeywordSortable(IndexField.NUMERO_PROGETTO, ip.getNumeroProgetto());
} }
document.addKeyword(IndexField.UNITA_OPERATIVA, ip.getUnitaOperativa()); document.addKeyword(IndexField.UNITA_OPERATIVA, ip.getUnitaOperativa());
List<ParereGeologo> pareri = ParereGeologoLocalServiceUtil.findByIntPraticaId(ip.getIntPraticaId(), List<ParereGeologo> pareri = ParereGeologoLocalServiceUtil.findByIntPraticaId(intPraticaId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, QueryUtil.ALL_POS); QueryUtil.ALL_POS);
List<Long> idGeologi = new ArrayList<>(); List<Long> idGeologi = new ArrayList<>();
boolean pareriForniti = false; boolean pareriForniti = false;
for (ParereGeologo geo : pareri) { for (ParereGeologo geo : pareri) {
@ -106,8 +127,8 @@ public class IndexerUtil {
istruttore.getScreenName().toLowerCase() }); istruttore.getScreenName().toLowerCase() });
} }
document.addNumber(IndexField.ISTRUTTORE_ID, ip.getStatusByUserId()); document.addNumber(IndexField.ISTRUTTORE_ID, ip.getStatusByUserId());
List<Soggetto> listaCommittenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto( List<Soggetto> listaCommittenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId,
ip.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE); TipoSoggettoUtil.COMMITTENTE);
if (Validator.isNotNull(listaCommittenti) && listaCommittenti.size() > 0) { if (Validator.isNotNull(listaCommittenti) && listaCommittenti.size() > 0) {
Set<String> committenti = new HashSet<>(); Set<String> committenti = new HashSet<>();
for (Soggetto committente : listaCommittenti) { for (Soggetto committente : listaCommittenti) {
@ -147,25 +168,26 @@ public class IndexerUtil {
} }
document.addText(IndexField.SOGGETTO, soggetti.toArray(new String[0])); document.addText(IndexField.SOGGETTO, soggetti.toArray(new String[0]));
} }
String taskName = hasFirma(intPraticaId) ? "Firma" : StringPool.BLANK;
// Indicizzazione campi da Kaleo // Indicizzazione campi da Kaleo
if (Validator.isNotNull(cp)) { if (Validator.isNotNull(cp)) {
document.addNumber(IndexField.STATUS, cp.getStatus()); document.addNumber(IndexField.STATUS, cp.getStatus());
long companyId = cp.getCompanyId();
if (Validator.isNotNull(cp.getStatusDate())) { if (Validator.isNotNull(cp.getStatusDate())) {
document.addKeyword(IndexField.DATA_ESITO, DATE_FORMAT.format(cp.getStatusDate())); document.addKeyword(IndexField.DATA_ESITO, DATE_FORMAT.format(cp.getStatusDate()));
} }
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(
cp.getCompanyId(), cp.getGroupId(), ControlloPratica.class.getName(), cp.getPrimaryKey()); companyId, cp.getGroupId(), ControlloPratica.class.getName(), cp.getPrimaryKey());
if (Validator.isNotNull(workflowInstanceLink)) { if (Validator.isNotNull(workflowInstanceLink)) {
WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(cp.getCompanyId(), WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(companyId,
workflowInstanceLink.getWorkflowInstanceId()); workflowInstanceLink.getWorkflowInstanceId());
if (Validator.isNotNull(workflowInstance)) { if (Validator.isNotNull(workflowInstance)) {
document.addKeyword(IndexField.WORKFLOW_STATE, workflowInstance.getState()); List<WorkflowTask> tasks = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(companyId,
List<WorkflowTask> tasks = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance( null, workflowInstance.getWorkflowInstanceId(), false, 0, 1,
cp.getCompanyId(), null, workflowInstance.getWorkflowInstanceId(), false, WorkflowComparatorFactoryUtil.getTaskCreateDateComparator(false));
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); if (!tasks.isEmpty()) {
if (Validator.isNotNull(tasks) && !tasks.isEmpty()) {
WorkflowTask task = tasks.get(0); WorkflowTask task = tasks.get(0);
if (task.getAssigneeUserId() != 0L && task.getAssigneeUserId() != -1) { if (task.getAssigneeUserId() > 0) {
document.addKeyword(IndexField.TASK_ASSIGNEE_USER_ID, task.getAssigneeUserId()); document.addKeyword(IndexField.TASK_ASSIGNEE_USER_ID, task.getAssigneeUserId());
} }
if (Validator.isNotNull(task.getWorkflowTaskAssignees()) if (Validator.isNotNull(task.getWorkflowTaskAssignees())
@ -180,17 +202,73 @@ public class IndexerUtil {
document.addKeyword(IndexField.TASK_ASSIGNEE_ROLE_IDS, document.addKeyword(IndexField.TASK_ASSIGNEE_ROLE_IDS,
roleIdsAssignee.toArray(new String[0])); roleIdsAssignee.toArray(new String[0]));
} }
document.addKeyword(IndexField.TASK, task.getName()); if (taskName.isEmpty()) {
taskName = task.getName();
}
if (task.getName().equals("Approvazione") && !task.isCompleted()) {
String esito = esitoPendente(cp);
if (!esito.isEmpty()) {
document.addKeyword(IndexField.ESITO_PENDENTE, esito);
}
}
}
} }
} }
} }
if (!taskName.isEmpty()) {
document.addKeyword(IndexField.TASK, taskName);
} }
// Prendo l'ultimo DettPratica legato a IntPratica // Prendo l'ultimo DettPratica legato a IntPratica
// DettPratica dp = DettPraticaLocalServiceUtil.getLastCompletedByIntPraticaAndProtocolloNotEmpty(ip DettPratica dp = DettPraticaLocalServiceUtil.getLastCompletedByIntPraticaAndProtocolloNotEmpty(intPraticaId);
// .getIntPraticaId()); if (Validator.isNull(dp)) {
// if (Validator.isNull(dp)) { dp = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPraticaId);
// dp = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(ip.getIntPraticaId()); }
// } if (Validator.isNull(dp)) {
dp=DettPraticaLocalServiceUtil.getLastEditableByIntPratica(intPraticaId);
}
if (Validator.isNotNull(dp)) {
document.addText(IndexField.DESCRIZIONE, dp.getDescLongIntervento());
}
return document; return document;
} }
private static boolean hasFirma(long intPraticaId) throws SystemException {
DynamicQuery query = AvvisoLocalServiceUtil.dynamicQuery();
query.add(PropertyFactoryUtil.forName("intPraticaId").eq(intPraticaId));
query.add(PropertyFactoryUtil.forName("tipoAvviso").eq(AvvisoUtil.TIPO_AVVISO_FIRMA));
query.add(PropertyFactoryUtil.forName("annullato").eq(false));
query.add(PropertyFactoryUtil.forName("rifiutato").eq(false));
query.add(PropertyFactoryUtil.forName("fileEntryIdInvio").eq(0L));
return AvvisoLocalServiceUtil.dynamicQuery(query).size() > 0;
}
private static final List<Integer> LOG_TYPES = Arrays.asList(WorkflowLog.TASK_ASSIGN, WorkflowLog.TASK_COMPLETION,
WorkflowLog.TASK_UPDATE, WorkflowLog.TRANSITION);
private static String esitoPendente(ControlloPratica cp) {
long companyId = cp.getCompanyId();
try {
WorkflowInstanceLink link = WorkflowInstanceLinkLocalServiceUtil.getWorkflowInstanceLink(companyId,
cp.getGroupId(), ControlloPratica.class.getName(), cp.getPrimaryKey());
List<WorkflowLog> logs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(companyId,
link.getWorkflowInstanceId(), LOG_TYPES, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
WorkflowComparatorFactoryUtil.getLogCreateDateComparator(false));
for (WorkflowLog log : logs) {
if (log.getWorkflowTaskId() > 0) {
WorkflowTask task = WorkflowTaskManagerUtil.getWorkflowTask(companyId, log.getWorkflowTaskId());
FormLog formLog = FormLogLocalServiceUtil.findByC_Task(companyId, task.getWorkflowTaskId());
if (Validator.isNotNull(formLog) && Validator.isNotNull(formLog.getFormParameters())) {
JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters());
if (json.has("esito")) {
return json.getString("esito");
}
}
}
}
} catch (Exception e) {}
return StringPool.BLANK;
}
} }

15
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/IntPraticaIndexer.java

@ -1,7 +1,9 @@
package it.mwg.sismica.bo.indexer; package it.mwg.sismica.bo.indexer;
import it.mwg.sismica.bo.shared.util.IndexField; import it.mwg.sismica.bo.shared.util.IndexField;
import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaServiceUtil;
import it.tref.liferay.portos.bo.service.persistence.IntPraticaActionableDynamicQuery; import it.tref.liferay.portos.bo.service.persistence.IntPraticaActionableDynamicQuery;
@ -78,13 +80,22 @@ public class IntPraticaIndexer extends BaseIndexer {
+ StringPool.COMMA_AND_SPACE) + "id " + ip.getIntPraticaId()); + StringPool.COMMA_AND_SPACE) + "id " + ip.getIntPraticaId());
} }
document = getBaseModelDocument(PORTLET_ID, intPratica); document = getBaseModelDocument(PORTLET_ID, intPratica);
document.addKeyword("entryClassName", IntPratica.class.getName()); document.addKeyword(Field.ENTRY_CLASS_NAME, IntPratica.class.getName());
document.addKeyword(Field.PORTLET_ID, getPortletId()); document.addKeyword(Field.PORTLET_ID, getPortletId());
document.addNumber(IndexField.INT_PRATICA_ID, ip.getIntPraticaId()); document.addNumber(IndexField.INT_PRATICA_ID, ip.getIntPraticaId());
IndexerUtil.fillDocument(document, ip, null); ControlloPratica cp = null;
for (ControlloPratica controllo : ControlloPraticaLocalServiceUtil.findByIntPratica(ip.getIntPraticaId())) {
if ((cp == null) || (cp.getControlloPraticaId() < controllo.getControlloPraticaId())) {
cp = controllo;
}
}
IndexerUtil.fillDocument(document, ip, cp);
} else { } else {
_log.warn("Received a null IntPratica in input."); _log.warn("Received a null IntPratica in input.");
} }
if (_log.isDebugEnabled()) {
_log.debug(document);
}
return document; return document;
} }

62
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/BaseSearch.java

@ -19,6 +19,7 @@ import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.search.BooleanClauseOccur; import com.liferay.portal.kernel.search.BooleanClauseOccur;
import com.liferay.portal.kernel.search.BooleanQuery; import com.liferay.portal.kernel.search.BooleanQuery;
import com.liferay.portal.kernel.search.BooleanQueryFactoryUtil; import com.liferay.portal.kernel.search.BooleanQueryFactoryUtil;
import com.liferay.portal.kernel.search.Hits;
import com.liferay.portal.kernel.search.ParseException; import com.liferay.portal.kernel.search.ParseException;
import com.liferay.portal.kernel.search.SearchContext; import com.liferay.portal.kernel.search.SearchContext;
import com.liferay.portal.kernel.search.Sort; import com.liferay.portal.kernel.search.Sort;
@ -45,7 +46,7 @@ public class BaseSearch {
IndexField.COMUNE_ID, IndexField.TITOLARE, IndexField.ISTRUTTORE, IndexField.ISTRUTTORE_ID, IndexField.COMUNE_ID, IndexField.TITOLARE, IndexField.ISTRUTTORE, IndexField.ISTRUTTORE_ID,
IndexField.COMMITTENTE, IndexField.SOGGETTO, IndexField.UNITA_OPERATIVA, IndexField.GEOLOGO_ID, IndexField.COMMITTENTE, IndexField.SOGGETTO, IndexField.UNITA_OPERATIVA, IndexField.GEOLOGO_ID,
IndexField.PARERI_FORNITI, IndexField.TASK, IndexField.DATA_RICHIESTA_DA, IndexField.DATA_RICHIESTA_A, IndexField.PARERI_FORNITI, IndexField.TASK, IndexField.DATA_RICHIESTA_DA, IndexField.DATA_RICHIESTA_A,
IndexField.DATA_ESITO_DA, IndexField.DATA_ESITO_A, IndexField.STATO_PRATICA, IndexField.WORKFLOW_STATE); IndexField.DATA_ESITO_DA, IndexField.DATA_ESITO_A, IndexField.STATO_PRATICA);
} }
protected static Sort[] getOrderedQuery(HttpServletRequest request) { protected static Sort[] getOrderedQuery(HttpServletRequest request) {
@ -79,6 +80,7 @@ public class BaseSearch {
queryKeywords(query, request, IndexField.ISTRUTTORE); queryKeywords(query, request, IndexField.ISTRUTTORE);
queryKeywords(query, request, IndexField.SOGGETTO); queryKeywords(query, request, IndexField.SOGGETTO);
queryKeywords(query, request, IndexField.TITOLARE); queryKeywords(query, request, IndexField.TITOLARE);
queryKeywords(query, request, IndexField.DESCRIZIONE);
queryNumeroProgetto(request, query, searchContext); queryNumeroProgetto(request, query, searchContext);
queryPareriForniti(request, query, searchContext); queryPareriForniti(request, query, searchContext);
queryPraticaAperta(request, query, searchContext); queryPraticaAperta(request, query, searchContext);
@ -86,7 +88,7 @@ public class BaseSearch {
queryStatoPratica(request, query, searchContext); queryStatoPratica(request, query, searchContext);
queryTipoProcedura(request, query, searchContext); queryTipoProcedura(request, query, searchContext);
queryUnitaOperativa(request, query, searchContext); queryUnitaOperativa(request, query, searchContext);
queryWorkflowState(request, query, searchContext); queryTask(request, query, searchContext);
} }
private static void queryComune(HttpServletRequest request, BooleanQuery query, SearchContext searchContext) private static void queryComune(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
@ -123,8 +125,8 @@ public class BaseSearch {
String da = Validator.isNull(daReq) ? "00000000" : DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING String da = Validator.isNull(daReq) ? "00000000" : DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING
.parse(daReq)); .parse(daReq));
String a = DATE_FORMAT_LUCENE.format(Validator.isNull(aReq) ? new Date() : DATE_FORMAT_STRING.parse(aReq)); String a = DATE_FORMAT_LUCENE.format(Validator.isNull(aReq) ? new Date() : DATE_FORMAT_STRING.parse(aReq));
TermRangeQuery termRangeQuery = TermRangeQueryFactoryUtil.create(searchContext, IndexField.DATA_ESITO, TermRangeQuery termRangeQuery = TermRangeQueryFactoryUtil.create(searchContext, IndexField.DATA_ESITO, da,
da, a, true, true); a, true, true);
query.add(termRangeQuery, BooleanClauseOccur.MUST); query.add(termRangeQuery, BooleanClauseOccur.MUST);
} }
} }
@ -216,17 +218,41 @@ public class BaseSearch {
private static void queryStatoPratica(HttpServletRequest request, BooleanQuery query, SearchContext searchContext) private static void queryStatoPratica(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException { throws ParseException {
String task = ParamUtil.getString(request, IndexField.TASK);
if (!task.isEmpty()) {
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.TASK, task);
query.add(term, BooleanClauseOccur.MUST);
}
String statoPratica = ParamUtil.getString(request, IndexField.STATO_PRATICA); String statoPratica = ParamUtil.getString(request, IndexField.STATO_PRATICA);
if (Validator.isNotNull(statoPratica)) { if (!statoPratica.isEmpty()) {
TermQuery term = null; TermQuery term = null;
if (statoPratica.equals("IC")) { // Se richiesto stato "Approvazione" si ricerca l'esito da approvare
term = TermQueryFactoryUtil.create(searchContext, "dtPratica", "0"); if (task.equals("Approvazione")) {
} else if (statoPratica.equals(StatoPraticaConstants.VARIATA)) { BooleanQuery bq = BooleanQueryFactoryUtil.create(searchContext);
term = TermQueryFactoryUtil.create(searchContext, "variata", StringPool.TRUE); term = TermQueryFactoryUtil.create(searchContext, IndexField.ESITO_PENDENTE, statoPratica);
} else if (!statoPratica.equals("-1")) { bq.add(term, BooleanClauseOccur.SHOULD);
term = TermQueryFactoryUtil.create(searchContext, IndexField.STATO_PRATICA, statoPratica); switch (statoPratica) {
case StatoPraticaConstants.AUTORIZZATA:
term = TermQueryFactoryUtil.create(searchContext, IndexField.ESITO_PENDENTE,
StatoPraticaConstants.CONFORME);
break;
case StatoPraticaConstants.CONFORME:
term = TermQueryFactoryUtil.create(searchContext, IndexField.ESITO_PENDENTE,
StatoPraticaConstants.AUTORIZZATA);
break;
case StatoPraticaConstants.NON_AUTORIZZATA:
term = TermQueryFactoryUtil.create(searchContext, IndexField.ESITO_PENDENTE,
StatoPraticaConstants.NON_CONFORME);
break;
case StatoPraticaConstants.NON_CONFORME:
term = TermQueryFactoryUtil.create(searchContext, IndexField.ESITO_PENDENTE,
StatoPraticaConstants.NON_AUTORIZZATA);
break;
} }
if (Validator.isNotNull(term)) { bq.add(term, BooleanClauseOccur.SHOULD);
query.add(bq, BooleanClauseOccur.MUST);
} else {
term = TermQueryFactoryUtil.create(searchContext, IndexField.STATO_PRATICA, statoPratica);
query.add(term, BooleanClauseOccur.MUST); query.add(term, BooleanClauseOccur.MUST);
} }
} }
@ -260,13 +286,15 @@ public class BaseSearch {
} }
} }
private static void queryWorkflowState(HttpServletRequest request, BooleanQuery query, SearchContext searchContext) private static void queryTask(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException { throws ParseException {
String state = ParamUtil.getString(request, IndexField.WORKFLOW_STATE); }
if (Validator.isNotNull(state)) {
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.WORKFLOW_STATE, state); protected static void logResults(BooleanQuery query, Hits hits) {
query.add(term, BooleanClauseOccur.MUST);
if (_log.isDebugEnabled()) {
_log.debug(query + " --- " + hits.getLength());
} }
} }
} }

64
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/ControlloPraticaSearch.java

@ -96,13 +96,8 @@ public class ControlloPraticaSearch extends BaseSearch {
} }
// Condizioni aggiuntive // Condizioni aggiuntive
query(request, user, query, searchContext); query(request, user, query, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + query.toString());
}
hits = SearchEngineUtil.search(searchContext, query); hits = SearchEngineUtil.search(searchContext, query);
if (_log.isDebugEnabled()) { logResults(query, hits);
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) { } catch (ParseException | SearchException | SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
@ -188,13 +183,8 @@ public class ControlloPraticaSearch extends BaseSearch {
} }
// Condizioni aggiuntive // Condizioni aggiuntive
query(request, user, query, searchContext); query(request, user, query, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + query.toString());
}
hits = SearchEngineUtil.search(searchContext, query); hits = SearchEngineUtil.search(searchContext, query);
if (_log.isDebugEnabled()) { logResults(query, hits);
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) { } catch (ParseException | SearchException | SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
@ -258,13 +248,8 @@ public class ControlloPraticaSearch extends BaseSearch {
} }
// Condizioni aggiuntive // Condizioni aggiuntive
query(request, user, query, searchContext); query(request, user, query, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + query.toString());
}
hits = SearchEngineUtil.search(searchContext, query); hits = SearchEngineUtil.search(searchContext, query);
if (_log.isDebugEnabled()) { logResults(query, hits);
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) { } catch (ParseException | SearchException | SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
@ -288,9 +273,9 @@ public class ControlloPraticaSearch extends BaseSearch {
ControlloPratica.class.getName()); ControlloPratica.class.getName());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS, TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS,
WorkflowConstants.STATUS_PENDING); WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST); query.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST); query.add(statusTermQuery, BooleanClauseOccur.MUST);
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio"); String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine"); String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) { if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) {
@ -306,15 +291,10 @@ public class ControlloPraticaSearch extends BaseSearch {
} }
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext, TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", dataDa, dataAl, true, true); "dataInizioProcedimento", dataDa, dataAl, true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST); query.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
}
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) {
_log.debug("Number of hints found : " + hits.getLength());
} }
hits = SearchEngineUtil.search(searchContext, query);
logResults(query, hits);
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId"); String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) { if (Validator.isNotNull(controlloPraticaId)) {
@ -350,10 +330,10 @@ public class ControlloPraticaSearch extends BaseSearch {
user.getUserId()); user.getUserId());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS, TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS,
WorkflowConstants.STATUS_PENDING); WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST); query.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST); query.add(userIdTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST); query.add(statusTermQuery, BooleanClauseOccur.MUST);
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio"); String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine"); String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) { if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) {
@ -369,15 +349,10 @@ public class ControlloPraticaSearch extends BaseSearch {
} }
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext, TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", dataDa, dataAl, true, true); "dataInizioProcedimento", dataDa, dataAl, true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST); query.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
}
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
} }
hits = SearchEngineUtil.search(searchContext, query);
logResults(query, hits);
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId"); String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) { if (Validator.isNotNull(controlloPraticaId)) {
@ -454,13 +429,8 @@ public class ControlloPraticaSearch extends BaseSearch {
} }
// Condizioni aggiuntive // Condizioni aggiuntive
query(request, user, query, searchContext); query(request, user, query, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + query.toString());
}
hits = SearchEngineUtil.search(searchContext, query); hits = SearchEngineUtil.search(searchContext, query);
if (_log.isDebugEnabled()) { logResults(query, hits);
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) { } catch (ParseException | SearchException | SystemException e) {
_log.error(e, e); _log.error(e, e);
} }

97
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/IntPraticaSearch.java

@ -2,6 +2,7 @@ package it.mwg.sismica.bo.search;
import it.mwg.sismica.bo.shared.util.IndexField; import it.mwg.sismica.bo.shared.util.IndexField;
import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import java.util.List; import java.util.List;
@ -46,20 +47,20 @@ public class IntPraticaSearch extends BaseSearch {
searchContext.setSorts(getOrderedQuery(request)); searchContext.setSorts(getOrderedQuery(request));
Hits hits = null; Hits hits = null;
try { try {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & userId=userId e stato!=chiuso ?? // Condizioni necessarie per questa ricerca: entryClassName=IntPratica & userId=userId e stato!=chiuso ??
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME, TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName()); IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, Field.USER_ID, user.getUserId()); termQuery = TermQueryFactoryUtil.create(searchContext, Field.USER_ID, user.getUserId());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE); termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive // Condizioni aggiuntive
query(request, user, booleanQuery, searchContext); fullQuery(request, user, query, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery); hits = SearchEngineUtil.search(searchContext, query);
logResults(user, booleanQuery, hits); logResults(query, hits);
} catch (SearchException | ParseException e) { } catch (SearchException | ParseException | java.text.ParseException e) {
_log.error(e, e); _log.error(e, e);
} }
return hits; return hits;
@ -75,23 +76,23 @@ public class IntPraticaSearch extends BaseSearch {
searchContext.setSorts(getOrderedQuery(request)); searchContext.setSorts(getOrderedQuery(request));
Hits hits = null; Hits hits = null;
try { try {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & soggettiInteressati=userScreenName // Condizioni necessarie per questa ricerca: entryClassName=IntPratica & soggettiInteressati=userScreenName
// e userId!=myUserId e stato!=chiuso ?? // e userId!=myUserId e stato!=chiuso ??
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME, TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName()); IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.SOGGETTO, user.getScreenName()); termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.SOGGETTO, user.getScreenName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.PRATICA_APERTA, StringPool.TRUE); termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.PRATICA_APERTA, StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE); termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive // Condizioni aggiuntive
query(request, user, booleanQuery, searchContext); fullQuery(request, user, query, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery); hits = SearchEngineUtil.search(searchContext, query);
logResults(user, booleanQuery, hits); logResults(query, hits);
} catch (ParseException | SearchException e) { } catch (ParseException | SearchException | java.text.ParseException e) {
_log.error(e, e); _log.error(e, e);
} }
return hits; return hits;
@ -109,24 +110,24 @@ public class IntPraticaSearch extends BaseSearch {
try { try {
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & soggettiInteressati=userScreenName // Condizioni necessarie per questa ricerca: entryClassName=IntPratica & soggettiInteressati=userScreenName
// e stato==chiuso // e stato==chiuso
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
BooleanQuery altriProgettiBooleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery altriProgettiBooleanQuery = BooleanQueryFactoryUtil.create(searchContext);
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.SOGGETTO, user.getScreenName()); TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.SOGGETTO, user.getScreenName());
altriProgettiBooleanQuery.add(termQuery, BooleanClauseOccur.SHOULD); altriProgettiBooleanQuery.add(termQuery, BooleanClauseOccur.SHOULD);
termQuery = TermQueryFactoryUtil.create(searchContext, Field.USER_ID, user.getUserId()); termQuery = TermQueryFactoryUtil.create(searchContext, Field.USER_ID, user.getUserId());
altriProgettiBooleanQuery.add(termQuery, BooleanClauseOccur.SHOULD); altriProgettiBooleanQuery.add(termQuery, BooleanClauseOccur.SHOULD);
termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME, IntPratica.class.getName()); termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME, IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.PRATICA_APERTA, StringPool.FALSE); termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.PRATICA_APERTA, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
booleanQuery.add(altriProgettiBooleanQuery, BooleanClauseOccur.MUST); query.add(altriProgettiBooleanQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE); termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive // Condizioni aggiuntive
query(request, user, booleanQuery, searchContext); fullQuery(request, user, query, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery); hits = SearchEngineUtil.search(searchContext, query);
logResults(user, booleanQuery, hits); logResults(query, hits);
} catch (ParseException | SearchException e) { } catch (ParseException | SearchException | java.text.ParseException e) {
_log.error(e, e); _log.error(e, e);
} }
return hits; return hits;
@ -177,9 +178,9 @@ public class IntPraticaSearch extends BaseSearch {
} }
} }
// Condizioni aggiuntive // Condizioni aggiuntive
query(request, user, query, searchContext); queryBO(request, user, query, searchContext);
hits = SearchEngineUtil.search(searchContext, query); hits = SearchEngineUtil.search(searchContext, query);
logResults(user, query, hits); logResults(query, hits);
} catch (ParseException | SearchException | SystemException e) { } catch (ParseException | SearchException | SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
@ -209,50 +210,32 @@ public class IntPraticaSearch extends BaseSearch {
searchContext.setSorts(getOrderedQuery(request)); searchContext.setSorts(getOrderedQuery(request));
Hits hits = null; Hits hits = null;
try { try {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & statusByUserId = myUserId // Condizioni necessarie per questa ricerca: entryClassName=IntPratica & statusByUserId = myUserId
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME, TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName()); IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId", user.getUserId()); termQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId", user.getUserId());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); query.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive // Condizioni aggiuntive
queryForIstruttore(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits);
} catch (ParseException | SearchException e) {
_log.error(e, e);
}
return hits;
}
private static void queryForIstruttore(HttpServletRequest request, User user, BooleanQuery query,
SearchContext searchContext) {
try {
fullQuery(request, user, query, searchContext); fullQuery(request, user, query, searchContext);
} catch (ParseException | java.text.ParseException e) { hits = SearchEngineUtil.search(searchContext, query);
logResults(query, hits);
} catch (ParseException | SearchException | java.text.ParseException e) {
_log.error(e, e); _log.error(e, e);
} }
return hits;
} }
private static void query(HttpServletRequest request, User user, BooleanQuery query, SearchContext searchContext) { private static void queryBO(HttpServletRequest request, User user, BooleanQuery query, SearchContext searchContext) {
try { try {
fullQuery(request, user, query, searchContext); fullQuery(request, user, query, searchContext);
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.IN_COMPILAZIONE, StringPool.FALSE); TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.STATO_PRATICA,
query.add(term, BooleanClauseOccur.MUST); StatoPraticaConstants.IN_COMPILAZIONE);
query.add(term, BooleanClauseOccur.MUST_NOT);
} catch (ParseException | java.text.ParseException e) { } catch (ParseException | java.text.ParseException e) {
_log.error(e, e); _log.error(e, e);
} }
} }
private static void logResults(User user, BooleanQuery booleanQuery, Hits hits) {
if (_log.isDebugEnabled()) {
_log.debug("Utente " + user.getScreenName() + " query : " + booleanQuery);
_log.debug("Number of hint find : " + hits.getLength());
}
}
} }

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/AmministrazionePortlet.java

@ -381,7 +381,9 @@ public class AmministrazionePortlet extends MVCPortlet {
if (comuneO == null) if (comuneO == null)
comuneO = ComuneLocalServiceUtil.fetchByC_CI(themeDisplay.getCompanyId(), codiceIstat); comuneO = ComuneLocalServiceUtil.fetchByC_CI(themeDisplay.getCompanyId(), codiceIstat);
if (comuneO == null) { if (comuneO == null) {
if (_log.isDebugEnabled()) {
_log.debug("Il comune non esiste e verra' creato: " + csvRecord); _log.debug("Il comune non esiste e verra' creato: " + csvRecord);
}
if (nazioneEstera) { if (nazioneEstera) {
ComuneLocalServiceUtil.addComune(themeDisplay.getUserId(), codiceProvincia, ComuneLocalServiceUtil.addComune(themeDisplay.getUserId(), codiceProvincia,
codiceComune, codiceIstat, codiceBelfiore, denominazione, false, true, codiceComune, codiceIstat, codiceBelfiore, denominazione, false, true,
@ -392,7 +394,9 @@ public class AmministrazionePortlet extends MVCPortlet {
StringPool.BLANK, StringPool.BLANK, serviceContext); StringPool.BLANK, StringPool.BLANK, serviceContext);
} }
} else { } else {
if (_log.isDebugEnabled()) {
_log.debug("Il comune esiste e verra' aggiornato: " + csvRecord); _log.debug("Il comune esiste e verra' aggiornato: " + csvRecord);
}
ComuneLocalServiceUtil.updateComune(themeDisplay.getUserId(), comuneO.getPrimaryKey(), ComuneLocalServiceUtil.updateComune(themeDisplay.getUserId(), comuneO.getPrimaryKey(),
codiceProvincia, codiceComune, codiceIstat, denominazione, isProvincia, codiceProvincia, codiceComune, codiceIstat, denominazione, isProvincia,
nazioneEstera, StringPool.BLANK, StringPool.BLANK, serviceContext); nazioneEstera, StringPool.BLANK, StringPool.BLANK, serviceContext);

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

@ -102,10 +102,11 @@ public class SchedulerEstrazioneFirme implements MessageListener {
} }
} }
} catch (Exception e) { } catch (Exception e) {
if (_log.isDebugEnabled()) if (_log.isDebugEnabled()) {
_log.debug("Errore", e); _log.debug("Errore", e);
else } else {
_log.error("Errore " + e.getMessage()); _log.error("Errore " + e.getMessage());
}
} finally { } finally {
lock.unlock(); lock.unlock();
} }

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

@ -53,10 +53,12 @@ public class SchedulerGeneraProtocollo implements MessageListener {
generaProtocollo(avviso, fileEntryBase); generaProtocollo(avviso, fileEntryBase);
} }
} catch (PortalException e) { } catch (PortalException e) {
if (_log.isDebugEnabled()) {
_log.debug("SchedulerGeneraProtocollo - non esiste file base | avvisoId=" + avvisoId); _log.debug("SchedulerGeneraProtocollo - non esiste file base | avvisoId=" + avvisoId);
} }
} }
} }
}
} catch (SystemException e) { } catch (SystemException e) {
_log.error(e, e); _log.error(e, e);
} finally { } finally {

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

@ -151,12 +151,14 @@ public class SchedulerInvioDocumento implements MessageListener {
} catch (Exception e) { } catch (Exception e) {
_log.info(e.getMessage() + ", avviso " + avviso.getAvvisoId() + ", controlloPratica " _log.info(e.getMessage() + ", avviso " + avviso.getAvvisoId() + ", controlloPratica "
+ avviso.getControlloPraticaId()); + avviso.getControlloPraticaId());
if (_log.isDebugEnabled()) {
_log.debug("Error", e); _log.debug("Error", e);
} }
} }
} }
} }
} }
}
private void processIntegrazioniInvioSignal() throws SystemException { private void processIntegrazioniInvioSignal() throws SystemException {

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

@ -687,12 +687,16 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
true)); true));
Date start = null; Date start = null;
Date end = null; Date end = null;
if (_log.isDebugEnabled()) {
_log.debug("Pratica " + pratica.getNumeroProgetto()); _log.debug("Pratica " + pratica.getNumeroProgetto());
}
for (Avviso avviso : avvisi) { for (Avviso avviso : avvisi) {
if (!avviso.isAnnullato()) { if (!avviso.isAnnullato()) {
String tipo = avviso.getTipoDocumento().toUpperCase(); String tipo = avviso.getTipoDocumento().toUpperCase();
_log.debug("Avviso " + avviso.getTipoDocumento() + StringPool.SPACE + avviso.getDtAvviso() if (_log.isDebugEnabled()) {
+ StringPool.SPACE + avviso.getCreateDate()); _log.debug("Avviso " + avviso.getTipoDocumento() + ' ' + avviso.getDtAvviso() + ' '
+ avviso.getCreateDate());
}
if (tipo.equals(StatoPraticaConstants.INTEGRAZIONE) if (tipo.equals(StatoPraticaConstants.INTEGRAZIONE)
|| tipo.equals(StatoPraticaConstants.PREAVVISO_CONTRARIO) || tipo.equals(StatoPraticaConstants.PREAVVISO_CONTRARIO)
|| tipo.equals(StatoPraticaConstants.PERIZIA_SANZIONE) || tipo.equals(StatoPraticaConstants.PERIZIA_SANZIONE)
@ -703,34 +707,48 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
apertura = avviso.getDtAvviso(); apertura = avviso.getDtAvviso();
chiusura = null; chiusura = null;
stop = 0; stop = 0;
if (_log.isDebugEnabled()) {
_log.debug("Reset apertura al " + apertura); _log.debug("Reset apertura al " + apertura);
} }
}
if (_log.isDebugEnabled()) {
_log.debug("IN start = " + start + ", pratica " + pratica.getNumeroProgetto()); _log.debug("IN start = " + start + ", pratica " + pratica.getNumeroProgetto());
}
} else if (tipo.equals(StatoPraticaConstants.VIDIMATA)) { } else if (tipo.equals(StatoPraticaConstants.VIDIMATA)) {
if (Validator.isNull(chiusura)) { if (Validator.isNull(chiusura)) {
end = avviso.getCreateDate(); end = avviso.getCreateDate();
if (_log.isDebugEnabled()) {
_log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto()); _log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto());
}
} else { } else {
apertura = avviso.getDtAvviso(); apertura = avviso.getDtAvviso();
chiusura = start = end = null; chiusura = start = end = null;
stop = 0; stop = 0;
if (_log.isDebugEnabled()) {
_log.debug("Reset apertura al " + apertura); _log.debug("Reset apertura al " + apertura);
} }
}
} else if (tipo.equals(StatoPraticaConstants.INTEGRAZIONE_ACCETTATA)) { } else if (tipo.equals(StatoPraticaConstants.INTEGRAZIONE_ACCETTATA)) {
end = avviso.getCreateDate(); end = avviso.getCreateDate();
if (_log.isDebugEnabled()) {
_log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto()); _log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto());
}
} else if (tipo.equals(StatoPraticaConstants.AUTORIZZATA) } else if (tipo.equals(StatoPraticaConstants.AUTORIZZATA)
|| tipo.equals(StatoPraticaConstants.NON_AUTORIZZATA)) { || tipo.equals(StatoPraticaConstants.NON_AUTORIZZATA)) {
chiusura = avviso.getCreateDate(); chiusura = avviso.getCreateDate();
if (_log.isDebugEnabled()) {
_log.debug("Chiusura al " + chiusura); _log.debug("Chiusura al " + chiusura);
} }
} }
}
if (Validator.isNotNull(start) && Validator.isNotNull(end)) { if (Validator.isNotNull(start) && Validator.isNotNull(end)) {
Long diff = SismicaUtil.daysBetween(start, end); Long diff = SismicaUtil.daysBetween(start, end);
if (Validator.isNotNull(diff)) { if (Validator.isNotNull(diff)) {
stop += diff; stop += diff;
} }
if (_log.isDebugEnabled()) {
_log.debug("Differenza: " + diff + ", pratica " + pratica.getNumeroProgetto()); _log.debug("Differenza: " + diff + ", pratica " + pratica.getNumeroProgetto());
}
start = end = null; start = end = null;
} }
} }

7
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/search.jsp

@ -141,15 +141,12 @@ if (Validator.isNotNull(data)) {
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="tipoAttivita" label="Attività"> <aui:select name="<%= IndexField.TASK %>" label="Attività">
<aui:option value="">Tutte</aui:option> <aui:option value="">Tutte</aui:option>
<aui:option value="Assegnazione">Assegnazione</aui:option> <aui:option value="Assegnazione">Assegnazione</aui:option>
<aui:option value="Approvazione">Approvazione</aui:option> <aui:option value="Approvazione">Approvazione</aui:option>
<aui:option value="Annullato">Annullato</aui:option>
<aui:option value="Esito">Esito</aui:option> <aui:option value="Esito">Esito</aui:option>
<aui:option value="NonApprovato">Non Approvato</aui:option> <aui:option value="Firma">Firma</aui:option>
<aui:option value="signal_cittadino">Richiesta Integrazione</aui:option>
<aui:option value="signal_ff">Firma</aui:option>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">

32
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/search.jsp

@ -13,6 +13,7 @@ String istruttoreSelect = ParamUtil.getString(renderRequest, IndexField.ISTRUTTO
String uoSelect = ParamUtil.getString(renderRequest, IndexField.UNITA_OPERATIVA); String uoSelect = ParamUtil.getString(renderRequest, IndexField.UNITA_OPERATIVA);
String geologoSelect = ParamUtil.getString(renderRequest, IndexField.GEOLOGO_ID); String geologoSelect = ParamUtil.getString(renderRequest, IndexField.GEOLOGO_ID);
String pareriFornitiSelect = ParamUtil.getString(renderRequest, IndexField.PARERI_FORNITI); String pareriFornitiSelect = ParamUtil.getString(renderRequest, IndexField.PARERI_FORNITI);
String taskSelect = ParamUtil.getString(renderRequest, IndexField.TASK);
String orderByColSelect = ParamUtil.getString(renderRequest, "orderByCol", IndexField.NUMERO_PROGETTO); String orderByColSelect = ParamUtil.getString(renderRequest, "orderByCol", IndexField.NUMERO_PROGETTO);
String orderByTypeSelect = ParamUtil.getString(renderRequest, "orderByType", "dec"); String orderByTypeSelect = ParamUtil.getString(renderRequest, "orderByType", "dec");
DateFormat format = new SimpleDateFormat("dd/MM/yyyy"); DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
@ -168,19 +169,20 @@ if (Validator.isNotNull(data)) {
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="<%= IndexField.WORKFLOW_STATE %>" label="Attività"> <aui:select name="<%= IndexField.TASK %>" label="Attività">
<aui:option value="">Tutte</aui:option> <aui:option value="">Tutte</aui:option>
<aui:option value="Assegnazione">Assegnazione</aui:option> <%
<aui:option value="Approvazione">Approvazione</aui:option> for (String task : new String[] { "Assegnazione", "Approvazione", "Esito", "Firma" }) {
<aui:option value="Annullato">Annullato</aui:option> %>
<aui:option value="Esito">Esito</aui:option> <aui:option value="<%= task %>" selected="<%= task.equals(taskSelect) %>"><%= task %></aui:option>
<aui:option value="NonApprovato">Non Approvato</aui:option> <%
<aui:option value="signal_cittadino">Richiesta Integrazione</aui:option> }
<aui:option value="signal_ff">Firma</aui:option> %>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="<%= IndexField.STATO_PRATICA %>" label="Esito"> <aui:select name="<%= IndexField.STATO_PRATICA %>"
label='<%= taskSelect.equals("Approvazione") ? "Esito da approvare" : "Esito" %>'>
<aui:option value="">Tutti</aui:option> <aui:option value="">Tutti</aui:option>
<% <%
for (String esito : new String[] { for (String esito : new String[] {
@ -205,7 +207,7 @@ if (Validator.isNotNull(data)) {
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="orderByCol" label="Ordina Per"> <aui:select name="orderByCol" label="Ordina Per">
<% <%
for (String col : Arrays.asList(IndexField.WORKFLOW_STATE, IndexField.NUMERO_PROGETTO, for (String col : Arrays.asList(IndexField.TASK, IndexField.NUMERO_PROGETTO,
IndexField.DATA_RICHIESTA, IndexField.TIPO_PROCEDURA)) { IndexField.DATA_RICHIESTA, IndexField.TIPO_PROCEDURA)) {
%> %>
<aui:option selected="<%= col.equalsIgnoreCase(orderByColSelect) %>" value="<%= col %>" <aui:option selected="<%= col.equalsIgnoreCase(orderByColSelect) %>" value="<%= col %>"
@ -231,7 +233,15 @@ if (Validator.isNotNull(data)) {
<liferay-portlet:resourceURL id="comuni" var="getComuniURL" /> <liferay-portlet:resourceURL id="comuni" var="getComuniURL" />
<liferay-portlet:resourceURL id="istruttore" var="getIstruttoriUrl" /> <liferay-portlet:resourceURL id="istruttore" var="getIstruttoriUrl" />
<liferay-portlet:resourceURL id="geologo" var="getGeologoUrl" /> <liferay-portlet:resourceURL id="geologo" var="getGeologoUrl" />
<script>
$(document).ready(function () {
$('#<portlet:namespace /><%= IndexField.TASK %>').change(function (el) {
$("label[for=<portlet:namespace /><%= IndexField.STATO_PRATICA %>]").text(
$(this).val() === 'Approvazione' ? ' Esito da approvare ' : ' Esito '
);
});
});
</script>
<aui:script use="aui-io-request,liferay-dynamic-select"> <aui:script use="aui-io-request,liferay-dynamic-select">
var getUnitaOperative = function (callback) { var getUnitaOperative = function (callback) {
A.io.request('<%= getUnitaOperativeUrl %>', { A.io.request('<%= getUnitaOperativeUrl %>', {

4
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java

@ -1332,7 +1332,9 @@ public class FascicoloFePortlet extends MVCPortlet {
} else if (fineLavoriId != 0) { } else if (fineLavoriId != 0) {
FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(fineLavoriId); FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(fineLavoriId);
if (fineLavori.pagamentoFineLavoriIsEnable()) { if (fineLavori.pagamentoFineLavoriIsEnable()) {
if (_log.isDebugEnabled()) {
_log.debug("pagamento inizializzato per fineLavori" + fineLavoriId); _log.debug("pagamento inizializzato per fineLavori" + fineLavoriId);
}
FineLavoriServiceUtil.pagaInvia(fineLavoriId, codiceFiscaleCommittente, url, serviceContext); FineLavoriServiceUtil.pagaInvia(fineLavoriId, codiceFiscaleCommittente, url, serviceContext);
} else { } else {
throw new PortalException("You have not permission to create the payment for Fine Lavori " throw new PortalException("You have not permission to create the payment for Fine Lavori "
@ -1429,7 +1431,9 @@ public class FascicoloFePortlet extends MVCPortlet {
Soggetto soggetto = SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale( Soggetto soggetto = SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale(
asseverazione.getIntPraticaId(), asseverazione.getCodiceFiscale(), 0L).get(0); asseverazione.getIntPraticaId(), asseverazione.getCodiceFiscale(), 0L).get(0);
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(asseverazione.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(asseverazione.getIntPraticaId());
if (_log.isDebugEnabled()) {
_log.debug("Sending asseverazione mail to " + soggetto.getEmail()); _log.debug("Sending asseverazione mail to " + soggetto.getEmail());
}
String[] to = { soggetto.getEmail() }; String[] to = { soggetto.getEmail() };
String[] cc = new String[0]; String[] cc = new String[0];
String[] ccn = new String[0]; String[] ccn = new String[0];

40
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp → liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/search.jsp

@ -1,5 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.mwg.sismica.bo.shared.util.PortosIndexField"%> <%@page import="it.mwg.sismica.bo.shared.util.IndexField"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@include file="/html/fascicolofe/init.jsp"%> <%@include file="/html/fascicolofe/init.jsp"%>
@ -12,8 +12,8 @@
<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-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="tipoProcedura" label="Tipo Pratica"> <aui:select name="<%= IndexField.TIPO_PROCEDURA %>" label="Tipo Pratica">
<aui:option value="-1">Seleziona il tipo di pratica</aui:option> <aui:option value="">Seleziona il tipo di pratica</aui:option>
<% <%
for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getTipiProcedure() for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getTipiProcedure()
.entrySet()) { .entrySet()) {
@ -32,18 +32,15 @@
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="statoPratica" label="Stato Pratica"> <aui:select name="<%= IndexField.STATO_PRATICA %>" label="Stato Pratica">
<aui:option value="-1">Stato Pratica</aui:option> <aui:option value="">Stato Pratica</aui:option>
<aui:option value="<%= PortosIndexField.ASSEGNATA_AD_ISTRUTTORE %>">
<liferay-ui:message key="Assegnata ad istruttore" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.ANNULLATA %>"> <aui:option value="<%= StatoPraticaConstants.ANNULLATA %>">
<liferay-ui:message key="Annullata" /> <liferay-ui:message key="Annullata" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.CONFORME %>"> <aui:option value="<%= StatoPraticaConstants.CONFORME %>">
<liferay-ui:message key="Autorizzata" /> <liferay-ui:message key="Autorizzata" />
</aui:option> </aui:option>
<aui:option value="IC"> <aui:option value="<%= StatoPraticaConstants.IN_COMPILAZIONE %>">
<liferay-ui:message key="In compilazione" /> <liferay-ui:message key="In compilazione" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>"> <aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">
@ -52,15 +49,9 @@
<aui:option value="<%= StatoPraticaConstants.RIFIUTATA %>"> <aui:option value="<%= StatoPraticaConstants.RIFIUTATA %>">
<liferay-ui:message key="Non autorizzata" /> <liferay-ui:message key="Non autorizzata" />
</aui:option> </aui:option>
<aui:option value="sospesa">
<liferay-ui:message key="Sospesa" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE %>"> <aui:option value="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE %>">
<liferay-ui:message key="Sottoposta a parere" /> <liferay-ui:message key="Sottoposta a parere" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.VARIATA %>">
<liferay-ui:message key="Variata" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.VIDIMATA %>"> <aui:option value="<%= StatoPraticaConstants.VIDIMATA %>">
<liferay-ui:message key="Vidimata" /> <liferay-ui:message key="Vidimata" />
</aui:option> </aui:option>
@ -69,41 +60,40 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<aui:input label="Descrizione Intervento" name="descIntervento" type="textarea" placeholder="" /> <aui:input label="Descrizione Intervento" name="<%= IndexField.DESCRIZIONE %>" type="textarea" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-4">
<aui:input type="text" name="committente" label="Committente" /> <aui:input type="text" name="<%= IndexField.COMMITTENTE %>" label="Committente" />
</div> </div>
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-4">
<aui:input type="text" name="soggettiInterconnessi" label="Soggetti Interconnessi" /> <aui:input type="text" name="<%= IndexField.SOGGETTO %>" label="Soggetti Interconnessi" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-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="<%= IndexField.DATA_RICHIESTA_DA %>" />
</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="<%= IndexField.DATA_RICHIESTA_A %>" />
</liferay-util:include> </liferay-util:include>
</aui:field-wrapper> </aui:field-wrapper>
</div> </div>
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-4">
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<aui:select name="ordinaPer" label="Ordina Per"> <aui:select name="orderByType" label="Ordina Per">
<aui:option value="numeroProgetto">Numero Progetto</aui:option> <aui:option value="<%= IndexField.NUMERO_PROGETTO %>">Numero Progetto</aui:option>
<aui:option value="protocollo">Protocollo</aui:option> <aui:option selected="true" value="<%= IndexField.DATA_RICHIESTA %>">Data Creazione</aui:option>
<aui:option selected="true" value="dtPratica">Data Creazione</aui:option>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<aui:select name="ordinaTipo" label="Tipo Ordine"> <aui:select name="orderByType" label="Tipo Ordine">
<aui:option selected="true" value="asc">Asc</aui:option> <aui:option selected="true" value="asc">Asc</aui:option>
<aui:option value="dec">Dec</aui:option> <aui:option value="dec">Dec</aui:option>
</aui:select> </aui:select>

2
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view.jsp

@ -32,7 +32,7 @@ String keywords = StringPool.BLANK;
</c:if> </c:if>
<c:if test="<%= isProgetti || isArchivioProgetti || isAltriProgetti %>"> <c:if test="<%= isProgetti || isArchivioProgetti || isAltriProgetti %>">
<aui:form action="<%= searchURL.toString() %>" method="post" name="fm"> <aui:form action="<%= searchURL.toString() %>" method="post" name="fm">
<liferay-ui:search-form page="/html/fascicolofe/advanced_search.jsp" servletContext="<%= application %>" /> <liferay-ui:search-form page="/html/fascicolofe/search.jsp" servletContext="<%= application %>" />
</aui:form> </aui:form>
</c:if> </c:if>
</div> </div>

4
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/mwg/sismica/bo/shared/util/IndexField.java

@ -15,8 +15,9 @@ public class IndexField implements Serializable {
public static final String DATA_RICHIESTA = "dataRichiesta"; public static final String DATA_RICHIESTA = "dataRichiesta";
public static final String DATA_RICHIESTA_A = "dataRichiestaA"; public static final String DATA_RICHIESTA_A = "dataRichiestaA";
public static final String DATA_RICHIESTA_DA = "dataRichiestaDa"; public static final String DATA_RICHIESTA_DA = "dataRichiestaDa";
public static final String DESCRIZIONE = "descrizione";
public static final String ESITO_PENDENTE = "esitoPendente";
public static final String GEOLOGO_ID = "geologoId"; public static final String GEOLOGO_ID = "geologoId";
public static final String IN_COMPILAZIONE = "inCompilazione";
public static final String IN_LAVORAZIONE_SUE = "inLavorazioneSue"; public static final String IN_LAVORAZIONE_SUE = "inLavorazioneSue";
public static final String INT_PRATICA_ID = "intPraticaId"; public static final String INT_PRATICA_ID = "intPraticaId";
public static final String ISTRUTTORE = "istruttore"; public static final String ISTRUTTORE = "istruttore";
@ -33,5 +34,4 @@ public class IndexField implements Serializable {
public static final String TIPO_PROCEDURA = "tipoProcedura"; public static final String TIPO_PROCEDURA = "tipoProcedura";
public static final String TITOLARE = "titolare"; public static final String TITOLARE = "titolare";
public static final String UNITA_OPERATIVA = "unitaOperativa"; public static final String UNITA_OPERATIVA = "unitaOperativa";
public static final String WORKFLOW_STATE = "workflowState";
} }

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

@ -26,6 +26,7 @@ public class StatoPraticaConstants {
public static final String VIDIMATA = "VI"; public static final String VIDIMATA = "VI";
/* Stati "virtuali" */ /* Stati "virtuali" */
public static final String IN_COMPILAZIONE = "IC";
public static final String ANNULLA_ISTANZA = "AI"; public static final String ANNULLA_ISTANZA = "AI";
public static final String AUTORIZZATA = "AU"; public static final String AUTORIZZATA = "AU";
public static final String CAMBIO_ISTRUTTORE = "CI"; public static final String CAMBIO_ISTRUTTORE = "CI";

BIN
liferay-plugins-sdk-6.2/z.zip

File binario non mostrato.
Caricamento…
Annulla
Salva