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
eb365d2f
Commit
eb365d2f
authored
Oct 23, 2020
by
Diogo Fellipe De Melo Souza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Versão com o datePicker funcional
parent
935ffa87
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
53 additions
and
38 deletions
+53
-38
.gitignore
bin/main/.gitignore
+2
-0
admin.js
bin/main/META-INF/resources/js/admin/admin.js
+4
-17
view-admin.jsp
bin/main/META-INF/resources/view-admin.jsp
+16
-0
MprjDoerjCadernoPortlet.class
.../mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.class
+0
-0
RestServices.class
bin/main/mprj/doerj/caderno/rest/RestServices.class
+0
-0
CadernoUtil.class
bin/main/mprj/doerj/caderno/util/CadernoUtil.class
+0
-0
GeraCaderno.class
bin/main/mprj/doerj/caderno/util/GeraCaderno.class
+0
-0
build.gradle
build.gradle
+2
-1
MprjDoerjCadernoPortlet.java
...a/mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.java
+9
-3
admin.js
src/main/resources/META-INF/resources/js/admin/admin.js
+4
-17
view-admin.jsp
src/main/resources/META-INF/resources/view-admin.jsp
+16
-0
No files found.
bin/main/.gitignore
View file @
eb365d2f
/META-INF/
/content/
/mprj/
/mprj/
bin/main/META-INF/resources/js/admin/admin.js
View file @
eb365d2f
...
@@ -63,28 +63,15 @@ $(function () {
...
@@ -63,28 +63,15 @@ $(function () {
})
})
});
});
function
createDatesValidation
()
{
function
createDatesValidation
()
{
var
date
=
new
Date
();
var
date
=
new
Date
();
$
(
'#datepickeragendamento'
).
datepicker
({
$
(
'#datepickeragendamento'
).
datepicker
({
startDate
:
date
,
language
:
'pt-BR'
,
language
:
'pt-BR'
,
autoclose
:
1
,
autoclose
:
1
,
ignoreReadonly
:
true
,
ignoreReadonly
:
true
,
beforeShowDay
:
function
(
currentDate
)
{
if
(
dates
!=
null
&&
dates
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
dates
.
length
;
i
++
)
{
if
(
moment
(
currentDate
).
unix
()
==
moment
(
dates
[
i
],
'DD.MM.YYYY'
).
unix
()){
return
false
;
}
}
}
return
true
;
}
}).
on
(
'show'
,
function
()
{
var
$clazz
=
$
(
".datepicker-days"
).
children
().
find
(
"tfoot"
).
children
().
find
(
".today"
);
$clazz
.
show
();
$clazz
.
addClass
(
"label-calendar-agendamento"
);
$clazz
.
text
(
"* Já existe agendamento da publicação para esse dia ou o horário limite foi ultrapassado."
);
$clazz
.
removeClass
(
"today"
);
});
});
}
}
bin/main/META-INF/resources/view-admin.jsp
View file @
eb365d2f
...
@@ -89,4 +89,19 @@
...
@@ -89,4 +89,19 @@
<script type="text/javascript">
<script type="text/javascript">
var urlAjax = "<%=testAjaxResourceUrl%>";
var urlAjax = "<%=testAjaxResourceUrl%>";
var urlOculto = "<%=ocultoJob%>";
var urlOculto = "<%=ocultoJob%>";
$.ajax ({
url:urlAjax,
type: 'POST',
cache: false,
async: false,
dataType: "json",
success: function(response)
{
dates = response.result;
dates = dates.split(",");
createDatesValidation();
}
});
</script>
</script>
\ No newline at end of file
bin/main/mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.class
View file @
eb365d2f
No preview for this file type
bin/main/mprj/doerj/caderno/rest/RestServices.class
View file @
eb365d2f
No preview for this file type
bin/main/mprj/doerj/caderno/util/CadernoUtil.class
View file @
eb365d2f
No preview for this file type
bin/main/mprj/doerj/caderno/util/GeraCaderno.class
View file @
eb365d2f
No preview for this file type
build.gradle
View file @
eb365d2f
...
@@ -109,6 +109,6 @@ repositories {
...
@@ -109,6 +109,6 @@ repositories {
}
}
liferay
{
liferay
{
liferayHome
=
"C:/
Projetos/mprj/opt
/deploy"
liferayHome
=
"C:/
liferay-mprj-fixpack6
/deploy"
deployDir
=
file
(
"${liferayHome}/"
)
deployDir
=
file
(
"${liferayHome}/"
)
}
}
\ No newline at end of file
src/main/java/mprj/doerj/caderno/portlet/MprjDoerjCadernoPortlet.java
View file @
eb365d2f
...
@@ -25,6 +25,7 @@ import org.osgi.service.component.annotations.Component;
...
@@ -25,6 +25,7 @@ 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
;
/**
/**
...
@@ -38,6 +39,7 @@ import mprj.doerj.caderno.util.GeraCaderno;
...
@@ -38,6 +39,7 @@ import mprj.doerj.caderno.util.GeraCaderno;
"com.liferay.portlet.instanceable=false"
,
"com.liferay.portlet.instanceable=false"
,
"com.liferay.portlet.scopeable=true"
,
"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/main.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"
,
"com.liferay.portlet.header-portlet-css=/css/confirm/jquery-confirm.min.css"
,
"com.liferay.portlet.header-portlet-css=/css/confirm/jquery-confirm.min.css"
,
...
@@ -49,6 +51,7 @@ import mprj.doerj.caderno.util.GeraCaderno;
...
@@ -49,6 +51,7 @@ import mprj.doerj.caderno.util.GeraCaderno;
"com.liferay.portlet.header-portlet-javascript=/js/datepicker/bootstrap-datepicker.min.js"
,
"com.liferay.portlet.header-portlet-javascript=/js/datepicker/bootstrap-datepicker.min.js"
,
"com.liferay.portlet.header-portlet-javascript=/js/datepicker/bootstrap-datepicker.pt-BR.js"
,
"com.liferay.portlet.header-portlet-javascript=/js/datepicker/bootstrap-datepicker.pt-BR.js"
,
"com.liferay.portlet.header-portlet-javascript=/js/confirm/jquery-confirm.min.js"
,
"com.liferay.portlet.header-portlet-javascript=/js/confirm/jquery-confirm.min.js"
,
"com.liferay.portlet.header-portlet-javascript=/js/bootpag/jquery.bootpag.min.js"
,
"com.liferay.portlet.header-portlet-javascript=/js/main.js"
,
"com.liferay.portlet.header-portlet-javascript=/js/main.js"
,
"com.liferay.portlet.header-portlet-javascript=/js/admin/admin.js"
,
"com.liferay.portlet.header-portlet-javascript=/js/admin/admin.js"
,
"com.liferay.portlet.icon=/icon.png"
,
"com.liferay.portlet.icon=/icon.png"
,
...
@@ -59,8 +62,8 @@ import mprj.doerj.caderno.util.GeraCaderno;
...
@@ -59,8 +62,8 @@ import mprj.doerj.caderno.util.GeraCaderno;
"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=
doerj-caderno-dxp-7.2
"
,
"javax.portlet.display-name=Caderno do Di
á
rio Oficial"
,
"javax.portlet.display-name=Caderno do Dirio 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=/"
,
...
@@ -105,12 +108,15 @@ public class MprjDoerjCadernoPortlet extends MVCPortlet {
...
@@ -105,12 +108,15 @@ public class MprjDoerjCadernoPortlet extends MVCPortlet {
}
else
{
}
else
{
try
{
try
{
//
jsonResponse.put("result", CadernoUtil.getDatasCadastradas());
jsonResponse
.
put
(
"result"
,
CadernoUtil
.
getDatasCadastradas
());
}
catch
(
SystemException
e
)
{
}
catch
(
SystemException
e
)
{
logger
.
error
(
"Erro requisicao AJAX"
,
e
);
logger
.
error
(
"Erro requisicao AJAX"
,
e
);
//} catch (ParseException e) {
//} catch (ParseException e) {
//logger.error("Erro validar horários AJAX",e);
//logger.error("Erro validar horários AJAX",e);
}
catch
(
java
.
text
.
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
// Writing the result in resourceResponse writer.
// Writing the result in resourceResponse writer.
PrintWriter
writer
=
resourceResponse
.
getWriter
();
PrintWriter
writer
=
resourceResponse
.
getWriter
();
...
...
src/main/resources/META-INF/resources/js/admin/admin.js
View file @
eb365d2f
...
@@ -63,28 +63,15 @@ $(function () {
...
@@ -63,28 +63,15 @@ $(function () {
})
})
});
});
function
createDatesValidation
()
{
function
createDatesValidation
()
{
var
date
=
new
Date
();
var
date
=
new
Date
();
$
(
'#datepickeragendamento'
).
datepicker
({
$
(
'#datepickeragendamento'
).
datepicker
({
startDate
:
date
,
language
:
'pt-BR'
,
language
:
'pt-BR'
,
autoclose
:
1
,
autoclose
:
1
,
ignoreReadonly
:
true
,
ignoreReadonly
:
true
,
beforeShowDay
:
function
(
currentDate
)
{
if
(
dates
!=
null
&&
dates
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
dates
.
length
;
i
++
)
{
if
(
moment
(
currentDate
).
unix
()
==
moment
(
dates
[
i
],
'DD.MM.YYYY'
).
unix
()){
return
false
;
}
}
}
return
true
;
}
}).
on
(
'show'
,
function
()
{
var
$clazz
=
$
(
".datepicker-days"
).
children
().
find
(
"tfoot"
).
children
().
find
(
".today"
);
$clazz
.
show
();
$clazz
.
addClass
(
"label-calendar-agendamento"
);
$clazz
.
text
(
"* Já existe agendamento da publicação para esse dia ou o horário limite foi ultrapassado."
);
$clazz
.
removeClass
(
"today"
);
});
});
}
}
src/main/resources/META-INF/resources/view-admin.jsp
View file @
eb365d2f
...
@@ -89,4 +89,19 @@
...
@@ -89,4 +89,19 @@
<script type="text/javascript">
<script type="text/javascript">
var urlAjax = "<%=testAjaxResourceUrl%>";
var urlAjax = "<%=testAjaxResourceUrl%>";
var urlOculto = "<%=ocultoJob%>";
var urlOculto = "<%=ocultoJob%>";
$.ajax ({
url:urlAjax,
type: 'POST',
cache: false,
async: false,
dataType: "json",
success: function(response)
{
dates = response.result;
dates = dates.split(",");
createDatesValidation();
}
});
</script>
</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