Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
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 46437a83
authored
Apr 06, 2012
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.insomnia.fi:/data/bortal
2 parents
67906a73
f2ae3181
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
226 additions
and
92 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ActionLogBean.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/ActionLogBeanLocal.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/GenericEntity.java
code/LanBortalWeb/WebContent/actionlog/messagelist.xhtml
code/LanBortalWeb/WebContent/actionlog/taskview.xhtml
code/LanBortalWeb/WebContent/layout/insomnia2/template.xhtml
code/LanBortalWeb/WebContent/resources/style/insomnia2/css/actionlog.css
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/TaskModificationView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/converter/ActionlogTaskTypeConverter.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ActionLogBean.java
View file @
46437a8
package
fi
.
insomnia
.
bortal
.
beans
;
import
java.util.Date
;
import
java.util.List
;
import
javax.annotation.security.RolesAllowed
;
import
javax.ejb.EJB
;
import
javax.ejb.Stateless
;
import
fi.insomnia.bortal.enums.ActionLogMessageState
;
import
fi.insomnia.bortal.enums.apps.UserPermission
;
import
fi.insomnia.bortal.facade.ActionLogFacade
;
import
fi.insomnia.bortal.model.ActionLogMessage
;
import
fi.insomnia.bortal.model.Role
;
/**
* Session Bean implementation class ActionLogBean
* eventin
* - luominen
* - editointi
* - deletointi
*/
@Stateless
public
class
ActionLogBean
implements
ActionLogBeanLocal
{
// TODO: Permissions
@EJB
private
ActionLogFacade
actionLogFacade
;
@EJB
private
RoleBeanLocal
roleBean
;
@EJB
private
PermissionBeanLocal
permissionBean
;
public
ActionLogBean
()
{
// TODO Auto-generated constructor stub
}
public
void
createActionLogEvent
(
String
message
,
Role
crew
,
boolean
isTask
)
{
ActionLogMessage
alm
=
new
ActionLogMessage
();
alm
.
setCrew
(
crew
);
if
(
isTask
)
{
alm
.
setState
(
ActionLogMessageState
.
PENDING
);
}
else
{
alm
.
setState
(
null
);
}
alm
.
setTime
(
new
Date
());
alm
.
setMessage
(
message
);
alm
.
setUser
(
permissionBean
.
getCurrentUser
());
actionLogFacade
.
saveToActionLog
(
alm
);
}
public
List
<
ActionLogMessage
>
getAllActionLogEvents
()
{
return
actionLogFacade
.
getAllSortedByTimestamp
();
}
public
List
<
Role
>
getAssignableRoles
()
{
return
roleBean
.
listRoles
();
}
}
package
fi
.
insomnia
.
bortal
.
beans
;
import
java.util.Date
;
import
java.util.List
;
import
javax.annotation.security.RolesAllowed
;
import
javax.ejb.EJB
;
import
javax.ejb.Stateless
;
import
fi.insomnia.bortal.enums.ActionLogMessageState
;
import
fi.insomnia.bortal.enums.apps.UserPermission
;
import
fi.insomnia.bortal.facade.ActionLogFacade
;
import
fi.insomnia.bortal.model.ActionLogMessage
;
import
fi.insomnia.bortal.model.Role
;
/**
* Session Bean implementation class ActionLogBean
* eventin
* - luominen
* - editointi
* - deletointi
*/
@Stateless
public
class
ActionLogBean
implements
ActionLogBeanLocal
{
// TODO: Permissions
@EJB
private
ActionLogFacade
actionLogFacade
;
@EJB
private
RoleBeanLocal
roleBean
;
@EJB
private
PermissionBeanLocal
permissionBean
;
public
ActionLogBean
()
{
// TODO Auto-generated constructor stub
}
public
void
createActionLogEvent
(
String
message
,
Role
crew
,
boolean
isTask
)
{
ActionLogMessage
alm
=
new
ActionLogMessage
();
alm
.
setCrew
(
crew
);
if
(
isTask
)
{
alm
.
setState
(
ActionLogMessageState
.
PENDING
);
}
else
{
alm
.
setState
(
null
);
}
alm
.
setTime
(
new
Date
());
alm
.
setMessage
(
message
);
alm
.
setUser
(
permissionBean
.
getCurrentUser
());
actionLogFacade
.
saveToActionLog
(
alm
);
}
public
List
<
ActionLogMessage
>
getAllActionLogEvents
()
{
return
actionLogFacade
.
getAllSortedByTimestamp
();
}
public
List
<
Role
>
getAssignableRoles
()
{
return
roleBean
.
listRoles
();
}
@Override
public
ActionLogMessage
find
(
Integer
id
)
{
return
actionLogFacade
.
find
(
id
);
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/ActionLogBeanLocal.java
View file @
46437a8
package
fi
.
insomnia
.
bortal
.
beans
;
import
java.util.List
;
import
javax.ejb.Local
;
import
fi.insomnia.bortal.model.ActionLogMessage
;
import
fi.insomnia.bortal.model.Role
;
@Local
public
interface
ActionLogBeanLocal
{
public
List
<
ActionLogMessage
>
getAllActionLogEvents
();
public
List
<
Role
>
getAssignableRoles
();
public
void
createActionLogEvent
(
String
message
,
Role
crew
,
boolean
isTask
);
}
package
fi
.
insomnia
.
bortal
.
beans
;
import
java.util.List
;
import
javax.ejb.Local
;
import
fi.insomnia.bortal.model.ActionLogMessage
;
import
fi.insomnia.bortal.model.Role
;
@Local
public
interface
ActionLogBeanLocal
{
public
List
<
ActionLogMessage
>
getAllActionLogEvents
();
public
List
<
Role
>
getAssignableRoles
();
public
void
createActionLogEvent
(
String
message
,
Role
crew
,
boolean
isTask
);
public
ActionLogMessage
find
(
Integer
id
);
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/GenericEntity.java
View file @
46437a8
...
...
@@ -19,7 +19,7 @@ public class GenericEntity extends EntityEquals implements ModelInterface<Intege
@Id
@Column
(
name
=
ID_COLUMN
,
nullable
=
false
)
@ReturnInsert
(
returnOnly
=
true
)
//
@ReturnInsert(returnOnly=true)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
...
...
code/LanBortalWeb/WebContent/actionlog/messagelist.xhtml
View file @
46437a8
...
...
@@ -3,9 +3,8 @@
"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"
>
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=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
...
...
@@ -13,7 +12,7 @@
<!-- f:event type="preRenderView" listener="#{newsListView.initView}" /-->
</f:metadata>
<ui:define
name=
"content"
>
<h:outputStylesheet
library=
"style"
name=
"insomnia2/css/actionlog.css"
></h:outputStylesheet
>
<h:outputStylesheet
library=
"style"
name=
"insomnia2/css/actionlog.css"
/
>
<h1>
#{i18n['actionlog.messagelist.header']}
</h1>
<p>
#{i18n['actionlog.messagelist.description']}
</p>
<h:form
id=
"actionlog_create"
>
...
...
@@ -40,12 +39,13 @@
<h:selectBooleanCheckbox
value=
"#{actionLogCreateView.task}"
/>
</div>
<h:commandButton
class=
"sendbutton"
action=
"#{actionLogCreateView.send}"
value=
"#{i18n['actionlog.create.submitbutton']}"
/>
<h:commandButton
class=
"sendbutton"
action=
"#{actionLogCreateView.send}"
value=
"#{i18n['actionlog.create.submitbutton']}"
>
</h:commandButton>
</div>
</h:form>
<div
class=
"clearfix"
></div>
<h2>
#{i18n['actionlog.tasklist.header']}
</h2>
<div
id=
"actionlog"
>
<div
id=
"actionlog"
>
<h:form
id=
"refresh"
>
<p:poll
interval=
"1"
update=
"actionlogtable"
/>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"actionlogtable"
value=
"#{actionLogMessageView.messages}"
var=
"message"
>
...
...
@@ -77,10 +77,12 @@
<h:outputText
value=
"#{message.message}"
/>
</h:column>
<h:column>
x
<h:link
rendered=
"#{!empty message.state}"
>
Näytä tehtävä
</h:link>
</h:column>
</h:dataTable>
</h:form>
</h:form>
</div>
</ui:define>
</ui:composition>
...
...
code/LanBortalWeb/WebContent/actionlog/taskview.xhtml
0 → 100644
View file @
46437a8
<!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:viewParam
name=
"id"
value=
"#{taskModificationView.id}"
></f:viewParam>
<f:event
type=
"preRenderView"
listener=
"#{taskModificationView.initView}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<h:outputStylesheet
library=
"style"
name=
"insomnia2/css/actionlog.css"
></h:outputStylesheet>
<h1>
Task: insert id
<!-- #{i18n['actionlog.messagelist.header']} -->
</h1>
<!-- <p>Mo #{i18n['actionlog.messagelist.description']} </p> -->
<table>
<tr>
<td><h:outputText
class=
"taskHeader"
value=
"Submit time/date: "
/></td>
<td><h:outputText
value=
"#{taskModification.message.time}"
/></td>
</tr>
<tr>
<td><h:outputText
class=
"taskHeader"
value=
"Submitter: "
/></td>
<td><h:outputText
value=
"infopoika69"
/></td>
</tr>
<tr>
<td><h:outputText
class=
"taskHeader"
value=
"Target crew: "
/></td>
<td><h:outputText
value=
"net"
/></td>
</tr>
<tr>
<td><h:outputText
class=
"taskHeader"
value=
"State: "
/></td>
<td><h:outputText
value=
"odottaa nappaamista"
/></td>
</tr>
<tr>
<td><h:outputText
class=
"taskHeader"
value=
"Message: "
/></td>
<td><h:outputText
value=
"verkko ei toimi."
/></td>
</tr>
</table>
<div
class=
"clearfix"
></div>
<div
id=
"actionlog"
>
</div>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/layout/insomnia2/template.xhtml
View file @
46437a8
...
...
@@ -43,11 +43,6 @@
</div>
<div
id=
"container"
class=
"top"
/>
<div
id=
"container"
class=
"clearfix"
>
<div
id=
"left"
>
<ui:insert
name=
"title"
/>
<h:messages
globalOnly=
"true"
/>
<ui:insert
name=
"content"
/>
</div>
<c:if
test=
"#{menuView.submenu.size() > 1}"
>
<div
id=
"right"
>
...
...
@@ -61,6 +56,12 @@
</ul>
</div>
</c:if>
<div
id=
"left"
>
<ui:insert
name=
"title"
/>
<h:messages
globalOnly=
"true"
/>
<ui:insert
name=
"content"
/>
</div>
</div>
<div
id=
"container"
class=
"bottom"
></div>
</div>
...
...
code/LanBortalWeb/WebContent/resources/style/insomnia2/css/actionlog.css
View file @
46437a8
...
...
@@ -77,4 +77,10 @@
#actionlog
tr
.rowodd
{
background-color
:
#9a9a9a
;
}
.taskHeader
{
color
:
#7DAC0C
;
font-size
:
120%
;
font-weight
:
bold
;
}
\ No newline at end of file
code/LanBortalWeb/WebContent/resources/style/insomnia2/css/tyyli.css
View file @
46437a8
...
...
@@ -14,11 +14,11 @@ body, html {width: 100%; height: 100%; color: #343434; font-family: trebuchet m
a
{
color
:
#0037bc
;}
a
:hover
{
color
:
#7dac0c
;}
#container
{
width
:
100%
;
background
:
url(../img/container.png)
repeat-y
;
font-size
:
13px
;}
#container
#left
{
width
:
680px
;
float
:
left
;
padding
:
10px
20px
;}
#container
#left
{
padding
:
10px
20px
;}
#left
h1
{
color
:
#7dac0c
;
font-size
:
24px
;
padding-top
:
0px
;
margin-top
:
0px
;}
#left
h2
{
color
:
#7dac0c
;
font-size
:
18px
;}
#left
h3
{
color
:
#7dac0c
;
font-size
:
16px
;}
#right
{
float
:
lef
t
;
border-left
:
1px
dotted
#c0c0c0
;
padding
:
10px
20px
;
width
:
200px
;}
#right
{
float
:
righ
t
;
border-left
:
1px
dotted
#c0c0c0
;
padding
:
10px
20px
;
width
:
200px
;}
#right
h1
,
#right
h1
a
{
color
:
#7dac0c
;
font-size
:
18px
;
padding-top
:
0px
;
margin-top
:
0px
;
text-decoration
:
none
;}
#container
.top
{
width
:
100%
;
background
:
url(../img/container-top.png)
no-repeat
;
height
:
15px
;}
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
View file @
46437a8
This diff is collapsed.
Click to expand it.
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/actionlog/TaskModificationView.java
0 → 100644
View file @
46437a8
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
actionlog
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.inject.Named
;
import
fi.insomnia.bortal.beans.ActionLogBeanLocal
;
import
fi.insomnia.bortal.model.ActionLogMessage
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
@Named
@ConversationScoped
public
class
TaskModificationView
extends
GenericCDIView
{
private
Integer
id
;
private
ActionLogMessage
message
;
@EJB
private
ActionLogBeanLocal
logbean
;
public
void
initView
(){
if
(
message
==
null
)
{
super
.
beginConversation
();
message
=
logbean
.
find
(
id
);
}
}
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/converter/ActionlogTaskTypeConverter.java
0 → 100644
View file @
46437a8
package
fi
.
insomnia
.
bortal
.
web
.
converter
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.component.UIComponent
;
import
javax.faces.context.FacesContext
;
import
javax.faces.convert.Converter
;
import
javax.inject.Named
;
@Named
(
"taskTypeConverter"
)
@RequestScoped
public
class
ActionlogTaskTypeConverter
implements
Converter
{
@Override
public
Object
getAsObject
(
FacesContext
context
,
UIComponent
component
,
String
value
)
{
// TODO Auto-generated method stub
return
null
;
}
@Override
public
String
getAsString
(
FacesContext
context
,
UIComponent
component
,
Object
value
)
{
if
(
value
==
null
)
{
return
""
;
}
else
{
return
"x"
;
}
}
}
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