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 cd258e9b
authored
May 09, 2010
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ok, now it works, you can test it now. If it does not work, its your fault
1 parent
d0093a9b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
5 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PlaceBean.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/PlaceBeanLocal.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Place.java
code/LanBortalWeb/src/fi/insomnia/bortal/view/MapView.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PlaceBean.java
0 → 100644
View file @
cd258e9
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package
fi
.
insomnia
.
bortal
.
beans
;
import
fi.insomnia.bortal.facade.PlaceFacade
;
import
fi.insomnia.bortal.model.Place
;
import
javax.ejb.EJB
;
import
javax.ejb.Stateless
;
/**
*
* @author tuukka
*/
@Stateless
public
class
PlaceBean
implements
PlaceBeanLocal
{
@EJB
private
PlaceFacade
placeFacade
;
public
void
mergeChanges
(
Place
place
)
{
placeFacade
.
merge
(
place
);
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/PlaceBeanLocal.java
0 → 100644
View file @
cd258e9
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package
fi
.
insomnia
.
bortal
.
beans
;
import
fi.insomnia.bortal.model.Place
;
import
javax.ejb.Local
;
/**
*
* @author tuukka
*/
@Local
public
interface
PlaceBeanLocal
{
public
void
mergeChanges
(
Place
place
);
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Place.java
View file @
cd258e9
...
...
@@ -334,7 +334,7 @@ public class Place implements EventChildInterface {
g
.
fill
(
new
Rectangle
(
mapX
,
mapY
,
width
,
height
));
}
p
rivate
boolean
isReserved
()
{
p
ublic
boolean
isReserved
()
{
...
...
@@ -355,7 +355,7 @@ public class Place implements EventChildInterface {
}
public
static
final
long
RESERVE_TIME
=
1000
*
60
*
20
;
// 20min.
p
rivate
void
setReserved
(
boolean
reserved
)
{
p
ublic
void
setReserved
(
boolean
reserved
)
{
if
(
reserved
)
{
releaseTime
=
Calendar
.
getInstance
();
releaseTime
.
setTimeInMillis
(
System
.
currentTimeMillis
()+
RESERVE_TIME
);
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/view/MapView.java
View file @
cd258e9
...
...
@@ -4,6 +4,7 @@
*/
package
fi
.
insomnia
.
bortal
.
view
;
import
fi.insomnia.bortal.beans.PlaceBeanLocal
;
import
fi.insomnia.bortal.beans.PlaceMapBeanLocal
;
import
fi.insomnia.bortal.handler.SessionHandler
;
import
fi.insomnia.bortal.model.EventMap
;
...
...
@@ -30,10 +31,13 @@ import org.slf4j.LoggerFactory;
public
class
MapView
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
MapView
.
class
);
@EJB
private
PlaceMapBeanLocal
placeMapBean
;
@EJB
private
PlaceBeanLocal
placeBean
;
@ManagedProperty
(
"#{sessionHandler}"
)
private
SessionHandler
sessionHandler
;
...
...
@@ -57,12 +61,14 @@ public class MapView {
if
(
place
!=
null
)
{
if
(
selectedPlaces
.
contains
(
place
))
{
selectedPlaces
.
remove
(
place
);
place
.
setReserved
(
false
);
placeBean
.
mergeChanges
(
place
);
}
else
{
selectedPlaces
.
add
(
place
);
place
.
setReserved
(
true
);
placeBean
.
mergeChanges
(
place
);
}
}
}
public
String
getSelectPlaceMapUrl
()
{
...
...
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