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
c1ed1712
Commit
c1ed1712
authored
Oct 22, 2020
by
Bruno Bertasso Araújo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configuração para Painel de Controle / Ajustes de layout
parent
db926089
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
293 additions
and
223 deletions
+293
-223
view.jsp
bin/main/META-INF/resources/view.jsp
+51
-87
Language.properties
bin/main/content/Language.properties
+1
-1
MprjDoerjCadernoPortlet.class
.../mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.class
+0
-0
build.gradle
build.gradle
+4
-1
mprj.doerj.caderno.jar
...RJ/DXP7.2/implementacao/opt/deploy/mprj.doerj.caderno.jar
+0
-0
MprjDoerjCadernoPanelApp.java
...rj/caderno/application/list/MprjDoerjCadernoPanelApp.java
+40
-0
MprjDoerjCadernoWebPanelCategoryKeys.java
...derno/constants/MprjDoerjCadernoWebPanelCategoryKeys.java
+11
-0
MprjDoerjCadernoPortlet.java
...a/mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.java
+41
-46
view-admin.jsp
src/main/resources/META-INF/resources/view-admin.jsp
+93
-0
view.jsp
src/main/resources/META-INF/resources/view.jsp
+51
-87
Language.properties
src/main/resources/content/Language.properties
+1
-1
No files found.
bin/main/META-INF/resources/view.jsp
View file @
c1ed1712
<%@ include file="/init.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://liferay.com/tld/clay" prefix="clay" %>
<%@ page import="com.liferay.portal.kernel.util.ParamUtil" %>
<%@ page import="com.liferay.frontend.taglib.clay.servlet.taglib.util.JSPNavigationItemList" %>
<%@ page import="com.liferay.portal.kernel.language.LanguageUtil" %>
<%@ page import="javax.portlet.PortletPreferences" %>
<%@ page import="javax.portlet.ActionRequest" %>
<%@ page import="javax.portlet.PortletURL" %>
<%@ page import="com.liferay.portal.kernel.util.HtmlUtil" %>
<%@ page import="com.liferay.portal.kernel.util.GetterUtil"%>
<%@ page import="com.liferay.portal.kernel.util.Validator" %>
<%@ page import="com.liferay.portal.kernel.dao.search.RowChecker" %>
<%@ page import="com.liferay.portal.kernel.search.Document" %>
<%@ page import="com.liferay.portal.kernel.dao.orm.QueryUtil" %>
<%@ page import="com.liferay.portal.kernel.search.Hits" %>
<%@ page import="com.liferay.portal.kernel.util.UnicodeFormatter" %>
<%@ page import="com.liferay.portal.kernel.util.PrefsParamUtil" %>
<%@ page import="com.liferay.portal.kernel.util.Constants" %>
<%@ page import="com.liferay.portal.kernel.portlet.LiferayWindowState" %>
<liferay-theme:defineObjects />
<portlet:defineObjects />
<%
<%
boolean errArquivo = false;
final String navigation = ParamUtil.getString(request, "navigation", "gerar");
boolean errVazio = false;
%>
boolean errDataNula = false;
boolean errHorarioLimite = false;
String cssErro = "control-group error";
if(request.getAttribute("erroArquivo") != null){
<clay:navigation-bar
errArquivo = (Boolean) request.getAttribute("erroArquivo");
inverted="<%= true %>"
}
navigationItems='<%=
if(request.getAttribute("erroVazio") != null){
new JSPNavigationItemList(pageContext) {
errVazio = (Boolean) request.getAttribute("erroVazio");
{
add(
navigationItem -> {
navigationItem.setActive(navigation.equals("gerar"));
navigationItem.setHref(renderResponse.createRenderURL());
navigationItem.setLabel(LanguageUtil.get(request, "Gerar Caderno"));
});
}
}
if(request.getAttribute("erroDataNula") != null){
errDataNula = (Boolean) request.getAttribute("erroDataNula");
}
}
if(request.getAttribute("erroHorarioLimite") != null){
%>'
errHorarioLimite = (Boolean) request.getAttribute("erroHorarioLimite");
/>
}
%>
<c:choose>
<c:when test='<%= navigation.equals("gerar") %>'>
<%@ include file="/view-admin.jsp" %>
<liferay-theme:defineObjects />
</c:when>
<portlet:defineObjects />
<c:otherwise>
<liferay-ui:error key="erroListagemNula" message="No existem matrias cadastradas para os parmetros utilizados." />
<%@ include file="/view-admin.jsp" %>
<h3><liferay-ui:message key="admin.form.agendamento.titulo"/></h3>
</c:otherwise>
<hr />
</c:choose>
<div class="texto-obs"><liferay-ui:message key="admin.form.agendamento.observacao"/></div>
<portlet:renderURL var="viewUrl">
<portlet:param name="jspPath" value="/view.jsp"/>
</portlet:renderURL>
<portlet:actionURL var="submitActionURL">
<portlet:param name="<%=ActionRequest.ACTION_NAME%>" value="geraCaderno" />
<portlet:param name="mvcPath" value="/view.jsp"/>
</portlet:actionURL>
<form id="<portlet:namespace />formDO" name="<portlet:namespace />formDO" method="POST" action="<%= submitActionURL%>" data-senna-off="true">
<div id="campo-situacao" class="campo">
<label><liferay-ui:message key="admin.form.editar.situacao"/></label>
<select class="selectpicker" name="<portlet:namespace/>situacao" id="<portlet:namespace/>situacao" >
<option value="4">Validada</option>
<option value="6">Aprovada</option>
<option value="8">Divulgada</option>
</select>
<liferay-ui:error key="erroTipoMat" message="Uma Situao deve ser selecionada." />
</div>
<div class='campo <%=errDataNula || errHorarioLimite ? cssErro : "" %>' >
<label><liferay-ui:message key="admin.form.agendamento.data.divulgacao"/></label>
<div class="form-group">
<div class='input-group date' id='datepickeragendamento'>
<input class="form-control" name="<portlet:namespace/>dataP" id="<portlet:namespace/>dataP" onpaste="return false;" ondrop="return false;"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<liferay-ui:error key="erroDataNula" message="Uma data deve ser selecionada." />
</div>
<button type="submit" id="enviarFormDO" name="enviarFormDO" class="btn btn-primary">Gerar Caderno</button>
<button type="reset" id="limparFormDO" name="limparFormDO" class="btn btn-cancel">Limpar</button>
<button type="button" id="jobForm" name="jobForm" class="oculto" style="display: none">no aperte</button>
</form>
<portlet:resourceURL var="ocultoJob"><portlet:param name="parameter" value="jobOculto" /></portlet:resourceURL>
<portlet:resourceURL var="testAjaxResourceUrl"></portlet:resourceURL>
<script type="text/javascript">
var urlAjax = "<%=testAjaxResourceUrl%>";
var urlOculto = "<%=ocultoJob%>";
</script>
\ No newline at end of file
bin/main/content/Language.properties
View file @
c1ed1712
javax.portlet.title.mprj_doerj_caderno_MprjDoerjCadernoPortlet
=
MprjDoerjCaderno
javax.portlet.title.mprj_doerj_caderno_MprjDoerjCadernoPortlet
=
Caderno do Diário Oficial
mprjdoerjcaderno.caption
=
Hello from MprjDoerjCaderno!
mprjdoerjcaderno.caption
=
Hello from MprjDoerjCaderno!
#ADMINISTRACAO
#ADMINISTRACAO
...
...
bin/main/mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.class
View file @
c1ed1712
No preview for this file type
build.gradle
View file @
c1ed1712
...
@@ -13,6 +13,8 @@ buildscript {
...
@@ -13,6 +13,8 @@ buildscript {
apply
plugin:
"com.liferay.plugin"
apply
plugin:
"com.liferay.plugin"
dependencies
{
dependencies
{
compileOnly
group:
'com.liferay'
,
name:
'com.liferay.application.list.api'
,
version:
'5.0.3'
compileOnly
group:
'com.liferay'
,
name:
'com.liferay.frontend.taglib.clay'
,
version:
'2.2.19'
compileOnly
group:
'com.liferay'
,
name:
'com.liferay.asset.taglib'
,
version:
'4.0.15'
compileOnly
group:
'com.liferay'
,
name:
'com.liferay.asset.taglib'
,
version:
'4.0.15'
compileOnly
group:
'com.liferay'
,
name:
'com.liferay.comment.taglib'
,
version:
'2.0.7'
compileOnly
group:
'com.liferay'
,
name:
'com.liferay.comment.taglib'
,
version:
'2.0.7'
compileOnly
group:
'com.liferay'
,
name:
'com.liferay.frontend.taglib'
,
version:
'4.0.15'
compileOnly
group:
'com.liferay'
,
name:
'com.liferay.frontend.taglib'
,
version:
'4.0.15'
...
@@ -105,6 +107,6 @@ repositories {
...
@@ -105,6 +107,6 @@ repositories {
}
}
liferay
{
liferay
{
liferayHome
=
"
/home/henrique/projetos/MPRJ/DXP7.2/implementacao
/opt/deploy"
liferayHome
=
"
C:/Projetos/mprj
/opt/deploy"
deployDir
=
file
(
"${liferayHome}/"
)
deployDir
=
file
(
"${liferayHome}/"
)
}
}
\ No newline at end of file
home/henrique/projetos/MPRJ/DXP7.2/implementacao/opt/deploy/mprj.doerj.caderno.jar
0 → 100644
View file @
c1ed1712
File added
src/main/java/mprj/doerj/caderno/application/list/MprjDoerjCadernoPanelApp.java
0 → 100644
View file @
c1ed1712
package
mprj
.
doerj
.
caderno
.
application
.
list
;
import
com.liferay.application.list.BasePanelApp
;
import
com.liferay.application.list.PanelApp
;
import
com.liferay.portal.kernel.model.Portlet
;
import
org.osgi.service.component.annotations.Component
;
import
org.osgi.service.component.annotations.Reference
;
import
mprj.doerj.caderno.constants.MprjDoerjCadernoPortletKeys
;
import
mprj.doerj.caderno.constants.MprjDoerjCadernoWebPanelCategoryKeys
;
/**
* @author Bertasso
*/
@Component
(
immediate
=
true
,
property
=
{
"panel.app.order:Integer=40"
,
"panel.category.key="
+
MprjDoerjCadernoWebPanelCategoryKeys
.
CONTROL_PANEL_CATEGORY
},
service
=
PanelApp
.
class
)
public
class
MprjDoerjCadernoPanelApp
extends
BasePanelApp
{
@Override
public
String
getPortletId
()
{
return
MprjDoerjCadernoPortletKeys
.
MPRJDOERJCADERNO
;
}
@Override
@Reference
(
target
=
"(javax.portlet.name="
+
MprjDoerjCadernoPortletKeys
.
MPRJDOERJCADERNO
+
")"
,
unbind
=
"-"
)
public
void
setPortlet
(
Portlet
portlet
)
{
super
.
setPortlet
(
portlet
);
}
}
src/main/java/mprj/doerj/caderno/constants/MprjDoerjCadernoWebPanelCategoryKeys.java
0 → 100644
View file @
c1ed1712
package
mprj
.
doerj
.
caderno
.
constants
;
/**
* @author everton
*/
public
class
MprjDoerjCadernoWebPanelCategoryKeys
{
public
static
final
String
CONTROL_PANEL_CATEGORY
=
"MPRJ"
;
}
\ No newline at end of file
src/main/java/mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.java
View file @
c1ed1712
...
@@ -6,11 +6,8 @@ import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;
...
@@ -6,11 +6,8 @@ import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;
import
com.liferay.portal.kernel.search.ParseException
;
import
com.liferay.portal.kernel.search.ParseException
;
import
com.liferay.portal.kernel.servlet.SessionErrors
;
import
com.liferay.portal.kernel.servlet.SessionErrors
;
import
com.liferay.portal.kernel.servlet.SessionMessages
;
import
com.liferay.portal.kernel.servlet.SessionMessages
;
import
com.liferay.portal.kernel.theme.ThemeDisplay
;
import
com.liferay.portal.kernel.upload.UploadPortletRequest
;
import
com.liferay.portal.kernel.util.ParamUtil
;
import
com.liferay.portal.kernel.util.ParamUtil
;
import
com.liferay.portal.kernel.util.PortalUtil
;
import
com.liferay.portal.kernel.util.PortalUtil
;
import
com.liferay.portal.kernel.util.WebKeys
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
...
@@ -19,9 +16,8 @@ import javax.portlet.ActionRequest;
...
@@ -19,9 +16,8 @@ import javax.portlet.ActionRequest;
import
javax.portlet.ActionResponse
;
import
javax.portlet.ActionResponse
;
import
javax.portlet.Portlet
;
import
javax.portlet.Portlet
;
import
javax.portlet.PortletException
;
import
javax.portlet.PortletException
;
import
javax.portlet.PortletURL
;
import
javax.portlet.ResourceRequest
;
import
javax.portlet.RenderRequest
;
import
javax.portlet.ResourceResponse
;
import
javax.portlet.RenderResponse
;
import
org.apache.log4j.Logger
;
import
org.apache.log4j.Logger
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
...
@@ -29,16 +25,18 @@ import org.osgi.service.component.annotations.Component;
...
@@ -29,16 +25,18 @@ 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.GeraCaderno
;
import
mprj.doerj.caderno.util.GeraCaderno
;
/**
/**
* @author diogo.souza
* @author diogo.souza
*/
*/
@Component
(
immediate
=
true
,
@Component
(
configurationPid
=
"mprj.doerj.caderno.configuration.DoerjCadernoPortletConfiguration"
,
immediate
=
true
,
property
=
{
"com.liferay.portlet.display-category=category.sample"
,
configurationPid
=
"mprj.doerj.caderno.configuration.DoerjCadernoPortletConfiguration"
,
"com.liferay.portlet.instanceable=false"
,
"com.liferay.portlet.scopeable=true"
,
property
=
{
"com.liferay.portlet.display-category=category.hidden"
,
"com.liferay.portlet.instanceable=false"
,
"com.liferay.portlet.scopeable=true"
,
"com.liferay.portlet.header-portlet-css=/css/admin/admin.css"
,
"com.liferay.portlet.header-portlet-css=/css/admin/admin.css"
,
"com.liferay.portlet.header-portlet-css=/css/datepicker/bootstrap.min.css"
,
"com.liferay.portlet.header-portlet-css=/css/datepicker/bootstrap.min.css"
,
"com.liferay.portlet.header-portlet-css=/css/datepicker/bootstrap-datepicker3.standalone.min.css"
,
"com.liferay.portlet.header-portlet-css=/css/datepicker/bootstrap-datepicker3.standalone.min.css"
,
...
@@ -57,74 +55,71 @@ property = { "com.liferay.portlet.display-category=category.sample",
...
@@ -57,74 +55,71 @@ property = { "com.liferay.portlet.display-category=category.sample",
"com.liferay.portlet.requires-namespaced-parameters=false"
,
"com.liferay.portlet.requires-namespaced-parameters=false"
,
"com.liferay.portlet.ajaxable=true"
,
"com.liferay.portlet.ajaxable=true"
,
"com.liferay.portlet.control-panel-entry-category=MPRJ"
,
"com.liferay.portlet.control-panel-entry-category=MPRJ"
,
"com.liferay.portlet.control-panel-entry-weight=39
"
,
"com.liferay.portlet.control-panel-entry-weight=40
"
,
"com.liferay.portlet.preferences-unique-per-layout=false"
,
"com.liferay.portlet.preferences-unique-per-layout=false"
,
"com.liferay.portlet.preferences-owned-by-group=true"
,
"com.liferay.portlet.preferences-owned-by-group=true"
,
"com.liferay.portlet.add-default-resource=true"
,
"com.liferay.portlet.add-default-resource=true"
,
"com.liferay.portlet.css-class-wrapper=mprj-doerj-materia-web"
,
"com.liferay.portlet.css-class-wrapper=mprj-doerj-materia-web"
,
"javax.portlet.display-name=
Gest�o de Mat�rias do Di�
rio Oficial"
,
"javax.portlet.display-name=
Caderno do Diá
rio Oficial"
,
"javax.portlet.expiration-cache=0"
,
"javax.portlet.expiration-cache=0"
,
"javax.portlet.init-param.portlet-title-based-navigation=true"
,
"javax.portlet.init-param.portlet-title-based-navigation=true"
,
"javax.portlet.init-param.template-path=/"
,
"javax.portlet.init-param.template-path=/"
,
"javax.portlet.info.title=Caderno do Diário Oficial"
,
"com.liferay.portlet.instanceable=true"
,
"javax.portlet.info.short-title=Caderno do Diário Oficial"
,
"javax.portlet.display-name=MprjDoerjCaderno
"
,
"javax.portlet.info.keywords=Caderno do Diário Oficial
"
,
"javax.portlet.init-param.template-path=/"
,
"javax.portlet.init-param.template-path=/"
,
"javax.portlet.init-param.view-template=/view.jsp"
,
"javax.portlet.init-param.view-template=/view.jsp"
,
"javax.portlet.init-param.config-template=/configuration.jsp"
,
"javax.portlet.init-param.config-template=/configuration.jsp"
,
"javax.portlet.name="
+
MprjDoerjCadernoPortletKeys
.
MPRJDOERJCADERNO
,
"javax.portlet.name="
+
MprjDoerjCadernoPortletKeys
.
MPRJDOERJCADERNO
,
"javax.portlet.resource-bundle=content.Language"
,
"javax.portlet.resource-bundle=content.Language"
,
"javax.portlet.mime-type=text/html"
,
"javax.portlet.mime-type=text/html"
,
"javax.portlet.security-role-ref=power-user,user"
},
service
=
Portlet
.
class
)
"javax.portlet.security-role-ref=administrator"
,
"javax.portlet.security-role-ref=guest"
,
"javax.portlet.security-role-ref=power-user"
,
"javax.portlet.security-role-ref=user"
},
service
=
Portlet
.
class
)
public
class
MprjDoerjCadernoPortlet
extends
MVCPortlet
{
public
class
MprjDoerjCadernoPortlet
extends
MVCPortlet
{
final
static
Logger
logger
=
Logger
.
getLogger
(
MprjDoerjCadernoPortlet
.
class
);
final
static
Logger
logger
=
Logger
.
getLogger
(
MprjDoerjCadernoPortlet
.
class
);
@Override
public
void
serveResource
(
ResourceRequest
resourceRequest
,
public
void
render
(
RenderRequest
renderRequest
,
RenderResponse
renderResponse
)
ResourceResponse
resourceResponse
)
throws
IOException
,
throws
IOException
,
PortletException
{
PortletException
{
// ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
// ThemeDisplay themeDisplay = (ThemeDisplay)
// UploadPortletRequest uploadRequest=PortalUtil.getUploadPortletRequest(resourceRequest);
// resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
// String valor = ParamUtil.getString(resourceRequest, "parameter");
// UploadPortletRequest
String
cmd
=
ParamUtil
.
getString
(
resourceRequest
,
"caderno"
);
// uploadRequest=PortalUtil.getUploadPortletRequest(resourceRequest);
// String dataDivulgacao = ParamUtil.getString(uploadRequest, "dataP");
// String valor = ParamUtil.getString(resourceRequest, "parameter");
// String situacao = ParamUtil.getString(uploadRequest, "situacao");
String
cmd
=
ParamUtil
.
getString
(
renderRequest
,
"caderno"
);
// String dataDivulgacao = ParamUtil.getString(uploadRequest, "dataP");
// String situacao = ParamUtil.getString(uploadRequest, "situacao");
com
.
liferay
.
portal
.
kernel
.
json
.
JSONObject
jsonResponse
=
JSONFactoryUtil
.
createJSONObject
();
com
.
liferay
.
portal
.
kernel
.
json
.
JSONObject
jsonResponse
=
JSONFactoryUtil
.
createJSONObject
();
if
(
cmd
.
equals
(
"geraCaderno"
))
{
if
(
cmd
.
equals
(
"geraCaderno"
))
{
try
{
try
{
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
else
{
}
else
{
try
{
try
{
jsonResponse
.
put
(
"result"
,
CadernoUtil
.
getDatasCadastradas
());
//
jsonResponse.put("result", CadernoUtil.getDatasCadastradas());
}
catch
(
SystemException
e
)
{
}
catch
(
SystemException
e
)
{
// TODO Auto-generated catch block
logger
.
error
(
"Erro requisicao AJAX"
,
e
);
logger
.
error
(
"Erro requisicao AJAX"
,
e
);
//} catch (ParseException e) {
}
catch
(
java
.
text
.
ParseException
e
)
{
//logger.error("Erro validar horários AJAX",e);
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
// Writing the result in resourceResponse writer.
// Writing the result in resourceResponse writer.
PrintWriter
writer
=
render
Response
.
getWriter
();
PrintWriter
writer
=
resource
Response
.
getWriter
();
writer
.
println
(
jsonResponse
);
writer
.
println
(
jsonResponse
);
// Creating a JSON object which will contain the sum.
// Creating a JSON object which will contain the sum.
}
}
//PortletURL renderUrl = resourceResponse.createRenderURL();
PortletURL
renderUrl
=
renderResponse
.
createRenderURL
();
resourceResponse
.
addProperty
(
"Location"
,
resourceResponse
.
createRenderURL
().
toString
());
renderResponse
.
addProperty
(
"Location"
,
renderResponse
.
createRenderURL
().
toString
());
return
;
super
.
render
(
renderRequest
,
renderResponse
);
// super.doView(renderRequest, renderResponse);
}
}
public
void
geraCaderno
(
ActionRequest
actionRequest
,
ActionResponse
actionResponse
)
throws
Exception
{
public
void
geraCaderno
(
ActionRequest
actionRequest
,
ActionResponse
actionResponse
)
throws
Exception
{
...
@@ -144,7 +139,7 @@ public class MprjDoerjCadernoPortlet extends MVCPortlet {
...
@@ -144,7 +139,7 @@ public class MprjDoerjCadernoPortlet extends MVCPortlet {
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);
}
}
...
...
src/main/resources/META-INF/resources/view-admin.jsp
0 → 100644
View file @
c1ed1712
<%@ include file="/init.jsp" %>
<%
boolean errArquivo = false;
boolean errVazio = false;
boolean errDataNula = false;
boolean errHorarioLimite = false;
String cssErro = "control-group error";
if(request.getAttribute("erroArquivo") != null){
errArquivo = (Boolean) request.getAttribute("erroArquivo");
}
if(request.getAttribute("erroVazio") != null){
errVazio = (Boolean) request.getAttribute("erroVazio");
}
if(request.getAttribute("erroDataNula") != null){
errDataNula = (Boolean) request.getAttribute("erroDataNula");
}
if(request.getAttribute("erroHorarioLimite") != null){
errHorarioLimite = (Boolean) request.getAttribute("erroHorarioLimite");
}
%>
<liferay-theme:defineObjects />
<portlet:defineObjects />
<liferay-portlet:actionURL var="submitActionURL">
<liferay-portlet:param name="<%=ActionRequest.ACTION_NAME%>" value='geraCaderno' />
<liferay-portlet:param name="navigation" value="gerar"/>
<liferay-portlet:param name="mvcPath" value="/view.jsp"/>
</liferay-portlet:actionURL>
<portlet:renderURL var="viewUrl">
<portlet:param name="navigation" value="gerar"/>
<portlet:param name="mvcPath" value="/view.jsp"/>
<portlet:param name="jspPath" value="/view.jsp"/>
</portlet:renderURL>
<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">
<liferay-ui:header title="Gerar Caderno"/>
<div style="font-size: 12px; line-height: 12px; color: #A3AFBF; margin-bottom: 15px; margin-top: -10px;"><liferay-ui:message key="*campos obrigatrios"/></div>
<div id="campo-situacao" class="campo">
<label><liferay-ui:message key="admin.form.editar.situacao"/></label>
<div class="form-group">
<div style="width: 31%;">
<aui:select name="situacao" id="situacao" label="">
<aui:option value="4">Validada</aui:option>
<aui:option value="6">Aprovada</aui:option>
<aui:option value="8">Divulgada</aui:option>
</aui:select>
</div>
</div>
<liferay-ui:error key="erroTipoMat" message="Uma Situao deve ser selecionada." />
</div>
<div class='campo <%=errDataNula || errHorarioLimite ? cssErro : "" %>' >
<label><liferay-ui:message key="admin.form.agendamento.data.divulgacao"/></label>
<div class="form-group">
<div class='input-group date' id='datepickeragendamento' style="width: 31%;">
<input class="form-control" name="<portlet:namespace/>dataP" id="<portlet:namespace/>dataP" onpaste="return false;" ondrop="return false;"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<liferay-ui:error key="erroDataNula" message="Uma data deve ser selecionada." />
</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="button" id="jobForm" name="jobForm" class="oculto" style="display: none" value="no aperte" />
</aui:button-row>
</div>
</aui:form>
<portlet:resourceURL var="ocultoJob"><portlet:param name="parameter" value="jobOculto" /></portlet:resourceURL>
<portlet:resourceURL var="testAjaxResourceUrl"></portlet:resourceURL>
<script type="text/javascript">
var urlAjax = "<%=testAjaxResourceUrl%>";
var urlOculto = "<%=ocultoJob%>";
</script>
\ No newline at end of file
src/main/resources/META-INF/resources/view.jsp
View file @
c1ed1712
<%@ include file="/init.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://liferay.com/tld/clay" prefix="clay" %>
<%@ page import="com.liferay.portal.kernel.util.ParamUtil" %>
<%@ page import="com.liferay.frontend.taglib.clay.servlet.taglib.util.JSPNavigationItemList" %>
<%@ page import="com.liferay.portal.kernel.language.LanguageUtil" %>
<%@ page import="javax.portlet.PortletPreferences" %>
<%@ page import="javax.portlet.ActionRequest" %>
<%@ page import="javax.portlet.PortletURL" %>
<%@ page import="com.liferay.portal.kernel.util.HtmlUtil" %>
<%@ page import="com.liferay.portal.kernel.util.GetterUtil"%>
<%@ page import="com.liferay.portal.kernel.util.Validator" %>
<%@ page import="com.liferay.portal.kernel.dao.search.RowChecker" %>
<%@ page import="com.liferay.portal.kernel.search.Document" %>
<%@ page import="com.liferay.portal.kernel.dao.orm.QueryUtil" %>
<%@ page import="com.liferay.portal.kernel.search.Hits" %>
<%@ page import="com.liferay.portal.kernel.util.UnicodeFormatter" %>
<%@ page import="com.liferay.portal.kernel.util.PrefsParamUtil" %>
<%@ page import="com.liferay.portal.kernel.util.Constants" %>
<%@ page import="com.liferay.portal.kernel.portlet.LiferayWindowState" %>
<liferay-theme:defineObjects />
<portlet:defineObjects />
<%
<%
boolean errArquivo = false;
final String navigation = ParamUtil.getString(request, "navigation", "gerar");
boolean errVazio = false;
%>
boolean errDataNula = false;
boolean errHorarioLimite = false;
String cssErro = "control-group error";
if(request.getAttribute("erroArquivo") != null){
<clay:navigation-bar
errArquivo = (Boolean) request.getAttribute("erroArquivo");
inverted="<%= true %>"
}
navigationItems='<%=
if(request.getAttribute("erroVazio") != null){
new JSPNavigationItemList(pageContext) {
errVazio = (Boolean) request.getAttribute("erroVazio");
{
add(
navigationItem -> {
navigationItem.setActive(navigation.equals("gerar"));
navigationItem.setHref(renderResponse.createRenderURL());
navigationItem.setLabel(LanguageUtil.get(request, "Gerar Caderno"));
});
}
}
if(request.getAttribute("erroDataNula") != null){
errDataNula = (Boolean) request.getAttribute("erroDataNula");
}
}
if(request.getAttribute("erroHorarioLimite") != null){
%>'
errHorarioLimite = (Boolean) request.getAttribute("erroHorarioLimite");
/>
}
%>
<c:choose>
<c:when test='<%= navigation.equals("gerar") %>'>
<%@ include file="/view-admin.jsp" %>
<liferay-theme:defineObjects />
</c:when>
<portlet:defineObjects />
<c:otherwise>
<liferay-ui:error key="erroListagemNula" message="No existem matrias cadastradas para os parmetros utilizados." />
<%@ include file="/view-admin.jsp" %>
<h3><liferay-ui:message key="admin.form.agendamento.titulo"/></h3>
</c:otherwise>
<hr />
</c:choose>
<div class="texto-obs"><liferay-ui:message key="admin.form.agendamento.observacao"/></div>
<portlet:renderURL var="viewUrl">
<portlet:param name="jspPath" value="/view.jsp"/>
</portlet:renderURL>
<portlet:actionURL var="submitActionURL">
<portlet:param name="<%=ActionRequest.ACTION_NAME%>" value="geraCaderno" />
<portlet:param name="mvcPath" value="/view.jsp"/>
</portlet:actionURL>
<form id="<portlet:namespace />formDO" name="<portlet:namespace />formDO" method="POST" action="<%= submitActionURL%>" data-senna-off="true">
<div id="campo-situacao" class="campo">
<label><liferay-ui:message key="admin.form.editar.situacao"/></label>
<select class="selectpicker" name="<portlet:namespace/>situacao" id="<portlet:namespace/>situacao" >
<option value="4">Validada</option>
<option value="6">Aprovada</option>
<option value="8">Divulgada</option>
</select>
<liferay-ui:error key="erroTipoMat" message="Uma Situao deve ser selecionada." />
</div>
<div class='campo <%=errDataNula || errHorarioLimite ? cssErro : "" %>' >
<label><liferay-ui:message key="admin.form.agendamento.data.divulgacao"/></label>
<div class="form-group">
<div class='input-group date' id='datepickeragendamento'>
<input class="form-control" name="<portlet:namespace/>dataP" id="<portlet:namespace/>dataP" onpaste="return false;" ondrop="return false;"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<liferay-ui:error key="erroDataNula" message="Uma data deve ser selecionada." />
</div>
<button type="submit" id="enviarFormDO" name="enviarFormDO" class="btn btn-primary">Gerar Caderno</button>
<button type="reset" id="limparFormDO" name="limparFormDO" class="btn btn-cancel">Limpar</button>
<button type="button" id="jobForm" name="jobForm" class="oculto" style="display: none">no aperte</button>
</form>
<portlet:resourceURL var="ocultoJob"><portlet:param name="parameter" value="jobOculto" /></portlet:resourceURL>
<portlet:resourceURL var="testAjaxResourceUrl"></portlet:resourceURL>
<script type="text/javascript">
var urlAjax = "<%=testAjaxResourceUrl%>";
var urlOculto = "<%=ocultoJob%>";
</script>
\ No newline at end of file
src/main/resources/content/Language.properties
View file @
c1ed1712
javax.portlet.title.mprj_doerj_caderno_MprjDoerjCadernoPortlet
=
MprjDoerjCaderno
javax.portlet.title.mprj_doerj_caderno_MprjDoerjCadernoPortlet
=
Caderno do Diário Oficial
mprjdoerjcaderno.caption
=
Hello from MprjDoerjCaderno!
mprjdoerjcaderno.caption
=
Hello from MprjDoerjCaderno!
#ADMINISTRACAO
#ADMINISTRACAO
...
...
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