diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/axis.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/axis.jar new file mode 100644 index 00000000..a4ad0aa8 Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/axis.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/commons-discovery.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/commons-discovery.jar new file mode 100644 index 00000000..8355f0be Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/commons-discovery.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/commons-logging.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/commons-logging.jar new file mode 100644 index 00000000..8758a96b Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/commons-logging.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/httpclient.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/httpclient.jar index 9e0df509..970c9891 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/httpclient.jar and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/httpclient.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/jaxrpc.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/jaxrpc.jar new file mode 100644 index 00000000..a2c13d9a Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/jaxrpc.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/jstl-api.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/jstl-api.jar new file mode 100644 index 00000000..80a5737f Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/jstl-api.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/jstl-impl.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/jstl-impl.jar new file mode 100644 index 00000000..e5a9342f Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/jstl-impl.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/log4j.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/log4j.jar new file mode 100644 index 00000000..068867eb Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/log4j.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-bridges.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-bridges.jar new file mode 100644 index 00000000..7d7435fe Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-bridges.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-taglib.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-taglib.jar new file mode 100644 index 00000000..fbba5f0a Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-taglib.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/wsdl4j.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/wsdl4j.jar new file mode 100644 index 00000000..67a35fcb Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/wsdl4j.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/xml-apis.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/xml-apis.jar new file mode 100644 index 00000000..46733464 Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/xml-apis.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalService.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalService.java index 69d3ec87..5302c432 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalService.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalService.java @@ -849,10 +849,7 @@ public interface DettPraticaLocalService extends BaseLocalService, com.liferay.portal.kernel.exception.SystemException; public void sendToVersioning(long dettPraticaId, java.lang.String url) - throws com.liferay.portal.kernel.exception.PortalException, - com.liferay.portal.kernel.exception.SystemException, - java.io.IOException, java.lang.NoSuchFieldException, - java.lang.SecurityException; + throws java.lang.Exception; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public int getNumeroDiVersioni(java.lang.String url) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceClp.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceClp.java index e4cfe8da..69038789 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceClp.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceClp.java @@ -4200,10 +4200,7 @@ public class DettPraticaLocalServiceClp implements DettPraticaLocalService { @Override public void sendToVersioning(long dettPraticaId, java.lang.String url) - throws com.liferay.portal.kernel.exception.PortalException, - com.liferay.portal.kernel.exception.SystemException, - java.io.IOException, java.lang.NoSuchFieldException, - java.lang.SecurityException { + throws java.lang.Exception { try { _invokableLocalService.invokeMethod(_methodName77, _methodParameterTypes77, @@ -4212,24 +4209,8 @@ public class DettPraticaLocalServiceClp implements DettPraticaLocalService { catch (Throwable t) { t = ClpSerializer.translateThrowable(t); - if (t instanceof com.liferay.portal.kernel.exception.PortalException) { - throw (com.liferay.portal.kernel.exception.PortalException)t; - } - - if (t instanceof com.liferay.portal.kernel.exception.SystemException) { - throw (com.liferay.portal.kernel.exception.SystemException)t; - } - - if (t instanceof java.io.IOException) { - throw (java.io.IOException)t; - } - - if (t instanceof java.lang.NoSuchFieldException) { - throw (java.lang.NoSuchFieldException)t; - } - - if (t instanceof java.lang.SecurityException) { - throw (java.lang.SecurityException)t; + if (t instanceof java.lang.Exception) { + throw (java.lang.Exception)t; } if (t instanceof RuntimeException) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceUtil.java index 01baa26e..c2395e70 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceUtil.java @@ -1149,10 +1149,7 @@ public class DettPraticaLocalServiceUtil { } public static void sendToVersioning(long dettPraticaId, java.lang.String url) - throws com.liferay.portal.kernel.exception.PortalException, - com.liferay.portal.kernel.exception.SystemException, - java.io.IOException, java.lang.NoSuchFieldException, - java.lang.SecurityException { + throws java.lang.Exception { getService().sendToVersioning(dettPraticaId, url); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceWrapper.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceWrapper.java index f59acb29..202c0940 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceWrapper.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DettPraticaLocalServiceWrapper.java @@ -1218,10 +1218,7 @@ public class DettPraticaLocalServiceWrapper implements DettPraticaLocalService, @Override public void sendToVersioning(long dettPraticaId, java.lang.String url) - throws com.liferay.portal.kernel.exception.PortalException, - com.liferay.portal.kernel.exception.SystemException, - java.io.IOException, java.lang.NoSuchFieldException, - java.lang.SecurityException { + throws java.lang.Exception { _dettPraticaLocalService.sendToVersioning(dettPraticaId, url); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerEstrazioneFirme.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerEstrazioneFirme.java index ff287dee..089d2304 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerEstrazioneFirme.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerEstrazioneFirme.java @@ -4,13 +4,8 @@ import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil; import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; -import it.tref.liferay.portos.bo.util.ContentType; - -import java.io.BufferedWriter; import java.io.File; -import java.io.FileWriter; import java.io.IOException; -import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; @@ -18,6 +13,14 @@ import java.util.concurrent.locks.ReentrantLock; import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.FileUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.entity.mime.content.ByteArrayBody; +import org.apache.http.entity.mime.content.ContentBody; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.json.JSONArray; @@ -28,10 +31,8 @@ import com.liferay.portal.kernel.messaging.Message; import com.liferay.portal.kernel.messaging.MessageListener; import com.liferay.portal.kernel.messaging.MessageListenerException; import com.liferay.portal.kernel.util.FileUtil; -import com.liferay.portal.kernel.util.Http.FilePart; -import com.liferay.portal.kernel.util.Http.Options; -import com.liferay.portal.kernel.util.HttpUtil; import com.liferay.portal.kernel.util.PropsUtil; +import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.UniqueList; import com.liferay.portal.kernel.workflow.WorkflowConstants; import com.liferay.portal.model.Company; @@ -68,9 +69,10 @@ public class SchedulerEstrazioneFirme implements MessageListener { List docPratiche = DocPraticaLocalServiceUtil.findByStaus( WorkflowConstants.STATUS_PENDING, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); + String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute( + "url_pdf_extractor", false); + for (DocPratica docPratica : docPratiche) { - String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute( - "url_pdf_extractor", false); DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.getFileEntry(docPratica .getDlFileEntryId()); User user = UserLocalServiceUtil.getRoleUsers( @@ -80,23 +82,18 @@ public class SchedulerEstrazioneFirme implements MessageListener { .create(user)); byte[] fileBytes = FileUtil.getBytes(fileEntry.getContentStream()); - Options options = new Options(); - options.setLocation(urlPdfExtractor); - options.setPost(true); - List fileParts = new ArrayList<>(); - fileParts.add(new FilePart("file", fileEntry.getTitle(), fileBytes, - ContentType.P7M.getContentType(), "UTF-8")); - options.setFileParts(fileParts); - - String responseBody; - try { - responseBody = HttpUtil.URLtoString(options); - } catch (Exception e) { - responseBody = ""; - } - - if (options.getResponse().getResponseCode() == HttpServletResponse.SC_OK - || options.getResponse().getResponseCode() == HttpServletResponse.SC_CREATED) { + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + ContentBody body = new ByteArrayBody(fileBytes, fileEntry.getTitle()); + builder.addPart("file", body); + HttpPost request = new HttpPost(urlPdfExtractor); + request.setEntity(builder.build()); + CloseableHttpClient client = HttpClientBuilder.create().build(); + HttpResponse response = client.execute(request); + + int statusCode = response.getStatusLine().getStatusCode(); + String responseBody = EntityUtils.toString(response.getEntity(), StringPool.UTF8); + if (statusCode == HttpServletResponse.SC_OK + || statusCode == HttpServletResponse.SC_CREATED) { JSONArray arrayFirme = JSONFactoryUtil.createJSONObject(responseBody) .getJSONArray("cf"); List cf = new UniqueList(); @@ -116,14 +113,16 @@ public class SchedulerEstrazioneFirme implements MessageListener { errorCode); _log.warn("P7M REST extractor error. Response: " + new String(responseBody) + " id=" + fileEntry.getFileEntryId()); - // salvaCampione(fileEntry, fileBytes, - // "0-firme"); + salvaCampione(fileEntry, fileBytes, "0-firme"); } } } } } catch (Exception e) { - _log.info("Errore", e); + if (_log.isDebugEnabled()) + _log.debug("Errore", e); + else + _log.error("Errore " + e.getMessage()); } finally { lock.unlock(); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java index 692beeca..23b33a06 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java @@ -12,6 +12,7 @@ package it.tref.liferay.portos.bo.service.impl; +import it.mwg.sismica.bo.util.HttpServiceUtil; import it.tref.liferay.portos.bo.NoSuchDettPraticaException; import it.tref.liferay.portos.bo.model.Asseverazione; import it.tref.liferay.portos.bo.model.ControlloPratica; @@ -1815,8 +1816,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl private void updateAsset(DettPratica dettPratica, ServiceContext serviceContext) throws PortalException, SystemException { - Locale locale = serviceContext.getLocale(); - AssetEntry assetEntry = assetEntryLocalService.updateEntry(dettPratica.getUserId(), dettPratica.getGroupId(), dettPratica.getCreateDate(), dettPratica.getModifiedDate(), DettPratica.class.getName(), dettPratica.getPrimaryKey(), dettPratica.getUuid(), 0L, @@ -2179,32 +2178,16 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl return dettPratica; } - public void sendToVersioning(long dettPraticaId, String url) throws PortalException, SystemException, - NoSuchFieldException, SecurityException, IOException { + public void sendToVersioning(long dettPraticaId, String url) throws Exception { DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId); String jsonToVersioning = dettPratica.serializeToVersioning(); - - Options options = new Options(); - options.setLocation(url); - options.setPost(true); - Body body = new Body(jsonToVersioning, ContentTypes.APPLICATION_JSON, "UTF-8"); - options.setBody(body); - - String responseBody = HttpUtil.URLtoString(options); - if (options.getResponse().getResponseCode() == HttpServletResponse.SC_OK - || options.getResponse().getResponseCode() == HttpServletResponse.SC_CREATED) { - JSONObject response = JSONFactoryUtil.createJSONObject(responseBody); - int version = response.getInt("version"); - dettPratica.setVersion(version); - dettPratica.setVersionata(true); - dettPraticaLocalService.updateDettPratica(dettPratica); - - } else { - throw new PortalException(options.getResponse().getResponseCode() + StringPool.SPACE - + responseBody); - } - + + JSONObject response = HttpServiceUtil.postJson(url, jsonToVersioning); + int version = response.getInt("version"); + dettPratica.setVersion(version); + dettPratica.setVersionata(true); + dettPraticaLocalService.updateDettPratica(dettPratica); } public int getNumeroDiVersioni(String url) throws IOException, PortalException, SystemException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/ProtocollazioneUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/ProtocollazioneUtil.java index 2cb6ddd1..3575acd6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/ProtocollazioneUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/ProtocollazioneUtil.java @@ -1,5 +1,6 @@ package it.tref.liferay.portos.bo.util; +import it.mwg.sismica.bo.util.HttpServiceUtil; import it.tref.liferay.portos.bo.model.Avviso; import it.tref.liferay.portos.bo.model.Collaudo; import it.tref.liferay.portos.bo.model.DettPratica; @@ -28,8 +29,6 @@ import java.util.Collections; import java.util.List; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVRecord; @@ -37,16 +36,11 @@ import org.apache.commons.io.IOUtils; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; -import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONObject; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.repository.model.FileEntry; -import com.liferay.portal.kernel.util.ContentTypes; import com.liferay.portal.kernel.util.GetterUtil; -import com.liferay.portal.kernel.util.Http.Body; -import com.liferay.portal.kernel.util.Http.Options; -import com.liferay.portal.kernel.util.HttpUtil; import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.StreamUtil; import com.liferay.portal.kernel.util.StringPool; @@ -61,13 +55,6 @@ public class ProtocollazioneUtil { private static final Log _log = LogFactoryUtil.getLog(ProtocollazioneUtil.class); - // public static String protocollaPartenza(DettPratica dettPratica, Avviso - // avviso) throws - // Exception { - // - // return protocollaPartenza(dettPratica, avviso, null); - // } - public static String protocollaPartenza(Avviso avviso, Long fileEntryId) throws Exception { String protocollo = null; @@ -100,11 +87,10 @@ public class ProtocollazioneUtil { allegato.setFileSha256(sha256); } - // utilizzato anche come discriminate tra la 1a e la 2a chiamata - // 1a recupero numero protocollo -> 1 allegato finto - // 2a aggiorno dati del documento prodotto -> 2 allegati, il 1o - // giusto e il 2o per recupero - // num protocollo + // utilizzato anche come discriminate tra la 1a e la 2a chiamata 1a + // recupero numero protocollo -> 1 allegato finto 2a aggiorno dati + // del documento prodotto -> 2 allegati, il 1o giusto e il 2o per + // recupero num protocollo Protocollo protocolloBean = new Protocollo(); protocolloBean.setOggetto(generaOggettoProtocollo(avviso.getClassName(), avviso.getAvvisoId())); @@ -114,17 +100,8 @@ public class ProtocollazioneUtil { protocolloBean.setUfficioId(String.valueOf(groupId)); protocolloBean.setPraticaId(String.valueOf(avviso.getClassPk())); protocolloBean.setFiles(Collections.singletonList(allegato)); - Options options = createCall(avviso.getCompanyId(), protocolloBean, true); - - String responseBody = HttpUtil.URLtoString(options); - if (options.getResponse().getResponseCode() == HttpServletResponse.SC_OK - || options.getResponse().getResponseCode() == HttpServletResponse.SC_CREATED) { - JSONObject risposta = JSONFactoryUtil.createJSONObject(responseBody); - protocollo = risposta.getString("anno") + String.format("%07d", risposta.getInt("numero")); - } else { - throw new Exception(options.getResponse().getResponseCode() + StringPool.SPACE + responseBody); - } - + JSONObject risposta = HttpServiceUtil.postProtocolloBean(avviso.getCompanyId(), protocolloBean); + protocollo = risposta.getString("anno") + String.format("%07d", risposta.getInt("numero")); } finally { StreamUtil.cleanUp(inputStream); } @@ -134,8 +111,6 @@ public class ProtocollazioneUtil { public static String protocollaArrivo(Object praticaInstance, String title) throws Exception { - String protocollo = null; - long groupId = 0l; long praticaId = 0l; long companyId = 0l; @@ -202,25 +177,13 @@ public class ProtocollazioneUtil { protocolloBean.setPraticaId(String.valueOf(praticaId)); protocolloBean.setFiles(allegati); - Options options = createCall(companyId, protocolloBean, true); - - String responseBody = HttpUtil.URLtoString(options); - if (options.getResponse().getResponseCode() == HttpServletResponse.SC_OK - || options.getResponse().getResponseCode() == HttpServletResponse.SC_CREATED) { - JSONObject risposta = JSONFactoryUtil.createJSONObject(responseBody); - protocollo = risposta.getString("anno") + String.format("%07d", risposta.getInt("numero")); - } else { - throw new Exception(options.getResponse().getResponseCode() + StringPool.SPACE + responseBody); - } - - return protocollo; + JSONObject risposta = HttpServiceUtil.postProtocolloBean(companyId, protocolloBean); + return risposta.getString("anno") + String.format("%07d", risposta.getInt("numero")); } public static String protocollaArrivoAccessoAtti(long groupId, long companyId, String userName, long accessoAttiId, String className) throws Exception { - String protocollo = null; - List allegati = new ArrayList(); File allegato = new File(); String doc = String.valueOf(accessoAttiId); @@ -238,18 +201,8 @@ public class ProtocollazioneUtil { protocolloBean.setPraticaId(String.valueOf(accessoAttiId)); protocolloBean.setFiles(allegati); - Options options = createCall(companyId, protocolloBean, true); - - String responseBody = HttpUtil.URLtoString(options); - if (options.getResponse().getResponseCode() == HttpServletResponse.SC_OK - || options.getResponse().getResponseCode() == HttpServletResponse.SC_CREATED) { - JSONObject risposta = JSONFactoryUtil.createJSONObject(responseBody); - protocollo = risposta.getString("anno") + String.format("%07d", risposta.getInt("numero")); - } else { - throw new Exception(options.getResponse().getResponseCode() + StringPool.SPACE + responseBody); - } - - return protocollo; + JSONObject risposta = HttpServiceUtil.postProtocolloBean(companyId, protocolloBean); + return risposta.getString("anno") + String.format("%07d", risposta.getInt("numero")); } public static String generaOggettoProtocollo(String className, long classPk) { @@ -266,69 +219,6 @@ public class ProtocollazioneUtil { return "Oggetto: " + className + " " + classPk; } - public static void test() { - - String url = "http://172.16.20.148:8080/portos-protocollazione-service/v1/api-rest/genera-protocollo"; - // String url = - // "http://10.159.51.84:8080/portos-protocollazione-service/v1/api-rest/genera-protocollo"; - Options options = new Options(); - options.setLocation(url); - options.setPost(true); - flexjson.JSONSerializer serialize = new flexjson.JSONSerializer(); - // JSONSerializer jsonSerializer = - // JSONFactoryUtil.createJSONSerializer(); - - serialize.exclude("*.class"); - - Protocollo protocolloBean = new Protocollo(); - protocolloBean.setOggetto("oggetto"); - protocolloBean.setChiuso(false); - protocolloBean.setTipo(TipoProtocollo.INGRESSO); - protocolloBean.setUtenteId("SSSS"); - protocolloBean.setUfficioId("genio"); - String protocollo = serialize.serialize(protocolloBean); - - Body body = new Body(protocollo, ContentTypes.APPLICATION_JSON, "UTF-8"); - options.setBody(body); - - try { - String responseBody = HttpUtil.URLtoString(options); - - if (options.getResponse().getResponseCode() == HttpServletResponse.SC_OK - || options.getResponse().getResponseCode() == HttpServletResponse.SC_CREATED) { - System.out.println("ok " + responseBody); - } else { - System.out.println("error " + responseBody); - } - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - private static Options createCall(long companyId, Protocollo protocolloBean, boolean post) throws SystemException { - - String url = - ConfigurazioneLocalServiceUtil.findByC_ChiaveString(companyId, - ConfigurazioneConstants.PROTOCOLLAZIONE_SERVICE_URL); - - Options options = new Options(); - options.setLocation(url); - options.setPost(post); - - flexjson.JSONSerializer serialize = new flexjson.JSONSerializer(); - serialize.exclude("*.class"); - String protocollo = serialize.serialize(protocolloBean); - Body body = new Body(protocollo, ContentTypes.APPLICATION_JSON, "UTF-8"); - - options.setBody(body); - - - return options; - - } - public static List csvToOggettoProtocollo(java.io.File file) throws FileNotFoundException, IOException, ParseException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties index c911bcbf..e65e63dc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_bo - build.number=2406 - build.date=1600353835805 + build.number=2409 + build.date=1600356327380 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/tld/c.tld b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/tld/c.tld new file mode 100644 index 00000000..98efa6a6 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/tld/c.tld @@ -0,0 +1,572 @@ + + + + + JSTL 1.2 core library + JSTL core + 1.2 + c + http://java.sun.com/jsp/jstl/core + + + + Provides core validation features for JSTL tags. + + + org.apache.taglibs.standard.tlv.JstlCoreTLV + + + + + + Catches any Throwable that occurs in its body and optionally + exposes it. + + catch + org.apache.taglibs.standard.tag.common.core.CatchTag + JSP + + +Name of the exported scoped variable for the +exception thrown from a nested action. The type of the +scoped variable is the type of the exception thrown. + + var + false + false + + + + + + Simple conditional tag that establishes a context for + mutually exclusive conditional operations, marked by + <when> and <otherwise> + + choose + com.liferay.taglib.core.ChooseTag + JSP + + + + + Simple conditional tag, which evalutes its body if the + supplied condition is true and optionally exposes a Boolean + scripting variable representing the evaluation of this condition + + if + com.liferay.taglib.core.IfTag + JSP + + +The test condition that determines whether or +not the body content should be processed. + + test + true + true + boolean + + + +Name of the exported scoped variable for the +resulting value of the test condition. The type +of the scoped variable is Boolean. + + var + false + false + + + +Scope for var. + + scope + false + false + + + + + + Retrieves an absolute or relative URL and exposes its contents + to either the page, a String in 'var', or a Reader in 'varReader'. + + import + org.apache.taglibs.standard.tag.rt.core.ImportTag + org.apache.taglibs.standard.tei.ImportTEI + JSP + + +The URL of the resource to import. + + url + true + true + + + +Name of the exported scoped variable for the +resource's content. The type of the scoped +variable is String. + + var + false + false + + + +Scope for var. + + scope + false + false + + + +Name of the exported scoped variable for the +resource's content. The type of the scoped +variable is Reader. + + varReader + false + false + + + +Name of the context when accessing a relative +URL resource that belongs to a foreign +context. + + context + false + true + + + +Character encoding of the content at the input +resource. + + charEncoding + false + true + + + + + + The basic iteration tag, accepting many different + collection types and supporting subsetting and other + functionality + + forEach + org.apache.taglibs.standard.tag.rt.core.ForEachTag + org.apache.taglibs.standard.tei.ForEachTEI + JSP + + +Collection of items to iterate over. + + items + false + true + java.lang.Object + + java.lang.Object + + + + +If items specified: +Iteration begins at the item located at the +specified index. First item of the collection has +index 0. +If items not specified: +Iteration begins with index set at the value +specified. + + begin + false + true + int + + + +If items specified: +Iteration ends at the item located at the +specified index (inclusive). +If items not specified: +Iteration ends when index reaches the value +specified. + + end + false + true + int + + + +Iteration will only process every step items of +the collection, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. Its type depends +on the object of the underlying collection. + + var + false + false + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of type +javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested +visibility. + + varStatus + false + false + + + + + + Iterates over tokens, separated by the supplied delimeters + + forTokens + org.apache.taglibs.standard.tag.rt.core.ForTokensTag + JSP + + +String of tokens to iterate over. + + items + true + true + java.lang.String + + java.lang.String + + + + +The set of delimiters (the characters that +separate the tokens in the string). + + delims + true + true + java.lang.String + + + +Iteration begins at the token located at the +specified index. First token has index 0. + + begin + false + true + int + + + +Iteration ends at the token located at the +specified index (inclusive). + + end + false + true + int + + + +Iteration will only process every step tokens +of the string, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. + + var + false + false + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of +type +javax.servlet.jsp.jstl.core.LoopTag +Status. This scoped variable has nested +visibility. + + varStatus + false + false + + + + + + Like <%= ... >, but for expressions. + + out + org.apache.taglibs.standard.tag.rt.core.OutTag + JSP + + +Expression to be evaluated. + + value + true + true + + + +Default value if the resulting value is null. + + default + false + true + + + +Determines whether characters <,>,&,'," in the +resulting string should be converted to their +corresponding character entity codes. Default value is +true. + + escapeXml + false + true + + + + + + + Subtag of <choose> that follows <when> tags + and runs only if all of the prior conditions evaluated to + 'false' + + otherwise + com.liferay.taglib.core.OtherwiseTag + JSP + + + + + Adds a parameter to a containing 'import' tag's URL. + + param + org.apache.taglibs.standard.tag.rt.core.ParamTag + JSP + + +Name of the query string parameter. + + name + true + true + + + +Value of the parameter. + + value + false + true + + + + + + Redirects to a new URL. + + redirect + org.apache.taglibs.standard.tag.rt.core.RedirectTag + JSP + + +The URL of the resource to redirect to. + + url + false + true + + + +Name of the context when redirecting to a relative URL +resource that belongs to a foreign context. + + context + false + true + + + + + + Removes a scoped variable (from a particular scope, if specified). + + remove + org.apache.taglibs.standard.tag.common.core.RemoveTag + empty + + +Name of the scoped variable to be removed. + + var + true + false + + + +Scope for var. + + scope + false + false + + + + + + Sets the result of an expression evaluation in a 'scope' + + set + org.apache.taglibs.standard.tag.rt.core.SetTag + JSP + + +Name of the exported scoped variable to hold the value +specified in the action. The type of the scoped variable is +whatever type the value expression evaluates to. + + var + false + false + + + +Expression to be evaluated. + + value + false + true + + java.lang.Object + + + + +Target object whose property will be set. Must evaluate to +a JavaBeans object with setter property property, or to a +java.util.Map object. + + target + false + true + + + +Name of the property to be set in the target object. + + property + false + true + + + +Scope for var. + + scope + false + false + + + + + + Creates a URL with optional query parameters. + + url + org.apache.taglibs.standard.tag.rt.core.UrlTag + JSP + + +Name of the exported scoped variable for the +processed url. The type of the scoped variable is +String. + + var + false + false + + + +Scope for var. + + scope + false + false + + + +URL to be processed. + + value + false + true + + + +Name of the context when specifying a relative URL +resource that belongs to a foreign context. + + context + false + true + + + + + + Subtag of <choose> that includes its body if its + condition evalutes to 'true' + + when + com.liferay.taglib.core.WhenTag + JSP + + +The test condition that determines whether or not the +body content should be processed. + + test + true + true + boolean + + + + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/httpclient.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/httpclient.jar index 9e0df509..970c9891 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/httpclient.jar and b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/httpclient.jar differ