Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
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 4c198e8b
authored
Apr 07, 2012
by
Antti Tonkyra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ActionLogStuff
1 parent
12b9a122
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
11 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ActionLogBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/ActionLogFacade.java
code/LanBortalWeb/WebContent/actionlog/taskview.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/actionlog/TaskModificationView.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ActionLogBean.java
View file @
4c198e8
...
...
@@ -42,7 +42,7 @@ public class ActionLogBean implements ActionLogBeanLocal {
ActionLogMessage
alm
=
new
ActionLogMessage
();
alm
.
setCrew
(
crew
);
if
(
isTask
)
{
alm
.
setState
(
ActionLogMessageState
.
PENDING
);
alm
.
setState
(
ActionLogMessageState
.
NEW
);
}
else
{
alm
.
setState
(
null
);
}
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/ActionLogFacade.java
View file @
4c198e8
...
...
@@ -15,6 +15,7 @@ import fi.insomnia.bortal.model.AccountEvent;
import
fi.insomnia.bortal.model.AccountEvent_
;
import
fi.insomnia.bortal.model.ActionLogMessage
;
import
fi.insomnia.bortal.model.ActionLogMessageResponse
;
import
fi.insomnia.bortal.model.ActionLogMessageResponse_
;
import
fi.insomnia.bortal.model.Bill
;
import
fi.insomnia.bortal.model.Bill_
;
import
fi.insomnia.bortal.model.EventPk
;
...
...
@@ -63,7 +64,9 @@ public class ActionLogFacade extends GenericFacade<Integer,ActionLogMessage> {
CriteriaQuery
<
ActionLogMessageResponse
>
cq
=
cb
.
createQuery
(
ActionLogMessageResponse
.
class
);
Root
<
ActionLogMessageResponse
>
root
=
cq
.
from
(
ActionLogMessageResponse
.
class
);
cq
.
orderBy
(
cb
.
desc
(
root
.
get
(
"time"
)));
// TODO TUNK FIX LOL
cq
.
where
(
cb
.
equal
(
root
.
get
(
ActionLogMessageResponse_
.
actionLogMessage
),
this
.
find
(
id
)));
cq
.
orderBy
(
cb
.
asc
(
root
.
get
(
"time"
)));
TypedQuery
<
ActionLogMessageResponse
>
tq
=
em
.
createQuery
(
cq
);
return
tq
.
getResultList
();
...
...
code/LanBortalWeb/WebContent/actionlog/taskview.xhtml
View file @
4c198e8
...
...
@@ -4,6 +4,7 @@
<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>
...
...
@@ -46,7 +47,9 @@
<hr
style=
"width:90%;"
/>
<div>
<h:dataTable
value=
"#{taskModificationView.responses}"
var=
"response"
>
<h:form>
<p:poll
interval=
"1"
update=
"messageresponsetable"
/>
<h:dataTable
id=
"messageresponsetable"
value=
"#{taskModificationView.responses}"
var=
"response"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Aika"
/>
...
...
@@ -69,11 +72,11 @@
<f:facet
name=
"header"
>
<h:outputText
value=
"tilanvaihdos"
/>
</f:facet>
<h:outputText
value=
"#{response.state
c
hange}"
/>
<h:outputText
value=
"#{response.state
C
hange}"
/>
</h:column>
</h:dataTable>
</h:form>
</div>
<div>
...
...
@@ -82,7 +85,7 @@
<h:outputText
value=
"Viestisi: "
/>
<h:inputText
value=
"#{taskModificationView.responseMessage}"
size=
"100"
/>
<h:outputText
value=
"Tila: "
/>
<h:selectOneMenu
id=
"stateMenu"
title=
"asdas"
value=
"#{taskModificationView.
message.stat
e}"
>
<h:selectOneMenu
id=
"stateMenu"
title=
"asdas"
value=
"#{taskModificationView.
responseStateChang
e}"
>
<f:selectItem
itemLabel=
"Ei muutosta"
itemValue=
"#{null}"
/>
<f:selectItem
itemLabel=
"Uusi"
itemValue=
"NEW"
/>
<f:selectItem
itemLabel=
"Työn alla"
itemValue=
"PENDING"
/>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/actionlog/TaskModificationView.java
View file @
4c198e8
...
...
@@ -9,6 +9,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
fi.insomnia.bortal.beans.ActionLogBeanLocal
;
import
fi.insomnia.bortal.enums.ActionLogMessageState
;
import
fi.insomnia.bortal.model.ActionLogMessage
;
import
fi.insomnia.bortal.model.ActionLogMessageResponse
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
...
...
@@ -20,25 +21,32 @@ public class TaskModificationView extends GenericCDIView {
private
ActionLogMessage
message
;
private
List
<
ActionLogMessageResponse
>
responses
;
private
String
responseMessage
;
private
ActionLogMessageState
responseStateChange
;
@EJB
private
ActionLogBeanLocal
logbean
;
public
void
initView
(){
super
.
beginConversation
();
if
(
message
==
null
)
{
super
.
beginConversation
();
message
=
logbean
.
find
(
id
);
}
if
(
responses
==
null
)
{
responses
=
logbean
.
getActionLogMessageResponsesByID
(
id
);
}
}
public
void
createResponse
()
{
if
(
responseStateChange
==
null
)
logbean
.
addActionLogMessageResponse
(
id
,
responseMessage
,
message
.
getState
());
else
{
logbean
.
addActionLogMessageResponse
(
id
,
responseMessage
,
responseStateChange
);
if
(
responseStateChange
!=
message
.
getState
())
{
this
.
message
=
logbean
.
find
(
id
);
}
}
responseMessage
=
""
;
responseStateChange
=
null
;
}
public
List
<
ActionLogMessageResponse
>
getResponses
()
{
responses
=
logbean
.
getActionLogMessageResponsesByID
(
id
);
return
responses
;
}
...
...
@@ -62,4 +70,12 @@ public class TaskModificationView extends GenericCDIView {
this
.
responseMessage
=
responseMessage
;
}
private
ActionLogMessageState
getResponseStateChange
()
{
return
responseStateChange
;
}
private
void
setResponseStateChange
(
ActionLogMessageState
responseStateChange
)
{
this
.
responseStateChange
=
responseStateChange
;
}
}
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