@ -45,6 +45,7 @@ import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.workflow.WorkflowConstants ;
import com.liferay.portal.kernel.workflow.WorkflowConstants ;
import com.liferay.portal.model.RoleConstants ;
import com.liferay.portal.model.RoleConstants ;
import com.liferay.portal.model.User ;
import com.liferay.portal.model.User ;
import com.liferay.portal.security.permission.ActionKeys ;
import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil ;
import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil ;
import com.liferay.portal.security.permission.PermissionThreadLocal ;
import com.liferay.portal.security.permission.PermissionThreadLocal ;
import com.liferay.portal.service.RoleLocalServiceUtil ;
import com.liferay.portal.service.RoleLocalServiceUtil ;
@ -57,13 +58,14 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
* The implementation of the doc pratica local service .
* The implementation of the doc pratica local 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 . DocPraticaLocalService } interface .
* { @link it . tref . liferay . portos . bo . service . DocPraticaLocalService } interface .
*
*
* < p >
* < p >
* This is a local service . Methods of this service will not have security checks based on the
* This is a local service . Methods of this service will not have security
* propagated JAAS credentials because this service can only be accessed from within the same VM .
* checks based on the propagated JAAS credentials because this service can only
* be accessed from within the same VM .
* < / p >
* < / p >
*
*
* @author Davide Barbagallo , 3F Consulting
* @author Davide Barbagallo , 3F Consulting
@ -72,9 +74,9 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
* /
* /
public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
/ *
/ *
* 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 . DocPraticaLocalServiceUtil } to access the doc pratica local
* { @link it . tref . liferay . portos . bo . service . DocPraticaLocalServiceUtil } to
* service .
* access the doc pratica local service .
* /
* /
private Log _log = LogFactoryUtil . getLog ( DocPraticaLocalServiceImpl . class ) ;
private Log _log = LogFactoryUtil . getLog ( DocPraticaLocalServiceImpl . class ) ;
@ -100,21 +102,22 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return deleteDocPratica ( docPraticaLocalService . getDocPratica ( docPraticaId ) ) ;
return deleteDocPratica ( docPraticaLocalService . getDocPratica ( docPraticaId ) ) ;
}
}
public DocPratica addDocPratica ( long userId , String className , long classPk , long intPraticaId , byte [ ] dlFileEntry ,
public DocPratica addDocPratica ( long userId , String className , long classPk , long intPraticaId ,
String fileName , String version , boolean praticaValidata , String descLong , String tipologia , String sha256 ,
byte [ ] dlFileEntry , String fileName , String version , boolean praticaValidata , String descLong ,
boolean aggiornato , String jsonFirmatari , long dettPraticaIdRimozione , Date dtDataRimozione ,
String tipologia , String sha256 , boolean aggiornato , String jsonFirmatari ,
ServiceContext serviceContext ) throws PortalException , SystemException {
long dettPraticaIdRimozione , Date dtDataRimozione , ServiceContext serviceContext )
throws PortalException , SystemException {
User user = userPersistence . findByPrimaryKey ( userId ) ;
User user = userPersistence . findByPrimaryKey ( userId ) ;
Date now = new Date ( ) ;
Date now = new Date ( ) ;
validate ( serviceContext . getScopeGroupId ( ) , 0L , className , classPk , intPraticaId , dlFileEntry , fileName , version ,
validate ( serviceContext . getScopeGroupId ( ) , 0L , className , classPk , intPraticaId , dlFileEntry ,
praticaValidata , descLong , tipologia , sha256 , aggiornato , jsonFirmatari , dettPraticaIdRimozione ,
fileName , version , praticaValidata , descLong , tipologia , sha256 , aggiornato , jsonFirmatari ,
dtDataRimozione ) ;
dettPraticaIdRimozione , dtDataRimozione ) ;
DocPratica docPratica = docPraticaPersistence . create ( counterLocalService . increment ( DocPratica . class
DocPratica docPratica = docPraticaPersistence . create ( counterLocalService . increment ( DocPratica . class . getName ( ) ) ) ;
. getName ( ) ) ) ;
FileEntry fileEntry = addAttachment ( classPk , intPraticaId , userId , fileName , dlFileEntry , tipologia ) ;
FileEntry fileEntry = addAttachment ( classPk , intPraticaId , userId , fileName , dlFileEntry , tipologia ) ;
@ -146,15 +149,16 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return docPratica ;
return docPratica ;
}
}
public DocPratica addDocPratica ( long userId , String className , long classPk , long intPraticaId , byte [ ] dlFileEntry ,
public DocPratica addDocPratica ( long userId , String className , long classPk , long intPraticaId ,
String fileName , String tipologia , String jsonFirmatari , ServiceContext serviceContext ) throws PortalException ,
byte [ ] dlFileEntry , String fileName , String tipologia , String jsonFirmatari ,
SystemException {
ServiceContext serviceContext ) throws PortalException , SystemException {
User user = userPersistence . findByPrimaryKey ( userId ) ;
User user = userPersistence . findByPrimaryKey ( userId ) ;
Date now = new Date ( ) ;
Date now = new Date ( ) ;
DocPratica docPratica = docPraticaPersistence . create ( counterLocalService . increment ( DocPratica . class . getName ( ) ) ) ;
DocPratica docPratica = docPraticaPersistence . create ( counterLocalService . increment ( DocPratica . class
. getName ( ) ) ) ;
FileEntry fileEntry = addAttachment ( classPk , intPraticaId , userId , fileName , dlFileEntry , tipologia ) ;
FileEntry fileEntry = addAttachment ( classPk , intPraticaId , userId , fileName , dlFileEntry , tipologia ) ;
@ -185,15 +189,16 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return docPratica ;
return docPratica ;
}
}
public DocPratica addDocPratica ( long userId , String className , long classPk , long intPraticaId , long fileEntry Id ,
public DocPratica addDocPratica ( long userId , String className , long classPk , long intPraticaId ,
String fileName , String tipologia , String jsonFirmatari , ServiceContext serviceContext ) throws PortalException ,
long fileEntryId , String fileName , String tipologia , String jsonFirmatari ,
SystemException {
ServiceContext serviceContext ) throws PortalException , SystemException {
User user = userPersistence . findByPrimaryKey ( userId ) ;
User user = userPersistence . findByPrimaryKey ( userId ) ;
Date now = new Date ( ) ;
Date now = new Date ( ) ;
DocPratica docPratica = docPraticaPersistence . create ( counterLocalService . increment ( DocPratica . class . getName ( ) ) ) ;
DocPratica docPratica = docPraticaPersistence . create ( counterLocalService . increment ( DocPratica . class
. getName ( ) ) ) ;
docPratica . setCompanyId ( serviceContext . getCompanyId ( ) ) ;
docPratica . setCompanyId ( serviceContext . getCompanyId ( ) ) ;
docPratica . setUserId ( user . getUserId ( ) ) ;
docPratica . setUserId ( user . getUserId ( ) ) ;
@ -223,18 +228,19 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
}
}
public DocPratica addDocPraticaForImport ( long userId , String className , long classPk , long intPraticaId ,
public DocPratica addDocPraticaForImport ( long userId , String className , long classPk , long intPraticaId ,
byte [ ] dlFileEntry , String fileName , String version , boolean praticaValidata , String descLong , String tipologia ,
byte [ ] dlFileEntry , String fileName , String version , boolean praticaValidata , String descLong ,
String sha256 , boolean aggiornato , String jsonFirmatari , long dettPraticaIdRimozione , Date dtDataRimozione ,
String tipologia , String sha256 , boolean aggiornato , String jsonFirmatari ,
long oldDocPraticaId , ServiceContext serviceContext ) throws PortalException , SystemException {
long dettPraticaIdRimozione , Date dtDataRimozione , long oldDocPraticaId ,
ServiceContext serviceContext ) throws PortalException , SystemException {
Date now = new Date ( ) ;
Date now = new Date ( ) ;
validate ( serviceContext . getScopeGroupId ( ) , 0L , className , classPk , intPraticaId , dlFileEntry , fileName , version ,
validate ( serviceContext . getScopeGroupId ( ) , 0L , className , classPk , intPraticaId , dlFileEntry ,
praticaValidata , descLong , tipologia , sha256 , aggiornato , jsonFirmatari , dettPraticaIdRimozione ,
fileName , version , praticaValidata , descLong , tipologia , sha256 , aggiornato , jsonFirmatari ,
dtDataRimozione ) ;
dettPraticaIdRimozione , dtDataRimozione ) ;
DocPratica docPratica = docPraticaPersistence . create ( counterLocalService . increment ( DocPratica . class
DocPratica docPratica = docPraticaPersistence . create ( counterLocalService . increment ( DocPratica . class . getName ( ) ) ) ;
. getName ( ) ) ) ;
docPratica . setCompanyId ( serviceContext . getCompanyId ( ) ) ;
docPratica . setCompanyId ( serviceContext . getCompanyId ( ) ) ;
docPratica . setUserId ( userId ) ;
docPratica . setUserId ( userId ) ;
@ -269,7 +275,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
FileEntry fileEntry = null ;
FileEntry fileEntry = null ;
// DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId);
// DettPratica dettPratica =
// dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId);
IntPratica intPratica = intPraticaPersistence . fetchByPrimaryKey ( intPraticaId ) ;
IntPratica intPratica = intPraticaPersistence . fetchByPrimaryKey ( intPraticaId ) ;
Territorio territorio = territorioPersistence . fetchByPrimaryKey ( intPratica . getTerritorioId ( ) ) ;
Territorio territorio = territorioPersistence . fetchByPrimaryKey ( intPratica . getTerritorioId ( ) ) ;
@ -277,9 +284,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
long groupId = territorio . getGroupId ( ) ;
long groupId = territorio . getGroupId ( ) ;
// TODO forse è meglio ragionare con un'altra logica per i permessi
// TODO forse è meglio ragionare con un'altra logica per i permessi
User user =
User user = UserLocalServiceUtil . getRoleUsers (
UserLocalServiceUtil . getRoleUsers (
RoleLocalServiceUtil . getRole ( intPratica . getCompanyId ( ) , RoleConstants . ADMINISTRATOR )
RoleLocalServiceUtil . getRole ( intPratica . getCompanyId ( ) , RoleConstants . ADMINISTRATOR ) . getRoleId ( ) ) . get ( 0 ) ;
. getRoleId ( ) ) . get ( 0 ) ;
try {
try {
PermissionThreadLocal . setPermissionChecker ( PermissionCheckerFactoryUtil . create ( user ) ) ;
PermissionThreadLocal . setPermissionChecker ( PermissionCheckerFactoryUtil . create ( user ) ) ;
} catch ( Exception e ) {
} catch ( Exception e ) {
@ -292,11 +299,10 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
serviceContext . setCompanyId ( companyId ) ;
serviceContext . setCompanyId ( companyId ) ;
serviceContext . setScopeGroupId ( groupId ) ;
serviceContext . setScopeGroupId ( groupId ) ;
serviceContext . setUserId ( userId ) ;
serviceContext . setUserId ( userId ) ;
serviceContext . setGroupPermissions ( new String [ ] { ActionKeys . VIEW } ) ;
// TODO forse mettiamo i permesssi ma non mi pare sicuro.
long defaultFolderId = configurazioneLocalService . findByC_ChiaveLong ( companyId ,
ConfigurazioneConstants . ATTACHMENT_FOLDER_ID ) ;
long defaultFolderId =
configurazioneLocalService . findByC_ChiaveLong ( companyId , ConfigurazioneConstants . ATTACHMENT_FOLDER_ID ) ;
Folder defaultFolder = dlAppLocalService . getFolder ( defaultFolderId ) ;
Folder defaultFolder = dlAppLocalService . getFolder ( defaultFolderId ) ;
@ -304,12 +310,12 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
Folder folder = null ;
Folder folder = null ;
try {
try {
folder = dlAppLocalService . getFolder ( defaultFolder . getRepositoryId ( ) , defaultFolder . getFolderId ( ) , folderName ) ;
folder = dlAppLocalService . getFolder ( defaultFolder . getRepositoryId ( ) ,
defaultFolder . getFolderId ( ) , folderName ) ;
} catch ( NoSuchFolderException e ) {
} catch ( NoSuchFolderException e ) {
// cartella non presente -> creo cartella
// cartella non presente -> creo cartella
folder =
folder = dlAppLocalService . addFolder ( userId , defaultFolder . getRepositoryId ( ) ,
dlAppLocalService . addFolder ( userId , defaultFolder . getRepositoryId ( ) , defaultFolder . getFolderId ( ) , folderName ,
defaultFolder . getFolderId ( ) , folderName , StringPool . BLANK , serviceContext ) ;
StringPool . BLANK , serviceContext ) ;
}
}
Date now = new Date ( ) ;
Date now = new Date ( ) ;
String title = tipoAllegato + StringPool . UNDERLINE + sourceFileName ;
String title = tipoAllegato + StringPool . UNDERLINE + sourceFileName ;
@ -317,13 +323,13 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
String mimeType = MimeTypesUtil . getContentType ( sourceFileName ) ;
String mimeType = MimeTypesUtil . getContentType ( sourceFileName ) ;
String changeLog = StringPool . BLANK ;
String changeLog = StringPool . BLANK ;
fileEntry =
fileEntry = dlAppLocalService . addFileEntry ( userId , folder . getRepositoryId ( ) , folder . getFolderId ( ) ,
dlAppLocalService . addFileEntry ( userId , folder . getRepositoryId ( ) , folder . getFolderId ( ) , now . getTime ( ) + "_"
now . getTime ( ) + "_" + sourceFileName , mimeType , title , description , changeLog , content ,
+ sourceFileName , mimeType , title , description , changeLog , content , serviceContext ) ;
serviceContext ) ;
try {
try {
PermissionThreadLocal . setPermissionChecker ( PermissionCheckerFactoryUtil . create ( UserLocalService Util
PermissionThreadLocal . setPermissionChecker ( PermissionCheckerFactoryUtil
. getUser ( delegaUserId ) ) ) ;
. create ( UserLocalServiceUtil . getUser ( delegaUserId ) ) ) ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw new SystemException ( e ) ;
throw new SystemException ( e ) ;
@ -344,7 +350,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPraticaLocalService . updateDocPratica ( docPratica ) ;
docPraticaLocalService . updateDocPratica ( docPratica ) ;
}
}
public void addFirmeAndApprova ( long docPraticaId , List < String > codiciFiscali ) throws PortalException , SystemException {
public void addFirmeAndApprova ( long docPraticaId , List < String > codiciFiscali ) throws PortalException ,
SystemException {
DocPratica docPratica = docPraticaLocalService . getDocPratica ( docPraticaId ) ;
DocPratica docPratica = docPraticaLocalService . getDocPratica ( docPraticaId ) ;
String jsonFirmatari = docPratica . getJsonFirmatari ( ) ;
String jsonFirmatari = docPratica . getJsonFirmatari ( ) ;
@ -357,7 +364,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPraticaLocalService . updateDocPratica ( docPratica ) ;
docPraticaLocalService . updateDocPratica ( docPratica ) ;
}
}
public void addErrorAndApprova ( long docPraticaId , String errorCode ) throws PortalException , SystemException {
public void addErrorAndApprova ( long docPraticaId , String errorCode ) throws PortalException ,
SystemException {
DocPratica docPratica = docPraticaLocalService . getDocPratica ( docPraticaId ) ;
DocPratica docPratica = docPraticaLocalService . getDocPratica ( docPraticaId ) ;
docPratica . setModifiedDate ( new Date ( ) ) ;
docPratica . setModifiedDate ( new Date ( ) ) ;
@ -376,16 +384,16 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
}
}
private void validate ( long groupId , long docPraticaId , String className , long classPk , long intPraticaId ,
private void validate ( long groupId , long docPraticaId , String className , long classPk , long intPraticaId ,
byte [ ] dlFileEntry , String fileName , String version , boolean praticaValidata , String descLong , String tipologia ,
byte [ ] dlFileEntry , String fileName , String version , boolean praticaValidata , String descLong ,
String sha256 , boolean aggiornato , String jsonFirmatari , long dettPraticaIdRimozione , Date dtDataRimozione )
String tipologia , String sha256 , boolean aggiornato , String jsonFirmatari ,
throws PortalException , SystemException {
long dettPraticaIdRimozione , Date dtDataRimozione ) throws PortalException , SystemException {
// TODO Write your own validation code
// TODO Write your own validation code
}
}
public DocPratica updateDocPraticaAggiornato ( long docPraticaId , boolean aggiornato ) throws SystemException {
public DocPratica updateDocPraticaAggiornato ( long docPraticaId , boolean aggiornato )
throws SystemException {
DocPratica docPratica = docPraticaPersistence . fetchByPrimaryKey ( docPraticaId ) ;
DocPratica docPratica = docPraticaPersistence . fetchByPrimaryKey ( docPraticaId ) ;
docPratica . setAggiornato ( aggiornato ) ;
docPratica . setAggiornato ( aggiornato ) ;
@ -436,7 +444,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return docPraticaPersistence . findByClassPk ( classPk ) ;
return docPraticaPersistence . findByClassPk ( classPk ) ;
}
}
public List < DocPratica > findByStaus ( int status , int start , int end , OrderByComparator order ) throws SystemException {
public List < DocPratica > findByStaus ( int status , int start , int end , OrderByComparator order )
throws SystemException {
return docPraticaPersistence . findByStatus ( status , start , end , order ) ;
return docPraticaPersistence . findByStatus ( status , start , end , order ) ;
}
}
@ -467,8 +476,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return soggettoPersistence . findWithDynamicQuery ( dynamicQuery , start , end ) ;
return soggettoPersistence . findWithDynamicQuery ( dynamicQuery , start , end ) ;
}
}
public List < DocPratica > findByIntPratica_ClassPk_Tipologia ( long intPraticaId , long classPk , String tipologia ,
public List < DocPratica > findByIntPratica_ClassPk_Tipologia ( long intPraticaId , long classPk ,
int start , int end ) throws SystemException {
String tipologia , int start , int end ) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery ( ) ;
DynamicQuery dynamicQuery = dynamicQuery ( ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "intPraticaId" , intPraticaId ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "intPraticaId" , intPraticaId ) ) ;
@ -478,8 +487,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery ( dynamicQuery , start , end ) ;
return dynamicQuery ( dynamicQuery , start , end ) ;
}
}
public List < DocPratica > findByIntPratica_ClassPk_Tipologie ( long intPraticaId , long classPk , List < String > tipologie )
public List < DocPratica > findByIntPratica_ClassPk_Tipologie ( long intPraticaId , long classPk ,
throws SystemException {
List < String > tipologie ) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery ( ) ;
DynamicQuery dynamicQuery = dynamicQuery ( ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "intPraticaId" , intPraticaId ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "intPraticaId" , intPraticaId ) ) ;
@ -500,7 +509,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery ( dynamicQuery ) ;
return dynamicQuery ( dynamicQuery ) ;
}
}
public DocPratica fetchByC_Group_DlFileEntry_Version ( long dlFileEntryId , String version ) throws SystemException {
public DocPratica fetchByC_Group_DlFileEntry_Version ( long dlFileEntryId , String version )
throws SystemException {
return docPraticaPersistence . fetchByDlFileEntry_Version ( dlFileEntryId , version ) ;
return docPraticaPersistence . fetchByDlFileEntry_Version ( dlFileEntryId , version ) ;
}
}
@ -513,14 +523,15 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
public List < Long > findDistinctDlFileEntryId ( long classPk , String tipologia , int start , int end )
public List < Long > findDistinctDlFileEntryId ( long classPk , String tipologia , int start , int end )
throws SystemException {
throws SystemException {
return findDistinctDlFileEntryId ( new long [ ] { classPk } , tipologia , start , end ) ;
return findDistinctDlFileEntryId ( new long [ ] { classPk } , tipologia , start , end ) ;
}
}
public List < Long > findDistinctDlFileEntryId ( long [ ] classPks , String tipologia , int start , int end )
public List < Long > findDistinctDlFileEntryId ( long [ ] classPks , String tipologia , int start , int end )
throws SystemException {
throws SystemException {
DynamicQuery dynamicQuery = docPraticaLocalService . dynamicQuery ( ) ;
DynamicQuery dynamicQuery = docPraticaLocalService . dynamicQuery ( ) ;
dynamicQuery . setProjection ( ProjectionFactoryUtil . distinct ( ProjectionFactoryUtil . property ( "dlFileEntryId" ) ) ) ;
dynamicQuery . setProjection ( ProjectionFactoryUtil . distinct ( ProjectionFactoryUtil
. property ( "dlFileEntryId" ) ) ) ;
dynamicQuery . add ( PropertyFactoryUtil . forName ( "tipologia" ) . eq ( tipologia ) ) ;
dynamicQuery . add ( PropertyFactoryUtil . forName ( "tipologia" ) . eq ( tipologia ) ) ;
Junction or = RestrictionsFactoryUtil . disjunction ( ) ;
Junction or = RestrictionsFactoryUtil . disjunction ( ) ;
for ( long classPk : classPks ) {
for ( long classPk : classPks ) {
@ -540,8 +551,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery ( dynamicQuery ) ;
return dynamicQuery ( dynamicQuery ) ;
}
}
public List < DocPratica > getValidByIntPratica_Tipologia ( long intPraticaId , String tipologia , int start , int end )
public List < DocPratica > getValidByIntPratica_Tipologia ( long intPraticaId , String tipologia , int start ,
throws SystemException {
int end ) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery ( ) ;
DynamicQuery dynamicQuery = dynamicQuery ( ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "intPraticaId" , intPraticaId ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "intPraticaId" , intPraticaId ) ) ;
@ -551,7 +562,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery ( dynamicQuery , start , end ) ;
return dynamicQuery ( dynamicQuery , start , end ) ;
}
}
public int countValidTmpByIntPratica_Tipologia ( long intPraticaId , String tipologia ) throws SystemException {
public int countValidTmpByIntPratica_Tipologia ( long intPraticaId , String tipologia )
throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica ( intPraticaId ) ;
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica ( intPraticaId ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "tipologia" , tipologia ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "tipologia" , tipologia ) ) ;
@ -559,8 +571,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return ( int ) docPraticaPersistence . countWithDynamicQuery ( dynamicQuery ) ;
return ( int ) docPraticaPersistence . countWithDynamicQuery ( dynamicQuery ) ;
}
}
public List < DocPratica > getValidTmpByIntPratica_Tipologia ( long intPraticaId , String tipologia , int start , int end )
public List < DocPratica > getValidTmpByIntPratica_Tipologia ( long intPraticaId , String tipologia , int start ,
throws SystemException {
int end ) throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica ( intPraticaId ) ;
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica ( intPraticaId ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "tipologia" , tipologia ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "tipologia" , tipologia ) ) ;
@ -569,8 +581,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery ( dynamicQuery , start , end ) ;
return dynamicQuery ( dynamicQuery , start , end ) ;
}
}
public List < DocPratica > getValidTmpByIntPratica_DettPratica_Tipologia ( long intPraticaId , long dettPraticaId , String tipologia , int start , int end )
public List < DocPratica > getValidTmpByIntPratica_DettPratica_Tipologia ( long intPraticaId ,
throws SystemException {
long dettPraticaId , String tipologia , int start , int end ) throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica ( intPraticaId ) ;
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica ( intPraticaId ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "tipologia" , tipologia ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "tipologia" , tipologia ) ) ;
@ -581,8 +593,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery ( dynamicQuery , start , end ) ;
return dynamicQuery ( dynamicQuery , start , end ) ;
}
}
public List < DocPratica > getValidTmpByIntPratica_Tipologie ( long intPraticaId , String [ ] tipologie , int start , int end )
public List < DocPratica > getValidTmpByIntPratica_Tipologie ( long intPraticaId , String [ ] tipologie ,
throws SystemException {
int start , int end ) throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica ( intPraticaId ) ;
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica ( intPraticaId ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . in ( "tipologia" , tipologie ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . in ( "tipologia" , tipologie ) ) ;
@ -591,7 +603,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery ( dynamicQuery , start , end ) ;
return dynamicQuery ( dynamicQuery , start , end ) ;
}
}
public int countValidTmpByIntPratica_Tipologie ( long intPraticaId , String [ ] tipologie ) throws SystemException {
public int countValidTmpByIntPratica_Tipologie ( long intPraticaId , String [ ] tipologie )
throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica ( intPraticaId ) ;
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica ( intPraticaId ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . in ( "tipologia" , tipologie ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . in ( "tipologia" , tipologie ) ) ;
@ -626,14 +639,15 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery ( dynamicQuery ) ;
return dynamicQuery ( dynamicQuery ) ;
}
}
public List < DocPratica > getValidUntilClassPkByIntPratica ( long intPraticaId , long classPk , String tipologia ,
public List < DocPratica > getValidUntilClassPkByIntPratica ( long intPraticaId , long classPk ,
int start , int end ) throws SystemException {
String tipologia , int start , int end ) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery ( ) ;
DynamicQuery dynamicQuery = dynamicQuery ( ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "intPraticaId" , intPraticaId ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "intPraticaId" , intPraticaId ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . le ( "classPk" , classPk ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . le ( "classPk" , classPk ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "tipologia" , tipologia ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "tipologia" , tipologia ) ) ;
// dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", null));
// dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione",
// null));
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "rimosso" , false ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "rimosso" , false ) ) ;
dynamicQuery . addOrder ( OrderFactoryUtil . desc ( "classPk" ) ) ;
dynamicQuery . addOrder ( OrderFactoryUtil . desc ( "classPk" ) ) ;
return dynamicQuery ( dynamicQuery , start , end ) ;
return dynamicQuery ( dynamicQuery , start , end ) ;
@ -660,16 +674,17 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return docPraticaLocalService . dynamicQuery ( dynamicQuery , start , end ) ;
return docPraticaLocalService . dynamicQuery ( dynamicQuery , start , end ) ;
}
}
//ADT BUG FE ID = 9
// ADT BUG FE ID = 9
public DocPratica addDocPraticaAnnullamento ( long userId , String className , long classPk , long intPraticaId , long fileEntryId ,
public DocPratica addDocPraticaAnnullamento ( long userId , String className , long classPk ,
String fileName , String tipologia , String sha256 , String jsonFirmatari , ServiceContext serviceContext ) throws PortalException ,
long intPraticaId , long fileEntryId , String fileName , String tipologia , String sha256 ,
SystemException {
String jsonFirmatari , ServiceContext serviceContext ) throws PortalException , SystemException {
User user = userPersistence . findByPrimaryKey ( userId ) ;
User user = userPersistence . findByPrimaryKey ( userId ) ;
Date now = new Date ( ) ;
Date now = new Date ( ) ;
DocPratica docPratica = docPraticaPersistence . create ( counterLocalService . increment ( DocPratica . class . getName ( ) ) ) ;
DocPratica docPratica = docPraticaPersistence . create ( counterLocalService . increment ( DocPratica . class
. getName ( ) ) ) ;
docPratica . setCompanyId ( serviceContext . getCompanyId ( ) ) ;
docPratica . setCompanyId ( serviceContext . getCompanyId ( ) ) ;
docPratica . setUserId ( user . getUserId ( ) ) ;
docPratica . setUserId ( user . getUserId ( ) ) ;
@ -699,9 +714,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return docPratica ;
return docPratica ;
}
}
/ * *
/ * *
* Metodo nuovo ADT
* Metodo nuovo ADT
*
*
* @param intPraticaId
* @param intPraticaId
* @param classPk
* @param classPk
@ -711,8 +725,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
* @return
* @return
* @throws SystemException
* @throws SystemException
* /
* /
public List < DocPratica > findByIntPratica_ClassPk_TipologiaNew ( long intPraticaId , long classPk , String tipologia ,
public List < DocPratica > findByIntPratica_ClassPk_TipologiaNew ( long intPraticaId , long classPk ,
int start , int end ) throws SystemException {
String tipologia , int start , int end ) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery ( ) ;
DynamicQuery dynamicQuery = dynamicQuery ( ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "intPraticaId" , intPraticaId ) ) ;
dynamicQuery . add ( RestrictionsFactoryUtil . eq ( "intPraticaId" , intPraticaId ) ) ;