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
0df6a964
Commit
0df6a964
authored
Nov 18, 2020
by
Diogo Fellipe De Melo Souza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Versão com ajustes no cabeçalho do caderno
parent
8f223bfb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
7 deletions
+38
-7
.gitignore
bin/main/.gitignore
+0
-1
view-admin.jsp
bin/main/META-INF/resources/view-admin.jsp
+11
-1
MprjDoerjCadernoPortlet.class
.../mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.class
+0
-0
GeraCaderno.class
bin/main/mprj/doerj/caderno/util/GeraCaderno.class
+0
-0
MprjDoerjCadernoPortlet.java
...a/mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.java
+5
-2
GeraCaderno.java
src/main/java/mprj/doerj/caderno/util/GeraCaderno.java
+11
-2
view-admin.jsp
src/main/resources/META-INF/resources/view-admin.jsp
+11
-1
No files found.
bin/main/.gitignore
View file @
0df6a964
/mprj/
/META-INF/
bin/main/META-INF/resources/view-admin.jsp
View file @
0df6a964
...
...
@@ -38,6 +38,7 @@
<liferay-ui:error key="erroListagemNula" message="No existem matrias cadastradas para os parmetros utilizados." />
<aui:form id="<portlet:namespace />formDO" name="<portlet:namespace />formDO" method="POST" action="<%= submitActionURL%>" data-senna-off="true">
<div class="sheet sheet-lg" style="margin-top: 24px">
...
...
@@ -74,7 +75,7 @@
</div>
<aui:button-row>
<aui:button type="reset" id="limparFormDO" name="limparFormDO" value="Limpar" />
<aui:button type="submit" id="enviarFormDO" name="enviarFormDO" value="Gerar Caderno"
/>
<aui:button type="submit" id="enviarFormDO" name="enviarFormDO" value="Gerar Caderno"/>
<aui:button type="button" id="jobForm" name="jobForm" class="oculto" style="display: none" value="no aperte" />
</aui:button-row>
...
...
@@ -104,4 +105,12 @@
createDatesValidation();
}
});
$('button[type="submit"]').click(function(){
setTimeout(function(){
$('button[type="submit"]').removeAttr('disabled');
$('button[type="submit"]').css("opacity", "1");
}, 1000);
});
</script>
\ No newline at end of file
bin/main/mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.class
View file @
0df6a964
No preview for this file type
bin/main/mprj/doerj/caderno/util/GeraCaderno.class
View file @
0df6a964
No preview for this file type
src/main/java/mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.java
View file @
0df6a964
...
...
@@ -137,12 +137,15 @@ public class MprjDoerjCadernoPortlet extends MVCPortlet {
RestServices
rest
=
new
RestServices
();
String
dataDivulgacaoRest
=
dataDivulgacao
.
replace
(
"/"
,
""
);
listaConteudos
=
rest
.
getRest
(
dataDivulgacaoRest
,
idStatus
,
actionRequest
);
//
SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_SUCCESS_MESSAGE);
SessionMessages
.
add
(
actionRequest
,
PortalUtil
.
getPortletId
(
actionRequest
));
SessionMessages
.
add
(
actionRequest
,
PortalUtil
.
getPortletId
(
actionRequest
)
+
SessionMessages
.
KEY_SUFFIX_HIDE_DEFAULT_SUCCESS_MESSAGE
);
//
SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest));
if
(!
mensagensDeErro
(
listaConteudos
,
dataDivulgacao
,
actionRequest
)){
GeraCaderno
caderno
=
new
GeraCaderno
();
caderno
.
processaCaderno
(
actionRequest
,
actionResponse
,
listaConteudos
,
dataDivulgacao
);
//SessionMessages.add(actionRequest, "sucessoMessage");
}
else
{
//String portletName = (String) actionRequest.getAttribute(WebKeys.PORTLET_ID);
...
...
src/main/java/mprj/doerj/caderno/util/GeraCaderno.java
View file @
0df6a964
package
mprj
.
doerj
.
caderno
.
util
;
import
com.liferay.portal.kernel.exception.PortalException
;
import
com.liferay.portal.kernel.portlet.LiferayPortletResponse
;
import
com.liferay.portal.kernel.servlet.SessionErrors
;
import
com.liferay.portal.kernel.servlet.SessionMessages
;
import
com.liferay.portal.kernel.theme.ThemeDisplay
;
import
com.liferay.portal.kernel.util.ContentTypes
;
import
com.liferay.portal.kernel.util.ParamUtil
;
import
com.liferay.portal.kernel.util.PortalUtil
;
import
com.liferay.portal.kernel.util.WebKeys
;
...
...
@@ -79,9 +81,9 @@ public class GeraCaderno {
JSONObject
cabecalho
=
new
JSONObject
(
listaConteudos
.
getJSONObject
(
0
).
toString
());
String
edicao
=
"
EDIO TESTE
"
;
String
edicao
=
"
--
"
;
String
disponibilizacao
=
util
.
gerarDataCabecalho
(
dataDivulgacao
);
String
publicacao
=
"
PUBLICAO TESTE
"
;
String
publicacao
=
"
--
"
;
...
...
@@ -226,14 +228,21 @@ public class GeraCaderno {
File
exportFile
=
File
.
createTempFile
(
"caderno_doerj_tmp_"
,
".docx"
);
try
{
templatePackage
.
save
(
exportFile
);
PortletResponse
pResponse
=
PortalUtil
.
getLiferayPortletResponse
(
actionResponse
);
HttpServletResponse
res
=
PortalUtil
.
getHttpServletResponse
(
pResponse
);
res
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
nomeArquivo
);
//
res
.
setContentType
(
ContentTypes
.
APPLICATION_MSWORD
);
/*String redirectURL = ParamUtil.getString(actionRequest, "/view-admin.jsp");
actionResponse.sendRedirect(redirectURL);*/
try
(
FileInputStream
in
=
new
FileInputStream
(
exportFile
);)
{
OutputStream
out
=
res
.
getOutputStream
();
...
...
src/main/resources/META-INF/resources/view-admin.jsp
View file @
0df6a964
...
...
@@ -38,6 +38,7 @@
<liferay-ui:error key="erroListagemNula" message="No existem matrias cadastradas para os parmetros utilizados." />
<aui:form id="<portlet:namespace />formDO" name="<portlet:namespace />formDO" method="POST" action="<%= submitActionURL%>" data-senna-off="true">
<div class="sheet sheet-lg" style="margin-top: 24px">
...
...
@@ -74,7 +75,7 @@
</div>
<aui:button-row>
<aui:button type="reset" id="limparFormDO" name="limparFormDO" value="Limpar" />
<aui:button type="submit" id="enviarFormDO" name="enviarFormDO" value="Gerar Caderno"
/>
<aui:button type="submit" id="enviarFormDO" name="enviarFormDO" value="Gerar Caderno"/>
<aui:button type="button" id="jobForm" name="jobForm" class="oculto" style="display: none" value="no aperte" />
</aui:button-row>
...
...
@@ -104,4 +105,12 @@
createDatesValidation();
}
});
$('button[type="submit"]').click(function(){
setTimeout(function(){
$('button[type="submit"]').removeAttr('disabled');
$('button[type="submit"]').css("opacity", "1");
}, 1000);
});
</script>
\ No newline at end of file
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