Versão para ajustar docx4J

parent 24327d7e
...@@ -14,6 +14,7 @@ Export-Package: mprj.doerj.caderno.constants ...@@ -14,6 +14,7 @@ Export-Package: mprj.doerj.caderno.constants
@commons-lang3-3.11.jar,\ @commons-lang3-3.11.jar,\
@json-20200518.jar,\ @json-20200518.jar,\
@docx4j-core-8.0.0.jar,\ @docx4j-core-8.0.0.jar,\
@docx4j-6.1.2.jar,\
@docx4j-ImportXHTML-8.0.0.jar,\ @docx4j-ImportXHTML-8.0.0.jar,\
@failureaccess-1.0.1.jar,\ @failureaccess-1.0.1.jar,\
@error_prone_annotations-2.4.0.jar,\ @error_prone_annotations-2.4.0.jar,\
...@@ -46,7 +47,18 @@ Export-Package: mprj.doerj.caderno.constants ...@@ -46,7 +47,18 @@ Export-Package: mprj.doerj.caderno.constants
@curator-framework-4.0.0.jar,\ @curator-framework-4.0.0.jar,\
@curator-client-4.0.0.jar,\ @curator-client-4.0.0.jar,\
@curator-x-discovery-4.0.0.jar,\ @curator-x-discovery-4.0.0.jar,\
@log4j-1.2.17.jar @log4j-1.2.17.jar,\
@spring-web-4.0.0.RELEASE.jar,\
@spring-core-4.0.0.RELEASE.jar,\
@commons-logging-1.2.jar,\
@com.springsource.javax.xml.stream-1.0.1.jar,\
@sax-2.0.1.jar,\
@dom-2.3.0-jaxb-1.0.6.jar,\
@slf4j-log4j12-1.7.25.jar,\
@slf4j-api-1.7.26.jar,\
@docx4j-MOXy-JAXBContext-6.0.0.jar
Import-Package: \ Import-Package: \
!com.google.*,\ !com.google.*,\
...@@ -55,7 +67,13 @@ com.liferay.portal.kernel.*,\ ...@@ -55,7 +67,13 @@ com.liferay.portal.kernel.*,\
com.liferay.portal.configuration.*,\ com.liferay.portal.configuration.*,\
javax.portlet.*,\ javax.portlet.*,\
javax.servlet.http.*,\ javax.servlet.http.*,\
!org.apache.* javax.servlet.*,\
javax.xml.*,\
!org.apache.curator.*,\
org.xml.sax.*,\
org.w3c.dom.*,\
org.slf4j.*
......
...@@ -31,7 +31,9 @@ dependencies { ...@@ -31,7 +31,9 @@ dependencies {
compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0" compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
compileOnly group: 'org.springframework', name: 'spring-web', version: '4.0.0.RELEASE' compileOnly group: 'org.springframework', name: 'spring-web', version: '4.0.0.RELEASE'
compileOnly group: 'org.springframework', name: 'spring-core', version: '4.0.0.RELEASE'
compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: '3.11' compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: '3.11'
compileOnly group: 'commons-logging', name: 'commons-logging', version: '1.2'
compileOnly group: 'log4j', name: 'log4j', version: '1.2.14' compileOnly group: 'log4j', name: 'log4j', version: '1.2.14'
compileOnly group: 'org.json', name: 'json', version: '20200518' compileOnly group: 'org.json', name: 'json', version: '20200518'
compileOnly group: 'biz.aQute.bnd', name: 'bndlib', version: '2.4.0' compileOnly group: 'biz.aQute.bnd', name: 'bndlib', version: '2.4.0'
...@@ -39,11 +41,15 @@ dependencies { ...@@ -39,11 +41,15 @@ dependencies {
compileOnly group: 'org.docx4j', name: 'docx4j-ImportXHTML', version: '8.0.0' compileOnly group: 'org.docx4j', name: 'docx4j-ImportXHTML', version: '8.0.0'
compileOnly group: 'org.docx4j', name: 'docx4j', version: '6.1.2' compileOnly group: 'org.docx4j', name: 'docx4j', version: '6.1.2'
compileOnly group: 'org.docx4j', name: 'docx4j-MOXy-JAXBContext', version: '6.0.0'
compileOnly group: 'com.google.guava', name: 'failureaccess', version: '1.0.1' compileOnly group: 'com.google.guava', name: 'failureaccess', version: '1.0.1'
compileOnly group: 'com.google.errorprone', name: 'error_prone_annotations', version: '2.4.0' compileOnly group: 'com.google.errorprone', name: 'error_prone_annotations', version: '2.4.0'
compileOnly group: 'com.google.guava', name: 'guava-concurrent', version: 'r03' compileOnly group: 'com.google.guava', name: 'guava-concurrent', version: 'r03'
compileOnly group: 'com.thedeanda', name: 'lorem', version: '2.1' compileOnly group: 'com.thedeanda', name: 'lorem', version: '2.1'
compileOnly group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2' compileOnly group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
compileOnly group: 'org.apache.servicemix.specs', name: 'org.apache.servicemix.specs.jaxp-api-1.4', version: '1.4_1'
compileOnly group: 'de.julielab', name: 'xercesImpl', version: '2.11.0.1'
compileOnly group: 'net.arnx', name: 'wmf2svg', version: '0.9.5' compileOnly group: 'net.arnx', name: 'wmf2svg', version: '0.9.5'
compileOnly group: 'com.google.appengine', name: 'appengine-api-1.0-sdk', version: '1.9.82' compileOnly group: 'com.google.appengine', name: 'appengine-api-1.0-sdk', version: '1.9.82'
compileOnly group: 'com.google.api', name: 'api-common', version: '1.9.3' compileOnly group: 'com.google.api', name: 'api-common', version: '1.9.3'
...@@ -69,6 +75,10 @@ dependencies { ...@@ -69,6 +75,10 @@ dependencies {
compileOnly group: 'org.apache.curator', name: 'curator-recipes', version: '4.0.0' compileOnly group: 'org.apache.curator', name: 'curator-recipes', version: '4.0.0'
compileOnly group: 'org.apache.curator', name: 'apache-curator', version: '4.0.0' compileOnly group: 'org.apache.curator', name: 'apache-curator', version: '4.0.0'
compileOnly group: 'org.apache.curator', name: 'curator-x-discovery', version: '4.0.0' compileOnly group: 'org.apache.curator', name: 'curator-x-discovery', version: '4.0.0'
compileOnly group: 'javax.xml.stream', name: 'com.springsource.javax.xml.stream', version: '1.0.1'
compileOnly group: 'sax', name: 'sax', version: '2.0.1'
compileOnly group: 'org.w3c', name: 'dom', version: '2.3.0-jaxb-1.0.6'
compileOnly group: 'org.slf4j', name: 'slf4j-api', version: '1.7.0'
......
package mprj.doerj.caderno.portlet; package mprj.doerj.caderno.portlet;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet; import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;
import com.liferay.portal.kernel.search.ParseException; import com.liferay.portal.kernel.search.ParseException;
...@@ -23,7 +22,6 @@ import javax.portlet.PortletException; ...@@ -23,7 +22,6 @@ import javax.portlet.PortletException;
import javax.portlet.PortletURL; import javax.portlet.PortletURL;
import javax.portlet.RenderRequest; import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse; import javax.portlet.RenderResponse;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.json.JSONArray; import org.json.JSONArray;
...@@ -32,7 +30,7 @@ import org.osgi.service.component.annotations.Component; ...@@ -32,7 +30,7 @@ import org.osgi.service.component.annotations.Component;
import mprj.doerj.caderno.constants.MprjDoerjCadernoPortletKeys; import mprj.doerj.caderno.constants.MprjDoerjCadernoPortletKeys;
import mprj.doerj.caderno.rest.RestServices; import mprj.doerj.caderno.rest.RestServices;
import mprj.doerj.caderno.util.CadernoUtil; import mprj.doerj.caderno.util.CadernoUtil;
import javax.portlet.ActionRequest; import mprj.doerj.caderno.util.GeraCaderno;
/** /**
* @author diogo.souza * @author diogo.souza
...@@ -145,9 +143,9 @@ public class MprjDoerjCadernoPortlet extends MVCPortlet { ...@@ -145,9 +143,9 @@ public class MprjDoerjCadernoPortlet extends MVCPortlet {
if(!mensagensDeErro(listaConteudos, dataDivulgacao, actionRequest)){ if(!mensagensDeErro(listaConteudos, dataDivulgacao, actionRequest)){
//GeraCaderno caderno = new GeraCaderno(); GeraCaderno caderno = new GeraCaderno();
//caderno.processaCaderno(actionRequest, actionResponse,listaConteudos,dataDivulgacao); caderno.processaCaderno(actionRequest, actionResponse,listaConteudos,dataDivulgacao);
}else{ }else{
String portletName = (String) actionRequest.getAttribute(WebKeys.PORTLET_ID); String portletName = (String) actionRequest.getAttribute(WebKeys.PORTLET_ID);
......
package mprj.doerj.caderno.rest; package mprj.doerj.caderno.rest;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import java.net.URI; import java.net.URI;
...@@ -15,6 +14,7 @@ import org.json.JSONObject; ...@@ -15,6 +14,7 @@ import org.json.JSONObject;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
public class RestServices { public class RestServices {
public JSONArray getRest(String dataDivulgacao, String idStatus,ActionRequest actionRequest) throws Exception{ public JSONArray getRest(String dataDivulgacao, String idStatus,ActionRequest actionRequest) throws Exception{
......
...@@ -50,8 +50,12 @@ public class GeraCaderno { ...@@ -50,8 +50,12 @@ public class GeraCaderno {
public static void processaCaderno(ActionRequest actionRequest,ActionResponse actionResponse,JSONArray listaConteudos,String dataDivulgacao) throws Docx4JException, JAXBException, IOException, ParseException{ public static void processaCaderno(ActionRequest actionRequest,ActionResponse actionResponse,JSONArray listaConteudos,String dataDivulgacao) throws Docx4JException, JAXBException, IOException, ParseException{
PortletContext context = actionRequest.getPortletSession().getPortletContext(); PortletContext context = actionRequest.getPortletSession().getPortletContext();
String pathTemplate = context.getRealPath("/template");
//String pathTemplate = context.getRealPath("");
String pathTemplate = "F:/LiferayWorkspacewithDevStudioDXP/workspace/mprj-doerj-caderno/src/main/resources/META-INF/resources/template";
String conteudo=""; String conteudo="";
String orgao=""; String orgao="";
String titulo=""; String titulo="";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment