@ -17,6 +17,7 @@ import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SorteggioLocalServiceUtil ;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil ;
import it.tref.liferay.portos.bo.service.persistence.ControlloPraticaActionableDynamicQuery ;
import it.tref.liferay.portos.bo.shared.util.Constants ;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants ;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil ;
import it.tref.liferay.portos.bo.util.PortosIndexField ;
@ -64,521 +65,560 @@ import com.liferay.portal.util.PortalUtil;
public class ControlloPraticaIndexer extends BaseIndexer {
public static final String [ ] CLASS_NAMES = { ControlloPratica . class . getName ( ) } ;
public static final String [ ] CLASS_NAMES = { ControlloPratica . class . getName ( ) } ;
public static final String PORTLET_ID = "1_WAR_portosfeportlet" ;
public static final String PORTLET_ID = "1_WAR_portosfeportlet" ;
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 ( ControlloPraticaIndexer . class ) ;
private static final Log _log = LogFactoryUtil . getLog ( ControlloPraticaIndexer . class ) ;
public ControlloPraticaIndexer ( ) {
public ControlloPraticaIndexer ( ) {
setPermissionAware ( true ) ;
}
setPermissionAware ( true ) ;
}
@Override
public String [ ] getClassNames ( ) {
@Override
public String [ ] getClassNames ( ) {
return CLASS_NAMES ;
}
return CLASS_NAMES ;
}
@Override
public String getPortletId ( ) {
@Override
public String getPortletId ( ) {
return PORTLET_ID ;
}
return PORTLET_ID ;
}
@Override
protected void doDelete ( Object obj ) throws Exception {
if ( Validator . isNotNull ( obj ) ) {
@Override
protected void doDelete ( Object obj ) throws Exception {
ControlloPratica controlloPratica = ( ControlloPratica ) obj ;
deleteDocument ( controlloPratica . getCompanyId ( ) , controlloPratica . getControlloPraticaId ( ) ) ;
if ( Validator . isNotNull ( obj ) ) {
} else {
_log . warn ( "Received a null ControlloPratica to delete in input." ) ;
}
ControlloPratica controlloPratica = ( ControlloPratica ) obj ;
deleteDocument ( controlloPratica . getCompanyId ( ) , controlloPratica . getControlloPraticaId ( ) ) ;
}
} else {
_log . warn ( "Received a null ControlloPratica to delete in input." ) ;
}
@Override
protected Document doGetDocument ( Object obj ) throws Exception {
}
Document document = null ;
@Override
protected Document doGetDocument ( Object obj ) throws Exception {
if ( Validator . isNotNull ( obj ) ) {
Document document = null ;
ControlloPratica controlloPratica = ( ControlloPratica ) obj ;
ControlloPratica controlloPraticaFromDB = ControlloPraticaLocalServiceUtil
. getControlloPratica ( controlloPratica . getControlloPraticaId ( ) ) ;
if ( Validator . isNotNull ( obj ) ) {
if ( _log . isDebugEnabled ( ) ) {
_log . debug ( "Indexing ControlloPratica: " + controlloPratica . getControlloPraticaId ( ) ) ;
}
ControlloPratica controlloPratica = ( ControlloPratica ) obj ;
ControlloPratica controlloPraticaFromDB =
ControlloPraticaLocalServiceUtil . getControlloPratica ( controlloPratica . getControlloPraticaId ( ) ) ;
document = getBaseModelDocument ( PORTLET_ID , controlloPratica ) ;
if ( _log . isDebugEnabled ( ) ) {
_log . debug ( "Indexing ControlloPratica: " + controlloPratica . getControlloPraticaId ( ) ) ;
}
document . addKeyword ( "entryClassName" , ControlloPratica . class . getName ( ) ) ;
document = getBaseModelDocument ( PORTLET_ID , controlloPratica ) ;
document . addKeyword ( PortosIndexField . CONTROLLO_PRATICA_ID ,
controlloPraticaFromDB . getControlloPraticaId ( ) ) ;
document . addKeyword ( "entryClassName" , ControlloPratica . class . getName ( ) ) ;
document . addKeyword ( PortosIndexField . DETT_PRATICA_ID , controlloPraticaFromDB . getDettPraticaId ( ) ) ;
document . addKeyword ( PortosIndexField . PARERE_GEOLOGO , controlloPraticaFromDB . getParereGeologo ( ) ) ;
document . addKeyword ( PortosIndexField . STATUS , controlloPraticaFromDB . getStatus ( ) ) ;
document . addKeyword ( PortosIndexField . STATUS_BY_USERID , controlloPraticaFromDB . getStatusByUserId ( ) ) ;
document . addKeyword ( PortosIndexField . STATUS_BY_USERNAME ,
controlloPraticaFromDB . getStatusByUserName ( ) ) ;
if ( controlloPraticaFromDB . getStatusDate ( ) ! = null ) {
document . addKeyword ( PortosIndexField . STATUS_DATE ,
DATE_FORMAT . format ( controlloPraticaFromDB . getStatusDate ( ) ) ) ;
} else {
document . addKeyword ( PortosIndexField . STATUS_DATE , 0 ) ;
}
document . addKeyword ( PortosIndexField . DATA_INIZIO_PROCEDIMENTO ,
DATE_FORMAT . format ( controlloPraticaFromDB . getCreateDate ( ) ) ) ;
document . addKeywordSortable ( PortosIndexField . DATA_INIZIO_PROCEDIMENTO ,
DATE_FORMAT . format ( controlloPraticaFromDB . getCreateDate ( ) ) ) ;
document . addDate ( PortosIndexField . DATA_INIZIO_PROCEDIMENTO ,
controlloPraticaFromDB . getCreateDate ( ) ) ;
// Indicizzo i campi relarivi a IntPratica
document . addKeyword ( PortosIndexField . INT_PRATICA_ID , controlloPraticaFromDB . getIntPraticaId ( ) ) ;
IntPratica intPratica = IntPraticaLocalServiceUtil . fetchIntPratica ( controlloPraticaFromDB
. getIntPraticaId ( ) ) ;
if ( Validator . isNotNull ( intPratica ) ) {
if ( intPratica . getStatusByUserId ( ) ! = 0L ) {
document . addKeyword ( PortosIndexField . ISTRUTTORE_USER_ID , intPratica . getStatusByUserId ( ) ) ;
User userIstruttore = UserLocalServiceUtil . fetchUser ( intPratica . getStatusByUserId ( ) ) ;
if ( userIstruttore ! = null ) {
document . addKeyword ( PortosIndexField . ISTRUTTORE_FULL_NAME , userIstruttore
. getFullName ( ) . toUpperCase ( ) ) ;
}
}
if ( intPratica . getUserId ( ) ! = 0L ) {
User proprietarioDigitale = UserLocalServiceUtil . fetchUser ( intPratica . getUserId ( ) ) ;
if ( proprietarioDigitale ! = null ) {
document . addKeyword ( PortosIndexField . PROPRIETARIO_DIGITALE_FULL_NAME ,
proprietarioDigitale . getFullName ( ) . toUpperCase ( ) ) ;
}
}
// Informazioni sullo stato della pratica
boolean variata = false ;
int countVariantiForIntPratica = DettPraticaLocalServiceUtil
. countVariateByIntPratica ( intPratica . getIntPraticaId ( ) ) ;
if ( countVariantiForIntPratica > 0 ) {
variata = true ;
}
document . addKeyword ( PortosIndexField . VARIATA , variata ) ;
document . addKeyword ( PortosIndexField . COLLAUDO_COMPLETATO , intPratica . getCollaudoTotale ( ) ) ;
document . addKeyword ( PortosIndexField . COLLAUDO_PARZIALE , intPratica . getCollaudoParziale ( ) ) ;
document . addKeyword ( PortosIndexField . FINE_LAVORI_COMPLETATI , intPratica . getFineLavoriTotale ( ) ) ;
document . addKeyword ( PortosIndexField . FINE_LAVORI_PARZIALI , intPratica . getFineLavoriParziale ( ) ) ;
document . addKeyword ( PortosIndexField . SOTTOPOSTO_A_PARERE ,
checkSottopostaAParere ( intPratica . getIntPraticaId ( ) ) ) ;
document . addKeyword ( PortosIndexField . LAVORAZIONE_SORTEGGIATA ,
checkLavorazioneSorteggiata ( intPratica . getIntPraticaId ( ) ) ) ;
document . addKeyword ( PortosIndexField . TIPO_PRATICA , intPratica . getTipoPratica ( ) ) ;
document . addKeywordSortable ( PortosIndexField . TIPO_PRATICA , intPratica . getTipoPratica ( ) ) ;
document . addKeyword ( PortosIndexField . NUMERO_PROGETTO ,
Integer . valueOf ( intPratica . getNumeroProgetto ( ) ) ) ;
document . addNumber ( PortosIndexField . NUMERO_PROGETTO ,
Integer . valueOf ( intPratica . getNumeroProgetto ( ) ) ) ;
document . addNumberSortable ( PortosIndexField . NUMERO_PROGETTO ,
Integer . valueOf ( intPratica . getNumeroProgetto ( ) ) ) ;
document . addKeyword ( PortosIndexField . STATO_PRATICA , intPratica . getStatoPratica ( ) ) ;
boolean sorteggiata = SorteggioLocalServiceUtil
. findByIntPratica ( intPratica . getIntPraticaId ( ) ) ! = null ;
document . addKeyword ( "sorteggiata" , sorteggiata ) ;
document . addKeyword ( "controlloObbligatorio" , intPratica . isControlloObbligatorio ( ) ) ;
String tipoProcedura = intPratica . getTipoProcedura ( ) ;
if ( Validator . isNotNull ( tipoProcedura ) ) {
if ( tipoProcedura . equalsIgnoreCase ( Constants . PROCEDURA_B1 ) )
tipoProcedura = Constants . PROCEDURA_B ;
document . addKeyword ( PortosIndexField . TIPO_PROCEDURA , tipoProcedura ) ;
}
// Prendo l ultimo DettPratica legato a IntPratica
DettPratica lastDettPratica = DettPraticaLocalServiceUtil
. getLastCompletedByIntPraticaAndProtocolloNotEmpty ( intPratica . getIntPraticaId ( ) ) ;
if ( Validator . isNull ( lastDettPratica ) ) {
lastDettPratica = DettPraticaLocalServiceUtil . getLastCompletedByIntPratica ( intPratica
. getIntPraticaId ( ) ) ;
}
if ( Validator . isNotNull ( lastDettPratica ) ) {
document . addKeyword ( "nuovaCostruzione" , lastDettPratica . getTcNuovaCostruzione ( ) ) ;
document . addKeyword ( "adeguamentoSismico" , lastDettPratica . getTcAdeguamentoSismico ( ) ) ;
document . addKeyword ( "miglioramentoSismico" , lastDettPratica . getTcMiglioramentoSismico ( ) ) ;
document . addKeyword ( "interventoLocale" ,
lastDettPratica . getTcRiparazioneInterventoLocale ( ) ) ;
if ( lastDettPratica . getProtocollo ( ) ! = null
& & ! lastDettPratica . getProtocollo ( ) . equals ( "" ) ) {
document . addKeyword ( PortosIndexField . PROTOCOLLO ,
Long . parseLong ( lastDettPratica . getProtocollo ( ) ) ) ;
document . addNumber ( PortosIndexField . PROTOCOLLO ,
Long . parseLong ( lastDettPratica . getProtocollo ( ) ) ) ;
document . addNumberSortable ( PortosIndexField . PROTOCOLLO ,
Long . parseLong ( lastDettPratica . getProtocollo ( ) ) ) ;
}
if ( lastDettPratica . getVia ( ) ! = null & & ! lastDettPratica . getVia ( ) . equals ( "" ) ) {
document . addKeyword ( PortosIndexField . INDIRIZZO , lastDettPratica . getVia ( ) ) ;
}
if ( lastDettPratica . getLocalita ( ) ! = null & & ! lastDettPratica . getLocalita ( ) . equals ( "" ) ) {
document . addKeyword ( PortosIndexField . LOCALITA , lastDettPratica . getLocalita ( ) ) ;
}
if ( Validator . isNotNull ( lastDettPratica . getDescLongIntervento ( ) ) ) {
document . addText ( PortosIndexField . DESC_INTERVENTO ,
lastDettPratica . getDescLongIntervento ( ) ) ;
document . addKeyword ( PortosIndexField . DESC_INTERVENTO ,
lastDettPratica . getDescLongIntervento ( ) ) ;
document . addKeyword ( PortosIndexField . NUOVA_COSTRUZIONE ,
lastDettPratica . getTcNuovaCostruzione ( ) ) ;
document . addKeyword ( PortosIndexField . ADEGUAMENTO_SISMICO ,
lastDettPratica . getTcAdeguamentoSismico ( ) ) ;
document . addKeyword ( PortosIndexField . MIGLIORAMENTO_SISMICO ,
lastDettPratica . getTcMiglioramentoSismico ( ) ) ;
document . addKeyword ( PortosIndexField . RIPARAZIONE_INTERVENTO_LOCALE ,
lastDettPratica . getTcRiparazioneInterventoLocale ( ) ) ;
}
}
// Gestione pratica aperta/chiusa fine lavori
if ( intPratica . getCollaudoTotale ( ) ) {
document . addKeyword ( PortosIndexField . PRATICA_APERTA , false ) ;
} else if ( lastDettPratica ! = null & & lastDettPratica . getCollaudoStatico ( )
& & intPratica . getFineLavoriTotale ( ) ) {
document . addKeyword ( PortosIndexField . PRATICA_APERTA , false ) ;
} else if ( intPratica . isAnnullata ( )
| | intPratica . getStatoPratica ( ) . equals ( StatoPraticaConstants . ANNULLATA ) ) {
document . addKeyword ( PortosIndexField . PRATICA_APERTA , false ) ;
} else {
document . addKeyword ( PortosIndexField . PRATICA_APERTA , true ) ;
}
if ( intPratica . getStatoPratica ( ) . equals ( StatoPraticaConstants . INTEGRAZIONE ) ) {
document . addKeyword ( PortosIndexField . PRATICA_APERTA , true ) ;
}
// Prendo la lista dei soggetti committenti legati a IntPratica
List < Soggetto > committenti = SoggettoLocalServiceUtil . findByIntPratica_TipologiaSoggetto (
intPratica . getIntPraticaId ( ) , TipoSoggettoUtil . COMMITTENTE ) ;
if ( Validator . isNotNull ( committenti ) & & committenti . size ( ) > 0 ) {
// Creao una stringa contenente tutti i codFisc legati alla
// IntPratica separati da ,
List < String > listaSoggetti = new ArrayList < String > ( ) ;
for ( Soggetto soggetto : committenti ) {
// listaSoggetti.add(soggetto.getCodiceFiscale().toUpperCase());
listaSoggetti . add ( soggetto . getNome ( ) . toUpperCase ( ) + " "
+ soggetto . getCognome ( ) . toUpperCase ( ) ) ;
}
document . addKeyword ( PortosIndexField . SOGGETTI_INTERESSATI ,
listaSoggetti . toArray ( new String [ 0 ] ) ) ;
document . addKeyword ( PortosIndexField . COMMITTENTI , listaSoggetti . toArray ( new String [ 0 ] ) ) ;
}
// Soggetti Interconnessi
List < Soggetto > listSoggettiInterconnessi = SoggettoLocalServiceUtil
. getSoggettiByIntPraticaId_DtRimozioneNull ( intPratica . getIntPraticaId ( ) ) ;
if ( listSoggettiInterconnessi ! = null & & ! listSoggettiInterconnessi . isEmpty ( ) ) {
List < String > listaStringata = new ArrayList < String > ( ) ;
for ( Soggetto sog : listSoggettiInterconnessi ) {
listaStringata
. add ( sog . getNome ( ) . toUpperCase ( ) + " " + sog . getCognome ( ) . toUpperCase ( ) ) ;
}
document . addKeyword ( PortosIndexField . SOGGETTI_INTERCONNESSI ,
listaStringata . toArray ( new String [ 0 ] ) ) ;
}
// Prendo dati relativi al Territorio
if ( Validator . isNotNull ( intPratica . getTerritorioId ( ) ) ) {
Territorio territorio = TerritorioLocalServiceUtil . fetchTerritorio ( intPratica
. getTerritorioId ( ) ) ;
if ( Validator . isNotNull ( territorio ) ) {
document . addKeyword ( PortosIndexField . CONTROLLO_PRATICA_ID , controlloPraticaFromDB . getControlloPraticaId ( ) ) ;
if ( Validator . isNotNull ( territorio . getComuneId ( ) ) ) {
document . addKeyword ( PortosIndexField . DETT_PRATICA_ID , controlloPraticaFromDB . getDettPraticaId ( ) ) ;
document . addKeyword ( PortosIndexField . PARERE_GEOLOGO , controlloPraticaFromDB . getParereGeologo ( ) ) ;
document . addKeyword ( PortosIndexField . STATUS , controlloPraticaFromDB . getStatus ( ) ) ;
document . addKeyword ( PortosIndexField . STATUS_BY_USERID , controlloPraticaFromDB . getStatusByUserId ( ) ) ;
document . addKeyword ( PortosIndexField . STATUS_BY_USERNAME , controlloPraticaFromDB . getStatusByUserName ( ) ) ;
if ( controlloPraticaFromDB . getStatusDate ( ) ! = null ) {
document . addKeyword ( PortosIndexField . STATUS_DATE , DATE_FORMAT . format ( controlloPraticaFromDB . getStatusDate ( ) ) ) ;
} else {
document . addKeyword ( PortosIndexField . STATUS_DATE , 0 ) ;
}
Comune comune = ComuneLocalServiceUtil . fetchComune ( territorio . getComuneId ( ) ) ;
if ( Validator . isNotNull ( comune ) ) {
document . addKeyword ( PortosIndexField . DATA_INIZIO_PROCEDIMENTO ,
DATE_FORMAT . format ( controlloPraticaFromDB . getCreateDate ( ) ) ) ;
document . addKeyword ( PortosIndexField . COMUNE_ID , comune . getComuneId ( ) ) ;
document . addKeyword ( PortosIndexField . COMUNE_DENOMINAZIONE ,
comune . getDenominazione ( ) ) ;
document . addKeywordSortable ( PortosIndexField . DATA_INIZIO_PROCEDIMENTO ,
DATE_FORMAT . format ( controlloPraticaFromDB . getCreateDate ( ) ) ) ;
}
document . addDate ( PortosIndexField . DATA_INIZIO_PROCEDIMENTO ,
controlloPraticaFromDB . getCreateDate ( ) ) ;
if ( Validator . isNotNull ( territorio . getCodiceProvincia ( ) ) ) {
// Indicizzo i campi relarivi a IntPratica
document . addKeyword ( PortosIndexField . INT_PRATICA_ID , controlloPraticaFromDB . getIntPraticaId ( ) ) ;
Provincia provincia = ProvinciaLocalServiceUtil . fetchByC_C (
territorio . getCompanyId ( ) , territorio . getCodiceProvincia ( ) ) ;
IntPratica intPratica = IntPraticaLocalServiceUtil . fetchIntPratica ( controlloPraticaFromDB . getIntPraticaId ( ) ) ;
if ( Validator . isNotNull ( intPratica ) ) {
if ( Validator . isNotNull ( provincia ) ) {
if ( intPratica . getStatusByUserId ( ) ! = 0L ) {
document . addKeyword ( PortosIndexField . ISTRUTTORE_USER_ID , intPratica . getStatusByUserId ( ) ) ;
User userIstruttore = UserLocalServiceUtil . fetchUser ( intPratica . getStatusByUserId ( ) ) ;
if ( userIstruttore ! = null ) {
document . addKeyword ( PortosIndexField . ISTRUTTORE_FULL_NAME , userIstruttore . getFullName ( ) . toUpperCase ( ) ) ;
}
}
document . addKeyword ( PortosIndexField . PROVINCIA_ID ,
provincia . getProvinciaId ( ) ) ;
document . addKeyword ( PortosIndexField . PROVINCIA_CODICE ,
provincia . getCodiceProvincia ( ) ) ;
document . addKeyword ( PortosIndexField . PROVINCIA_NAME ,
provincia . getProvincia ( ) ) ;
if ( intPratica . getUserId ( ) ! = 0L ) {
User proprietarioDigitale = UserLocalServiceUtil . fetchUser ( intPratica . getUserId ( ) ) ;
if ( proprietarioDigitale ! = null ) {
document . addKeyword ( PortosIndexField . PROPRIETARIO_DIGITALE_FULL_NAME ,
proprietarioDigitale . getFullName ( ) . toUpperCase ( ) ) ;
}
}
}
// Informazioni sullo stato della pratica
}
boolean variata = false ;
int countVariantiForIntPratica =
DettPraticaLocalServiceUtil . countVariateByIntPratica ( intPratica . getIntPraticaId ( ) ) ;
if ( countVariantiForIntPratica > 0 ) {
variata = true ;
}
document . addKeyword ( PortosIndexField . VARIATA , variata ) ;
}
document . addKeyword ( PortosIndexField . COLLAUDO_COMPLETATO , intPratica . getCollaudoTotale ( ) ) ;
document . addKeyword ( PortosIndexField . COLLAUDO_PARZIALE , intPratica . getCollaudoParziale ( ) ) ;
document . addKeyword ( PortosIndexField . FINE_LAVORI_COMPLETATI , intPratica . getFineLavoriTotale ( ) ) ;
document . addKeyword ( PortosIndexField . FINE_LAVORI_PARZIALI , intPratica . getFineLavoriParziale ( ) ) ;
document . addKeyword ( PortosIndexField . SOTTOPOSTO_A_PARERE , checkSottopostaAParere ( intPratica . getIntPraticaId ( ) ) ) ;
document . addKeyword ( PortosIndexField . LAVORAZIONE_SORTEGGIATA ,
checkLavorazioneSorteggiata ( intPratica . getIntPraticaId ( ) ) ) ;
}
}
document . addKeyword ( PortosIndexField . TIPO_PRATICA , intPratica . getTipoPratica ( ) ) ;
document . addKeywordSortable ( PortosIndexField . TIPO_PRATICA , intPratica . getTipoPratica ( ) ) ;
document . addKeyword ( PortosIndexField . NUMERO_PROGETTO , Integer . valueOf ( intPratica . getNumeroProgetto ( ) ) ) ;
document . addNumber ( PortosIndexField . NUMERO_PROGETTO , Integer . valueOf ( intPratica . getNumeroProgetto ( ) ) ) ;
document . addNumberSortable ( PortosIndexField . NUMERO_PROGETTO , Integer . valueOf ( intPratica . getNumeroProgetto ( ) ) ) ;
document . addKeyword ( PortosIndexField . STATO_PRATICA , intPratica . getStatoPratica ( ) ) ;
}
boolean sorteggiata = SorteggioLocalServiceUtil . findByIntPratica ( intPratica . getIntPraticaId ( ) ) ! = null ;
document . addKeyword ( "sorteggiata" , sorteggiata ) ;
document . addKeyword ( "controlloObbligatorio" , intPratica . isControlloObbligatorio ( ) ) ;
// Indicizzazione campi da Kaleo
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil
. fetchWorkflowInstanceLink ( controlloPraticaFromDB . getCompanyId ( ) ,
controlloPraticaFromDB . getGroupId ( ) , ControlloPratica . class . getName ( ) ,
controlloPraticaFromDB . getPrimaryKey ( ) ) ;
if ( Validator . isNotNull ( workflowInstanceLink ) ) {
long workflowInstanceId = workflowInstanceLink . getWorkflowInstanceId ( ) ;
WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil . getWorkflowInstance (
controlloPraticaFromDB . getCompanyId ( ) , workflowInstanceId ) ;
// Prendo l ultimo DettPratica legato a IntPratica
DettPratica lastDettPratica =
DettPraticaLocalServiceUtil . getLastCompletedByIntPraticaAndProtocolloNotEmpty ( intPratica . getIntPraticaId ( ) ) ;
if ( Validator . isNotNull ( workflowInstance ) ) {
if ( Validator . isNull ( lastDettPratica ) ) {
lastDettPratica = DettPraticaLocalServiceUtil . getLastCompletedByIntPratica ( intPratica . getIntPraticaId ( ) ) ;
}
document . addKeyword ( PortosIndexField . WORKFLOW_STATE , workflowInstance . getState ( ) ) ;
if ( Validator . isNotNull ( lastDettPratica ) ) {
List < WorkflowTask > listaTask = WorkflowTaskManagerUtil
. getWorkflowTasksByWorkflowInstance ( controlloPraticaFromDB . getCompanyId ( ) , null ,
workflowInstance . getWorkflowInstanceId ( ) , false , QueryUtil . ALL_POS ,
QueryUtil . ALL_POS , null ) ;
document . addKeyword ( "nuovaCostruzione" , lastDettPratica . getTcNuovaCostruzione ( ) ) ;
document . addKeyword ( "adeguamentoSismico" , lastDettPratica . getTcAdeguamentoSismico ( ) ) ;
document . addKeyword ( "miglioramentoSismico" , lastDettPratica . getTcMiglioramentoSismico ( ) ) ;
document . addKeyword ( "interventoLocale" , lastDettPratica . getTcRiparazioneInterventoLocale ( ) ) ;
if ( Validator . isNotNull ( listaTask ) & & ! listaTask . isEmpty ( ) ) {
WorkflowTask task = listaTask . get ( 0 ) ;
if ( lastDettPratica . getProtocollo ( ) ! = null & & ! lastDettPratica . getProtocollo ( ) . equals ( "" ) ) {
document . addKeyword ( PortosIndexField . PROTOCOLLO , Long . parseLong ( lastDettPratica . getProtocollo ( ) ) ) ;
document . addNumber ( PortosIndexField . PROTOCOLLO , Long . parseLong ( lastDettPratica . getProtocollo ( ) ) ) ;
document . addNumberSortable ( PortosIndexField . PROTOCOLLO , Long . parseLong ( lastDettPratica . getProtocollo ( ) ) ) ;
}
if ( task . getAssigneeUserId ( ) ! = 0L & & task . getAssigneeUserId ( ) ! = - 1 ) {
document . addKeyword ( PortosIndexField . TASK_ASSIGNEE_USER_ID ,
task . getAssigneeUserId ( ) ) ;
} else if ( workflowInstance . getState ( ) . equals ( "Esito" ) ) {
_log . warn ( "Fascicolo Disallineato su Kaleo : assenza assegnazione istruttore | kaleoInstanceId="
+ workflowInstance . getWorkflowInstanceId ( ) ) ;
}
if ( lastDettPratica . getVia ( ) ! = null & & ! lastDettPratica . getVia ( ) . equals ( "" ) ) {
document . addKeyword ( PortosIndexField . INDIRIZZO , lastDettPratica . getVia ( ) ) ;
}
if ( Validator . isNotNull ( task . getWorkflowTaskAssignees ( ) )
& & ! task . getWorkflowTaskAssignees ( ) . isEmpty ( ) ) {
List < String > roleIdsAssignee = new ArrayList < String > ( ) ;
if ( lastDettPratica . getLocalita ( ) ! = null & & ! lastDettPratica . getLocalita ( ) . equals ( "" ) ) {
document . addKeyword ( PortosIndexField . LOCALITA , lastDettPratica . getLocalita ( ) ) ;
}
for ( WorkflowTaskAssignee taskAssignee : task . getWorkflowTaskAssignees ( ) ) {
if ( taskAssignee . getAssigneeClassName ( ) . equals ( Role . class . getName ( ) ) ) {
roleIdsAssignee . add ( "R" + taskAssignee . getAssigneeClassPK ( ) + "G"
+ controlloPraticaFromDB . getGroupId ( ) ) ;
}
}
if ( Validator . isNotNull ( lastDettPratica . getDescLongIntervento ( ) ) ) {
document . addText ( PortosIndexField . DESC_INTERVENTO , lastDettPratica . getDescLongIntervento ( ) ) ;
document . addKeyword ( PortosIndexField . DESC_INTERVENTO , lastDettPratica . getDescLongIntervento ( ) ) ;
document . addKeyword ( PortosIndexField . TASK_ASSIGNEE_ROLE_IDS ,
roleIdsAssignee . toArray ( new String [ 0 ] ) ) ;
}
document . addKeyword ( PortosIndexField . NUOVA_COSTRUZIONE , lastDettPratica . getTcNuovaCostruzione ( ) ) ;
document . addKeyword ( PortosIndexField . ADEGUAMENTO_SISMICO , lastDettPratica . getTcAdeguamentoSismico ( ) ) ;
document . addKeyword ( PortosIndexField . MIGLIORAMENTO_SISMICO , lastDettPratica . getTcMiglioramentoSismico ( ) ) ;
document . addKeyword ( PortosIndexField . RIPARAZIONE_INTERVENTO_LOCALE ,
lastDettPratica . getTcRiparazioneInterventoLocale ( ) ) ; }
}
document . addKeyword ( PortosIndexField . WORKFLOW_DEFINITION_NAME ,
workflowInstance . getWorkflowDefinitionName ( ) ) ;
document . addKeyword ( PortosIndexField . WORKFLOW_DEFINITION_VERSION ,
workflowInstance . getWorkflowDefinitionVersion ( ) ) ;
document . addKeyword ( PortosIndexField . TASK_NAME , task . getName ( ) ) ;
// Gestione pratica aperta/chiusa fine lavori
if ( intPratica . getCollaudoTotale ( ) ) {
document . addKeyword ( PortosIndexField . PRATICA_APERTA , false ) ;
} else if ( lastDettPratica ! = null & & lastDettPratica . getCollaudoStatico ( )
& & intPratica . getFineLavoriTotale ( ) ) {
document . addKeyword ( PortosIndexField . PRATICA_APERTA , false ) ;
} else if ( intPratica . isAnnullata ( ) | | intPratica . getStatoPratica ( ) . equals ( StatoPraticaConstants . ANNULLATA ) ) {
document . addKeyword ( PortosIndexField . PRATICA_APERTA , false ) ;
} else {
document . addKeyword ( PortosIndexField . PRATICA_APERTA , true ) ;
}
document . addKeywordSortable ( PortosIndexField . TASK_NAME , task . getName ( ) ) ;
if ( intPratica . getStatoPratica ( ) . equals ( StatoPraticaConstants . INTEGRAZIONE ) ) {
document . addKeyword ( PortosIndexField . PRATICA_APERTA , true ) ;
}
}
}
}
// Prendo la lista dei soggetti committenti legati a IntPratica
List < Soggetto > committenti =
SoggettoLocalServiceUtil . findByIntPratica_TipologiaSoggetto ( intPratica . getIntPraticaId ( ) ,
TipoSoggettoUtil . COMMITTENTE ) ;
} else {
if ( Validator . isNotNull ( committenti ) & & committenti . size ( ) > 0 ) {
_log . warn ( "Received a null ControlloPratica in input." ) ;
}
// Creao una stringa contenente tutti i codFisc legati alla IntPratica separati da ,
List < String > listaSoggetti = new ArrayList < String > ( ) ;
for ( Soggetto soggetto : committenti ) {
return document ;
// listaSoggetti.add(soggetto.getCodiceFiscale().toUpperCase());
listaSoggetti . add ( soggetto . getNome ( ) . toUpperCase ( ) + " " + soggetto . getCognome ( ) . toUpperCase ( ) ) ;
}
}
document . addKeyword ( PortosIndexField . SOGGETTI_INTERESSATI , listaSoggetti . toArray ( new String [ 0 ] ) ) ;
document . addKeyword ( PortosIndexField . COMMITTENTI , listaSoggetti . toArray ( new String [ 0 ] ) ) ;
}
@Override
protected Document getBaseModelDocument ( String portletId , BaseModel < ? > baseModel ) throws SystemException {
// Soggetti Interconnessi
List < Soggetto > listSoggettiInterconnessi =
SoggettoLocalServiceUtil . getSoggettiByIntPraticaId_DtRimozioneNull ( intPratica . getIntPraticaId ( ) ) ;
Document document = newDocument ( ) ;
if ( listSoggettiInterconnessi ! = null & & ! listSoggettiInterconnessi . isEmpty ( ) ) {
String className = baseModel . getModelClassName ( ) ;
List < String > listaStringata = new ArrayList < String > ( ) ;
long classPK = 0 ;
long resourcePrimKey = 0 ;
for ( Soggetto sog : listSoggettiInterconnessi ) {
listaStringata . add ( sog . getNome ( ) . toUpperCase ( ) + " " + sog . getCognome ( ) . toUpperCase ( ) ) ;
}
if ( baseModel instanceof ResourcedModel ) {
ResourcedModel resourcedModel = ( ResourcedModel ) baseModel ;
classPK = resourcedModel . getResourcePrimKey ( ) ;
resourcePrimKey = resourcedModel . getResourcePrimKey ( ) ;
} else {
classPK = GetterUtil . getLong ( baseModel . getPrimaryKeyObj ( ) ) ;
}
document . addKeyword ( PortosIndexField . SOGGETTI_INTERCONNESSI , listaStringata . toArray ( new String [ 0 ] ) ) ;
}
document . addUID ( portletId , classPK , className ) ;
// Prendo dati relativi al Territorio
if ( Validator . isNotNull ( intPratica . getTerritorioId ( ) ) ) {
document . addKeyword ( Field . ENTRY_CLASS_NAME , className ) ;
document . addKeyword ( Field . ENTRY_CLASS_PK , classPK ) ;
document . addKeyword ( Field . PORTLET_ID , portletId ) ;
Territorio territorio = TerritorioLocalServiceUtil . fetchTerritorio ( intPratica . getTerritorioId ( ) ) ;
if ( resourcePrimKey > 0 ) {
document . addKeyword ( Field . ROOT_ENTRY_CLASS_PK , resourcePrimKey ) ;
}
if ( Validator . isNotNull ( territorio ) ) {
if ( baseModel instanceof AuditedModel ) {
AuditedModel auditedModel = ( AuditedModel ) baseModel ;
if ( Validator . isNotNull ( territorio . getComuneId ( ) ) ) {
document . addKeyword ( Field . COMPANY_ID , auditedModel . getCompanyId ( ) ) ;
document . addDate ( Field . CREATE_DATE , auditedModel . getCreateDate ( ) ) ;
document . addDate ( Field . MODIFIED_DATE , auditedModel . getModifiedDate ( ) ) ;
Comune comune = ComuneLocalServiceUtil . fetchComune ( territorio . getComuneId ( ) ) ;
if ( Validator . isNotNull ( comune ) ) {
document . addKeyword ( Field . USER_ID , auditedModel . getUserId ( ) ) ;
document . addKeyword ( PortosIndexField . COMUNE_ID , comune . getComuneId ( ) ) ;
document . addKeyword ( PortosIndexField . COMUNE_DENOMINAZIONE , comune . getDenominazione ( ) ) ;
String userName = PortalUtil . getUserName ( auditedModel . getUserId ( ) , auditedModel . getUserName ( ) ) ;
}
document . addKeyword ( Field . USER_NAME , userName , true ) ;
if ( Validator . isNotNull ( territorio . getCodiceProvincia ( ) ) ) {
}
Provincia provincia =
ProvinciaLocalServiceUtil . fetchByC_C ( territorio . getCompanyId ( ) , territorio . getCodiceProvincia ( ) ) ;
GroupedModel groupedModel = null ;
if ( Validator . isNotNull ( provincia ) ) {
if ( baseModel instanceof GroupedModel ) {
groupedModel = ( GroupedModel ) baseModel ;
document . addKeyword ( PortosIndexField . PROVINCIA_ID , provincia . getProvinciaId ( ) ) ;
document . addKeyword ( PortosIndexField . PROVINCIA_CODICE , provincia . getCodiceProvincia ( ) ) ;
document . addKeyword ( PortosIndexField . PROVINCIA_NAME , provincia . getProvincia ( ) ) ;
document . addKeyword ( Field . GROUP_ID , getSiteGroupId ( groupedModel . getGroupId ( ) ) ) ;
document . addKeyword ( Field . SCOPE_GROUP_ID , groupedModel . getGroupId ( ) ) ;
}
}
if ( ( groupedModel ! = null ) & & ( baseModel instanceof TrashedModel ) ) {
TrashedModel trashedModel = ( TrashedModel ) baseModel ;
}
if ( trashedModel . isInTrash ( ) ) {
addTrashFields ( document , trashedModel ) ;
}
}
}
addAssetFields ( document , className , classPK ) ;
return document ;
}
}
}
@Override
protected Summary doGetSummary ( Document document , Locale locale , String snippet , PortletURL portletURL )
throws Exception {
}
if ( Validator . isNotNull ( document ) ) {
// Indicizzazione campi da Kaleo
WorkflowInstanceLink workflowInstanceLink =
WorkflowInstanceLinkLocalServiceUtil . fetchWorkflowInstanceLink ( controlloPraticaFromDB . getCompanyId ( ) ,
controlloPraticaFromDB . getGroupId ( ) , ControlloPratica . class . getName ( ) ,
controlloPraticaFromDB . getPrimaryKey ( ) ) ;
String title = document . get ( "" ) ;
String content = document . get ( "" ) ;
String controlloPraticaId = document . get ( PortosIndexField . CONTROLLO_PRATICA_ID ) ;
if ( Validator . isNotNull ( workflowInstanceLink ) ) {
long workflowInstanceId = workflowInstanceLink . getWorkflowInstanceId ( ) ;
WorkflowInstance workflowInstance =
WorkflowInstanceManagerUtil . getWorkflowInstance ( controlloPraticaFromDB . getCompanyId ( ) , workflowInstanceId ) ;
portletURL . setParameter ( "struts_action" , "/web/TODO" ) ;
portletURL . setParameter ( "intPraticaId" , controlloPraticaId ) ;
if ( Validator . isNotNull ( workflowInstance ) ) {
return new Summary ( title , content , portletURL ) ;
} else {
_log . warn ( "Received a null document in input." ) ;
return new Summary ( "---" , "---" , portletURL ) ;
}
}
document . addKeyword ( PortosIndexField . WORKFLOW_STATE , workflowInstance . getState ( ) ) ;
@Override
protected void doReindex ( Object obj ) throws Exception {
List < WorkflowTask > listaTask =
WorkflowTaskManagerUtil . getWorkflowTasksByWorkflowInstance ( controlloPraticaFromDB . getCompanyId ( ) , null ,
workflowInstance . getWorkflowInstanceId ( ) , false , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
if ( Validator . isNotNull ( obj ) ) {
ControlloPratica controlloPratica = ( ControlloPratica ) obj ;
Document document = getDocument ( controlloPratica ) ;
SearchEngineUtil . updateDocument ( getSearchEngineId ( ) , controlloPratica . getCompanyId ( ) , document ,
false ) ;
if ( Validator . isNotNull ( listaTask ) & & ! listaTask . isEmpty ( ) ) {
WorkflowTask task = listaTask . get ( 0 ) ;
} else {
_log . warn ( "Received a null ControlloPratica in input." ) ;
}
}
if ( task . getAssigneeUserId ( ) ! = 0L & & task . getAssigneeUserId ( ) ! = - 1 ) {
document . addKeyword ( PortosIndexField . TASK_ASSIGNEE_USER_ID , task . getAssigneeUserId ( ) ) ;
} else if ( workflowInstance . getState ( ) . equals ( "Esito" ) ) {
_log . warn ( "Fascicolo Disallineato su Kaleo : assenza assegnazione istruttore | kaleoInstanceId=" + workflowInstance . getWorkflowInstanceId ( ) ) ;
}
@Override
protected void doReindex ( String [ ] ids ) throws Exception {
if ( Validator . isNotNull ( task . getWorkflowTaskAssignees ( ) ) & & ! task . getWorkflowTaskAssignees ( ) . isEmpty ( ) ) {
List < String > roleIdsAssignee = new ArrayList < String > ( ) ;
_log . debug ( "doReindex ControlloPratica" ) ;
if ( ids ! = null & & ids . length > 0 ) {
long companyId = GetterUtil . getLong ( ids [ 0 ] ) ;
reindexControlloPratica ( companyId ) ;
for ( WorkflowTaskAssignee taskAssignee : task . getWorkflowTaskAssignees ( ) ) {
if ( taskAssignee . getAssigneeClassName ( ) . equals ( Role . class . getName ( ) ) ) {
roleIdsAssignee . add ( "R" + taskAssignee . getAssigneeClassPK ( ) + "G"
+ controlloPraticaFromDB . getGroupId ( ) ) ;
}
}
} else {
_log . warn ( "Received a null or empty set of ids." ) ;
}
document . addKeyword ( PortosIndexField . TASK_ASSIGNEE_ROLE_IDS , roleIdsAssignee . toArray ( new String [ 0 ] ) ) ;
}
}
document . addKeyword ( PortosIndexField . WORKFLOW_DEFINITION_NAME , workflowInstance . getWorkflowDefinitionName ( ) ) ;
document . addKeyword ( PortosIndexField . WORKFLOW_DEFINITION_VERSION ,
workflowInstance . getWorkflowDefinitionVersion ( ) ) ;
document . addKeyword ( PortosIndexField . TASK_NAME , task . getName ( ) ) ;
protected void reindexControlloPratica ( long companyId ) throws PortalException , SystemException {
document . addKeywordSortable ( PortosIndexField . TASK_NAME , task . getName ( ) ) ;
ActionableDynamicQuery actionableDynamicQuery = new ControlloPraticaActionableDynamicQuery ( ) {
@Override
protected void performAction ( Object object ) throws PortalException {
}
}
}
if ( object ! = null ) {
ControlloPratica controlloPratica = ( ControlloPratica ) object ;
if ( controlloPratica ! = null ) {
try {
Document document = null ;
try {
document = getDocument ( controlloPratica ) ;
} catch ( SearchException se ) {
_log . warn ( "Received a SearchException while getting a document for ControlloPratica.getControlloPraticaId()="
+ controlloPratica . getControlloPraticaId ( ) ) ;
se . printStackTrace ( ) ;
}
if ( document ! = null ) {
addDocument ( document ) ;
}
} catch ( Exception e ) {
_log . error ( e ) ;
}
}
}
}
} else {
_log . warn ( "Received a null ControlloPratica in input." ) ;
}
return document ;
}
@Override
protected Document getBaseModelDocument ( String portletId , BaseModel < ? > baseModel ) throws SystemException {
Document document = newDocument ( ) ;
String className = baseModel . getModelClassName ( ) ;
long classPK = 0 ;
long resourcePrimKey = 0 ;
if ( baseModel instanceof ResourcedModel ) {
ResourcedModel resourcedModel = ( ResourcedModel ) baseModel ;
classPK = resourcedModel . getResourcePrimKey ( ) ;
resourcePrimKey = resourcedModel . getResourcePrimKey ( ) ;
} else {
classPK = GetterUtil . getLong ( baseModel . getPrimaryKeyObj ( ) ) ;
}
document . addUID ( portletId , classPK , className ) ;
document . addKeyword ( Field . ENTRY_CLASS_NAME , className ) ;
document . addKeyword ( Field . ENTRY_CLASS_PK , classPK ) ;
document . addKeyword ( Field . PORTLET_ID , portletId ) ;
if ( resourcePrimKey > 0 ) {
document . addKeyword ( Field . ROOT_ENTRY_CLASS_PK , resourcePrimKey ) ;
}
if ( baseModel instanceof AuditedModel ) {
AuditedModel auditedModel = ( AuditedModel ) baseModel ;
document . addKeyword ( Field . COMPANY_ID , auditedModel . getCompanyId ( ) ) ;
document . addDate ( Field . CREATE_DATE , auditedModel . getCreateDate ( ) ) ;
document . addDate ( Field . MODIFIED_DATE , auditedModel . getModifiedDate ( ) ) ;
document . addKeyword ( Field . USER_ID , auditedModel . getUserId ( ) ) ;
String userName = PortalUtil . getUserName ( auditedModel . getUserId ( ) , auditedModel . getUserName ( ) ) ;
document . addKeyword ( Field . USER_NAME , userName , true ) ;
}
GroupedModel groupedModel = null ;
if ( baseModel instanceof GroupedModel ) {
groupedModel = ( GroupedModel ) baseModel ;
document . addKeyword ( Field . GROUP_ID , getSiteGroupId ( groupedModel . getGroupId ( ) ) ) ;
document . addKeyword ( Field . SCOPE_GROUP_ID , groupedModel . getGroupId ( ) ) ;
}
if ( ( groupedModel ! = null ) & & ( baseModel instanceof TrashedModel ) ) {
TrashedModel trashedModel = ( TrashedModel ) baseModel ;
if ( trashedModel . isInTrash ( ) ) {
addTrashFields ( document , trashedModel ) ;
}
}
addAssetFields ( document , className , classPK ) ;
return document ;
}
@Override
protected Summary doGetSummary ( Document document , Locale locale , String snippet , PortletURL portletURL )
throws Exception {
if ( Validator . isNotNull ( document ) ) {
String title = document . get ( "" ) ;
String content = document . get ( "" ) ;
String controlloPraticaId = document . get ( PortosIndexField . CONTROLLO_PRATICA_ID ) ;
portletURL . setParameter ( "struts_action" , "/web/TODO" ) ;
portletURL . setParameter ( "intPraticaId" , controlloPraticaId ) ;
return new Summary ( title , content , portletURL ) ;
} else {
_log . warn ( "Received a null document in input." ) ;
return new Summary ( "---" , "---" , portletURL ) ;
}
}
@Override
protected void doReindex ( Object obj ) throws Exception {
if ( Validator . isNotNull ( obj ) ) {
ControlloPratica controlloPratica = ( ControlloPratica ) obj ;
Document document = getDocument ( controlloPratica ) ;
SearchEngineUtil . updateDocument ( getSearchEngineId ( ) , controlloPratica . getCompanyId ( ) , document , false ) ;
} else {
_log . warn ( "Received a null ControlloPratica in input." ) ;
}
}
@Override
protected void doReindex ( String [ ] ids ) throws Exception {
_log . debug ( "doReindex ControlloPratica" ) ;
if ( ids ! = null & & ids . length > 0 ) {
long companyId = GetterUtil . getLong ( ids [ 0 ] ) ;
reindexControlloPratica ( companyId ) ;
} else {
_log . warn ( "Received a null or empty set of ids." ) ;
}
}
protected void reindexControlloPratica ( long companyId ) throws PortalException , SystemException {
ActionableDynamicQuery actionableDynamicQuery = new ControlloPraticaActionableDynamicQuery ( ) {
@Override
protected void performAction ( Object object ) throws PortalException {
if ( object ! = null ) {
ControlloPratica controlloPratica = ( ControlloPratica ) object ;
if ( controlloPratica ! = null ) {
try {
Document document = null ;
try {
document = getDocument ( controlloPratica ) ;
} catch ( SearchException se ) {
_log . warn ( "Received a SearchException while getting a document for ControlloPratica.getControlloPraticaId()="
+ controlloPratica . getControlloPraticaId ( ) ) ;
se . printStackTrace ( ) ;
}
if ( document ! = null ) {
addDocument ( document ) ;
}
} catch ( Exception e ) {
_log . error ( e ) ;
}
}
}
}
} ;
actionableDynamicQuery . setCompanyId ( companyId ) ;
actionableDynamicQuery . setSearchEngineId ( getSearchEngineId ( ) ) ;
actionableDynamicQuery . performActions ( ) ;
}
@Override
protected void doReindex ( String className , long id ) throws Exception {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil . getControlloPratica ( id ) ;
doReindex ( controlloPratica ) ;
}
private boolean checkSottopostaAParere ( long intPraticaId ) throws SystemException , PortalException {
return WorkflowUtil . isWorkflowDisattivabile ( intPraticaId ) ;
// List<ControlloPratica> lista =
// ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId,
// WorkflowConstants.STATUS_APPROVED);
//
// if (Validator.isNotNull(lista) && !lista.isEmpty()) {
// return true;
// } else {
// return false;
// }
}
private boolean checkLavorazioneSorteggiata ( long intPraticaId ) throws SystemException {
Sorteggio sorteggio = SorteggioLocalServiceUtil . findByIntPratica ( intPraticaId ) ;
if ( Validator . isNotNull ( sorteggio ) ) {
return true ;
} else {
return false ;
}
}
@Override
protected String getPortletId ( SearchContext searchContext ) {
return PORTLET_ID ;
}
} ;
actionableDynamicQuery . setCompanyId ( companyId ) ;
actionableDynamicQuery . setSearchEngineId ( getSearchEngineId ( ) ) ;
actionableDynamicQuery . performActions ( ) ;
}
@Override
protected void doReindex ( String className , long id ) throws Exception {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil . getControlloPratica ( id ) ;
doReindex ( controlloPratica ) ;
}
private boolean checkSottopostaAParere ( long intPraticaId ) throws SystemException , PortalException {
return WorkflowUtil . isWorkflowDisattivabile ( intPraticaId ) ;
// List<ControlloPratica> lista =
// ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId,
// WorkflowConstants.STATUS_APPROVED);
//
// if (Validator.isNotNull(lista) && !lista.isEmpty()) {
// return true;
// } else {
// return false;
// }
}
private boolean checkLavorazioneSorteggiata ( long intPraticaId ) throws SystemException {
Sorteggio sorteggio = SorteggioLocalServiceUtil . findByIntPratica ( intPraticaId ) ;
if ( Validator . isNotNull ( sorteggio ) ) {
return true ;
} else {
return false ;
}
}
@Override
protected String getPortletId ( SearchContext searchContext ) {
return PORTLET_ID ;
}
}