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
c81646be
Commit
c81646be
authored
Oct 08, 2020
by
clecio.santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alterei o Path do template
parent
fe42501f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
7 deletions
+19
-7
.project
.project
+1
-1
org.eclipse.buildship.core.prefs
.settings/org.eclipse.buildship.core.prefs
+1
-1
org.eclipse.core.resources.prefs
.settings/org.eclipse.core.resources.prefs
+2
-0
.gitignore
bin/main/.gitignore
+3
-0
GeraCaderno.class
bin/main/mprj/doerj/caderno/util/GeraCaderno.class
+0
-0
build.gradle
build.gradle
+7
-1
GeraCaderno.java
src/main/java/mprj/doerj/caderno/util/GeraCaderno.java
+5
-4
No files found.
.project
View file @
c81646be
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
mprj-doerj-caderno
</name>
<name>
doerj-caderno-dxp-7.2
</name>
<comment></comment>
<projects>
</projects>
...
...
.settings/org.eclipse.buildship.core.prefs
View file @
c81646be
...
...
@@ -6,7 +6,7 @@ connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
jvm.arguments=
-Xmx2560m
offline.mode=false
override.workspace.settings=true
show.console.view=true
...
...
.settings/org.eclipse.core.resources.prefs
0 → 100644
View file @
c81646be
eclipse.preferences.version=1
encoding/build.gradle=UTF-8
bin/main/.gitignore
0 → 100644
View file @
c81646be
/META-INF/
/content/
/mprj/
bin/main/mprj/doerj/caderno/util/GeraCaderno.class
View file @
c81646be
No preview for this file type
build.gradle
View file @
c81646be
...
...
@@ -78,7 +78,7 @@ dependencies {
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
'
compileOnly
group:
'org.slf4j'
,
name:
'slf4j-api'
,
version:
'1.7.
26
'
...
...
@@ -89,4 +89,9 @@ repositories {
maven
{
url
"https://repository-cdn.liferay.com/nexus/content/groups/public"
}
}
liferay
{
liferayHome
=
"C:/liferay-mprj-fixpack6/deploy"
deployDir
=
file
(
"${liferayHome}/"
)
}
\ No newline at end of file
src/main/java/mprj/doerj/caderno/util/GeraCaderno.java
View file @
c81646be
...
...
@@ -55,14 +55,14 @@ public class GeraCaderno {
//String pathTemplate = context.getRealPath("");
String
pathTemplate
=
"F:/LiferayWorkspacewithDevStudioDXP/workspace/mprj-doerj-caderno/src/main/resources/META-INF/resources/template"
;
InputStream
templateCaderno
=
GeraCaderno
.
class
.
getClass
().
getResourceAsStream
(
"/META-INF/resources/template/TemplateCaderno.docx"
)
;
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"
));
WordprocessingMLPackage
templatePackage
=
WordprocessingMLPackage
.
load
(
new
File
(
templateCaderno
.
toString
()
));
//System.out.println(XmlUtils.marshaltoString(templatePackage.getMainDocumentPart().getJaxbElement(), true, true));
WordprocessingMLPackage
acumuladoPackage
=
WordprocessingMLPackage
.
createPackage
();
...
...
@@ -217,8 +217,9 @@ public class GeraCaderno {
util
.
TITULO
=
""
;
//File exportFile = new File("C:/Users/diogo.souza/Documents/Caderno DO/testeDoc4JNovo.docx");
String
dataNomeArquivo
=
dataDivulgacao
.
replace
(
"/"
,
"-"
);
String
nomeArquivo
=
"caderno_doerj_"
+
dataNomeArquivo
;
File
exportFile
=
new
File
(
pathTemplate
+
"/"
+
nomeArquivo
+
".docx"
);
String
nomeArquivo
=
"caderno_doerj_"
+
dataNomeArquivo
+
".docx"
;
InputStream
nomeArquivoInputStream
=
GeraCaderno
.
class
.
getClass
().
getResourceAsStream
(
"/META-INF/resources/template/"
+
nomeArquivo
);
File
exportFile
=
new
File
(
nomeArquivoInputStream
.
toString
());
templatePackage
.
save
(
exportFile
);
PortletRequest
pRequest
=
PortalUtil
.
getLiferayPortletRequest
(
actionRequest
);
...
...
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