Versão em homologação

parent f2ce3e3b
......@@ -4,9 +4,9 @@
<modelVersion>4.0.0</modelVersion>
<groupId>mprj-doerj-geracao-caderno-portlet</groupId>
<artifactId>mprj-doerj-geracao-caderno-portlet</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<name>mprj-doerj-geracao-caderno-portlet</name>
<version>arthur</version>
<parent>
<groupId>root-pom</groupId>
......@@ -16,6 +16,7 @@
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>com.liferay.maven.plugins</groupId>
......@@ -57,7 +58,7 @@
</configuration>
</plugin>
</plugins>
<finalName>mprj-doerj-geracao-caderno-portlet</finalName>
</build>
<dependencies>
<dependency>
......@@ -103,6 +104,11 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
......
......@@ -76,21 +76,17 @@ public class CadernoPortlet extends MVCPortlet{
String dataDivulgacao = ParamUtil.getString(uploadRequest, "dataP");
String situacao = ParamUtil.getString(uploadRequest, "situacao");
//System.out.println(valor);
com.liferay.portal.kernel.json.JSONObject jsonResponse = JSONFactoryUtil.createJSONObject();
if (cmd.equals("geraCaderno")){
try {
//geraCaderno(resourceRequest,resourceResponse,dataDivulgacao,situacao);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
//System.out.println(valor);
try {
jsonResponse.put("result", CadernoUtil.getDatasCadastradas());
......@@ -108,11 +104,6 @@ public class CadernoPortlet extends MVCPortlet{
}
PortletURL renderUrl = resourceResponse.createRenderURL();
//renderUrl.setParameter("erro", "");
// resourceResponse.addProperty("Location", renderUrl.toString());
//resourceResponse.encodeURL(renderUrl.toString());
//resourceResponse.createActionURL().addProperty("Location", renderUrl.toString());
//resourceResponse.createRenderURL();
resourceResponse.addProperty("Location", resourceResponse.createRenderURL().toString());
return;
......@@ -130,7 +121,7 @@ public class CadernoPortlet extends MVCPortlet{
JSONArray listaConteudos = new JSONArray();
RestServices rest = new RestServices();
String dataDivulgacaoRest = dataDivulgacao.replace("/", "");
listaConteudos = rest.getRest(dataDivulgacaoRest,idStatus);
listaConteudos = rest.getRest(dataDivulgacaoRest,idStatus,actionRequest);
SessionMessages.add(actionRequest.getPortletSession(), PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_SUCCESS_MESSAGE);
if(!mensagensDeErro(listaConteudos, dataDivulgacao, actionRequest)){
......@@ -139,38 +130,10 @@ public class CadernoPortlet extends MVCPortlet{
caderno.processaCaderno(actionRequest, actionResponse,listaConteudos,dataDivulgacao);
}else{
/*com.liferay.portal.kernel.json.JSONObject jsonResponse = JSONFactoryUtil.createJSONObject();
jsonResponse.put("erroDataNula", true);
PrintWriter writer = resourceResponse.getWriter();
writer.println(jsonResponse);*/
/* PortletRequestDispatcher dispatcher;
dispatcher = getPortletContext().getRequestDispatcher("/jsp/admin/view-admin.jsp");
dispatcher.include(resourceRequest, resourceResponse);*/
// SessionMessages.add(actionRequest.getPortletSession(), "erro");
String portletName = (String) actionRequest.getAttribute(WebKeys.PORTLET_ID);
/*PortletURL redirectURL = PortletURLFactoryUtil.create(PortalUtil.getHttpServletRequest(resourceRequest), portletName, themeDisplay.getLayout().getPlid(),
PortletRequest.RENDER_PHASE);
redirectURL.setParameter("jspPage", "/jsp/admin/view-admin.jsp");
((ActionResponse) resourceResponse).sendRedirect(redirectURL.toString());*/
}
/*String portletName = (String) resourceRequest.getAttribute(WebKeys.PORTLET_ID);
PortletURL redirectURL = PortletURLFactoryUtil.create(PortalUtil.getHttpServletRequest(resourceRequest), portletName, themeDisplay.getLayout().getPlid(),
PortletRequest.RENDER_PHASE);
redirectURL.setParameter("jspPage", "/jsp/admin/view-admin.jsp");
//resourceResponse.sendRedirect(redirectURL.toString());*/
//HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(resourceResponse);
//httpResponse.sendRedirect(redirect);
}
......
package br.mp.mprj.portal.portlet.caderno.conf;
import com.liferay.portal.kernel.portlet.DefaultConfigurationAction;
import com.liferay.portal.kernel.util.ParamUtil;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import javax.portlet.PortletPreferences;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
public class Configuration extends DefaultConfigurationAction {
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
super.processAction(portletConfig, actionRequest, actionResponse);
PortletPreferences prefs = actionRequest.getPreferences();
String urlConfig = ParamUtil.getString(actionRequest, "urlConfig");
String urlOrgao = ParamUtil.getString(actionRequest, "urlOrgao");
prefs.setValue("urlConfig", urlConfig);
prefs.setValue("urlOrgao", urlOrgao);
prefs.store();
}
}
\ No newline at end of file
package br.mp.mprj.portal.portlet.caderno.conf;
import com.liferay.portal.kernel.portlet.DefaultConfigurationAction;
import com.liferay.portal.kernel.util.ParamUtil;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import javax.portlet.PortletPreferences;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
public class ConfigurationActionImpl extends DefaultConfigurationAction {
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
super.processAction(portletConfig, actionRequest, actionResponse);
PortletPreferences prefs = actionRequest.getPreferences();
String urlConfig = ParamUtil.getString(actionRequest, "urlConfig");
String PGJConfig = ParamUtil.getString(actionRequest, "PGJConfig");
String CGMPConfig = ParamUtil.getString(actionRequest, "CGMPConfig");
String SGJAConfig = ParamUtil.getString(actionRequest, "SGJAConfig");
String SGJPIConfig = ParamUtil.getString(actionRequest, "SGJPIConfig");
String SGJACIConfig = ParamUtil.getString(actionRequest, "SGJACIConfig");
String SGJACDHConfig = ParamUtil.getString(actionRequest, "SGJACDHConfig");
String SGJRIDPConfig = ParamUtil.getString(actionRequest, "SGJRIDPConfig");
String CGConfig = ParamUtil.getString(actionRequest, "CGConfig");
String CJConfig = ParamUtil.getString(actionRequest, "CJConfig");
String AEConfig = ParamUtil.getString(actionRequest, "AEConfig");
String CMPROCJConfig = ParamUtil.getString(actionRequest, "CMPROCJConfig");
String CMPROMJConfig = ParamUtil.getString(actionRequest, "CMPROMJConfig");
String CSIConfig = ParamUtil.getString(actionRequest, "CSIConfig");
String CEAFConfig = ParamUtil.getString(actionRequest, "CEAFConfig");
String OUVIConfig = ParamUtil.getString(actionRequest, "OUVIConfig");
String SGMPConfig = ParamUtil.getString(actionRequest, "SGMPConfig");
String AAOMCConfig = ParamUtil.getString(actionRequest, "AAOMCConfig");
String ARCCConfig = ParamUtil.getString(actionRequest, "ARCCConfig");
String GAOMCConfig = ParamUtil.getString(actionRequest, "GAOMCConfig");
String ARCCRIConfig = ParamUtil.getString(actionRequest, "ARCCRIConfig");
String ACConfig = ParamUtil.getString(actionRequest, "ACConfig");
String ADHMConfig = ParamUtil.getString(actionRequest, "ADHMConfig");
String AAPConfig = ParamUtil.getString(actionRequest, "AAPConfig");
String AIConfig = ParamUtil.getString(actionRequest, "AIConfig");
prefs.setValue("urlConfig", urlConfig);
prefs.setValue("PGJConfig", PGJConfig);
prefs.setValue("CGMPConfig", CGMPConfig);
prefs.setValue("SGJAConfig", SGJAConfig);
prefs.setValue("SGJPIConfig", SGJPIConfig);
prefs.setValue("SGJACIConfig", SGJACIConfig);
prefs.setValue("SGJACDHConfig", SGJACDHConfig);
prefs.setValue("SGJRIDPConfig", SGJRIDPConfig);
prefs.setValue("CGConfig", CGConfig);
prefs.setValue("CJConfig", CJConfig);
prefs.setValue("AEConfig", AEConfig);
prefs.setValue("CMPROCJConfig", CMPROCJConfig);
prefs.setValue("CMPROMJConfig", CMPROMJConfig);
prefs.setValue("CSIConfig", CSIConfig);
prefs.setValue("CEAFConfig", CEAFConfig);
prefs.setValue("OUVIConfig", OUVIConfig);
prefs.setValue("SGMPConfig", SGMPConfig);
prefs.setValue("AAOMCConfig", AAOMCConfig);
prefs.setValue("ARCCConfig", ARCCConfig);
prefs.setValue("GAOMCConfig", GAOMCConfig);
prefs.setValue("ARCCRIConfig", ARCCRIConfig);
prefs.setValue("ACConfig", ACConfig);
prefs.setValue("ADHMConfig", ADHMConfig);
prefs.setValue("AAPConfig", AAPConfig);
prefs.setValue("AIConfig", AIConfig);
prefs.store();
}
}
\ No newline at end of file
package br.mp.mprj.portal.portlet.caderno.rest;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import javax.portlet.ActionRequest;
import javax.portlet.PortletPreferences;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.http.ResponseEntity;
......@@ -11,12 +17,16 @@ import org.springframework.web.client.RestTemplate;
public class RestServices {
public JSONArray getRest(String dataDivulgacao, String idStatus) throws Exception{
public JSONArray getRest(String dataDivulgacao, String idStatus,ActionRequest actionRequest) throws Exception{
Boolean array=false;
JSONArray arr = new JSONArray();
final String baseUrl = "http://d-esb.pgj.rj.gov.br:8283/cadernoDoerj/buscaCadernoAno/" + dataDivulgacao + "/" + idStatus;
PortletPreferences prefs = actionRequest.getPreferences();
String urlConfig = prefs.getValue("urlConfig", StringPool.BLANK);
final String baseUrl = urlConfig + dataDivulgacao + "/" + idStatus;
URI uri = new URI(baseUrl);
//RestTemplate restTemplate = new RestTemplate();
RestTemplate restTemp = new RestTemplate();
......@@ -40,14 +50,7 @@ public class RestServices {
}
}/*else{
array=false;
JSONObject jObjVazio = new JSONObject();
arr.put(jObjVazio);
}*/
/* CreateOdc creatOdc = new CreateOdc();
creatOdc.criaPlanilhaODS(arr, req, res,tipoFunc,mes,ano,array);*/
}
return arr;
}
......
package br.mp.mprj.portal.portlet.caderno.service;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.util.PortalUtil;
import br.mp.mprj.portal.portlet.caderno.util.CadernoUtil;
......@@ -21,6 +22,7 @@ import javax.portlet.ActionResponse;
import javax.portlet.CacheControl;
import javax.portlet.ClientDataRequest;
import javax.portlet.PortletContext;
import javax.portlet.PortletPreferences;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
import javax.portlet.PortletURL;
......@@ -56,11 +58,11 @@ public class GeraCaderno {
String conteudo="";
String orgao="";
String titulo="";
PortletPreferences prefs = actionRequest.getPreferences();
CadernoUtil util = new CadernoUtil();
MainDocumentPart currentDocumentPart = null;
WordprocessingMLPackage templatePackage = WordprocessingMLPackage.load(new File(pathTemplate + "/" + "TemplateCaderno.docx"));
System.out.println(XmlUtils.marshaltoString(templatePackage.getMainDocumentPart().getJaxbElement(), true, true));
//System.out.println(XmlUtils.marshaltoString(templatePackage.getMainDocumentPart().getJaxbElement(), true, true));
WordprocessingMLPackage acumuladoPackage = WordprocessingMLPackage.createPackage();
//Preenche os dados do cabeçalho
......@@ -76,14 +78,10 @@ public class GeraCaderno {
JSONObject cabecalho = new JSONObject(listaConteudos.getJSONObject(0).toString());
//String edicao = cabecalho.get("EDICAO").toString();
String edicao = "EDIÇÃO TESTE";
//String disponibilizacao = cabecalho.get("DISPONIBILIZACAO").toString();
String disponibilizacao = util.gerarDataCabecalho(dataDivulgacao);
//String publicacao = cabecalho.get("PUBLICACAO").toString();
String publicacao = "PUBLICAÇÃO TESTE";
String textoMain="José Eduardo Ciotola Gussem";
//Cria o hash map com as variáveis para substuição dos dados dos cabeçalhos e expediente
......@@ -91,79 +89,82 @@ public class GeraCaderno {
variables.put("edicao", edicao);
variables.put("disponibilizacao", disponibilizacao);
variables.put("publicacao", publicacao);
variables.put("PGJ", textoMain);
textoMain="Luciana Sapha Silveira";
variables.put("CGMP", textoMain);
String PGJ = prefs.getValue("PGJConfig", StringPool.BLANK);
variables.put("PGJ", PGJ);
textoMain="Eduardo da Silva Lima Neto";
variables.put("SGJA", textoMain);
String CGMP = prefs.getValue("CGMPConfig", StringPool.BLANK);
variables.put("CGMP", CGMP);
textoMain="Leila Machado Costa";
variables.put("SGJPI", textoMain);
String SGJA = prefs.getValue("SGJAConfig", StringPool.BLANK);
variables.put("SGJA", SGJA);
textoMain="Sérgio Roberto Ulhôa Pimentel";
variables.put("SGJACI", textoMain);
String SGJPI = prefs.getValue("SGJPIConfig", StringPool.BLANK);
variables.put("SGJPI", SGJPI);
textoMain="Fernando Chaves da Costa";
variables.put("SGJACDH", textoMain);
String SGJACI = prefs.getValue("SGJACIConfig", StringPool.BLANK);
variables.put("SGJACI", SGJACI);
textoMain="Marfan Martins Vieira";
variables.put("SGJRIDP", textoMain);
String SGJACDH = prefs.getValue("SGJACDHConfig", StringPool.BLANK);
variables.put("SGJACDH", SGJACDH);
textoMain="Virgilio Panagiotis Stavridis";
variables.put("CG", textoMain);
String SGJRIDP = prefs.getValue("SGJRIDPConfig", StringPool.BLANK);
variables.put("SGJRIDP", SGJRIDP);
textoMain="Emerson Garcia";
variables.put("CJ", textoMain);
String CG = prefs.getValue("CGConfig", StringPool.BLANK);
variables.put("CG", CG);
textoMain="Mária Luiza Bezerra Cortes Barroso Miranda";
variables.put("AE", textoMain);
String CJ = prefs.getValue("CJConfig", StringPool.BLANK);
variables.put("CJ", CJ);
textoMain="Vera de Souza Leite";
variables.put("CMPROCJ", textoMain);
String AE = prefs.getValue("AEConfig", StringPool.BLANK);
variables.put("AE", AE);
textoMain="Patricia Mothé Glioche Béze";
variables.put("CMPROMJ", textoMain);
String CMPROCJ = prefs.getValue("CMPROCJConfig", StringPool.BLANK);
variables.put("CMPROCJ", CMPROCJ);
textoMain="Elisa Fraga de Rego Monteiro";
variables.put("CSI", textoMain);
String CMPROMJ = prefs.getValue("CMPROMJConfig", StringPool.BLANK);
variables.put("CMPROMJ", CMPROMJ);
textoMain="Leandro Silva Navega";
variables.put("CEAF", textoMain);
String CSI = prefs.getValue("CSIConfig", StringPool.BLANK);
variables.put("CSI", CSI);
textoMain="José Roberto Paredes";
variables.put("OUVI", textoMain);
String CEAF = prefs.getValue("CEAFConfig", StringPool.BLANK);
variables.put("CEAF", CEAF);
textoMain="Dimitrius Viveiros Gonçalves";
variables.put("SGMP", textoMain);
String OUVI = prefs.getValue("OUVIConfig", StringPool.BLANK);
variables.put("OUVI", OUVI);
textoMain="Fernanda Moreira Jorgensen (Assessora-Chefe)";
variables.put("AAOMC", textoMain);
String SGMP = prefs.getValue("SGMPConfig", StringPool.BLANK);
variables.put("SGMP", SGMP);
textoMain="Inês da Matta Andreiuolo (Assessora-Chefe)";
variables.put("ARCC", textoMain);
String AAOMC = prefs.getValue("AAOMCConfig", StringPool.BLANK);
variables.put("AAOMC", AAOMC);
textoMain="Cláucio Cardoso da Conceição (Coordenador)";
variables.put("GAOMC", textoMain);
String ARCC = prefs.getValue("ARCCConfig", StringPool.BLANK);
variables.put("ARCC", ARCC);
textoMain="Orlando Carlos Neves Belém (Assessor-Chefe)";
variables.put("ARCCRI", textoMain);
String GAOMC = prefs.getValue("GAOMCConfig", StringPool.BLANK);
variables.put("GAOMC", GAOMC);
textoMain="Antonio Carlos Silva Biscaia (Assessor-Chefe)";
variables.put("AC", textoMain);
String ARCCRI = prefs.getValue("ARCCRIConfig", StringPool.BLANK);
variables.put("ARCCRI", ARCCRI);
textoMain="Eliane de Lima Pereira";
variables.put("ADHM", textoMain);
String AC = prefs.getValue("ACConfig", StringPool.BLANK);
variables.put("AC", AC);
textoMain="Ertulei Laureano Matos";
variables.put("ARIDP", textoMain);
String ADHM = prefs.getValue("ADHMConfig", StringPool.BLANK);
variables.put("ADHM", ADHM);
textoMain="Humberto Dalla Bernadina de Pinho";
variables.put("AI", textoMain);
String ARIDP = prefs.getValue("ARIDPConfig", StringPool.BLANK);
variables.put("ARIDP", ARIDP);
textoMain="Victoria Siqueiros Soares Le Cocq D`Oliveira";
variables.put("AAP", textoMain);
String AI = prefs.getValue("AIConfig", StringPool.BLANK);
variables.put("AI", AI);
String AAP = prefs.getValue("AAPConfig", StringPool.BLANK);
variables.put("AAP", AAP);
firstPageHeaderPart.variableReplace(variables);
......@@ -196,19 +197,15 @@ public class GeraCaderno {
conteudo=util.tratarString(conteudo,"conteudo");
wordCurrentPackage = util.ConverterHTML(conteudo,orgao,titulo);
wordCurrentPackage = util.ConverterHTML(conteudo,orgao,titulo,actionRequest);
currentDocumentPart = wordCurrentPackage.getMainDocumentPart();
acumuladoPackage.getMainDocumentPart().getContent().addAll(currentDocumentPart.getContent());
wordCurrentPackage = null;
currentDocumentPart =null;
//firstDocumentPart=null;
}
MainDocumentPart acumuladoDocumentPart = acumuladoPackage.getMainDocumentPart();
estilo.alterStyleSheet(templatePackage);
......@@ -223,25 +220,6 @@ public class GeraCaderno {
File exportFile = new File(pathTemplate + "/" + nomeArquivo + ".docx");
templatePackage.save(exportFile);
/*response.setContentType("application/force-download");
((PortletResponse) response).addProperty("Content-Disposition", "attachment; filename="+nomeArquivo + ".docx");
File outputFile = new File(System.getProperty("java.io.tmpdir"), nomeArquivo);
FileInputStream in = new FileInputStream(exportFile);
OutputStream out = resourceResponse.getPortletOutputStream();
//wb.write(out);
byte[] buffer = new byte[4096];
int length;
while ((length = in.read(buffer)) > 0){
out.write(buffer, 0, length);
}
in.close();
out.flush();
out.close();*/
PortletRequest pRequest = PortalUtil.getLiferayPortletRequest(actionRequest);
PortletResponse pResponse = PortalUtil.getLiferayPortletResponse(actionResponse);
......
......@@ -9,12 +9,16 @@ import java.util.GregorianCalendar;
import java.util.List;
import java.util.Locale;
import javax.portlet.ActionRequest;
import javax.portlet.PortletContext;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.docx4j.XmlUtils;
import org.docx4j.convert.in.xhtml.XHTMLImporterImpl;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart;
import org.docx4j.openpackaging.parts.WordprocessingML.NumberingDefinitionsPart;
import org.docx4j.org.xhtmlrenderer.util.XRLog;
public class CadernoUtil {
......@@ -22,22 +26,10 @@ public class CadernoUtil {
public static String TITULO="";
public static String getDatasCadastradas() throws SystemException, ParseException{
//List<Agendamento> agendamentos =AgendamentoLocalServiceUtil.getAgendamentos(0, AgendamentoLocalServiceUtil.getAgendamentosCount());
String datas = " ";
Date data = GregorianCalendar.getInstance().getTime();
String now = DateFormatUtils.format(GregorianCalendar.getInstance(), "dd/MM/yyyy", new Locale("pt-BR"));
boolean ch=false;
/*for (Agendamento agendamento : agendamentos) {
if(now.equals(agendamento.getDataDivulgacao()) ) {
ch=true;
}
datas += agendamento.getDataDivulgacao().replaceAll("/", "-") +",";
}
//Local que preenche o datepicker permitindo agendamentos ate as 19:50
if(!ch && regraDeAgendamentoPorPeriodo()) {
datas += now.replaceAll("/", "-") +",";
}*/
datas+= datas.substring(0, datas.length() - 1);
datas += " ";
return datas;
......@@ -260,46 +252,20 @@ public class CadernoUtil {
return conteudoHtml;
}
public static WordprocessingMLPackage ConverterHTML(String stringFromFile,String orgao,String titulo){
public static WordprocessingMLPackage ConverterHTML(String stringFromFile,String orgao,String titulo, ActionRequest actionRequest){
//String inputfilepath = System.getProperty("user.dir") + "/Documents/Caderno DO/arquivoHtmlTeste.html";
String inputfilepath = "C:/Users/diogo.souza/Documents/Caderno DO/arquivoHtmlTeste.html";
// String baseURL = "file:///C:/Users/jharrop/git/docx4j-ImportXHTML/somedir/";
String baseURL = "file:///C:/Users/diogo.souza/Documents/Caderno DO";
//String stringFromFile = FileUtils.readFileToString(new File(inputfilepath), "UTF-8");
PortletContext context = actionRequest.getPortletSession().getPortletContext();
String baseURL = "file:///" + context.getRealPath("/template");
//String baseURL = "file:///C:/Users/diogo.souza/Documents/Caderno DO";
XRLog.setLoggingEnabled(false);
String unescaped = stringFromFile;
// if (stringFromFile.contains("&lt;/") ) {
// unescaped = StringEscapeUtils.unescapeHtml(stringFromFile);
// }
// XHTMLImporter.setTableFormatting(FormattingOption.IGNORE_CLASS);
// XHTMLImporter.setParagraphFormatting(FormattingOption.IGNORE_CLASS);
System.out.println("Unescaped: " + unescaped);
// Setup font mapping
/* RFonts rfonts = Context.getWmlObjectFactory().createRFonts();
rfonts.setAscii("Century Gothic");
XHTMLImporterImpl.addFontMapping("Century Gothic", rfonts);*/
// Create an empty docx package
WordprocessingMLPackage wordMLPackage=null;
try {
wordMLPackage = WordprocessingMLPackage.createPackage();
//Estilos estilo = new Estilos();
//estilo.alterStyleSheet(wordMLPackage);
// WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new File(System.getProperty("user.dir") + "/styled.docx"));
MainDocumentPart DocumentPart = wordMLPackage.getMainDocumentPart();
// DocumentPart.addStyledParagraphOfText("Century Gothic", "texto teste");
if(!orgao.equals(ORGAO)){
......@@ -325,20 +291,8 @@ public class CadernoUtil {
XHTMLImporterImpl XHTMLImporter = new XHTMLImporterImpl(wordMLPackage);
XHTMLImporter.setHyperlinkStyle("Heading1");
// XHTMLImporter.setRunFormatting(null);
wordMLPackage.getMainDocumentPart().getContent().addAll(XHTMLImporter.convert(unescaped, baseURL) );
//System.out.println(XmlUtils.marshaltoString(wordMLPackage.getMainDocumentPart().getJaxbElement(), true, true));
// System.out.println(
// XmlUtils.marshaltoString(wordMLPackage.getMainDocumentPart().getNumberingDefinitionsPart().getJaxbElement(), true, true));
//wordMLPackage.save(new java.io.File(System.getProperty("user.dir") + "/OUT_from_XHTML.docx") );
//wordMLPackage.save(new java.io.File("C:/Users/diogo.souza/Documents/Caderno DO" + "/OUT_from_XHTML.docx"));
//String retorno = XmlUtils.marshaltoString(wordMLPackage.getMainDocumentPart().getJaxbElement(), true, true);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
......
<?xml version="1.0"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" default-destroy-method="destroy" default-init-method="afterPropertiesSet" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="br.mp.mprj.portal.portlet.doerj.service.service.AgendamentoLocalService" class="br.mp.mprj.portal.portlet.doerj.service.service.impl.AgendamentoLocalServiceImpl" />
<bean id="br.mp.mprj.portal.portlet.doerj.service.service.AgendamentoService" class="br.mp.mprj.portal.portlet.doerj.service.service.impl.AgendamentoServiceImpl" />
<bean id="br.mp.mprj.portal.portlet.doerj.service.service.persistence.AgendamentoPersistence" class="br.mp.mprj.portal.portlet.doerj.service.service.persistence.AgendamentoPersistenceImpl" parent="basePersistence" />
</beans>
\ No newline at end of file
#ADMINISTRACAO
admin.form.agendamento.observacao=*campos obrigatórios
admin.form.agendamento.titulo=Gerar Caderno
admin.form.agendamento.do=Diário Oficial *
admin.form.agendamento.data.divulgacao=Data de disponibilização *
admin.form.agendamento.do=Diário Oficial*
admin.form.agendamento.data.divulgacao=Data de disponibilização*
admin.form.agendamento.obs.arquivo=Envie arquivos com a extensão .pdf com até 100mb de tamanho.
admin.form.adicionar.titulo=Adicionar mat&eacute;ria
admin.form.adicionar.observacao=*campos obrigatórios
admin.form.adicionar.orgao=&Oacute;rg&atilde;o
admin.form.adicionar.materia=Tipo de mat&eacute;ria *
admin.form.adicionar.data.divulgacao=Data de disponibilização *
admin.form.adicionar.conteudo=Conte&uacute;do *
admin.form.adicionar.materia=Tipo de mat&eacute;ria*
admin.form.adicionar.data.divulgacao=Data de disponibilização*
admin.form.adicionar.conteudo=Conte&uacute;do*
admin.form.editar.situacao= Situação*
admin.form.editar.titulo=Editar mat&eacute;ria
......@@ -5,9 +5,14 @@
<portlet>
<portlet-name>mprj-doerj-geracao-caderno-portlet</portlet-name>
<icon>/icon.png</icon>
<configuration-action-class>br.mp.mprj.portal.portlet.caderno.conf.Configuration</configuration-action-class>
<configuration-action-class>br.mp.mprj.portal.portlet.caderno.conf.ConfigurationActionImpl</configuration-action-class>
<control-panel-entry-category>content</control-panel-entry-category>
<control-panel-entry-weight>2</control-panel-entry-weight>
<control-panel-entry-weight>3</control-panel-entry-weight>
<preferences-unique-per-layout>false</preferences-unique-per-layout>
<maximize-edit>true</maximize-edit>
<instanceable>false</instanceable>
<requires-namespaced-parameters>false</requires-namespaced-parameters>
<ajaxable>true</ajaxable>
<header-portlet-css>/css/admin/admin.css</header-portlet-css>
<header-portlet-css>/css/datepicker/bootstrap.min.css</header-portlet-css>
<header-portlet-css>/css/datepicker/bootstrap-datepicker3.standalone.min.css</header-portlet-css>
......
......@@ -11,12 +11,13 @@
</init-param>
<init-param>
<name>config-template</name>
<value>/jsp/configuration.jsp</value>
<value>/jsp/admin/configuration.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
</supports>
<resource-bundle>content/Language</resource-bundle>
<portlet-info>
......
......@@ -27,6 +27,7 @@
line-height: 16px;
font-weight: bold;
color: #333;
}
.texto-obs{
font-size: 12px;
......
<%@ include file="/jsp/admin/init.jsp" %>
<liferay-portlet:actionURL portletConfiguration="true" var="configurationURL" />
<%
String urlConfig = portletPreferences.getValue("urlConfig", StringPool.BLANK);
String PGJConfig = portletPreferences.getValue("PGJConfig", StringPool.BLANK);
String CGMPConfig = portletPreferences.getValue("CGMPConfig", StringPool.BLANK);
String SGJAConfig = portletPreferences.getValue("SGJAConfig", StringPool.BLANK);
String SGJPIConfig = portletPreferences.getValue("SGJPIConfig", StringPool.BLANK);
String SGJACIConfig = portletPreferences.getValue("SGJACIConfig", StringPool.BLANK);
String SGJACDHConfig = portletPreferences.getValue("SGJACDHConfig", StringPool.BLANK);
String SGJRIDPConfig = portletPreferences.getValue("SGJRIDPConfig", StringPool.BLANK);
String CGConfig = portletPreferences.getValue("CGConfig", StringPool.BLANK);
String CJConfig = portletPreferences.getValue("CJConfig", StringPool.BLANK);
String AEConfig = portletPreferences.getValue("AEConfig", StringPool.BLANK);
String CMPROCJConfig = portletPreferences.getValue("CMPROCJConfig", StringPool.BLANK);
String CMPROMJConfig = portletPreferences.getValue("CMPROMJConfig", StringPool.BLANK);
String CSIConfig = portletPreferences.getValue("CSIConfig", StringPool.BLANK);
String CEAFConfig = portletPreferences.getValue("CEAFConfig", StringPool.BLANK);
String OUVIConfig = portletPreferences.getValue("OUVIConfig", StringPool.BLANK);
String SGMPConfig = portletPreferences.getValue("SGMPConfig", StringPool.BLANK);
String AAOMCConfig = portletPreferences.getValue("AAOMCConfig", StringPool.BLANK);
String ARCCConfig = portletPreferences.getValue("ARCCConfig", StringPool.BLANK);
String GAOMCConfig = portletPreferences.getValue("GAOMCConfig", StringPool.BLANK);
String ARCCRIConfig = portletPreferences.getValue("ARCCRIConfig", StringPool.BLANK);
String ACConfig = portletPreferences.getValue("ACConfig", StringPool.BLANK);
String ADHMConfig = portletPreferences.getValue("ADHMConfig", StringPool.BLANK);
String AAPConfig = portletPreferences.getValue("AAPConfig", StringPool.BLANK);
String AIConfig = portletPreferences.getValue("AIConfig", StringPool.BLANK);
%>
<aui:form action="<%=configurationURL %>" method="post" name="fm">
<aui:fieldset label="Dados da Conexo com Servio">
<aui:input name="urlConfig" label="URL do Servio REST: " style="width:500px; display:block" type="text" value="<%= urlConfig %>" />
</aui:fieldset>
<br/>
<aui:fieldset label="Expediente">
<aui:input name="PGJConfig" label="PROCURADOR GERAL DE JUSTIA: " style="width:500px; display:block" type="text" value="<%= PGJConfig %>" />
<aui:input name="CGMPConfig" label="CORREGEDORA GERAL DO MINISTRIO PBLICO: " style="width:500px; display:block" type="text" value="<%= CGMPConfig %>" />
<aui:input name="SGJAConfig" label="PROCURADORIA GERAL DE JUSTIA SUBPROCURADORIA GERAL DE JUSTIA DE ADMINISTRAO: " style="width:500px; display:block" type="text" value="<%= SGJAConfig %>" />
<aui:input name="SGJPIConfig" label="SUBPROCURADORIA GERAL DE JUSTIA DE PLANEJAMENTO INSTITUCIONAL: " style="width:500px; display:block" type="text" value="<%= SGJPIConfig %>" />
<aui:input name="SGJACIConfig" label="SUBPROCURADORIA GERAL DE JUSTIA DE ASSUNTOS CVEIS E INSTITUCIONAIS: " style="width:500px; display:block" type="text" value="<%= SGJACIConfig %>" />
<aui:input name="SGJACDHConfig" label="SUBPROCURADORIA GERAL DE JUSTIA DE ASSUNTOS CRIMINAIS E DE DIREITOS HUMANOS: " style="width:500px; display:block" type="text" value="<%= SGJACDHConfig %>" />
<aui:input name="SGJRIDPConfig" label="SUBPROCURADORIA GERAL DE JUSTIA DE RELAES INSTITUCIONAIS E DEFESA DE PRERROGATIVAS: " style="width:500px; display:block" type="text" value="<%= SGJRIDPConfig %>" />
<aui:input name="CGConfig" label="CHEFIA DE GABINETE: " style="width:500px; display:block" type="text" value="<%= CGConfig %>" />
<aui:input name="CJConfig" label="CONSULTORIA JURDICA: " style="width:500px; display:block" type="text" value="<%= CJConfig %>" />
<aui:input name="AEConfig" label="ASSESSORIA EXECUTIVA: " style="width:500px; display:block" type="text" value="<%= AEConfig %>" />
<aui:input name="CMPROCJConfig" label="COOREDENADORIA DE MOVIMENTAO DOS PROCURADORES DE JUSTIA: " style="width:500px; display:block" type="text" value="<%= CMPROCJConfig %>" />
<aui:input name="CMPROMJConfig" label="COORDENADORIA DE MOVIMENTAO DOS PROMOTORES DE JUSTIA: " style="width:500px; display:block" type="text" value="<%= CMPROMJConfig %>" />
<aui:input name="CSIConfig" label="COORDENADORIA DE SEGURANA E INTELIGNCIA: " style="width:500px; display:block" type="text" value="<%= CSIConfig %>" />
<aui:input name="CEAFConfig" label="CENTRO DE ESTUDOS E APERFEIOAMENTO FUNCIONAL: " style="width:500px; display:block" type="text" value="<%= CEAFConfig %>" />
<aui:input name="OUVIConfig" label="OUVIDORIA: " style="width:500px; display:block" type="text" value="<%= OUVIConfig %>" />
<aui:input name="SGMPConfig" label="SECRETARIA GERAL DO MINISTRIO PBLICO: " style="width:500px; display:block" type="text" value="<%= SGMPConfig %>" />
<aui:input name="AAOMCConfig" label="ASSESSORIA DE ATRIBUIO ORIGINRIA EM MATRIA CVEL: " style="width:500px; display:block" type="text" value="<%= AAOMCConfig %>" />
<aui:input name="ARCCConfig" label="ASSESSORIA DE RECURSOS CONSTITUCIONAIS CVEIS: " style="width:500px; display:block" type="text" value="<%= ARCCConfig %>" />
<aui:input name="GAOMCConfig" label="GRUPO DE ATRIBUIO ORIGINRIA EM MATRIA CRIMINAL: " style="width:500px; display:block" type="text" value="<%= GAOMCConfig %>" />
<aui:input name="ARCCRIConfig" label="ASSESSORIA DE RECURSOS CONSTITUCIONAIS CRIMINAIS: " style="width:500px; display:block" type="text" value="<%= ARCCRIConfig %>" />
<aui:input name="ACConfig" label="ASSESSORIA CRIMINAL: " style="width:500px; display:block" type="text" value="<%= ACConfig %>" />
<aui:input name="ADHMConfig" label="ASSESSORIA DE DIRETOS HUMANOS E DE MINORIAS: " style="width:500px; display:block" type="text" value="<%= ADHMConfig %>" />
<aui:input name="AAPConfig" label="ASSESSORIA DE ASSUNTOS PARLAMENTARES: " style="width:500px; display:block" type="text" value="<%= AAPConfig %>" />
<aui:input name="AIConfig" label="ASSESSORIA INTERNACIONAL: " style="width:500px; display:block" type="text" value="<%= AIConfig %>" />
</aui:fieldset>
<aui:button-row>
<aui:button type="submit" value="Salvar" />
</aui:button-row>
</aui:form>
\ No newline at end of file
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
......@@ -8,6 +9,7 @@
<%@ page import="com.liferay.portal.kernel.util.StringPool" %>
<%@ page import="com.liferay.portal.kernel.util.ParamUtil" %>
<%@page import="com.liferay.portal.theme.ThemeDisplay"%>
<%@page import="org.apache.taglibs.standard.tag.common.core.ForEachSupport"%>
<%@page import="com.liferay.portal.kernel.servlet.SessionErrors"%>
<%@page import="java.util.List"%>
<%@page import="java.lang.String"%>
......
......@@ -59,7 +59,7 @@
<select class="selectpicker" name="<portlet:namespace/>situacao" id="<portlet:namespace/>situacao" >
<option value="3">Validada</option>
<option value="4">Validada</option>
<option value="6">Aprovada</option>
<option value="8">Divulgada</option>
......
<%@ include file="/jsp/init.jsp" %>
<liferay-portlet:actionURL portletConfiguration="true" var="configurationURL" />
<%
String urlConfig = portletPreferences.getValue("urlConfig", StringPool.BLANK);
String urlOrgao = portletPreferences.getValue("urlOrgao", StringPool.BLANK);
%>
<aui:form action="<%=configurationURL %>" method="post" name="fm">
<aui:input name="urlConfig" label="URL do Solr utilizado: " type="text" value="<%= urlConfig %>" />
<aui:input name="urlOrgao" label="URL do Servio Orgao: " type="text" value="<%= urlOrgao %>" />
<aui:button-row>
<aui:button type="submit" value="Salvar" />
</aui:button-row>
</aui:form>
\ No newline at end of file
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