- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.ComuneLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.ComuneLocalService} interface. * *
- * This is a local service. Methods of this service will not have security checks based on the - * propagated JAAS credentials because this service can only be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *
* * @author Davide Barbagallo, 3F Consulting @@ -63,8 +61,8 @@ import com.liferay.portal.service.ServiceContext; public class ComuneLocalServiceImpl extends ComuneLocalServiceBaseImpl { @Override public Comune addComune(long userId, String codiceProvincia, String codiceComune, String codiceIstat, - String codiceBelfiore, String denominazione, boolean provincia, boolean stato, String mailSuap, String mailSue, - ServiceContext serviceContext) throws PortalException, SystemException { + String codiceBelfiore, String denominazione, boolean provincia, boolean stato, String mailSuap, + String mailSue, ServiceContext serviceContext) throws PortalException, SystemException { User user = userPersistence.findByPrimaryKey(userId); @@ -216,6 +214,7 @@ public class ComuneLocalServiceImpl extends ComuneLocalServiceBaseImpl { return comunePersistence.findByC_CP(companyId, codiceProvincia); } + @Override public List- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.ComuneService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.ComuneService} interface. * *
- * This is a remote service. Methods of this service are expected to have security checks based on - * the propagated JAAS credentials because this service can be accessed remotely. + * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS + * credentials because this service can be accessed remotely. *
* * @author Davide Barbagallo, 3F Consulting @@ -39,19 +37,18 @@ import com.liferay.portal.kernel.exception.SystemException; * @see it.tref.liferay.portos.bo.service.ComuneServiceUtil */ public class ComuneServiceImpl extends ComuneServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.bo.service.ComuneServiceUtil} to access the comune remote service. - */ - - public Comune getComune(long comuneId) throws PortalException, SystemException { - return ComuneLocalServiceUtil.getComune(comuneId); - } - - public List- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.ComunicazioneService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.ComunicazioneService} interface. * *
- * This is a remote service. Methods of this service are expected to have security checks based on - * the propagated JAAS credentials because this service can be accessed remotely. + * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS + * credentials because this service can be accessed remotely. *
* * @author Davide Barbagallo, 3F Consulting @@ -37,21 +36,22 @@ import com.liferay.portal.service.ServiceContext; * @see it.tref.liferay.portos.bo.service.ComunicazioneServiceUtil */ public class ComunicazioneServiceImpl extends ComunicazioneServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.bo.service.ComunicazioneServiceUtil} to access the comunicazione remote - * service. - */ - - public Comunicazione addComunicazione(long userId, long intPraticaId, String domanda, ServiceContext serviceContext) - throws SystemException, PortalException { - return comunicazioneLocalService.addComunicazione(userId, intPraticaId, domanda, serviceContext); - } - - public Comunicazione updateComunicazione(long comunicazioneId, String risposta) throws SystemException, - PortalException { - return comunicazioneLocalService.updateComunicazione(comunicazioneId, risposta); - } + /* + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.ComunicazioneServiceUtil} to access the comunicazione remote service. + */ + + @Override + public Comunicazione addComunicazione(long userId, long intPraticaId, String domanda, ServiceContext serviceContext) + throws SystemException, PortalException { + + return comunicazioneLocalService.addComunicazione(userId, intPraticaId, domanda, serviceContext); + } + + @Override + public Comunicazione updateComunicazione(long comunicazioneId, String risposta) throws SystemException, + PortalException { + + return comunicazioneLocalService.updateComunicazione(comunicazioneId, risposta); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ConfigurazioneServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ConfigurazioneServiceImpl.java index 6621089e..ca2531dd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ConfigurazioneServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ConfigurazioneServiceImpl.java @@ -14,7 +14,6 @@ package it.tref.liferay.portos.bo.service.impl; -import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil; import it.tref.liferay.portos.bo.service.base.ConfigurazioneServiceBaseImpl; import com.liferay.portal.kernel.exception.PortalException; @@ -25,13 +24,12 @@ import com.liferay.portal.service.ServiceContext; * The implementation of the configurazione remote service. * *- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.ConfigurazioneService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.ConfigurazioneService} interface. * *
- * This is a remote service. Methods of this service are expected to have security checks based on - * the propagated JAAS credentials because this service can be accessed remotely. + * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS + * credentials because this service can be accessed remotely. *
* * @author Davide Barbagallo, 3F Consulting @@ -39,22 +37,27 @@ import com.liferay.portal.service.ServiceContext; * @see it.tref.liferay.portos.bo.service.ConfigurazioneServiceUtil */ public class ConfigurazioneServiceImpl extends ConfigurazioneServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.bo.service.ConfigurazioneServiceUtil} to access the configurazione - * remote service. - */ - - public long findByC_ChiaveLong(long companyId, String chiave) throws SystemException { - return ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, chiave); - } - - public String findByC_ChiaveString(long companyId, String chiave) throws SystemException { - return ConfigurazioneLocalServiceUtil.findByC_ChiaveString(companyId, chiave); - } - - public void storeConfig(String chiave, String valore, ServiceContext serviceContext) throws PortalException, - SystemException { - ConfigurazioneLocalServiceUtil.storeConfig(chiave, valore, serviceContext); - } + /* + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.ConfigurazioneServiceUtil} to access the configurazione remote service. + */ + + @Override + public long findByC_ChiaveLong(long companyId, String chiave) throws SystemException { + + return configurazioneLocalService.findByC_ChiaveLong(companyId, chiave); + } + + @Override + public String findByC_ChiaveString(long companyId, String chiave) throws SystemException { + + return configurazioneLocalService.findByC_ChiaveString(companyId, chiave); + } + + @Override + public void storeConfig(String chiave, String valore, ServiceContext serviceContext) throws PortalException, + SystemException { + + configurazioneLocalService.storeConfig(chiave, valore, serviceContext); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java index 412214dc..7c7b95d0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java @@ -17,11 +17,6 @@ import it.tref.liferay.portos.bo.model.Avviso; import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.IntPratica; -import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil; -import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.TempisticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.base.ControlloPraticaLocalServiceBaseImpl; import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; import it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil; @@ -74,7 +69,6 @@ import com.liferay.portal.model.UserGroupRole; import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; -import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.workflow.kaleo.model.KaleoInstance; import com.liferay.portal.workflow.kaleo.service.KaleoInstanceLocalServiceUtil; import com.liferay.portlet.asset.NoSuchEntryException; @@ -144,7 +138,7 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi serviceContext.getAssetLinkEntryIds(), now); // ADT: BUG BO GESTIONE WORKFLOW Map- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.PagamentoService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.PagamentoService} interface. * *
- * This is a remote service. Methods of this service are expected to have - * security checks based on the propagated JAAS credentials because this service - * can be accessed remotely. + * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS + * credentials because this service can be accessed remotely. *
* * @author Davide Barbagallo, 3F Consulting @@ -48,17 +45,16 @@ import com.liferay.portal.service.ServiceContext; */ public class PagamentoServiceImpl extends PagamentoServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use - * {@link it.tref.liferay.portos.bo.service.PagamentoServiceUtil} to access - * the pagamento remote service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.PagamentoServiceUtil} to access the pagamento remote service. */ - public void sostituisciPagamento(long pagamentoId, String codiceFiscaleCommittente, String mezzo, - String url, ServiceContext serviceContext) throws PortalException, SystemException { + @Override + public void sostituisciPagamento(long pagamentoId, String codiceFiscaleCommittente, String mezzo, String url, + ServiceContext serviceContext) throws PortalException, SystemException { - Pagamento pagamento = PagamentoLocalServiceUtil.getPagamento(pagamentoId); + Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); long userId = findTitolare(pagamentoId); - if (getUserId() == userId || DelegheUtil.hasDelegaPagamento(userId, pagamento.getClassPk())) { pagamentoLocalService.sostituisciPagamento(pagamentoId, codiceFiscaleCommittente, mezzo, url, serviceContext); @@ -68,20 +64,12 @@ public class PagamentoServiceImpl extends PagamentoServiceBaseImpl { } } - public void rigeneraPagamento(long pagamentoId, String codiceFiscaleCommittente, String mezzo, - String url, ServiceContext serviceContext) throws PortalException, SystemException { + @Override + public void rigeneraPagamento(long pagamentoId, String codiceFiscaleCommittente, String mezzo, String url, + ServiceContext serviceContext) throws PortalException, SystemException { if (PendingPagamentiPermission.contains(getPermissionChecker(), serviceContext.getScopeGroupId(), ActionKeys.PAGAMENTI_PENDING)) { - // long userId = serviceContext.getUserId(); - // List- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.ParereGeologoLocalService} - * interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.ParereGeologoLocalService} interface. * *
- * This is a local service. Methods of this service will not have security - * checks based on the propagated JAAS credentials because this service can only - * be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *
* * @author Davide Barbagallo, 3F Consulting @@ -58,104 +54,83 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; */ public class ParereGeologoLocalServiceImpl extends ParereGeologoLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use - * {@link it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil} - * to access the parere geologo local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil} to access the parere geologo local service. */ + @Override public ParereGeologo addParereGeologo(long geologoUserId, long intPraticaId, long dettPraticaId, ServiceContext serviceContext) throws SystemException, PortalException { validateParereGeologo(geologoUserId, intPraticaId, dettPraticaId); - long parereGeologoId = counterLocalService.increment(ParereGeologo.class.getName()); ParereGeologo parereGeologo = parereGeologoPersistence.create(parereGeologoId); - parereGeologo.setCompanyId(serviceContext.getCompanyId()); - - User user = UserLocalServiceUtil.getUser(serviceContext.getUserId()); + User user = userLocalService.getUser(serviceContext.getUserId()); parereGeologo.setUserId(user.getUserId()); parereGeologo.setUserName(user.getScreenName()); parereGeologo.setCreateDate(serviceContext.getCreateDate()); parereGeologo.setModifiedDate(serviceContext.getModifiedDate()); parereGeologo.setGroupId(serviceContext.getScopeGroupId()); - parereGeologo.setIntPraticaId(intPraticaId); parereGeologo.setDettPraticaId(dettPraticaId); parereGeologo.setGeologoUserId(geologoUserId); parereGeologo.setDtRichista(new Date()); - return parereGeologoPersistence.update(parereGeologo); } private void validateParereGeologo(long geologoUserId, long intPraticaId, long dettPraticaId) { - // TODO - } - public ParereGeologo updateParereGeologo(long parereGeologoId, String parere, byte[] content, - String fileName, ServiceContext serviceContext) throws PortalException, SystemException { + @Override + public ParereGeologo updateParereGeologo(long parereGeologoId, String parere, byte[] content, String fileName, + ServiceContext serviceContext) throws PortalException, SystemException { ParereGeologo parereGeologo = getParereGeologo(parereGeologoId); - User geologo = UserLocalServiceUtil.getUser(serviceContext.getUserId()); + User geologo = userLocalService.getUser(serviceContext.getUserId()); if (Validator.isNotNull(geologo) && serviceContext.getUserId() == geologo.getUserId()) { - Date now = new Date(); - parereGeologo.setModifiedDate(serviceContext.getModifiedDate()); parereGeologo.setDtCompilazione(now); parereGeologo.setParere(parere); - if (Validator.isNotNull(content) && Validator.isNotNull(fileName)) { - - long fileEntryId = 0l; - - long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong( - serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - + long fileEntryId = 0L; + long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), + ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); String folderName = PraticaUtil.getFolderName(parereGeologo.getDettPraticaId()); - serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); Folder folder = null; try { - folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), - defaultFolder.getFolderId(), folderName); + folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), + folderName); } catch (NoSuchFolderException e) { // cartella non presente -> creo cartella - folder = dlAppLocalService.addFolder(serviceContext.getUserId(), - defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), folderName, - StringPool.BLANK, serviceContext); + folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(), + defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext); } - String title = now.getTime() + StringPool.UNDERLINE + "parere_geologo" + StringPool.UNDERLINE + parereGeologoId + StringPool.UNDERLINE + fileName; String description = ""; String mimeType = MimeTypesUtil.getContentType(fileName); - String changeLog = StringPool.BLANK; FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), - folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + fileName, - mimeType, title, description, changeLog, content, serviceContext); + folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + fileName, mimeType, + title, description, changeLog, content, serviceContext); fileEntryId = fileEntry.getFileEntryId(); - parereGeologo.setFileEntryId(fileEntryId); } - return updateParereGeologo(parereGeologo); - } else { - // TODO error chi sta compilando non è il geologo designato o il - // geologo non esiste. + // TODO error chi sta compilando non è il geologo designato o il geologo non esiste. return parereGeologo; } - } @Override public ParereGeologo deleteParereGeologo(long parereGeologoId) throws PortalException, SystemException { - return deleteParereGeologo(parereGeologoLocalService.getParereGeologo(parereGeologoId)); + return deleteParereGeologo(getParereGeologo(parereGeologoId)); } @Override @@ -170,106 +145,103 @@ public class ParereGeologoLocalServiceImpl extends ParereGeologoLocalServiceBase } catch (PortalException e) { throw new SystemException(e); } - return super.deleteParereGeologo(parereGeologo); } + @Override public ParereGeologo updateParereGeologo(ParereGeologo parereGeologo) throws SystemException { - return parereGeologoPersistence.update(parereGeologo); } + @Override public ParereGeologo remove(ParereGeologo parereGeologoId) throws SystemException { - return parereGeologoPersistence.remove(parereGeologoId); } - public ListDelega incompletaRefresh
');" - + "body.ancestor('.modal-body').next('.modal-footer').remove();return;}" - + "}, complete: function(event){A.one('#" + renderResponse.getNamespace() - + "dgSaveAndCloseDiv_" + randomId + "').show();modal.show();}" + "}});"; + String function = "A.io.request('" + isCompletedDelegaGeologoURL + + "',{data: {" + + renderResponse.getNamespace() + + "classPk: " + + dettPraticaId + + "}," + + "dataType: 'json',on: {success: function(event, id, obj) {console.log(this.get('responseData'));var response = this.get('responseData');" + + "console.log(response.isCompleted);" + + "if(!response.isCompleted){var body = A.one('#" + + renderResponse.getNamespace() + + "dgSaveAndCloseDiv_" + + randomId + + "');" + + "body.html('Delega incompletaRefresh
');" + + "body.ancestor('.modal-body').next('.modal-footer').remove();return;}" + + "}, complete: function(event){A.one('#" + renderResponse.getNamespace() + + "dgSaveAndCloseDiv_" + randomId + "').show();modal.show();}" + "}});"; %> -