Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 939b39af
authored
Feb 09, 2014
by
Antti Tönkyrä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tagging UI / ActionLog tweaks
1 parent
0e48a8ea
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
27 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/ActionLogBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/ActionLogFacade.java
code/MoyaWeb/WebContent/actionlog/index.xhtml
code/MoyaWeb/WebContent/resources/templates/insomnia2/css/actionlog.css
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/actionlog/ActionLogMessageView.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/ActionLogBean.java
View file @
939b39a
...
...
@@ -79,6 +79,9 @@ public class ActionLogBean implements ActionLogBeanLocal {
@Override
@RolesAllowed
(
ContentPermission
.
S_MANAGE_ACTIONLOG
)
public
List
<
ActionLogMessage
>
getAllActionLogEventsByFilter
(
List
<
ActionLogMessageTag
>
filterTags
)
{
if
(
filterTags
.
size
()
==
0
)
return
actionLogFacade
.
getAllSortedByTimestamp
(
permissionBean
.
getCurrentUser
().
getEvent
());
else
return
actionLogFacade
.
getAllSortedByTimestampFiltered
(
permissionBean
.
getCurrentUser
().
getEvent
(),
filterTags
);
}
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/ActionLogFacade.java
View file @
939b39a
...
...
@@ -26,7 +26,7 @@ public class ActionLogFacade extends IntegerPkGenericFacade<ActionLogMessage> {
super
(
ActionLogMessage
.
class
);
}
@Deprecated
public
List
<
ActionLogMessage
>
getAllSortedByTimestamp
(
LanEvent
event
)
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
ActionLogMessage
>
cq
=
cb
.
createQuery
(
ActionLogMessage
.
class
);
...
...
code/MoyaWeb/WebContent/actionlog/index.xhtml
View file @
939b39a
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
<h:body>
<ui:composition
template=
"#{sessionHandler.template}"
>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{actionLogMessageView.initView}"
/>
<f:event
type=
"preRenderView"
listener=
"#{actionLogMessageView.initView}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<h:outputStylesheet
library=
"style"
name=
"templates/insomnia2/css/actionlog.css"
/>
<h:outputStylesheet
library=
"style"
name=
"templates/insomnia2/css/actionlog.css"
/>
<h1>
#{i18n['actionlog.messagelist.header']}
</h1>
<p>
#{i18n['actionlog.messagelist.description']}
</p>
<h:form
id=
"actionlog
_create
"
>
<h:form
id=
"actionlog"
>
<h2>
#{i18n['actionlog.create.header']}
</h2>
<p:messages
/>
<h:panelGrid
columns=
"2"
>
...
...
@@ -22,37 +29,48 @@
<h:outputText
value=
"#{i18n['actionlog.create.taskradio']}"
/>
<h:outputText
/>
<p:inputText
value=
"#{actionLogCreateView.message}"
/>
<p:inputText
value=
"#{actionLogCreateView.message}"
style=
"width: 400px;"
/>
<p:selectBooleanCheckbox
value=
"#{actionLogCreateView.task}"
/>
<h:commandButton
class=
"sendbutton"
action=
"#{actionLogCreateView.send}"
value=
"#{i18n['actionlog.create.submitbutton']}"
/>
<h:commandButton
class=
"sendbutton"
action=
"#{actionLogCreateView.send}"
value=
"#{i18n['actionlog.create.submitbutton']}"
update=
"@form"
/>
</h:panelGrid>
<h:panelGrid
columns=
"1"
>
<p:tagCloud
model=
"#{actionLogMessageView.tagCloud}"
>
<p:ajax
event=
"select"
listener=
"#{actionLogMessageView.onTagSelect}"
update=
"@form"
/>
<p:ajax
event=
"select"
listener=
"#{actionLogMessageView.onTagSelect}"
update=
"@form,actionlogtable"
/>
</p:tagCloud>
<h:panelGroup
layout=
"block"
>
<ui:repeat
id=
"selectedtags"
var=
"tag"
value=
"#{actionLogMessageView.activeTags}"
>
<span
style=
"border: 1px solid #0af; display: inline-block; padding: 2px"
>
#{tag.tag}
</span>
<!-- <span style="border: 1px solid #0af; display: inline-block; padding: 2px">#{tag.tag}</span> -->
<p:commandButton
actionListener=
"#{actionLogMessageView.selectFilterTag(tag.tag)}"
value=
"#{tag.tag}"
immediate=
"true"
update=
"@form"
/>
</ui:repeat>
</h:panelGroup>
</h:panelGrid>
</h:panelGrid>
</h:form
>
<!-- </h:form>--
>
<div
class=
"clearfix"
></div>
<h2>
#{i18n['actionlog.tasklist.header']}
</h2>
<div
id=
"actionlog"
>
<h:form
id=
"refresh"
>
<p:poll
interval=
"10"
update=
"actionlogtable"
onerror=
"location.reload();"
/>
<p:dataTable
styleClass=
"bordertable"
rowStyleClass=
"#{message.state.name}"
id=
"actionlogtable"
value=
"#{actionLogMessageView.messages}"
var=
"message"
paginator=
"true"
rows=
"30"
paginatorTemplate=
"{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate=
"30,50,100"
>
<!-- <h:form id="refresh"> -->
<p:poll
interval=
"10"
update=
"actionlogtable"
onerror=
"location.reload();"
/>
<p:dataTable
styleClass=
"bordertable"
rowStyleClass=
"#{message.state.name}"
id=
"actionlogtable"
value=
"#{actionLogMessageView.messages}"
var=
"message"
paginator=
"true"
rows=
"30"
paginatorTemplate=
"{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate=
"30,50,100"
>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.time']}"
/>
</f:facet>
<h:outputText
value=
"#{message.time}"
>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</p:column>
<p:column>
...
...
@@ -82,8 +100,8 @@
</h:link>
</p:column>
</p:dataTable>
</h:form>
</div>
</h:form>
</ui:define>
</ui:composition>
</h:body>
...
...
code/MoyaWeb/WebContent/resources/templates/insomnia2/css/actionlog.css
View file @
939b39a
@CHARSET
"utf-8"
;
/*
#actionlog_create .row {
display: block;
clear: both;
...
...
@@ -88,4 +88,4 @@
.sendbutton2 {
border: 1px solid #aaa;
margin-left: 10px;
}
\ No newline at end of file
}*/
\ No newline at end of file
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/actionlog/ActionLogMessageView.java
View file @
939b39a
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
actionlog
;
import
java.awt.event.ActionEvent
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -37,18 +38,21 @@ public class ActionLogMessageView extends GenericCDIView {
if
(
super
.
requirePermissions
(
ContentPermission
.
MANAGE_ACTIONLOG
))
{
this
.
beginConversation
();
if
(
tagCloud
==
null
||
activeTags
==
null
)
{
tagCloud
=
new
DefaultTagCloudModel
();
for
(
ActionLogMessageTag
almt
:
actionLogBean
.
getAllTags
())
{
tagCloud
.
addTag
(
new
DefaultTagCloudItem
(
almt
.
getTag
(),
1
));
}
refreshTagCloud
();
if
(
activeTags
==
null
)
{
activeTags
=
new
ArrayList
<>();
}
}
}
public
void
refreshTagCloud
()
{
tagCloud
=
new
DefaultTagCloudModel
();
for
(
ActionLogMessageTag
almt
:
actionLogBean
.
getAllTags
())
{
tagCloud
.
addTag
(
new
DefaultTagCloudItem
(
almt
.
getTag
(),
1
));
}
}
public
boolean
getUpdateEnabled
()
{
return
updateEnabled
;
...
...
@@ -67,7 +71,6 @@ public class ActionLogMessageView extends GenericCDIView {
}
public
void
onTagSelect
(
SelectEvent
event
)
{
System
.
err
.
println
(
"T+"
+
activeTags
.
size
());
TagCloudItem
item
=
(
TagCloudItem
)
event
.
getObject
();
ActionLogMessageTag
almt
=
actionLogBean
.
getActionLogMessageTagByString
(
item
.
getLabel
());
...
...
@@ -75,6 +78,16 @@ public class ActionLogMessageView extends GenericCDIView {
activeTags
.
add
(
almt
);
}
public
void
selectFilterTag
(
String
tag
)
{
for
(
ActionLogMessageTag
almt
:
this
.
activeTags
)
{
if
(
tag
.
equals
(
almt
.
getTag
()))
{
this
.
activeTags
.
remove
(
almt
);
break
;
}
}
}
public
List
<
ActionLogMessageTag
>
getActiveTags
()
{
return
this
.
activeTags
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment