Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
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 1b3330f4
authored
Feb 12, 2012
by
Antti Tonkyra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ActionMessage stuff
1 parent
a5075373
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
101 additions
and
73 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ActionLogBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/ActionLogFacade.java
code/LanBortalWeb/.metadata/WebContent/WEB-INF/faces-config.pageflow
code/LanBortalWeb/WebContent/WEB-INF/faces-config.xml
code/LanBortalWeb/WebContent/actionlog/create.xhtml
code/LanBortalWeb/WebContent/actionlog/messagelist.xhtml
code/LanBortalWeb/WebContent/resources/style/insomnia2/css/tyyli.css
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/actionlog/ActionLogCreateView.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ActionLogBean.java
View file @
1b3330f
...
...
@@ -49,7 +49,6 @@ public class ActionLogBean implements ActionLogBeanLocal {
alm
.
setMessage
(
message
);
alm
.
setUser
(
permissionBean
.
getCurrentUser
());
//System.out.println("would creates, crew="+crew.getName()+" u="+alm.getUser().getNick());
actionLogFacade
.
saveToActionLog
(
alm
);
}
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/ActionLogFacade.java
View file @
1b3330f
...
...
@@ -6,6 +6,7 @@ import javax.ejb.LocalBean;
import
javax.ejb.Stateless
;
import
javax.persistence.EntityManager
;
import
javax.persistence.PersistenceContext
;
import
javax.persistence.TypedQuery
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
...
...
@@ -13,6 +14,8 @@ import javax.persistence.criteria.Root;
import
fi.insomnia.bortal.model.AccountEvent
;
import
fi.insomnia.bortal.model.AccountEvent_
;
import
fi.insomnia.bortal.model.ActionLogMessage
;
import
fi.insomnia.bortal.model.Bill
;
import
fi.insomnia.bortal.model.Bill_
;
import
fi.insomnia.bortal.model.EventPk
;
import
fi.insomnia.bortal.model.LanEvent
;
import
fi.insomnia.bortal.model.LogEntry
;
...
...
@@ -38,11 +41,19 @@ public class ActionLogFacade extends GenericFacade<Integer,ActionLogMessage> {
}
public
List
<
ActionLogMessage
>
getAllSortedByTimestamp
()
{
// TODO Auto-generated method stub
return
null
;
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
ActionLogMessage
>
cq
=
cb
.
createQuery
(
ActionLogMessage
.
class
);
Root
<
ActionLogMessage
>
root
=
cq
.
from
(
ActionLogMessage
.
class
);
cq
.
orderBy
(
cb
.
desc
(
root
.
get
(
"time"
)));
TypedQuery
<
ActionLogMessage
>
tq
=
em
.
createQuery
(
cq
);
tq
.
setMaxResults
(
10
);
tq
.
setFirstResult
(
0
);
return
tq
.
getResultList
();
}
public
void
saveToActionLog
(
ActionLogMessage
alm
)
{
em
.
persist
(
alm
);
em
.
flush
();
}
}
code/LanBortalWeb/.metadata/WebContent/WEB-INF/faces-config.pageflow
View file @
1b3330f
...
...
@@ -4,7 +4,10 @@
<nodes
xsi:type=
"pageflow:PFPage"
name=
"auth/logoutResponse"
x=
"288"
y=
"60"
id=
"pf131682121330016"
referenceLink=
"//@navigationRule.0/@navigationCase.0/@toViewId|"
inlinks=
"pf131682121330015"
path=
"/auth/logoutResponse"
/>
<nodes
xsi:type=
"pageflow:PFPage"
name=
"place/placemap"
x=
"276"
y=
"228"
id=
"pf13168224196920"
referenceLink=
"//@navigationRule.1/@navigationCase.0/@toViewId|"
outlinks=
"pf13168224196921"
inlinks=
"pf13168224196921"
path=
"/place/placemap"
/>
<nodes
xsi:type=
"pageflow:PFPage"
name=
"user/sendPicture"
id=
"pf13196506256641"
referenceLink=
"//@navigationRule.0/@navigationCase.1/@toViewId|"
inlinks=
"pf13196506256640"
path=
"/user/sendPicture"
/>
<nodes
xsi:type=
"pageflow:PFPage"
name=
"actionlog/messagelist"
id=
"pf13290472154543"
referenceLink=
"//@navigationRule.2/@fromViewId|"
outlinks=
"pf13290472154544"
path=
"/actionlog/messagelist.xhtml"
/>
<nodes
xsi:type=
"pageflow:PFPage"
name=
"actionlog/messagelist.xhtml"
id=
"pf13290472154545"
referenceLink=
"//@navigationRule.2/@navigationCase.0/@toViewId|"
inlinks=
"pf13290472154544"
path=
"/actionlog/messagelist.xhtml"
/>
<links
id=
"pf131682121330015"
target=
"pf131682121330016"
source=
"pf131682121330014"
outcome=
"logoutDone"
redirect=
"true"
/>
<links
id=
"pf13168224196921"
target=
"pf13168224196920"
source=
"pf13168224196920"
outcome=
"placesReserved"
redirect=
"true"
/>
<links
id=
"pf13196506256640"
target=
"pf13196506256641"
source=
"pf131682121330014"
outcome=
"redirToUserimage"
redirect=
"true"
/>
<links
id=
"pf13290472154544"
target=
"pf13290472154545"
source=
"pf13290472154543"
outcome=
"success"
redirect=
"true"
/>
</pageflow:Pageflow>
code/LanBortalWeb/WebContent/WEB-INF/faces-config.xml
View file @
1b3330f
...
...
@@ -91,6 +91,15 @@
<redirect/>
</navigation-case>
</navigation-rule>
<navigation-rule>
<display-name>
actionlog/messagelist
</display-name>
<from-view-id>
/actionlog/messagelist.xhtml
</from-view-id>
<navigation-case>
<from-outcome>
success
</from-outcome>
<to-view-id>
/actionlog/messagelist.xhtml
</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
</faces-config>
...
...
code/LanBortalWeb/WebContent/actionlog/create.xhtml
deleted
100644 → 0
View file @
a507537
<!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"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<!-- f:event type="preRenderView" listener="#{newsListView.initView}" /-->
</f:metadata>
<ui:define
name=
"content"
>
<h:form>
<h:messages
/>
<h1>
#{i18n['actionlog.create.header']}
</h1>
<h:outputText
value=
"#{i18n['actionlog.create.role']}"
/>
<h:selectOneMenu
value=
"#{actionLogCreateView.role}"
converter=
"#{roleConverter}"
>
<f:selectItems
var=
"role"
itemLabel=
"#{role.name}"
value=
"#{actionLogCreateView.roles}"
/>
</h:selectOneMenu>
<h:outputText
value=
"#{i18n['actionlog.create.message']}"
/>
<h:inputText
value=
"#{actionLogCreateView.message}"
/>
<h:outputText
value=
"#{i18n['actionlog.create.taskradio']}"
/>
<h:selectBooleanCheckbox
value=
"#{actionLogCreateView.task}"
/>
<br
/>
<h:commandButton
action=
"#{actionLogCreateView.send}"
value=
"#{i18n['actionlog.create.submitbutton']}"
/>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/actionlog/messagelist.xhtml
View file @
1b3330f
...
...
@@ -5,39 +5,80 @@
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"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<!-- f:event type="preRenderView" listener="#{newsListView.initView}" /-->
</f:metadata>
<ui:define
name=
"content"
>
<h:outputStylesheet
library=
"style"
name=
"insomnia2/css/actionlog.css"
></h:outputStylesheet>
<h1>
#{i18n['actionlog.messagelist.header']}
</h1>
<h:dataTable
styleClass=
"bordertable"
id=
"message"
value=
"#{actionLogMessageView.messages}"
var=
"message"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.time']}"
/>
</f:facet>
<h:outputText
value=
"#{message.time}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.user']}"
/>
</f:facet>
<h:outputText
value=
"#{message.user.nick}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.crew']}"
/>
</f:facet>
<h:outputText
value=
"#{message.crew}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.message']}"
/>
</f:facet>
<h:outputText
value=
"#{message.message}"
/>
</h:column>
</h:dataTable>
<p>
#{i18n['actionlog.messagelist.description']}
</p>
<h:form
id=
"actionlog_create"
>
<h2>
#{i18n['actionlog.create.header']}
</h2>
<h:messages
/>
<div
class=
"row"
>
<h3
class=
"actionlog_create_role"
>
#{i18n['actionlog.create.role']}
</h3>
<h3
class=
"actionlog_create_message"
>
#{i18n['actionlog.create.message']}
</h3>
<h3
class=
"actionlog_create_istask"
>
#{i18n['actionlog.create.taskradio']}
</h3>
</div>
<div
class=
"row"
>
<div
class=
"actionlog_create_role"
>
<h:selectOneMenu
value=
"#{actionLogCreateView.role}"
converter=
"#{roleConverter}"
>
<f:selectItems
var=
"role"
itemLabel=
"#{role.name}"
value=
"#{actionLogCreateView.roles}"
/>
</h:selectOneMenu>
</div>
<div
class=
"actionlog_create_message"
>
<h:inputText
value=
"#{actionLogCreateView.message}"
/>
</div>
<div
class=
"actionlog_create_istask"
>
<h:selectBooleanCheckbox
value=
"#{actionLogCreateView.task}"
/>
</div>
<h:commandButton
class=
"sendbutton"
action=
"#{actionLogCreateView.send}"
value=
"#{i18n['actionlog.create.submitbutton']}"
/>
</div>
</h:form>
<div
class=
"clearfix"
></div>
<h2>
#{i18n['actionlog.tasklist.header']}
</h2>
<div
id=
"actionlog"
>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"actionlogtable"
value=
"#{actionLogMessageView.messages}"
var=
"message"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.time']}"
/>
</f:facet>
<h:outputText
value=
"#{message.time}"
>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
<!-- <f:convertDateTime type="both" dateStyle="HH:mm" /> -->
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.user']}"
/>
</f:facet>
<h:outputText
value=
"#{message.user.nick}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.crew']}"
/>
</f:facet>
<h:outputText
value=
"#{message.crew.name}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['actionlog.message']}"
/>
</f:facet>
<h:outputText
value=
"#{message.message}"
/>
</h:column>
<h:column>
x
</h:column>
</h:dataTable>
</div>
</ui:define>
</ui:composition>
</h:body>
...
...
code/LanBortalWeb/WebContent/resources/style/insomnia2/css/tyyli.css
View file @
1b3330f
...
...
@@ -24,4 +24,4 @@ a:hover {color: #7dac0c;}
#container
.top
{
width
:
100%
;
background
:
url(../img/container-top.png)
no-repeat
;
height
:
15px
;}
#container
.bottom
{
width
:
100%
;
background
:
url(../img/container-bottom.png)
no-repeat
;
height
:
16px
;}
.clearfix
:after
{
content
:
"."
;
display
:
block
;
clear
:
both
;
visibility
:
hidden
;
line-height
:
0
;
height
:
0
;}
\ No newline at end of file
.clearfix
:after
{
content
:
"."
;
display
:
block
;
clear
:
both
;
visibility
:
hidden
;
line-height
:
0
;
height
:
0
;}
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
View file @
1b3330f
...
...
@@ -377,14 +377,15 @@ news.save=Tallenna
usertitle.managingUser
=
Hallitaan kyttj
actionlog.messagelist.header
=
Viestilista
actionlog.messagelist.header
=
ActionLog
actionlog.messagelist.description
=
Voit seurata sek luoda uusia ActionMessageja tss nkymss.
actionlog.tasklist.header
=
Task
ilista
actionlog.tasklist.header
=
Viest
ilista
actionlog.create.header
=
Luo
eventti
actionlog.create.role
=
R
ooli
actionlog.create.header
=
Luo
uusi ActionMessage
actionlog.create.role
=
Kohder
ooli
actionlog.create.message
=
Viesti
actionlog.create.taskradio
=
T
m on taski
actionlog.create.taskradio
=
T
ehtv
actionlog.create.submitbutton
=
Lhet
actionlog.time
=
Aika
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/actionlog/ActionLogCreateView.java
View file @
1b3330f
...
...
@@ -56,7 +56,8 @@ public class ActionLogCreateView extends GenericCDIView {
this
.
task
=
task
;
}
public
void
send
()
{
public
String
send
()
{
actionLogBean
.
createActionLogEvent
(
message
,
role
,
task
);
return
"success"
;
}
}
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