@ -91,6 +91,19 @@ public class AdvancedOperationPortlet extends MVCPortlet {
actionResponse . setRenderParameter ( "intPraticaId" , String . valueOf ( intPraticaId ) ) ;
actionResponse . setRenderParameter ( "intPraticaId" , String . valueOf ( intPraticaId ) ) ;
}
}
public void reindexPratica ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception {
Privati . checkIfUserIsCompanyAdmin ( actionRequest ) ;
ThemeDisplay themeDisplay = ( ThemeDisplay ) actionRequest . getAttribute ( WebKeys . THEME_DISPLAY ) ;
long intPraticaId = ParamUtil . getLong ( actionRequest , "intPraticaId" , 0L ) ;
if ( intPraticaId ! = 0L ) {
_log . info ( "AdvancedOperationPortlet --- Reindexing fascicolo of IntPraticaId " + intPraticaId ) ;
IntPraticaLocalServiceUtil . reIndexFasciolo ( intPraticaId , themeDisplay . getCompanyId ( ) ) ;
}
actionResponse . setRenderParameter ( "intPraticaId" , String . valueOf ( intPraticaId ) ) ;
}
public void fixStatusPratica ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception {
public void fixStatusPratica ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception {
@ -112,32 +125,35 @@ public class AdvancedOperationPortlet extends MVCPortlet {
Privati . checkIfUserIsCompanyAdmin ( actionRequest ) ;
Privati . checkIfUserIsCompanyAdmin ( actionRequest ) ;
long intPraticaId = ParamUtil . getLong ( actionRequest , "intPraticaId" , - 1L ) ;
long intPraticaId = ParamUtil . getLong ( actionRequest , "intPraticaId" , - 1L ) ;
_log . info ( "intPraticaId: " + intPraticaId ) ;
IntPratica intPratica = IntPraticaLocalServiceUtil . fetchIntPratica ( intPraticaId ) ;
IntPratica intPratica = IntPraticaLocalServiceUtil . fetchIntPratica ( intPraticaId ) ;
int destinationUO = AdvancedOperationUtil . getDestinationUO ( intPratica ) ;
int destinationUO = AdvancedOperationUtil . getDestinationUO ( intPratica ) ;
_log . info ( "intPratica uo: " + intPratica . getUnitaOperativa ( ) ) ;
if ( AdvancedOperationUtil . evalUO ( intPratica ) ) {
if ( AdvancedOperationUtil . evalUO ( intPratica ) ) {
_setUO ( intPratica , destinationUO ) ;
_setUO ( intPratica , destinationUO ) ;
}
}
_log . info ( "intPratica uo: " + intPratica . getUnitaOperativa ( ) ) ;
actionResponse . setRenderParameter ( "intPraticaId" , String . valueOf ( intPraticaId ) ) ;
actionResponse . setRenderParameter ( "intPraticaId" , String . valueOf ( intPraticaId ) ) ;
}
}
private void _setUO ( IntPratica intPratica , int uo ) throws SystemException , SearchException {
private void _setUO ( IntPratica intPratica , int uo ) throws SystemException , PortalException {
_log . info ( "uo: " + uo ) ;
intPratica . setUnitaOperativa ( uo ) ;
intPratica . setUnitaOperativa ( uo ) ;
IntPraticaLocalServiceUtil . updateIntPratica ( intPratica ) ;
IntPraticaLocalServiceUtil . updateIntPratica ( intPratica ) ;
Indexer intPraticaIndexer = IndexerRegistryUtil . getIndexer ( IntPratica . class ) ;
IntPraticaLocalServiceUtil . reIndexFasciolo ( intPratica . getIntPraticaId ( ) , intPratica . getCompanyId ( ) ) ;
intPraticaIndexer . reindex ( intPratica ) ;
// Indexer intPraticaIndexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
Indexer controlloPraticaIndexer = IndexerRegistryUtil . getIndexer ( ControlloPratica . class ) ;
// intPraticaIndexer.reindex(intPratica);
List < ControlloPratica > controlloPraticas = ControlloPraticaLocalServiceUtil . findByIntPratica ( intPratica . getIntPraticaId ( ) ) ;
// Indexer controlloPraticaIndexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
if ( ! controlloPraticas . isEmpty ( ) ) {
// List<ControlloPratica> controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId());
for ( ControlloPratica controlloPratica : controlloPraticas ) {
// if(!controlloPraticas.isEmpty()){
if ( controlloPratica . getStatus ( ) = = WorkflowConstants . STATUS_PENDING ) {
// for(ControlloPratica controlloPratica : controlloPraticas){
controlloPraticaIndexer . reindex ( intPratica ) ;
// if(controlloPratica.getStatus() == WorkflowConstants.STATUS_PENDING){
}
// controlloPraticaIndexer.reindex(intPratica);
}
// }
}
// }
// }
}
}
public void ripristinaPraticaVidimata ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception {
public void ripristinaPraticaVidimata ( ActionRequest actionRequest , ActionResponse actionResponse ) throws Exception {