@ -37,13 +37,14 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the int pratica remote service .
* The implementation of the int pratica remote service .
*
*
* < p >
* < p >
* All custom service methods should be put in this class . Whenever methods are added , rerun
* All custom service methods should be put in this class . Whenever methods are
* ServiceBuilder to copy their definitions into the
* added , rerun ServiceBuilder to copy their definitions into the
* { @link it . tref . liferay . portos . bo . service . IntPraticaService } interface .
* { @link it . tref . liferay . portos . bo . service . IntPraticaService } interface .
*
*
* < p >
* < p >
* This is a remote service . Methods of this service are expected to have security checks based on
* This is a remote service . Methods of this service are expected to have
* the propagated JAAS credentials because this service can be accessed remotely .
* security checks based on the propagated JAAS credentials because this service
* can be accessed remotely .
* < / p >
* < / p >
*
*
* @author Davide Barbagallo , 3F Consulting
* @author Davide Barbagallo , 3F Consulting
@ -51,179 +52,192 @@ import com.liferay.portal.service.ServiceContext;
* @see it . tref . liferay . portos . bo . service . IntPraticaServiceUtil
* @see it . tref . liferay . portos . bo . service . IntPraticaServiceUtil
* /
* /
public class IntPraticaServiceImpl extends IntPraticaServiceBaseImpl {
public class IntPraticaServiceImpl extends IntPraticaServiceBaseImpl {
/ *
/ *
* NOTE FOR DEVELOPERS : Never reference this interface directly . Always use { @link
* NOTE FOR DEVELOPERS : Never reference this interface directly . Always use
* it . tref . liferay . portos . bo . service . IntPraticaServiceUtil } to access the int pratica remote
* { @link it . tref . liferay . portos . bo . service . IntPraticaServiceUtil } to access
* service .
* the int pratica remote service .
* /
* /
public IntPratica getIntPratica ( long intPraticaId ) throws PortalException , SystemException {
public IntPratica getIntPratica ( long intPraticaId ) throws PortalException , SystemException {
// TODO: Permessi
// TODO: Permessi
return intPraticaLocalService . getIntPratica ( intPraticaId ) ;
return intPraticaLocalService . getIntPratica ( intPraticaId ) ;
}
}
public void deleteIntPratica ( long intPraticaId , long userId ) throws PortalException , SystemException {
public void deleteIntPratica ( long intPraticaId , long userId ) throws PortalException , SystemException {
IntPratica intPratica = IntPraticaLocalServiceUtil . getIntPratica ( intPraticaId ) ;
IntPratica intPratica = IntPraticaLocalServiceUtil . getIntPratica ( intPraticaId ) ;
if ( ValidazionePraticaUtil . canDeletePratica ( intPraticaId , userId ) ) {
if ( ValidazionePraticaUtil . canDeletePratica ( intPraticaId , userId ) ) {
intPraticaLocalService . deleteIntPratica ( intPratica ) ;
intPraticaLocalService . deleteIntPratica ( intPratica ) ;
} else {
} else {
throw new SystemException ( "impossibile cancellare la int pratica" ) ;
throw new SystemException ( "impossibile cancellare la int pratica" ) ;
}
}
}
}
// public void pagaInvia(long intPraticaId, int pagAdeguamentoSismico, int pagAltro, int
// public void pagaInvia(long intPraticaId, int pagAdeguamentoSismico, int
// pagMiglioramentoSismico,
// pagAltro, int
// int pagNuovaCostruzione, boolean pagNuoveCostruzioni, boolean pagRiparazioneInterventoLocale,
// pagMiglioramentoSismico,
// boolean pagVarianti, String importoSpeseIstruttoria, String codiceFiscaleCommittente, String
// int pagNuovaCostruzione, boolean pagNuoveCostruzioni, boolean
// currentUrl,
// pagRiparazioneInterventoLocale,
// ServiceContext serviceContext) throws PortalException, SystemException {
// boolean pagVarianti, String importoSpeseIstruttoria, String
//
// codiceFiscaleCommittente, String
//
// currentUrl,
// intPraticaLocalService.pagaInvia(intPraticaId, pagAdeguamentoSismico, pagAltro,
// ServiceContext serviceContext) throws PortalException, SystemException {
// pagMiglioramentoSismico,
//
// pagNuovaCostruzione, pagNuoveCostruzioni, pagRiparazioneInterventoLocale, pagVarianti,
//
// importoSpeseIstruttoria,
// intPraticaLocalService.pagaInvia(intPraticaId, pagAdeguamentoSismico,
// codiceFiscaleCommittente, currentUrl, serviceContext);
// pagAltro,
//
// pagMiglioramentoSismico,
// }
// pagNuovaCostruzione, pagNuoveCostruzioni, pagRiparazioneInterventoLocale,
// pagVarianti,
// importoSpeseIstruttoria,
// codiceFiscaleCommittente, currentUrl, serviceContext);
//
// }
public void sospendiPratica ( long intPraticaId , boolean sospesa ) throws PortalException , SystemException {
public void sospendiPratica ( long intPraticaId , boolean sospesa ) throws PortalException , SystemException {
IntPratica intPratica = IntPraticaLocalServiceUtil . getIntPratica ( intPraticaId ) ;
Territorio territorio = TerritorioLocalServiceUtil . getTerritorio ( intPratica . getTerritorioId ( ) ) ;
IntPratica intPratica = IntPraticaLocalServiceUtil . getIntPratica ( intPraticaId ) ;
IntPraticaPermission . check ( getPermissionChecker ( ) , territorio . getGroupId ( ) ,
Territorio territorio = TerritorioLocalServiceUtil . getTerritorio ( intPratica . getTerritorioId ( ) ) ;
ActionKeys . SOSPENDI_FASCICOLO ) ;
intPraticaLocalService . sospendiPratica ( intPraticaId , sospesa ) ;
IntPraticaPermission . check ( getPermissionChecker ( ) , territorio . getGroupId ( ) , ActionKeys . SOSPENDI_FASCICOLO ) ;
}
intPraticaLocalService . sospendiPratica ( intPraticaId , sospesa ) ;
}
public void cambiaTitolare ( long intPraticaId , long soggettoId , ServiceContext serviceContext )
throws PortalException , SystemException {
public void cambiaTitolare ( long intPraticaId , long soggettoId , ServiceContext serviceContext ) throws PortalException ,
IntPratica intPratica = IntPraticaLocalServiceUtil . getIntPratica ( intPraticaId ) ;
SystemException {
Territorio territorio = TerritorioLocalServiceUtil . getTerritorio ( intPratica . getTerritorioId ( ) ) ;
IntPratica intPratica = IntPraticaLocalServiceUtil . getIntPratica ( intPraticaId ) ;
IntPraticaPermission . check ( getPermissionChecker ( ) , territorio . getGroupId ( ) ,
Territorio territorio = TerritorioLocalServiceUtil . getTerritorio ( intPratica . getTerritorioId ( ) ) ;
ActionKeys . CAMBIO_TITOLARE ) ;
intPraticaLocalService . cambiaTitolare ( intPraticaId , soggettoId , serviceContext ) ;
}
IntPraticaPermission . check ( getPermissionChecker ( ) , territorio . getGroupId ( ) , ActionKeys . CAMBIO_TITOLARE ) ;
public void updateStatoPratica ( long intPraticaId , String statoPratica ) throws PortalException ,
intPraticaLocalService . cambiaTitolare ( intPraticaId , soggettoId , serviceContext ) ;
SystemException {
}
public void updateStatoPratica ( long intPraticaId , String statoPratica ) throws PortalException , SystemException {
IntPratica intPratica = IntPraticaLocalServiceUtil . getIntPratica ( intPraticaId ) ;
Territorio territorio = TerritorioLocalServiceUtil . getTerritorio ( intPratica . getTerritorioId ( ) ) ;
IntPratica intPratica = IntPraticaLocalServiceUtil . getIntPratica ( intPraticaId ) ;
IntPraticaPermission . check ( getPermissionChecker ( ) , territorio . getGroupId ( ) , ActionKeys . CAMBIO_STATO ) ;
Territorio territorio = TerritorioLocalServiceUtil . getTerritorio ( intPratica . getTerritorioId ( ) ) ;
intPraticaLocalService . updateStatoPratica ( intPraticaId , statoPratica ) ;
}
IntPraticaPermission . check ( getPermissionChecker ( ) , territorio . getGroupId ( ) , ActionKeys . CAMBIO_STATO ) ;
public List < IntPratica > search ( List < Long > groupIds , int start , int end ) throws SystemException {
intPraticaLocalService . updateStatoPratica ( intPraticaId , 0l , statoPratica ) ;
}
public List < IntPratica > search ( List < Long > groupIds , int start , int end ) throws SystemException {
// TODO Modificare tramite Indexer
// TODO Aggiungere controllo permessi
// TODO Modificare tramite Indexer
return intPraticaLocalService . search ( groupIds , start , end ) ;
// TODO Aggiungere controllo permessi
return intPraticaLocalService . search ( groupIds , start , end ) ;
}
}
public int countSearch ( List < Long > groupIds ) throws SystemException {
public int countSearch ( List < Long > groupIds ) throws SystemException {
// TODO Modificare tramite Indexer
// TODO Aggiungere controllo permessi
// TODO Modificare tramite Indexer
return intPraticaLocalService . countSearch ( groupIds ) ;
// TODO Aggiungere controllo permessi
return intPraticaLocalService . countSearch ( groupIds ) ;
}
}
public List < IntPratica > findByCompanyIdSoggettoProgetti ( long companyId , long soggettoId )
throws SystemException , PortalException {
public List < IntPratica > findByCompanyIdSoggettoProgetti ( long companyId , long soggettoId ) throws SystemException ,
return intPraticaLocalService . findByCompanyIdSoggettoProgetti ( companyId , soggettoId ) ;
PortalException {
}
return intPraticaLocalService . find ByCompanyIdSoggettoProgetti ( companyId , soggettoId ) ;
public int count ByCompanyIdSoggettoProgetti ( long companyId , long soggettoId ) throws SystemException ,
}
PortalException {
public int countByCompanyIdSoggettoProgetti ( long companyId , long soggettoId ) throws SystemException , PortalException {
return intPraticaLocalService . countByCompanyIdSoggettoProgetti ( companyId , soggettoId ) ;
}
return intPraticaLocalService . countByCompanyIdSoggettoProgetti ( companyId , soggettoId ) ;
public List < IntPratica > findByCompanyIdSoggettoArchivio ( long companyId , long soggettoId )
}
throws SystemException , PortalException {
public List < IntPratica > findByCompanyIdSoggettoArchivio ( long companyId , long soggettoId ) throws SystemException ,
return intPraticaLocalService . findByCompanyIdSoggettoArchivio ( companyId , soggettoId ) ;
PortalException {
}
return intPraticaLocalService . find ByCompanyIdSoggettoArchivio ( companyId , soggettoId ) ;
public int count ByCompanyIdSoggettoArchivio ( long companyId , long soggettoId ) throws SystemException ,
}
PortalException {
public int countByCompanyIdSoggettoArchivio ( long companyId , long soggettoId ) throws SystemException , PortalException {
return intPraticaLocalService . countByCompanyIdSoggettoArchivio ( companyId , soggettoId ) ;
}
return intPraticaLocalService . countByCompanyIdSoggettoArchivio ( companyId , soggettoId ) ;
public List < IntPratica > findByCompanyIdSoggettoAltriProgetti ( long companyId , long soggettoId , int start ,
}
int end ) throws SystemException , PortalException {
public List < IntPratica > findByCompanyIdSoggettoAltriProgetti ( long companyId , long soggettoId , int start , int end )
return intPraticaLocalService . findByCompanyIdSoggettoAltriProgetti ( companyId , soggettoId , start , end ) ;
throws SystemException , PortalException {
}
return intPraticaLocalService . findByCompanyIdSoggettoAltriProgetti ( companyId , soggettoId , start , end ) ;
public int countByCompanyIdSoggettoAltriProgetti ( long companyId , long soggettoId ) throws SystemException ,
}
PortalException {
public int countByCompanyIdSoggettoAltriProgetti ( long companyId , long soggettoId ) throws SystemException ,
return intPraticaLocalService . countByCompanyIdSoggettoAltriProgetti ( companyId , soggettoId ) ;
PortalException {
}
return intPraticaLocalService . countByCompanyIdSoggettoAltriProgetti ( companyId , soggettoId ) ;
public List < IntPratica > findByCanAddFineLavori ( long companyId , String codiceFiscale , int start , int end )
}
throws SystemException , PortalException {
public List < IntPratica > findByCanAddFineLavori ( long companyId , String codiceFiscale , int start , int end )
return intPraticaLocalService . findByCanAddFineLavori ( companyId , codiceFiscale , start , end ) ;
throws SystemException , PortalException {
}
return intPraticaLocalService . findByCanAddFineLavori ( companyId , codiceFiscale , start , end ) ;
public int countByCanAddFineLavori ( long companyId , String codiceFiscale ) throws SystemException ,
}
PortalException {
public int countByCanAddFineLavori ( long companyId , String codiceFiscale ) throws SystemException , PortalException {
return intPraticaLocalService . countByCanAddFineLavori ( companyId , codiceFiscale ) ;
}
return intPraticaLocalService . countByCanAddFineLavori ( companyId , codiceFiscale ) ;
public List < IntPratica > findByCanAddCollaudo ( long companyId , String codiceFiscale , int start , int end )
}
throws SystemException , PortalException {
public List < IntPratica > findByCanAddCollaudo ( long companyId , String codiceFiscale , int start , int end )
return intPraticaLocalService . findByCanAddCollaudo ( companyId , codiceFiscale , start , end ) ;
throws SystemException , PortalException {
}
return intPraticaLocalService . findByCanAddCollaudo ( companyId , codiceFiscale , start , end ) ;
public int countByCanAddCollaudo ( long companyId , String codiceFiscale ) throws SystemException ,
}
PortalException {
public int countByCanAddCollaudo ( long companyId , String codiceFiscale ) throws SystemException , PortalException {
return intPraticaLocalService . countByCanAddCollaudo ( companyId , codiceFiscale ) ;
}
return intPraticaLocalService . countByCanAddCollaudo ( companyId , codiceFiscale ) ;
public FileEntry allegaFileAnnullamento ( long intPraticaId , byte [ ] content , String sourceFileName ,
}
String jsonFirmatari , ServiceContext serviceContext ) throws SystemException , PortalException ,
IOException {
public FileEntry allegaFileAnnullamento ( long intPraticaId , byte [ ] content , String sourceFileName ,
return intPraticaLocalService . allegaFileAnnullamento ( intPraticaId , content , sourceFileName ,
String jsonFirmatari , ServiceContext serviceContext ) throws SystemException , PortalException , IOException {
jsonFirmatari , serviceContext ) ;
}
return intPraticaLocalService . allegaFileAnnullamento ( intPraticaId , content , sourceFileName , jsonFirmatari , serviceContext ) ;
public void completeAnnullamento ( long intPraticaId , long userId ) throws PortalException , SystemException {
}
public void completeAnnullamento ( long intPraticaId , long userId ) throws PortalException , SystemException {
if ( ! AzioniPraticheUtil . isAllowedAction ( intPraticaId , AzioniPraticheUtil . ACTION_ANNULLA )
| | ! ValidazionePraticaUtil . praticaCanAbort ( intPraticaId , userId ) ) {
throw new SystemException ( "error.annullamento.add.file.not.allowed" ) ;
}
intPraticaLocalService . completeAnnullamento ( intPraticaId ) ;
}
if ( ! AzioniPraticheUtil . isAllowedAction ( intPraticaId , AzioniPraticheUtil . ACTION_ANNULLA )
public void cambiaIstruttore ( long intPraticaId , long controlloPraticaId , long istruttoreId )
| | ! ValidazionePraticaUtil . praticaCanAbort ( intPraticaId , userId ) ) {
throws PortalException , SystemException {
throw new SystemException ( "error.annullamento.add.file.not.allowed" ) ;
}
intPraticaLocalService . completeAnnullamento ( intPraticaId ) ;
}
public void cambiaIstruttore ( long intPraticaId , long controlloPraticaId , long istruttoreId ) throws PortalException ,
intPraticaLocalService . cambiaIstruttore ( intPraticaId , controlloPraticaId , istruttoreId ) ;
SystemException {
}
intPraticaLocalService . cambiaIstruttore ( intPraticaId , controlloPraticaId , istruttoreId ) ;
public String geosisma ( long intPraticaId ) throws PortalException , SystemException {
}
public String geosisma ( long intPraticaId ) throws PortalException , SystemException {
JSONObject json = JSONFactoryUtil . createJSONObject ( ) ;
JSONObject json = JSONFactoryUtil . createJSONObject ( ) ;
IntPratica intPratica = intPraticaLocalService . fetchIntPratica ( intPraticaId ) ;
if ( Validator . isNotNull ( intPratica ) ) {
json . put ( "intPraticaId" , intPratica . getIntPraticaId ( ) ) ;
}
IntPratica intPratica = intPraticaLocalService . fetchIntPratica ( intPraticaId ) ;
return json . toString ( ) ;
if ( Validator . isNotNull ( intPratica ) ) {
}
json . put ( "intPraticaId" , intPratica . getIntPraticaId ( ) ) ;
}
return json . toString ( ) ;
}
}
}