Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
doerj-caderno-dxp-7.2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diogo.souza
doerj-caderno-dxp-7.2
Commits
31041d15
Commit
31041d15
authored
Oct 13, 2020
by
Bruno Bertasso Araújo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Carregando arquivo de template por InputStream
parent
aad88432
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
MprjDoerjCadernoPortlet.class
.../mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.class
+0
-0
GeraCaderno.class
bin/main/mprj/doerj/caderno/util/GeraCaderno.class
+0
-0
GeraCaderno.java
src/main/java/mprj/doerj/caderno/util/GeraCaderno.java
+5
-3
No files found.
bin/main/mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.class
View file @
31041d15
No preview for this file type
bin/main/mprj/doerj/caderno/util/GeraCaderno.class
View file @
31041d15
No preview for this file type
src/main/java/mprj/doerj/caderno/util/GeraCaderno.java
View file @
31041d15
...
@@ -47,7 +47,7 @@ import org.w3c.dom.Element;
...
@@ -47,7 +47,7 @@ import org.w3c.dom.Element;
public
class
GeraCaderno
{
public
class
GeraCaderno
{
public
static
void
processaCaderno
(
ActionRequest
actionRequest
,
ActionResponse
actionResponse
,
JSONArray
listaConteudos
,
String
dataDivulgacao
)
throws
Docx4JException
,
JAXBException
,
IOException
,
ParseException
,
PortalException
{
public
void
processaCaderno
(
ActionRequest
actionRequest
,
ActionResponse
actionResponse
,
JSONArray
listaConteudos
,
String
dataDivulgacao
)
throws
Docx4JException
,
JAXBException
,
IOException
,
ParseException
,
PortalException
{
...
@@ -56,8 +56,9 @@ public class GeraCaderno {
...
@@ -56,8 +56,9 @@ public class GeraCaderno {
//String pathTemplate = context.getRealPath("");
//String pathTemplate = context.getRealPath("");
//InputStream templateCaderno = GeraCaderno.class.getClass().getResourceAsStream("/META-INF/resources/template/TemplateCaderno.docx");
//InputStream templateCaderno = GeraCaderno.class.getClass().getResourceAsStream("/META-INF/resources/template/TemplateCaderno.docx");
InputStream
templateCaderno
=
getClass
().
getResourceAsStream
(
"/META-INF/resources/template/TemplateCaderno.docx"
);
ThemeDisplay
themeDisplay
=
(
ThemeDisplay
)
actionRequest
.
getAttribute
(
WebKeys
.
THEME_DISPLAY
);
ThemeDisplay
themeDisplay
=
(
ThemeDisplay
)
actionRequest
.
getAttribute
(
WebKeys
.
THEME_DISPLAY
);
String
templateCaderno
=
PortalUtil
.
getPortalURL
(
themeDisplay
)
+
"/o/mprj.doerj.caderno/template/TemplateCaderno.docx"
;
//
String templateCaderno = PortalUtil.getPortalURL(themeDisplay) + "/o/mprj.doerj.caderno/template/TemplateCaderno.docx";
String
conteudo
=
""
;
String
conteudo
=
""
;
String
orgao
=
""
;
String
orgao
=
""
;
...
@@ -67,7 +68,8 @@ public class GeraCaderno {
...
@@ -67,7 +68,8 @@ public class GeraCaderno {
MainDocumentPart
currentDocumentPart
=
null
;
MainDocumentPart
currentDocumentPart
=
null
;
//WordprocessingMLPackage templatePackage = WordprocessingMLPackage.load(new File(templateCaderno.toString()));
//WordprocessingMLPackage templatePackage = WordprocessingMLPackage.load(new File(templateCaderno.toString()));
WordprocessingMLPackage
templatePackage
=
WordprocessingMLPackage
.
load
(
new
File
(
templateCaderno
));
//WordprocessingMLPackage templatePackage = WordprocessingMLPackage.load(new File(templateCaderno));
WordprocessingMLPackage
templatePackage
=
WordprocessingMLPackage
.
load
(
templateCaderno
);
//System.out.println(XmlUtils.marshaltoString(templatePackage.getMainDocumentPart().getJaxbElement(), true, true));
//System.out.println(XmlUtils.marshaltoString(templatePackage.getMainDocumentPart().getJaxbElement(), true, true));
WordprocessingMLPackage
acumuladoPackage
=
WordprocessingMLPackage
.
createPackage
();
WordprocessingMLPackage
acumuladoPackage
=
WordprocessingMLPackage
.
createPackage
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment