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 7c2f4e43
authored
Apr 08, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Korjattu vanhoja funktioita. Rewrite rfid-asialle.
1 parent
50a80b4f
Hide whitespace changes
Inline
Side-by-side
Showing
77 changed files
with
1032 additions
and
1173 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/EventBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/EventOrganiserBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/EventStatusBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/Menubean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ReaderBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/RfidContainerBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/EventStatusFacade.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/ReaderEventFacade.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/ReaderFacade.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/EventOrganiserBeanLocal.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/EventStatusBeanLocal.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/ReaderBeanLocal.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/RfidContainerBeanLocal.java
code/LanBortalDatabase/diagrams/LanBortalDatabase.xml
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Certificate.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventStatus.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/LanEvent.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/PrintedCard.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Reader.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/ReaderEvent.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/salespoint/SalesEntity.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/salespoint/SalesEntityType.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/salespoint/SalesEntity_.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/salespoint/Salespoint.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/salespoint/Salespoint_.java
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/EventStatusEnum.java → code/LanBortalUtilities/src/fi/insomnia/bortal/enums/EventStatus.java
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/OldRolePermission.java
code/LanBortalWeb/WebContent/account/edit.xhtml
code/LanBortalWeb/WebContent/auth/login.xhtml
code/LanBortalWeb/WebContent/auth/loginError.xhtml
code/LanBortalWeb/WebContent/auth/loginSuccessRedirect.xhtml
code/LanBortalWeb/WebContent/auth/logout.xhtml
code/LanBortalWeb/WebContent/auth/notauthorized.xhtml
code/LanBortalWeb/WebContent/auth/passwordChanged.xhtml
code/LanBortalWeb/WebContent/auth/resetPassword.xhtml
code/LanBortalWeb/WebContent/auth/resetmailSent.xhtml
code/LanBortalWeb/WebContent/auth/sendResetMail.xhtml
code/LanBortalWeb/WebContent/bill/billSummary.xhtml
code/LanBortalWeb/WebContent/bill/edit.xhtml
code/LanBortalWeb/WebContent/bill/list.xhtml
code/LanBortalWeb/WebContent/bill/listAll.xhtml
code/LanBortalWeb/WebContent/bill/placemap.xhtml
code/LanBortalWeb/WebContent/event/editMap.xhtml
code/LanBortalWeb/WebContent/event/editPlace.xhtml
code/LanBortalWeb/WebContent/event/listMaps.xhtml
code/LanBortalWeb/WebContent/eventorg/create.xhtml
code/LanBortalWeb/WebContent/eventorg/edit.xhtml
code/LanBortalWeb/WebContent/eventorg/editEvent.xhtml
code/LanBortalWeb/WebContent/eventorg/list.xhtml
code/LanBortalWeb/WebContent/map/create.xhtml
code/LanBortalWeb/WebContent/pages/editNews.xhtml
code/LanBortalWeb/WebContent/pages/list.xhtml
code/LanBortalWeb/WebContent/resources/cditools/news/edit.xhtml → code/LanBortalWeb/WebContent/resources/cditools/pages/edit.xhtml
code/LanBortalWeb/WebContent/resources/cditools/shop/readerevents.xhtml
code/LanBortalWeb/WebContent/resources/cditools/shop/readerlist.xhtml
code/LanBortalWeb/WebContent/resources/oldtools/shop/readerlist.xhtml
code/LanBortalWeb/WebContent/shop/assocToUser.xhtml
code/LanBortalWeb/WebContent/shop/listReaders.xhtml
code/LanBortalWeb/WebContent/shop/rfidListener.xhtml
code/LanBortalWeb/WebContent/shop/showReaderEvents.xhtml
code/LanBortalWeb/WebContent/user/acceptInvite.xhtml
code/LanBortalWeb/WebContent/rfid/assocToUser.xhtml → code/LanBortalWeb/WebContent/user/assocToUser.xhtml
code/LanBortalWeb/WebContent/user/edit.xhtml
code/LanBortalWeb/WebContent/user/editcreate.xhtml
code/LanBortalWeb/oldview/view/BillView.java
code/LanBortalWeb/oldview/view/ReaderView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/map/MapManageView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/menu/MenuView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/organisation/EventOrgView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/BillListView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ReaderListDataView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ReaderNameContainer.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ReaderView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/RfidContainer.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/RfidView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/converter/GenericIntegerEntityConverter.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/helpers/RfidEvent.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/EventBean.java
View file @
7c2f4e4
...
@@ -32,8 +32,6 @@ public class EventBean implements EventBeanLocal {
...
@@ -32,8 +32,6 @@ public class EventBean implements EventBeanLocal {
@EJB
@EJB
private
EventOrganiserFacade
eventOrganiserFacade
;
private
EventOrganiserFacade
eventOrganiserFacade
;
@EJB
private
EventStatusBeanLocal
eventStatusBean
;
@PersistenceContext
@PersistenceContext
private
EntityManager
em
;
private
EntityManager
em
;
@EJB
@EJB
...
@@ -59,7 +57,6 @@ public class EventBean implements EventBeanLocal {
...
@@ -59,7 +57,6 @@ public class EventBean implements EventBeanLocal {
ret
.
setName
(
DEFAULT_EVENT_NAME
);
ret
.
setName
(
DEFAULT_EVENT_NAME
);
ret
.
setOrganiser
(
findOrCreateDefaultEventOrganisation
());
ret
.
setOrganiser
(
findOrCreateDefaultEventOrganisation
());
ret
.
setStatus
(
eventStatusBean
.
findOrCreateDefaultEventStatus
());
eventFacade
.
create
(
ret
);
eventFacade
.
create
(
ret
);
em
.
flush
();
em
.
flush
();
}
}
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/EventOrganiserBean.java
View file @
7c2f4e4
...
@@ -7,14 +7,17 @@ import javax.annotation.security.RolesAllowed;
...
@@ -7,14 +7,17 @@ import javax.annotation.security.RolesAllowed;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.ejb.Stateless
;
import
javax.ejb.Stateless
;
import
fi.insomnia.bortal.enums.apps.SpecialPermission
;
import
fi.insomnia.bortal.facade.EventFacade
;
import
fi.insomnia.bortal.facade.EventOrganiserFacade
;
import
fi.insomnia.bortal.facade.EventOrganiserFacade
;
import
fi.insomnia.bortal.model.EventOrganiser
;
import
fi.insomnia.bortal.model.EventOrganiser
;
import
fi.insomnia.bortal.model.LanEvent
;
/**
/**
* Session Bean implementation class EventOrganiserBean
* Session Bean implementation class EventOrganiserBean
*/
*/
@Stateless
@Stateless
@DeclareRoles
({
"SUPERADMIN"
})
@DeclareRoles
({
SpecialPermission
.
S_SUPERADMIN
})
public
class
EventOrganiserBean
implements
EventOrganiserBeanLocal
{
public
class
EventOrganiserBean
implements
EventOrganiserBeanLocal
{
@EJB
@EJB
...
@@ -24,6 +27,8 @@ public class EventOrganiserBean implements EventOrganiserBeanLocal {
...
@@ -24,6 +27,8 @@ public class EventOrganiserBean implements EventOrganiserBeanLocal {
private
LoggingBeanLocal
loggingbean
;
private
LoggingBeanLocal
loggingbean
;
@EJB
@EJB
private
PermissionBeanLocal
permbean
;
private
PermissionBeanLocal
permbean
;
@EJB
private
EventFacade
eventfacade
;
/**
/**
* Default constructor.
* Default constructor.
...
@@ -58,4 +63,9 @@ public class EventOrganiserBean implements EventOrganiserBeanLocal {
...
@@ -58,4 +63,9 @@ public class EventOrganiserBean implements EventOrganiserBeanLocal {
public
EventOrganiser
find
(
Integer
orgId
)
{
public
EventOrganiser
find
(
Integer
orgId
)
{
return
eventorgfacade
.
find
(
orgId
);
return
eventorgfacade
.
find
(
orgId
);
}
}
@Override
public
LanEvent
findEvent
(
Integer
eventid
)
{
return
eventfacade
.
find
(
eventid
);
}
}
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/EventStatusBean.java
deleted
100644 → 0
View file @
50a80b4
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package
fi
.
insomnia
.
bortal
.
beans
;
import
javax.ejb.EJB
;
import
javax.ejb.Stateless
;
import
fi.insomnia.bortal.enums.EventStatusEnum
;
import
fi.insomnia.bortal.facade.EventStatusFacade
;
import
fi.insomnia.bortal.model.EventStatus
;
/**
*
* @author tuukka
*/
@Stateless
public
class
EventStatusBean
implements
EventStatusBeanLocal
{
@EJB
private
EventStatusFacade
eventStatusFacade
;
public
EventStatus
findEventStatus
(
EventStatusEnum
eventStatusEnum
)
{
EventStatus
status
=
eventStatusFacade
.
findEventStatus
(
eventStatusEnum
);
if
(
status
==
null
)
{
status
=
new
EventStatus
(
eventStatusEnum
);
eventStatusFacade
.
create
(
status
);
}
return
status
;
}
@Override
public
EventStatus
findOrCreateDefaultEventStatus
()
{
return
findEventStatus
(
EventStatusEnum
.
getDefaultEventStatusEnum
());
}
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/Menubean.java
View file @
7c2f4e4
...
@@ -48,7 +48,6 @@ public class Menubean implements MenubeanLocal {
...
@@ -48,7 +48,6 @@ public class Menubean implements MenubeanLocal {
@Override
@Override
public
MenuNavigation
getMenuNavigation
(
String
url
)
{
public
MenuNavigation
getMenuNavigation
(
String
url
)
{
MenuNavigation
ret
=
navifacade
.
find
(
url
,
eventbean
.
getCurrentEvent
());
MenuNavigation
ret
=
navifacade
.
find
(
url
,
eventbean
.
getCurrentEvent
());
logger
.
warn
(
"Children at bean: {}"
,
ret
.
getChildren
());
return
ret
;
return
ret
;
}
}
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ReaderBean.java
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
beans
;
package
fi
.
insomnia
.
bortal
.
beans
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.List
;
import
javax.annotation.security.DeclareRoles
;
import
javax.annotation.security.RolesAllowed
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.ejb.Stateless
;
import
javax.ejb.Stateless
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.exceptions.BortalCatchableException
;
import
fi.insomnia.bortal.facade.GroupMembershipFacade
;
import
fi.insomnia.bortal.facade.PrintedCardFacade
;
import
fi.insomnia.bortal.facade.PrintedCardFacade
;
import
fi.insomnia.bortal.facade.ReaderEventFacade
;
import
fi.insomnia.bortal.facade.ReaderEventFacade
;
import
fi.insomnia.bortal.facade.ReaderFacade
;
import
fi.insomnia.bortal.facade.ReaderFacade
;
import
fi.insomnia.bortal.model.GroupMembership
;
import
fi.insomnia.bortal.model.LanEvent
;
import
fi.insomnia.bortal.model.PrintedCard
;
import
fi.insomnia.bortal.model.PrintedCard
;
import
fi.insomnia.bortal.model.Reader
;
import
fi.insomnia.bortal.model.Reader
;
import
fi.insomnia.bortal.model.ReaderEvent
;
import
fi.insomnia.bortal.model.ReaderEvent
;
...
@@ -25,97 +20,152 @@ import fi.insomnia.bortal.model.ReaderEvent;
...
@@ -25,97 +20,152 @@ import fi.insomnia.bortal.model.ReaderEvent;
* Session Bean implementation class ReaderBean
* Session Bean implementation class ReaderBean
*/
*/
@Stateless
@Stateless
@DeclareRoles
(
"GAME/EXECUTE"
)
public
class
ReaderBean
implements
ReaderBeanLocal
{
public
class
ReaderBean
implements
ReaderBeanLocal
{
@EJB
@EJB
private
ReaderFacade
readerfacade
;
private
ReaderFacade
readerfacade
;
@EJB
@EJB
private
EventBeanLocal
eventbean
;
@EJB
private
PrintedCardFacade
cardfacade
;
private
PrintedCardFacade
cardfacade
;
@EJB
@EJB
private
ReaderEventFacade
readerEventFacade
;
@EJB
private
GroupMembershipFacade
gmfacade
;
@EJB
private
CardTemplateBeanLocal
cardtemplatebean
;
private
CardTemplateBeanLocal
cardtemplatebean
;
@EJB
private
ReaderEventFacade
readerEventFacade
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ReaderBean
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ReaderBean
.
class
);
@Override
@Override
public
ReaderEvent
checkTag
(
String
i
dent
,
String
tag
,
String
hash
)
{
public
ReaderEvent
checkTag
(
String
readerI
dent
,
String
tag
,
String
hash
)
{
PrintedCard
card
=
cardfacade
.
findByRfid
(
tag
);
PrintedCard
card
=
cardfacade
.
findByRfid
(
tag
);
Reader
reader
=
readerfacade
.
findOrCreateByIdent
(
readerIdent
);
// RfidEvent revent = reventcontainer.foundTag(reader, tag);
List
<
ReaderEvent
>
lastevents
=
readerEventFacade
.
findLastEvents
(
reader
,
1
);
ReaderEvent
ret
=
null
;
ReaderEvent
ret
=
null
;
logger
.
debug
(
"Found card by rfid: {}"
,
card
);
if
(!
lastevents
.
isEmpty
())
if
(
card
!=
null
)
{
{
ReaderEvent
lastevent
=
lastevents
.
get
(
0
);
if
(
card
==
null
)
{
if
(
lastevent
.
getPrintedCard
()
==
null
&&
tag
.
equals
(
lastevent
.
getValue
()))
{
ret
=
lastevent
;
}
ret
=
createReaderEvent
(
ident
,
card
);
}
else
if
(
card
.
equals
(
lastevent
.
getPrintedCard
()))
{
ret
=
lastevent
;
}
}
}
if
(
ret
==
null
)
{
ret
=
createReaderEvent
(
reader
,
card
);
}
else
{
ret
.
setUpdatetime
(
Calendar
.
getInstance
());
}
if
(
card
==
null
)
{
ret
.
setValue
(
tag
);
}
return
ret
;
return
ret
;
//
// if (revent.getEvent() != null) {
// ret = readerEventFacade.find(revent.getEvent().getId());
// revent.setEvent(ret);
// }
// else if (card != null) {
//
// revent.setEvent(ret);
// }
//
// return ret;
}
}
@Override
//
public
ReaderEvent
assocTagToPlacecode
(
String
tag
,
String
readerIdent
,
String
placecode
)
throws
BortalCatchableException
,
PermissionDeniedException
{
// @Override
// public ReaderEvent assocTagToPlacecode(String tag, String readerIdent,
GroupMembership
gm
=
gmfacade
.
findByToken
(
placecode
);
// String placecode) throws BortalCatchableException,
if
(
gm
==
null
)
{
// PermissionDeniedException {
throw
new
BortalCatchableException
(
"Token"
+
placecode
+
" not found!"
,
"readerbean.tokenNotFound"
);
//
}
// GroupMembership gm = gmfacade.findByToken(placecode);
if
(
gm
.
getUser
()
==
null
)
{
// if (gm == null) {
throw
new
BortalCatchableException
(
"Token "
+
placecode
+
"found but not assoc to user!"
,
"readerbean.userNotAssociateToMembership"
);
// throw new BortalCatchableException("Token" + placecode + " not found!",
}
// "readerbean.tokenNotFound");
// }
// if (gm.getUser() == null) {
// throw new BortalCatchableException("Token " + placecode +
// "found but not assoc to user!",
// "readerbean.userNotAssociateToMembership");
// }
//
// PrintedCard card = cardtemplatebean.setRfidUid(tag, gm.getUser());
//
// Reader reader = readerfacade.findOrCreateByIdent(readerIdent);
//
// return createReaderEvent(reader, card);
//
// }
private
ReaderEvent
createReaderEvent
(
Reader
reader
,
PrintedCard
card
)
{
PrintedCard
card
=
cardtemplatebean
.
setRfidUid
(
tag
,
gm
.
getUser
()
);
ReaderEvent
ret
=
new
ReaderEvent
(
Calendar
.
getInstance
(),
card
,
reader
);
return
createReaderEvent
(
readerIdent
,
card
);
Integer
gamepoints
=
reader
.
getGamepoints
(
);
}
if
(
gamepoints
>
0
&&
card
!=
null
)
{
int
awardedCount
=
0
;
private
ReaderEvent
createReaderEvent
(
String
readerIdent
,
PrintedCard
card
)
{
for
(
ReaderEvent
oldRe
:
reader
.
getEvents
())
{
if
(
oldRe
.
getGamePoint
()
>
0
)
{
++
awardedCount
;
LanEvent
ev
=
eventbean
.
getCurrentEvent
();
// User has been already awarded points from this reader.
// Not awarding again...
if
(
oldRe
.
getPrintedCard
().
equals
(
card
))
{
gamepoints
=
0
;
break
;
}
}
}
// if points can be awarded only limited times...
if
(
reader
.
getMaxEvents
()
>
0
&&
reader
.
getMaxEvents
()
>
awardedCount
)
{
gamepoints
=
0
;
}
Reader
reader
=
readerfacade
.
findOrCreateByIdent
(
ev
,
readerIdent
);
logger
.
debug
(
"Creating new readerevent for reader {} and events {}"
,
reader
,
reader
.
getMaxEvents
());
logger
.
debug
(
"maxevents for reder {}. readerevents at the moment {}"
,
reader
.
getMaxEvents
(),
reader
.
getEvents
().
size
());
if
(
reader
.
getMaxEvents
()
>
0
&&
reader
.
getMaxEvents
()
<=
reader
.
getEvents
().
size
())
{
logger
.
debug
(
"Max events {} found. returning null"
);
return
null
;
}
}
if
(
reader
.
getGamepoints
()
>
0
&&
card
.
getUser
()
!=
null
)
{
logger
.
debug
(
"Checking if user has been here"
);
for
(
ReaderEvent
oldRe
:
card
.
getReaderEvents
())
{
ret
.
setGamePoint
(
gamepoints
);
if
(
oldRe
.
getReader
().
getId
().
equals
(
reader
.
getId
()))
{
logger
.
debug
(
"Found already an event for user! returning null"
);
return
null
;
}
}
}
ReaderEvent
ret
=
new
ReaderEvent
(
Calendar
.
getInstance
(),
card
,
reader
);
ret
.
setGamePoint
(
reader
.
getGamepoints
());
ret
.
setReader
(
reader
);
reader
.
getEvents
().
add
(
ret
);
reader
.
getEvents
().
add
(
ret
);
card
.
getReaderEvents
().
add
(
ret
);
if
(
card
!=
null
)
cardfacade
.
merge
(
card
);
{
card
.
getReaderEvents
().
add
(
ret
);
}
return
ret
;
return
ret
;
}
}
@Override
@Override
public
ReaderEvent
assocTagToCard
(
String
tag
,
String
readerIdent
,
PrintedCard
card
)
{
public
ReaderEvent
assocTagToCard
(
String
tag
,
String
readerIdent
,
PrintedCard
card
)
{
Reader
reader
=
readerfacade
.
findOrCreateByIdent
(
readerIdent
);
card
=
cardtemplatebean
.
setRfidUid
(
tag
,
card
);
card
=
cardtemplatebean
.
setRfidUid
(
tag
,
card
);
return
createReaderEvent
(
reader
Ident
,
card
);
return
createReaderEvent
(
reader
,
card
);
}
}
@Override
@Override
@RolesAllowed
(
"GAME/EXECUTE"
)
public
List
<
Reader
>
getReaders
()
{
public
ReaderEvent
merge
(
ReaderEvent
e
)
{
return
readerfacade
.
findAllForEvent
();
return
readerEventFacade
.
merge
(
e
);
}
}
@Override
public
List
<
ReaderEvent
>
getReaderEvents
(
Integer
readerId
)
{
Reader
reader
=
readerfacade
.
find
(
readerId
);
return
readerEventFacade
.
findLastEvents
(
reader
,
20
);
}
}
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/RfidContainerBean.java
0 → 100644
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
beans
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Singleton
;
@Singleton
@LocalBean
public
class
RfidContainerBean
implements
RfidContainerBeanLocal
{
// private static final Logger logger =
// LoggerFactory.getLogger(RfidContainerBean.class);
//
// // -------------- EventId ---- Reader Id --- Rfidevent
// private final Map<Integer, Map<Integer, List<RfidEvent>>> events =
// Collections.synchronizedMap(new HashMap<Integer, Map<Integer,
// List<RfidEvent>>>());
//
// @EJB
// private EventBeanLocal evbean;
//
// public synchronized RfidEvent foundTag(Reader reader, String tag) {
// LanEvent currEv = evbean.getCurrentEvent();
//
// if (!events.containsKey(currEv.getId())) {
// events.put(currEv.getId(), new HashMap<Integer, List<RfidEvent>>());
// }
//
// Map<Integer, List<RfidEvent>> eventMap = events.get(currEv.getId());
//
// if (!eventMap.containsKey(reader)) {
// eventMap.put(reader.getId(), new LinkedList<RfidEvent>());
// }
//
// List<RfidEvent> readerevents = eventMap.get(reader);
// while (readerevents.size() > 20) {
// readerevents.remove(readerevents.size() - 1);
// logger.debug("Cleaning readerevents from reader {}", reader);
// }
//
// RfidEvent ret = null;
// if (readerevents.size() > 0 && readerevents.get(0).getTag().equals(tag))
// {
// ret = readerevents.get(0);
// readerevents.get(0).seen();
// } else {
// ret = new RfidEvent(reader, tag);
// readerevents.add(0, ret);
// }
//
// return ret;
// }
//
// @Override
// public List<RfidEvent> getReaderEvents(String readername) {
// LanEvent currEv = evbean.getCurrentEvent();
// List<RfidEvent> ret = null;
// if (events.containsKey(currEv.getId())) {
// ret = events.get(currEv.getId()).get(readername);
// }
// return ret;
//
// }
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/EventStatusFacade.java
deleted
100644 → 0
View file @
50a80b4
package
fi
.
insomnia
.
bortal
.
facade
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
javax.persistence.EntityManager
;
import
javax.persistence.PersistenceContext
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
import
fi.insomnia.bortal.enums.EventStatusEnum
;
import
fi.insomnia.bortal.model.EventStatus
;
import
fi.insomnia.bortal.model.EventStatus_
;
@Stateless
@LocalBean
public
class
EventStatusFacade
extends
GenericFacade
<
Integer
,
EventStatus
>
{
@PersistenceContext
private
EntityManager
em
;
public
EventStatusFacade
()
{
super
(
EventStatus
.
class
);
}
@Override
protected
EntityManager
getEm
()
{
return
em
;
}
public
EventStatus
findEventStatus
(
EventStatusEnum
eventStatusEnum
)
{
// @NamedQuery(name = "EventStatus.findByStatusName", query =
// "SELECT e FROM EventStatus e WHERE e.name = :name") })
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
EventStatus
>
cq
=
cb
.
createQuery
(
EventStatus
.
class
);
Root
<
EventStatus
>
root
=
cq
.
from
(
EventStatus
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
EventStatus_
.
name
),
eventStatusEnum
));
// TypedQuery<EventStatus> q =
// em.createNamedQuery("EventStatus.findByStatusName",
// EventStatus.class);
// q.setParameter("name", eventStatusEnum.name());
return
getSingleNullableResult
(
em
.
createQuery
(
cq
));
}
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/ReaderEventFacade.java
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
facade
;
package
fi
.
insomnia
.
bortal
.
facade
;
import
java.util.List
;
import
javax.ejb.LocalBean
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
javax.ejb.Stateless
;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManager
;
import
javax.persistence.PersistenceContext
;
import
javax.persistence.PersistenceContext
;
import
javax.persistence.TypedQuery
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
import
fi.insomnia.bortal.model.Reader
;
import
fi.insomnia.bortal.model.ReaderEvent
;
import
fi.insomnia.bortal.model.ReaderEvent
;
import
fi.insomnia.bortal.model.ReaderEvent_
;
@Stateless
@Stateless
@LocalBean
@LocalBean
...
@@ -23,4 +31,16 @@ public class ReaderEventFacade extends GenericFacade<Integer, ReaderEvent> {
...
@@ -23,4 +31,16 @@ public class ReaderEventFacade extends GenericFacade<Integer, ReaderEvent> {
return
em
;
return
em
;
}
}
public
List
<
ReaderEvent
>
findLastEvents
(
Reader
reader
,
int
count
)
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
ReaderEvent
>
cq
=
cb
.
createQuery
(
ReaderEvent
.
class
);
Root
<
ReaderEvent
>
root
=
cq
.
from
(
ReaderEvent
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
ReaderEvent_
.
reader
),
reader
));
cq
.
orderBy
(
cb
.
desc
(
root
.
get
(
ReaderEvent_
.
time
)));
TypedQuery
<
ReaderEvent
>
q
=
em
.
createQuery
(
cq
);
q
.
setMaxResults
(
count
);
return
q
.
getResultList
();
}
}
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/ReaderFacade.java
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
facade
;
package
fi
.
insomnia
.
bortal
.
facade
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.ejb.LocalBean
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
javax.ejb.Stateless
;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManager
;
...
@@ -9,6 +12,7 @@ import javax.persistence.criteria.CriteriaBuilder;
...
@@ -9,6 +12,7 @@ import javax.persistence.criteria.CriteriaBuilder;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
import
javax.persistence.criteria.Root
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.model.LanEvent
;
import
fi.insomnia.bortal.model.LanEvent
;
import
fi.insomnia.bortal.model.Reader
;
import
fi.insomnia.bortal.model.Reader
;
import
fi.insomnia.bortal.model.Reader_
;
import
fi.insomnia.bortal.model.Reader_
;
...
@@ -20,6 +24,9 @@ public class ReaderFacade extends GenericFacade<Integer, Reader> {
...
@@ -20,6 +24,9 @@ public class ReaderFacade extends GenericFacade<Integer, Reader> {
@PersistenceContext
@PersistenceContext
private
EntityManager
em
;
private
EntityManager
em
;
@EJB
private
EventBeanLocal
eventbean
;
public
ReaderFacade
()
{
public
ReaderFacade
()
{
super
(
Reader
.
class
);
super
(
Reader
.
class
);
}
}
...
@@ -44,10 +51,11 @@ public class ReaderFacade extends GenericFacade<Integer, Reader> {
...
@@ -44,10 +51,11 @@ public class ReaderFacade extends GenericFacade<Integer, Reader> {
return
getSingleNullableResult
(
q
);
return
getSingleNullableResult
(
q
);
}
}
public
Reader
findOrCreateByIdent
(
LanEvent
ev
,
String
ident
)
{
public
Reader
findOrCreateByIdent
(
String
ident
)
{
Reader
ret
=
findByIdent
(
ev
,
ident
);
LanEvent
event
=
eventbean
.
getCurrentEvent
();
Reader
ret
=
findByIdent
(
event
,
ident
);
if
(
ret
==
null
)
{
if
(
ret
==
null
)
{
ret
=
createIdent
(
this
,
ev
,
ident
);
ret
=
createIdent
(
this
,
ev
ent
,
ident
);
}
}
return
ret
;
return
ret
;
}
}
...
@@ -61,4 +69,12 @@ public class ReaderFacade extends GenericFacade<Integer, Reader> {
...
@@ -61,4 +69,12 @@ public class ReaderFacade extends GenericFacade<Integer, Reader> {
}
}
return
ret
;
return
ret
;
}
}
public
List
<
Reader
>
findAllForEvent
()
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Reader
>
cq
=
cb
.
createQuery
(
Reader
.
class
);
Root
<
Reader
>
root
=
cq
.
from
(
Reader
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
Reader_
.
event
),
eventbean
.
getCurrentEvent
()));
return
em
.
createQuery
(
cq
).
getResultList
();
}
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/EventOrganiserBeanLocal.java
View file @
7c2f4e4
...
@@ -5,11 +5,12 @@ import java.util.List;
...
@@ -5,11 +5,12 @@ import java.util.List;
import
javax.ejb.Local
;
import
javax.ejb.Local
;
import
fi.insomnia.bortal.model.EventOrganiser
;
import
fi.insomnia.bortal.model.EventOrganiser
;
import
fi.insomnia.bortal.model.LanEvent
;
@Local
@Local
public
interface
EventOrganiserBeanLocal
{
public
interface
EventOrganiserBeanLocal
{
void
save
(
EventOrganiser
eventorg
)
throws
PermissionDeniedException
;
void
save
(
EventOrganiser
eventorg
);
List
<
EventOrganiser
>
getEventOrganisers
();
List
<
EventOrganiser
>
getEventOrganisers
();
...
@@ -17,4 +18,6 @@ public interface EventOrganiserBeanLocal {
...
@@ -17,4 +18,6 @@ public interface EventOrganiserBeanLocal {
EventOrganiser
find
(
Integer
orgId
);
EventOrganiser
find
(
Integer
orgId
);
LanEvent
findEvent
(
Integer
eventid
);
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/EventStatusBeanLocal.java
deleted
100644 → 0
View file @
50a80b4
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package
fi
.
insomnia
.
bortal
.
beans
;
import
fi.insomnia.bortal.model.EventStatus
;
import
javax.ejb.Local
;
/**
*
* @author tuukka
*/
@Local
public
interface
EventStatusBeanLocal
{
public
EventStatus
findOrCreateDefaultEventStatus
();
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/ReaderBeanLocal.java
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
beans
;
package
fi
.
insomnia
.
bortal
.
beans
;
import
java.util.List
;
import
javax.ejb.Local
;
import
javax.ejb.Local
;
import
fi.insomnia.bortal.exceptions.BortalCatchableException
;
import
fi.insomnia.bortal.model.PrintedCard
;
import
fi.insomnia.bortal.model.PrintedCard
;
import
fi.insomnia.bortal.model.Reader
;
import
fi.insomnia.bortal.model.ReaderEvent
;
import
fi.insomnia.bortal.model.ReaderEvent
;
@Local
@Local
...
@@ -11,10 +13,14 @@ public interface ReaderBeanLocal {
...
@@ -11,10 +13,14 @@ public interface ReaderBeanLocal {
ReaderEvent
checkTag
(
String
reader
,
String
tag
,
String
hash
);
ReaderEvent
checkTag
(
String
reader
,
String
tag
,
String
hash
);
ReaderEvent
assocTagToPlacecode
(
String
tag
,
String
readerIdent
,
String
placecode
)
throws
BortalCatchableException
,
PermissionDeniedException
;
// WAT!
// ReaderEvent assocTagToPlacecode(String tag, String readerIdent, String
// placecode) throws BortalCatchableException, PermissionDeniedException;
ReaderEvent
assocTagToCard
(
String
tag
,
String
readerIdent
,
PrintedCard
card
);
ReaderEvent
assocTagToCard
(
String
tag
,
String
readerIdent
,
PrintedCard
card
);
ReaderEvent
merge
(
ReaderEvent
e
);
List
<
Reader
>
getReaders
();
List
<
ReaderEvent
>
getReaderEvents
(
Integer
readerId
);
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/RfidContainerBeanLocal.java
0 → 100644
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
beans
;
import
javax.ejb.Local
;
@Local
public
interface
RfidContainerBeanLocal
{
// List<RfidEvent> getReaderEvents(String readername);
}
code/LanBortalDatabase/diagrams/LanBortalDatabase.xml
View file @
7c2f4e4
...
@@ -33,6 +33,17 @@
...
@@ -33,6 +33,17 @@
</entity>
</entity>
<entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.ActionLogMessage
</entity-name>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
-200
</entity-X-Coordinate>
<entity-Y-Coordinate>
880
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
</entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.Bill
</entity-name>
<entity-name>
fi.insomnia.bortal.model.Bill
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-height>
30
</entity-height>
...
@@ -66,17 +77,6 @@
...
@@ -66,17 +77,6 @@
</entity>
</entity>
<entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.EventStatus
</entity-name>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
364
</entity-X-Coordinate>
<entity-Y-Coordinate>
580
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
</entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.CompoEntryParticipant
</entity-name>
<entity-name>
fi.insomnia.bortal.model.CompoEntryParticipant
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-height>
30
</entity-height>
...
@@ -132,6 +132,17 @@
...
@@ -132,6 +132,17 @@
</entity>
</entity>
<entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.Menuitem
</entity-name>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
-161
</entity-X-Coordinate>
<entity-Y-Coordinate>
1545
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
</entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.CompoEntry
</entity-name>
<entity-name>
fi.insomnia.bortal.model.CompoEntry
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-height>
30
</entity-height>
...
@@ -146,8 +157,8 @@
...
@@ -146,8 +157,8 @@
<entity-name>
fi.insomnia.bortal.model.ReaderEvent
</entity-name>
<entity-name>
fi.insomnia.bortal.model.ReaderEvent
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
3
64
</entity-X-Coordinate>
<entity-X-Coordinate>
3
02
</entity-X-Coordinate>
<entity-Y-Coordinate>
169
6
</entity-Y-Coordinate>
<entity-Y-Coordinate>
169
8
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
<basic-collapsed>
false
</basic-collapsed>
...
@@ -198,6 +209,17 @@
...
@@ -198,6 +209,17 @@
</entity>
</entity>
<entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.MenuNavigation
</entity-name>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
-207
</entity-X-Coordinate>
<entity-Y-Coordinate>
1409
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
</entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.LanEvent
</entity-name>
<entity-name>
fi.insomnia.bortal.model.LanEvent
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-height>
30
</entity-height>
...
@@ -244,7 +266,7 @@
...
@@ -244,7 +266,7 @@
<entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.Reader
</entity-name>
<entity-name>
fi.insomnia.bortal.model.Reader
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
268
</entity-height>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
413
</entity-X-Coordinate>
<entity-X-Coordinate>
413
</entity-X-Coordinate>
<entity-Y-Coordinate>
1877
</entity-Y-Coordinate>
<entity-Y-Coordinate>
1877
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<primary-collapsed>
false
</primary-collapsed>
...
@@ -267,8 +289,8 @@
...
@@ -267,8 +289,8 @@
<entity-name>
fi.insomnia.bortal.model.Location
</entity-name>
<entity-name>
fi.insomnia.bortal.model.Location
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
194
</entity-X-Coordinate>
<entity-X-Coordinate>
63
</entity-X-Coordinate>
<entity-Y-Coordinate>
1
841
</entity-Y-Coordinate>
<entity-Y-Coordinate>
1
712
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
<basic-collapsed>
false
</basic-collapsed>
...
@@ -286,6 +308,28 @@
...
@@ -286,6 +308,28 @@
</entity>
</entity>
<entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.PageContent
</entity-name>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
-38
</entity-X-Coordinate>
<entity-Y-Coordinate>
1478
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
</entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.SitePage
</entity-name>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
-65
</entity-X-Coordinate>
<entity-Y-Coordinate>
1281
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
</entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.PossibleAnswer
</entity-name>
<entity-name>
fi.insomnia.bortal.model.PossibleAnswer
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-height>
30
</entity-height>
...
@@ -343,7 +387,7 @@
...
@@ -343,7 +387,7 @@
<entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.NewsGroup
</entity-name>
<entity-name>
fi.insomnia.bortal.model.NewsGroup
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
208
</entity-height>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
663
</entity-X-Coordinate>
<entity-X-Coordinate>
663
</entity-X-Coordinate>
<entity-Y-Coordinate>
1150
</entity-Y-Coordinate>
<entity-Y-Coordinate>
1150
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<primary-collapsed>
false
</primary-collapsed>
...
@@ -355,8 +399,8 @@
...
@@ -355,8 +399,8 @@
<entity-name>
fi.insomnia.bortal.model.CardTemplate
</entity-name>
<entity-name>
fi.insomnia.bortal.model.CardTemplate
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
156
</entity-X-Coordinate>
<entity-X-Coordinate>
40
</entity-X-Coordinate>
<entity-Y-Coordinate>
1
205
</entity-Y-Coordinate>
<entity-Y-Coordinate>
1
091
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
<basic-collapsed>
false
</basic-collapsed>
...
@@ -374,22 +418,22 @@
...
@@ -374,22 +418,22 @@
</entity>
</entity>
<entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.
Us
er
</entity-name>
<entity-name>
fi.insomnia.bortal.model.
PollAnsw
er
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
1
132
</entity-X-Coordinate>
<entity-X-Coordinate>
1
236
</entity-X-Coordinate>
<entity-Y-Coordinate>
994
</entity-Y-Coordinate>
<entity-Y-Coordinate>
1323
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
<basic-collapsed>
false
</basic-collapsed>
</entity>
</entity>
<entity>
<entity>
<entity-name>
fi.insomnia.bortal.model.
PollAnsw
er
</entity-name>
<entity-name>
fi.insomnia.bortal.model.
Us
er
</entity-name>
<entity-width>
120
</entity-width>
<entity-width>
120
</entity-width>
<entity-height>
30
</entity-height>
<entity-height>
30
</entity-height>
<entity-X-Coordinate>
1
236
</entity-X-Coordinate>
<entity-X-Coordinate>
1
132
</entity-X-Coordinate>
<entity-Y-Coordinate>
1323
</entity-Y-Coordinate>
<entity-Y-Coordinate>
994
</entity-Y-Coordinate>
<primary-collapsed>
false
</primary-collapsed>
<primary-collapsed>
false
</primary-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<relation-collapsed>
false
</relation-collapsed>
<basic-collapsed>
false
</basic-collapsed>
<basic-collapsed>
false
</basic-collapsed>
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Certificate.java
deleted
100644 → 0
View file @
50a80b4
package
fi
.
insomnia
.
bortal
.
model
;
import
java.io.IOException
;
import
java.io.Serializable
;
import
java.io.StringReader
;
import
java.security.cert.CertificateException
;
import
java.security.cert.X509Certificate
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
org.bouncycastle.openssl.PEMReader
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
/**
* Entity implementation class for Entity: Certificate
*
*/
@Entity
@Table
(
name
=
"certificate"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
Certificate
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"common_name"
)
private
String
commonName
;
private
String
certificate
;
public
Certificate
()
{
super
();
}
public
String
getCommonName
()
{
return
this
.
commonName
;
}
public
void
setCommonName
(
String
commonName
)
{
this
.
commonName
=
commonName
;
}
public
String
getCertificate
()
{
return
this
.
certificate
;
}
public
X509Certificate
getX509Certificate
()
throws
CertificateException
,
IOException
{
StringReader
sr
=
new
StringReader
(
this
.
certificate
);
PEMReader
pemReader
=
new
PEMReader
(
sr
);
X509Certificate
cert
=
(
X509Certificate
)
pemReader
.
readObject
();
return
cert
;
}
public
void
setCertificate
(
String
certificate
)
{
this
.
certificate
=
certificate
;
}
public
void
set509Certificate
(
X509Certificate
cert
)
{
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/EventStatus.java
deleted
100644 → 0
View file @
50a80b4
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package
fi
.
insomnia
.
bortal
.
model
;
import
java.util.List
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.EnumType
;
import
javax.persistence.Enumerated
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
import
fi.insomnia.bortal.enums.EventStatusEnum
;
/**
*
*/
@Entity
@Table
(
name
=
"event_status"
)
// , uniqueConstraints = { @UniqueConstraint(columnNames = { "status_name" }) })
// @NamedQueries({
// @NamedQuery(name = "EventStatus.findAll", query =
// "SELECT e FROM EventStatus e"),
// @NamedQuery(name = "EventStatus.findByStatusName", query =
// "SELECT e FROM EventStatus e WHERE e.name = :name") })
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
EventStatus
extends
GenericEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"status_name"
,
nullable
=
false
,
unique
=
true
)
@Enumerated
(
EnumType
.
STRING
)
private
EventStatusEnum
name
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"status"
)
private
List
<
LanEvent
>
events
;
public
EventStatus
()
{
super
();
};
public
EventStatus
(
EventStatusEnum
name
)
{
super
();
this
.
name
=
name
;
}
public
EventStatusEnum
getName
()
{
return
name
;
}
public
void
setName
(
EventStatusEnum
statusName
)
{
this
.
name
=
statusName
;
}
public
List
<
LanEvent
>
getEvents
()
{
return
events
;
}
public
void
setEvents
(
List
<
LanEvent
>
eventList
)
{
this
.
events
=
eventList
;
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/LanEvent.java
View file @
7c2f4e4
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package
fi
.
insomnia
.
bortal
.
model
;
package
fi
.
insomnia
.
bortal
.
model
;
import
java.util.Calendar
;
import
java.util.Calendar
;
...
@@ -10,6 +6,8 @@ import java.util.List;
...
@@ -10,6 +6,8 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.EnumType
;
import
javax.persistence.Enumerated
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToMany
;
import
javax.persistence.OneToMany
;
...
@@ -21,25 +19,17 @@ import javax.persistence.TemporalType;
...
@@ -21,25 +19,17 @@ import javax.persistence.TemporalType;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
import
fi.insomnia.bortal.enums.EventStatus
;
import
fi.insomnia.bortal.model.salespoint.Salespoint
;
/**
/**
*
*
*/
*/
@Entity
@Entity
@Table
(
name
=
"events"
)
@Table
(
name
=
"events"
)
// @NamedQueries({
// @NamedQuery(name = "LanEvent.findAll", query = "SELECT e FROM LanEvent e"),
// @NamedQuery(name = "LanEvent.findByStartTime", query =
// "SELECT e FROM LanEvent e WHERE e.startTime = :startTime"),
// @NamedQuery(name = "LanEvent.findByEndTime", query =
// "SELECT e FROM LanEvent e WHERE e.endTime = :endTime"),
// @NamedQuery(name = "LanEvent.findByName", query =
// "SELECT e FROM LanEvent e WHERE e.name = :name") })
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
LanEvent
extends
GenericEntity
{
public
class
LanEvent
extends
GenericEntity
{
/**
*
*/
private
static
final
long
serialVersionUID
=
179811358211927126L
;
private
static
final
long
serialVersionUID
=
179811358211927126L
;
@Column
(
name
=
"start_time"
)
@Column
(
name
=
"start_time"
)
...
@@ -71,9 +61,9 @@ public class LanEvent extends GenericEntity {
...
@@ -71,9 +61,9 @@ public class LanEvent extends GenericEntity {
@ManyToOne
(
optional
=
false
)
@ManyToOne
(
optional
=
false
)
private
EventOrganiser
organiser
;
private
EventOrganiser
organiser
;
@
JoinColumn
(
name
=
"event_status_id"
,
referencedColumnName
=
"id
"
,
nullable
=
false
)
@
Column
(
name
=
"status
"
,
nullable
=
false
)
@
ManyToOne
(
optional
=
false
)
@
Enumerated
(
EnumType
.
STRING
)
private
EventStatus
status
;
private
EventStatus
status
=
EventStatus
.
INACTIVE
;
@OneToMany
(
mappedBy
=
"parentEvent"
)
@OneToMany
(
mappedBy
=
"parentEvent"
)
private
List
<
LogEntry
>
logEntries
;
private
List
<
LogEntry
>
logEntries
;
...
@@ -103,6 +93,9 @@ public class LanEvent extends GenericEntity {
...
@@ -103,6 +93,9 @@ public class LanEvent extends GenericEntity {
@OneToMany
(
mappedBy
=
"event"
,
cascade
=
CascadeType
.
ALL
)
@OneToMany
(
mappedBy
=
"event"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
Poll
>
polls
;
private
List
<
Poll
>
polls
;
@OneToMany
(
mappedBy
=
"event"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
Salespoint
>
salespoints
;
public
LanEvent
()
{
public
LanEvent
()
{
}
}
...
@@ -264,4 +257,12 @@ public class LanEvent extends GenericEntity {
...
@@ -264,4 +257,12 @@ public class LanEvent extends GenericEntity {
this
.
polls
=
polls
;
this
.
polls
=
polls
;
}
}
public
List
<
Salespoint
>
getSalespoints
()
{
return
salespoints
;
}
public
void
setSalespoints
(
List
<
Salespoint
>
salespoints
)
{
this
.
salespoints
=
salespoints
;
}
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/PrintedCard.java
View file @
7c2f4e4
...
@@ -33,16 +33,6 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
...
@@ -33,16 +33,6 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
@Table
(
name
=
"printed_cards"
,
uniqueConstraints
=
{
@Table
(
name
=
"printed_cards"
,
uniqueConstraints
=
{
@UniqueConstraint
(
columnNames
=
{
"event_id"
,
"rfid_uid"
,
}),
@UniqueConstraint
(
columnNames
=
{
"event_id"
,
"rfid_uid"
,
}),
@UniqueConstraint
(
columnNames
=
{
"event_id"
,
"barcode"
})
})
@UniqueConstraint
(
columnNames
=
{
"event_id"
,
"barcode"
})
})
// @NamedQueries({
// @NamedQuery(name = "PrintedCard.findAll", query =
// "SELECT p FROM PrintedCard p"),
//
// @NamedQuery(name = "PrintedCard.findByPrintTime", query =
// "SELECT p FROM PrintedCard p WHERE p.printTime = :printTime"),
// @NamedQuery(name = "PrintedCard.findByEnabled", query =
// "SELECT p FROM PrintedCard p WHERE p.enabled = :enabled"),
// @NamedQuery(name = "PrintedCard.findByRfidUid", query =
// "SELECT p FROM PrintedCard p WHERE p.rfidUid = :rfidUid") })
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
PrintedCard
extends
GenericEntity
{
public
class
PrintedCard
extends
GenericEntity
{
...
@@ -70,7 +60,7 @@ public class PrintedCard extends GenericEntity {
...
@@ -70,7 +60,7 @@ public class PrintedCard extends GenericEntity {
private
String
rfidUid
;
private
String
rfidUid
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"printedCard"
)
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"printedCard"
)
private
List
<
ReaderEvent
>
readerEvents
;
private
List
<
ReaderEvent
>
readerEvents
=
new
ArrayList
<
ReaderEvent
>()
;
@Column
(
name
=
"print_count"
,
nullable
=
false
)
@Column
(
name
=
"print_count"
,
nullable
=
false
)
private
int
printCount
=
0
;
private
int
printCount
=
0
;
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Reader.java
View file @
7c2f4e4
...
@@ -4,6 +4,11 @@
...
@@ -4,6 +4,11 @@
*/
*/
package
fi
.
insomnia
.
bortal
.
model
;
package
fi
.
insomnia
.
bortal
.
model
;
import
static
javax
.
persistence
.
CascadeType
.
DETACH
;
import
static
javax
.
persistence
.
CascadeType
.
MERGE
;
import
static
javax
.
persistence
.
CascadeType
.
PERSIST
;
import
static
javax
.
persistence
.
CascadeType
.
REFRESH
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -13,12 +18,15 @@ import javax.persistence.JoinColumn;
...
@@ -13,12 +18,15 @@ import javax.persistence.JoinColumn;
import
javax.persistence.Lob
;
import
javax.persistence.Lob
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToMany
;
import
javax.persistence.OneToMany
;
import
javax.persistence.OneToOne
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
javax.persistence.UniqueConstraint
;
import
javax.persistence.UniqueConstraint
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
import
fi.insomnia.bortal.model.salespoint.SalesEntity
;
/**
/**
*
*
*/
*/
...
@@ -58,6 +66,9 @@ public class Reader extends GenericEntity {
...
@@ -58,6 +66,9 @@ public class Reader extends GenericEntity {
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
private
Integer
maxEvents
=
0
;
private
Integer
maxEvents
=
0
;
@OneToOne
(
mappedBy
=
"reader"
)
private
SalesEntity
salesEntity
;
/**
/**
*
*
*/
*/
...
@@ -83,7 +94,7 @@ public class Reader extends GenericEntity {
...
@@ -83,7 +94,7 @@ public class Reader extends GenericEntity {
@Column
(
name
=
"map_y"
)
@Column
(
name
=
"map_y"
)
private
Integer
mapY
;
private
Integer
mapY
;
@OneToMany
(
mappedBy
=
"reader"
)
@OneToMany
(
mappedBy
=
"reader"
,
cascade
=
{
PERSIST
,
MERGE
,
REFRESH
,
DETACH
}
)
private
List
<
ReaderEvent
>
events
=
new
ArrayList
<
ReaderEvent
>();
private
List
<
ReaderEvent
>
events
=
new
ArrayList
<
ReaderEvent
>();
public
String
getIdentification
()
{
public
String
getIdentification
()
{
...
@@ -186,4 +197,12 @@ public class Reader extends GenericEntity {
...
@@ -186,4 +197,12 @@ public class Reader extends GenericEntity {
public
void
setEvent
(
LanEvent
event
)
{
public
void
setEvent
(
LanEvent
event
)
{
this
.
event
=
event
;
this
.
event
=
event
;
}
}
public
SalesEntity
getSalesEntity
()
{
return
salesEntity
;
}
public
void
setSalesEntity
(
SalesEntity
salesEntity
)
{
this
.
salesEntity
=
salesEntity
;
}
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/ReaderEvent.java
View file @
7c2f4e4
...
@@ -29,13 +29,17 @@ public class ReaderEvent extends GenericEntity {
...
@@ -29,13 +29,17 @@ public class ReaderEvent extends GenericEntity {
@Temporal
(
TemporalType
.
TIMESTAMP
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
time
;
private
Calendar
time
;
@Column
(
name
=
"event_updated"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
updatetime
;
@Column
(
name
=
"value"
)
@Column
(
name
=
"value"
)
private
String
value
;
private
String
value
;
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
private
Integer
gamePoint
=
0
;
private
Integer
gamePoint
=
0
;
@JoinColumn
(
name
=
"printed_cards_id"
,
referencedColumnName
=
"id"
,
nullable
=
fals
e
,
updatable
=
false
)
@JoinColumn
(
name
=
"printed_cards_id"
,
referencedColumnName
=
"id"
,
nullable
=
tru
e
,
updatable
=
false
)
@ManyToOne
(
optional
=
false
)
@ManyToOne
(
optional
=
false
)
private
PrintedCard
printedCard
;
private
PrintedCard
printedCard
;
...
@@ -93,4 +97,34 @@ public class ReaderEvent extends GenericEntity {
...
@@ -93,4 +97,34 @@ public class ReaderEvent extends GenericEntity {
return
gamePoint
;
return
gamePoint
;
}
}
public
Calendar
getUpdatetime
()
{
return
updatetime
;
}
public
void
setUpdatetime
(
Calendar
updatetime
)
{
this
.
updatetime
=
updatetime
;
}
public
String
getSeenSince
()
{
Calendar
comptime
=
updatetime
;
if
(
comptime
==
null
)
{
comptime
=
time
;
}
long
diffSec
=
(
Calendar
.
getInstance
().
getTimeInMillis
()
-
comptime
.
getTimeInMillis
())
/
1000
;
long
secs
=
diffSec
%
60
;
long
diffMin
=
diffSec
/
60
;
long
mins
=
diffMin
%
60
;
long
hours
=
diffMin
/
60
;
StringBuilder
ret
=
new
StringBuilder
();
if
(
hours
>
0
)
{
ret
.
append
(
hours
).
append
(
" h "
);
}
if
(
hours
>
0
||
mins
>
0
)
{
ret
.
append
(
mins
).
append
(
" min "
);
}
ret
.
append
(
secs
).
append
(
" sec"
);
return
ret
.
toString
();
}
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/salespoint/SalesEntity.java
0 → 100644
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
model
.
salespoint
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.EnumType
;
import
javax.persistence.Enumerated
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.Lob
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToOne
;
import
javax.persistence.Table
;
import
fi.insomnia.bortal.model.GenericEntity
;
import
fi.insomnia.bortal.model.Reader
;
@Entity
@Table
(
name
=
"sales_entity"
)
public
class
SalesEntity
extends
GenericEntity
{
private
static
final
long
serialVersionUID
=
-
1071792777020210982L
;
@Lob
private
String
certificate
;
private
String
name
;
@Lob
private
String
secret
;
@Enumerated
(
EnumType
.
STRING
)
@Column
(
nullable
=
false
)
private
SalesEntityType
type
;
@OneToOne
()
private
Reader
reader
;
@ManyToOne
()
@JoinColumn
(
nullable
=
false
)
private
Salespoint
point
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
SalesEntityType
getType
()
{
return
type
;
}
public
void
setType
(
SalesEntityType
type
)
{
this
.
type
=
type
;
}
public
Salespoint
getPoint
()
{
return
point
;
}
public
void
setPoint
(
Salespoint
point
)
{
this
.
point
=
point
;
}
public
String
getSecret
()
{
return
secret
;
}
public
void
setSecret
(
String
secret
)
{
this
.
secret
=
secret
;
}
public
String
getCertificate
()
{
return
certificate
;
}
public
void
setCertificate
(
String
certificate
)
{
this
.
certificate
=
certificate
;
}
public
Reader
getReader
()
{
return
reader
;
}
public
void
setReader
(
Reader
reader
)
{
this
.
reader
=
reader
;
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/salespoint/SalesEntityType.java
0 → 100644
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
model
.
salespoint
;
public
enum
SalesEntityType
{
CASHIER
,
CLIENT
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/salespoint/SalesEntity_.java
0 → 100644
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
model
.
salespoint
;
import
fi.insomnia.bortal.model.GenericEntity_
;
import
fi.insomnia.bortal.model.Reader
;
import
javax.annotation.Generated
;
import
javax.persistence.metamodel.SingularAttribute
;
import
javax.persistence.metamodel.StaticMetamodel
;
@Generated
(
value
=
"Dali"
,
date
=
"2012-04-08T02:57:31.378+0300"
)
@StaticMetamodel
(
SalesEntity
.
class
)
public
class
SalesEntity_
extends
GenericEntity_
{
public
static
volatile
SingularAttribute
<
SalesEntity
,
String
>
certificate
;
public
static
volatile
SingularAttribute
<
SalesEntity
,
String
>
name
;
public
static
volatile
SingularAttribute
<
SalesEntity
,
SalesEntityType
>
type
;
public
static
volatile
SingularAttribute
<
SalesEntity
,
Salespoint
>
point
;
public
static
volatile
SingularAttribute
<
SalesEntity
,
String
>
secret
;
public
static
volatile
SingularAttribute
<
SalesEntity
,
Reader
>
reader
;
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/salespoint/Salespoint.java
0 → 100644
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
model
.
salespoint
;
import
java.util.List
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.Lob
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
import
org.eclipse.persistence.annotations.PrivateOwned
;
import
fi.insomnia.bortal.model.GenericEntity
;
import
fi.insomnia.bortal.model.LanEvent
;
@Entity
@Table
(
name
=
"salespoint"
)
public
class
Salespoint
extends
GenericEntity
{
private
static
final
long
serialVersionUID
=
-
4659193907997736818L
;
@ManyToOne
@JoinColumn
(
nullable
=
false
,
updatable
=
false
)
private
LanEvent
event
;
@Column
(
nullable
=
false
)
private
String
name
;
@Lob
private
String
description
;
@OneToMany
(
mappedBy
=
"point"
,
cascade
=
CascadeType
.
ALL
)
@PrivateOwned
private
List
<
SalesEntity
>
entities
;
public
LanEvent
getEvent
()
{
return
event
;
}
public
void
setEvent
(
LanEvent
event
)
{
this
.
event
=
event
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
List
<
SalesEntity
>
getEntities
()
{
return
entities
;
}
public
void
setEntities
(
List
<
SalesEntity
>
entities
)
{
this
.
entities
=
entities
;
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/salespoint/Salespoint_.java
0 → 100644
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
model
.
salespoint
;
import
fi.insomnia.bortal.model.GenericEntity_
;
import
fi.insomnia.bortal.model.LanEvent
;
import
javax.annotation.Generated
;
import
javax.persistence.metamodel.ListAttribute
;
import
javax.persistence.metamodel.SingularAttribute
;
import
javax.persistence.metamodel.StaticMetamodel
;
@Generated
(
value
=
"Dali"
,
date
=
"2012-04-06T18:38:59.377+0300"
)
@StaticMetamodel
(
Salespoint
.
class
)
public
class
Salespoint_
extends
GenericEntity_
{
public
static
volatile
SingularAttribute
<
Salespoint
,
LanEvent
>
event
;
public
static
volatile
SingularAttribute
<
Salespoint
,
String
>
name
;
public
static
volatile
SingularAttribute
<
Salespoint
,
String
>
description
;
public
static
volatile
ListAttribute
<
Salespoint
,
SalesEntity
>
entities
;
}
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/EventStatus
Enum
.java
→
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/EventStatus.java
View file @
7c2f4e4
...
@@ -9,7 +9,7 @@ package fi.insomnia.bortal.enums;
...
@@ -9,7 +9,7 @@ package fi.insomnia.bortal.enums;
*
*
* @author tuukka
* @author tuukka
*/
*/
public
enum
EventStatus
Enum
{
public
enum
EventStatus
{
INACTIVE
,
// Not yet public
INACTIVE
,
// Not yet public
TICKET_SALES
,
// Site is public with ticket sales
TICKET_SALES
,
// Site is public with ticket sales
PRE_EVENT
,
// Upcoming event...
PRE_EVENT
,
// Upcoming event...
...
@@ -18,11 +18,11 @@ public enum EventStatusEnum {
...
@@ -18,11 +18,11 @@ public enum EventStatusEnum {
// cannot be modified.
// cannot be modified.
ARCHIVED
;
// Past events are archived
ARCHIVED
;
// Past events are archived
public
static
EventStatus
Enum
getEventStatusEnum
(
String
name
)
{
public
static
EventStatus
getEventStatusEnum
(
String
name
)
{
return
EventStatus
Enum
.
valueOf
(
name
);
return
EventStatus
.
valueOf
(
name
);
}
}
public
static
EventStatus
Enum
getDefaultEventStatusEnum
()
{
public
static
EventStatus
getDefaultEventStatusEnum
()
{
return
INACTIVE
;
return
INACTIVE
;
}
}
}
}
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/OldRolePermission.java
deleted
100644 → 0
View file @
50a80b4
package
fi
.
insomnia
.
bortal
.
enums
;
@Deprecated
public
enum
OldRolePermission
{
READ
,
WRITE
,
EXECUTE
}
code/LanBortalWeb/WebContent/account/edit.xhtml
deleted
100644 → 0
View file @
50a80b4
<!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:f=
"http://java.sun.com/jsf/core"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:tools=
"http://java.sun.com/jsf/composite/tools"
xmlns:account=
"http://java.sun.com/jsf/composite/tools/account"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.account.edit"
/>
<ui:define
name=
"content"
>
<tools:canWrite
target=
"ACCOUNT_MANAGEMENT"
>
<h:form
id=
"placeEdit"
>
<h:inputHidden
value=
"#{accountView.account.id.id}"
/>
<h:panelGrid
columns=
"2"
>
<h:outputLabel
value=
"#{i18n['accountEvent.total']}:"
/>
<h:outputText
value=
"#{accountView.account.total}"
>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
</h:outputText>
<h:outputLabel
value=
"#{i18n['accountEvent.quantity']}:"
/>
<h:inputText
value=
"#{accountView.account.quantity}"
>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
</h:inputText>
<h:outputLabel
value=
"#{i18n['accountEvent.unitPrice']}:"
/>
<h:inputText
value=
"#{accountView.account.unitPrice}"
>
<f:convertNumber
minFractionDigits=
"2"
maxFractionDigits=
"2"
/>
</h:inputText>
<h:outputLabel
value=
"#{i18n['accountEvent.eventTime']}:"
/>
<h:inputText
value=
"#{accountView.account.eventTime.time}"
>
<f:convertDateTime
type=
"both"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:inputText>
<h:outputLabel
value=
"#{i18n['accountEvent.delivered']}:"
/>
<h:inputText
value=
"#{accountView.account.delivered.time}"
>
<f:convertDateTime
type=
"both"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:inputText>
<h:outputLabel
value=
"#{i18n['accountEvent.seller']}:"
/>
<h:outputText
value=
"#{accountView.account.seller.wholeName}"
>
</h:outputText>
</h:panelGrid>
<h:commandButton
rendered=
"#{sessionHandler.canWrite('ACCOUNT_MANAGEMENT')}"
id=
"commitbtn"
action=
"#{accountView.merge()}"
value=
"#{i18n['accountEvent.commit']}"
/>
<br
/>
<h:commandButton
rendered=
"#{sessionHandler.canWrite('ACCOUNT_MANAGEMENT')}"
id=
"deletebtn"
action=
"#{accountView.delete()}"
value=
"#{i18n['accountEvent.delete']}"
/>
</h:form>
<h:dataTable
border=
"0"
id=
"discountlist"
value=
"#{accountView.account.discountInstances}"
var=
"discount"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['discount.percentage']}"
/>
</f:facet>
<h:outputText
value=
"#{discount.discount.percentage}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['discount.code']}"
/>
</f:facet>
<h:outputText
value=
"#{discount.discount.code}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['discount.details']}"
/>
</f:facet>
<h:outputText
value=
"#{discount.discount.details}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['discount.shortdesc']}"
/>
</f:facet>
<h:outputText
value=
"#{discount.discount.shortdesc}"
/>
</h:column>
</h:dataTable>
</tools:canWrite>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/auth/login.xhtml
View file @
7c2f4e4
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
<f:metadata>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{authView.executeLogin}"
/>
<f:event
type=
"preRenderView"
listener=
"#{authView.executeLogin}"
/>
</f:metadata>
</f:metadata>
<ui:param
name=
"thispage"
value=
"page.auth.login"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h1>
#{i18n['login.login']}
</h1>
<h1>
#{i18n['login.login']}
</h1>
...
...
code/LanBortalWeb/WebContent/auth/loginError.xhtml
View file @
7c2f4e4
...
@@ -9,7 +9,6 @@ xmlns:login="http://java.sun.com/jsf/composite/cditools/login"
...
@@ -9,7 +9,6 @@ xmlns:login="http://java.sun.com/jsf/composite/cditools/login"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.auth.loginerror"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h1>
#{i18n['loginerror.header']}
</h1>
<h1>
#{i18n['loginerror.header']}
</h1>
...
...
code/LanBortalWeb/WebContent/auth/loginSuccessRedirect.xhtml
View file @
7c2f4e4
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
<f:metadata>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{authView.executeLogin}"
/>
<f:event
type=
"preRenderView"
listener=
"#{authView.executeLogin}"
/>
</f:metadata>
</f:metadata>
<ui:param
name=
"thispage"
value=
"page.auth.login"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h1>
#{i18n['login.login']}
</h1>
<h1>
#{i18n['login.login']}
</h1>
</ui:define>
</ui:define>
...
...
code/LanBortalWeb/WebContent/auth/logout.xhtml
View file @
7c2f4e4
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
>
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.auth.logout"
/>
<f:metadata>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{authView.executeLogout}"
/>
<f:event
type=
"preRenderView"
listener=
"#{authView.executeLogout}"
/>
</f:metadata>
</f:metadata>
...
...
code/LanBortalWeb/WebContent/auth/notauthorized.xhtml
View file @
7c2f4e4
...
@@ -14,7 +14,6 @@ xmlns:c="http://java.sun.com/jsp/jstl/core">
...
@@ -14,7 +14,6 @@ xmlns:c="http://java.sun.com/jsp/jstl/core">
</h:head>
</h:head>
<h:body>
<h:body>
<ui:composition
template=
"/layout/${sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/${sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.auth.notauthorized"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:outputText
value=
"#{i18n['global.notauthorized'] }"
/>
<h:outputText
value=
"#{i18n['global.notauthorized'] }"
/>
</ui:define>
</ui:define>
...
...
code/LanBortalWeb/WebContent/auth/passwordChanged.xhtml
View file @
7c2f4e4
...
@@ -9,7 +9,6 @@ xmlns:login="http://java.sun.com/jsf/composite/tools/login"
...
@@ -9,7 +9,6 @@ xmlns:login="http://java.sun.com/jsf/composite/tools/login"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.auth.loginerror"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h1>
#{i18n['passwordChanged.header']}
</h1>
<h1>
#{i18n['passwordChanged.header']}
</h1>
...
...
code/LanBortalWeb/WebContent/auth/resetPassword.xhtml
View file @
7c2f4e4
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
</h:head>
</h:head>
<h:body>
<h:body>
<ui:composition
template=
"/layout/${sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/${sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.auth.resetPassword"
/>
<f:metadata>
<f:metadata>
<f:viewParam
name=
"id"
value=
"#{pwdResetView.id}"
/>
<f:viewParam
name=
"id"
value=
"#{pwdResetView.id}"
/>
<f:viewParam
name=
"hash"
value=
"#{pwdResetView.hash}"
/>
<f:viewParam
name=
"hash"
value=
"#{pwdResetView.hash}"
/>
...
...
code/LanBortalWeb/WebContent/auth/resetmailSent.xhtml
View file @
7c2f4e4
...
@@ -9,7 +9,6 @@ xmlns:login="http://java.sun.com/jsf/composite/tools/login"
...
@@ -9,7 +9,6 @@ xmlns:login="http://java.sun.com/jsf/composite/tools/login"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.auth.loginerror"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h1>
#{i18n['resetmailSent.header']}
</h1>
<h1>
#{i18n['resetmailSent.header']}
</h1>
...
...
code/LanBortalWeb/WebContent/auth/sendResetMail.xhtml
View file @
7c2f4e4
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
</h:head>
</h:head>
<h:body>
<h:body>
<ui:composition
template=
"/layout/${sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/${sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.auth.resetPassword"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h1><h:outputText
value=
"#{i18n['resetMail.header']}"
/></h1>
<h1><h:outputText
value=
"#{i18n['resetMail.header']}"
/></h1>
...
...
code/LanBortalWeb/WebContent/bill/billSummary.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
<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:bills=
"http://java.sun.com/jsf/composite/tools/bills"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:bills=
"http://java.sun.com/jsf/composite/tools/bills"
xmlns:f=
"http://java.sun.com/jsf/core"
>
xmlns:f=
"http://java.sun.com/jsf/core"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.bill.billSummary"
/>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{billListView.initSummaryView}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:dataTable
border=
"0"
id=
"billSummary"
value=
"#{bill
View.billLineS
ummary}"
var=
"sumline"
>
<h:dataTable
border=
"0"
id=
"billSummary"
value=
"#{bill
ListView.bills
ummary}"
var=
"sumline"
>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['product.name']}"
/>
<h:outputText
value=
"${i18n['product.name']}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{sumline.name}"
/>
<h:outputText
value=
"#{sumline.name}"
/>
</h:column>
</h:column>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['product.boughtTotal']}"
/>
<h:outputText
value=
"${i18n['product.boughtTotal']}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{sumline.total}"
>
<h:outputText
value=
"#{sumline.total}"
>
<f:convertNumber
/>
<f:convertNumber
/>
</h:outputText>
</h:outputText>
</h:column>
</h:column>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['product.paid']}"
/>
<h:outputText
value=
"${i18n['product.paid']}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{sumline.paid}"
>
<h:outputText
value=
"#{sumline.paid}"
>
<f:convertNumber
/>
<f:convertNumber
/>
</h:outputText>
</h:outputText>
</h:column>
</h:column>
</h:dataTable>
</h:dataTable>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
...
...
code/LanBortalWeb/WebContent/bill/edit.xhtml
View file @
7c2f4e4
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
<f:viewParam
name=
"billid"
value=
"#{billEditView.billid}"
/>
<f:viewParam
name=
"billid"
value=
"#{billEditView.billid}"
/>
<f:event
type=
"preRenderView"
listener=
"#{billEditView.initView}"
/>
<f:event
type=
"preRenderView"
listener=
"#{billEditView.initView}"
/>
</f:metadata>
</f:metadata>
<ui:param
name=
"thispage"
value=
"page.bill.edit"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form
id=
"billform"
>
<h:form
id=
"billform"
>
...
...
code/LanBortalWeb/WebContent/bill/list.xhtml
View file @
7c2f4e4
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
<f:viewParam
name=
"userid"
value=
"#{userView.userid}"
/>
<f:viewParam
name=
"userid"
value=
"#{userView.userid}"
/>
<f:event
type=
"preRenderView"
listener=
"#{billListView.initUsersBills}"
/>
<f:event
type=
"preRenderView"
listener=
"#{billListView.initUsersBills}"
/>
</f:metadata>
</f:metadata>
<ui:param
name=
"thispage"
value=
"page.bill.list"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<bills:list
/>
<bills:list
/>
</ui:define>
</ui:define>
...
...
code/LanBortalWeb/WebContent/bill/listAll.xhtml
View file @
7c2f4e4
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
<f:metadata>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{billListView.initAllBills}"
/>
<f:event
type=
"preRenderView"
listener=
"#{billListView.initAllBills}"
/>
</f:metadata>
</f:metadata>
<ui:param
name=
"thispage"
value=
"page.bill.listAll"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<bills:list
/>
<bills:list
/>
</ui:define>
</ui:define>
...
...
code/LanBortalWeb/WebContent/bill/placemap.xhtml
deleted
100644 → 0
View file @
50a80b4
<!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:bills=
"http://java.sun.com/jsf/composite/tools/bills"
xmlns:f=
"http://java.sun.com/jsf/core"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.bill.placemap"
/>
<ui:define
name=
"content"
>
<img
class=
"imgcenter"
src=
"#{request.contextPath}/resources/style/insomnia1/konepaikat.png"
alt=
"Konepaikat"
/>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/event/editMap.xhtml
deleted
100644 → 0
View file @
50a80b4
<!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:f=
"http://java.sun.com/jsf/core"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.eventorg.edit"
/>
<ui:define
name=
"content"
>
<h:form
id=
"orgform"
>
<h:inputHidden
value=
"#{eventView.eventmap.id}"
/>
<h:panelGrid
columns=
"2"
>
<h:outputLabel
value=
"#{i18n['eventmap.name']}:"
/><h:inputText
value=
"#{eventView.eventmap.name}"
/>
<h:commandButton
id=
"commitbtn"
action=
"#{eventView.saveMap()}"
value=
"#{i18n['eventmap.save']}"
/>
</h:panelGrid>
</h:form>
<h2>
#{i18n['eventmap.places']}
</h2>
<h:form
id=
"eventmapPlacelist"
>
<h:dataTable
border=
"1"
id=
"places"
value=
"#{eventView.mapPlaces}"
var=
"place"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['place.name']}"
/>
</f:facet>
<h:outputText
value=
"#{place.name}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['place.description']}"
/>
</f:facet>
<h:outputText
value=
"#{place.description}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['place.details']}"
/>
</f:facet>
<h:outputText
value=
"#{place.details}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['place.mapX']}"
/>
</f:facet>
<h:outputText
value=
"#{place.mapX}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['place.mapY']}"
/>
</f:facet>
<h:outputText
value=
"#{place.mapY}"
/>
</h:column>
<h:column
>
<h:commandButton
action=
"#{eventView.editPlace()}"
value=
"#{i18n['place.edit']}"
/>
</h:column>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/event/editPlace.xhtml
deleted
100644 → 0
View file @
50a80b4
<!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:f=
"http://java.sun.com/jsf/core"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.eventorg.edit"
/>
<ui:define
name=
"content"
>
<h:form
id=
"orgform"
>
<h:inputHidden
id=
"#{eventView.eventmap.id}"
/>
<h:panelGrid
columns=
"2"
>
<h:outputLabel
value=
"#{i18n['eventmap.name']}:"
/><h:inputText
value=
"#{eventView.eventmap.name}"
/>
<h:commandButton
id=
"commitbtn"
action=
"#{eventView.saveMap()}"
value=
"#{i18n['eventmap.save']}"
/>
</h:panelGrid>
</h:form>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/event/listMaps.xhtml
deleted
100644 → 0
View file @
50a80b4
<!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:f=
"http://java.sun.com/jsf/core"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.eventorg.list"
/>
<ui:define
name=
"content"
>
<h:form>
<h:dataTable
border=
"1"
id=
"maps"
value=
"#{eventView.eventmaps}"
var=
"maps"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['eventmap.name']}"
/>
</f:facet>
<h:outputText
value=
"#{maps.name}"
/>
</h:column>
<h:column
>
<h:commandButton
action=
"#{eventView.editMap()}"
value=
"#{i18n['eventmap.edit']}"
/>
</h:column>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/eventorg/create.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
<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:f=
"http://java.sun.com/jsf/core"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:h=
"http://java.sun.com/jsf/html"
<h:body>
xmlns:f=
"http://java.sun.com/jsf/core"
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
<ui:param
name=
"thispage"
value=
"page.eventorg.create"
/>
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<f:metadata>
<h:body>
<f:event
type=
"preRenderView"
listener=
"#{eventorgView.initCreate}"
/>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
</f:metadata>
<ui:param
name=
"thispage"
value=
"page.eventorg.create"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form
id=
"orgform"
>
<h:form
id=
"orgform"
>
<h:panelGrid
columns=
"2"
>
<h:panelGrid
columns=
"2"
>
<h:outputLabel
value=
"#{i18n['eventorg.organisation']}:"
/><h:inputText
value=
"#{eventorgView.createorgname}"
/>
<h:outputLabel
value=
"#{i18n['eventorg.organisation']}:"
/>
<h:commandButton
id=
"commitbtn"
action=
"#{eventorgView.create()}"
value=
"#{i18n['eventorg.create']}"
/>
<h:inputText
value=
"#{eventorgView.createorgname}"
/>
</h:panelGrid>
<h:commandButton
id=
"commitbtn"
action=
"#{eventorgView.create()}"
value=
"#{i18n['eventorg.create']}"
/>
</h:form>
</h:panelGrid>
</h:form>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
...
...
code/LanBortalWeb/WebContent/eventorg/edit.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<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:f=
"http://java.sun.com/jsf/core"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.eventorg.edit"
/>
<ui:param
name=
"thispage"
value=
"page.eventorg.edit"
/>
<f:metadata>
<f:viewParam
name=
"id"
value=
"#{eventorgView.orgId}"
/>
<f:event
type=
"preRenderView"
listener=
"#{eventorgView.initEdit}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form
id=
"orgform"
>
<h:form
id=
"orgform"
>
<h:panelGrid
columns=
"2"
>
<h:panelGrid
columns=
"2"
>
<h:outputLabel
value=
"#{i18n['eventorg.organisation']}:"
/>
<h:outputLabel
value=
"#{i18n['eventorg.organisation']}:"
/>
<h:inputText
value=
"#{eventorgView.eventorg.organisation}"
/>
<h:inputText
value=
"#{eventorgView.eventorg.organisation}"
/>
<h:outputLabel
value=
"#{i18n['eventorg.bundleCountry']}:"
/>
<h:outputLabel
value=
"#{i18n['eventorg.bundleCountry']}:"
/>
<h:inputText
value=
"#{eventorgView.eventorg.bundleCountry}"
/>
<h:inputText
value=
"#{eventorgView.eventorg.bundleCountry}"
/>
<h:outputLabel
value=
"#{i18n['eventorg.billAddress1']}:"
/>
<h:outputLabel
value=
"#{i18n['eventorg.billAddress1']}:"
/>
<h:inputText
value=
"#{eventorgView.eventorg.billAddress1}"
/>
<h:inputText
value=
"#{eventorgView.eventorg.billAddress1}"
/>
<h:outputLabel
value=
"#{i18n['eventorg.billAddress2']}:"
/>
<h:outputLabel
value=
"#{i18n['eventorg.billAddress2']}:"
/>
<h:inputText
value=
"#{eventorgView.eventorg.billAddress2}"
/>
<h:inputText
value=
"#{eventorgView.eventorg.billAddress2}"
/>
<h:outputLabel
value=
"#{i18n['eventorg.billAddress3']}:"
/>
<h:outputLabel
value=
"#{i18n['eventorg.billAddress3']}:"
/>
<h:inputText
value=
"#{eventorgView.eventorg.billAddress3}"
/>
<h:inputText
value=
"#{eventorgView.eventorg.billAddress3}"
/>
<h:outputLabel
value=
"#{i18n['eventorg.billAddress4']}:"
/>
<h:outputLabel
value=
"#{i18n['eventorg.billAddress4']}:"
/>
<h:inputText
value=
"#{eventorgView.eventorg.billAddress4}"
/>
<h:inputText
value=
"#{eventorgView.eventorg.billAddress4}"
/>
<h:outputLabel
value=
"#{i18n['eventorg.bankNumber1']}:"
/>
<h:outputLabel
value=
"#{i18n['eventorg.bankNumber1']}:"
/>
<h:inputText
value=
"#{eventorgView.eventorg.bankNumber1}"
/>
<h:inputText
value=
"#{eventorgView.eventorg.bankNumber1}"
/>
<h:outputLabel
value=
"#{i18n['eventorg.bankNumber2']}:"
/>
<h:outputLabel
value=
"#{i18n['eventorg.bankNumber2']}:"
/>
<h:inputText
value=
"#{eventorgView.eventorg.bankNumber2}"
/>
<h:inputText
value=
"#{eventorgView.eventorg.bankNumber2}"
/>
<h:outputLabel
value=
"#{i18n['eventorg.bankName1']}:"
/>
<h:outputLabel
value=
"#{i18n['eventorg.bankName1']}:"
/>
<h:inputText
value=
"#{eventorgView.eventorg.bankName1}"
/>
<h:inputText
value=
"#{eventorgView.eventorg.bankName1}"
/>
<h:outputLabel
value=
"#{i18n['eventorg.bankName2']}:"
/>
<h:outputLabel
value=
"#{i18n['eventorg.bankName2']}:"
/>
<h:inputText
value=
"#{eventorgView.eventorg.bankName2}"
/>
<h:inputText
value=
"#{eventorgView.eventorg.bankName2}"
/>
<h:commandButton
id=
"commitbtn"
action=
"#{eventorgView.save()}"
value=
"#{i18n['eventorg.save']}"
/>
<h:commandButton
id=
"commitbtn"
action=
"#{eventorgView.save()}"
value=
"#{i18n['eventorg.save']}"
/>
</h:panelGrid>
</h:panelGrid>
</h:form>
</h:form>
<h2>
#{i18n['eventorg.createevent']}
</h2>
<h2>
#{i18n['eventorg.createevent']}
</h2>
<h:form
id=
"createevent"
>
<h:form
id=
"createevent"
>
<h:outputLabel
for=
"createEventName"
value=
"#{i18n['event.name']}"
/>
<h:outputLabel
for=
"createEventName"
value=
"#{i18n['event.name']}"
/>
<h:inputText
id=
"createEventName"
value=
"#{eventorgView.eventname}"
/>
<h:inputText
id=
"createEventName"
value=
"#{eventorgView.eventname}"
/>
<h:commandButton
action=
"#{eventorgView.createEvent()}"
value=
"#{i18n['eventorg.createEvent']}"
/>
<h:commandButton
action=
"#{eventorgView.createEvent()}"
value=
"#{i18n['eventorg.createEvent']}"
/>
</h:form>
</h:form>
<h2>
#{i18n['eventorg.events']}
</h2>
<h2>
#{i18n['eventorg.events']}
</h2>
<h:form
id=
"orgsEventlist"
>
<h:dataTable
border=
"1"
id=
"org"
value=
"#{eventorgView.eventorg.events}"
var=
"event"
>
<h:dataTable
border=
"1"
id=
"org"
value=
"#{eventorgView.orgsEvents}"
var=
"event"
>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['event.name']}"
/>
<h:outputText
value=
"${i18n['event.name']}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{event.name}"
/>
<h:outputText
value=
"#{event.name}"
/>
</h:column>
</h:column>
<h:column>
<h:column>
<h:link
outcome=
"/eventorg/editEvent"
value=
"#{i18n['event.edit']}"
>
<h:commandButton
action=
"#{eventorgView.editEvent()}"
value=
"#{i18n['eventorg.editEvent']}"
/>
<f:param
name=
"eventid"
value=
"#{event.id}"
/>
</h:column>
</h:link>
</h:column>
</h:dataTable>
</h:
form
>
</h:
dataTable
>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
...
...
code/LanBortalWeb/WebContent/eventorg/editEvent.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
<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:f=
"http://java.sun.com/jsf/core"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:h=
"http://java.sun.com/jsf/html"
<h:body>
xmlns:f=
"http://java.sun.com/jsf/core"
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
<f:metadata>
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<f:viewParam
name=
"eventid"
value=
"#{eventorgView.eventid}"
/>
<h:body>
<f:event
type=
"preRenderView"
listener=
"#{eventorgView.initEditEvent}"
/>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
</f:metadata>
<ui:param
name=
"thispage"
value=
"page.eventorg.editEvent"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:messages
/>
<h:form
id=
"orgform"
>
<h:form
id=
"orgform"
>
<h:panelGrid
columns=
"2"
>
<h:inputHidden
value=
"#{eventorgView.event.id}"
/>
<h:outputLabel
value=
"#{i18n['event.name']}:"
/>
<h:panelGrid
columns=
"2"
>
<h:inputText
value=
"#{eventorgView.event.name}"
/>
<h:outputLabel
value=
"#{i18n['event.name']}:"
/><h:inputText
value=
"#{eventorgView.event.name}"
/>
<h:outputLabel
value=
"#{i18n['event.referer']}:"
/><h:inputText
value=
"#{eventorgView.event.referer}"
/>
<h:outputLabel
value=
"#{i18n['event.referer']}:"
/>
<h:outputLabel
value=
"#{i18n['event.referenceNumberBase']}:"
/><h:inputText
value=
"#{eventorgView.event.referenceNumberBase}"
/>
<h:inputText
value=
"#{eventorgView.event.referer}"
/>
<h:outputLabel
value=
"#{i18n['event.nextBillNumber']}:"
/><h:inputText
value=
"#{eventorgView.event.nextBillNumber}"
/>
<h:outputLabel
value=
"#{i18n['event.startTime']}:"
/>
<h:outputLabel
value=
"#{i18n['event.referenceNumberBase']}:"
/>
<h:inputText
value=
"#{eventorgView.event.startTime}"
>
<h:inputText
value=
"#{eventorgView.event.referenceNumberBase}"
/>
<f:convertDateTime
/>
</h:inputText>
<h:outputLabel
value=
"#{i18n['event.nextBillNumber']}:"
/>
<h:outputLabel
value=
"#{i18n['event.endTime']}:"
/>
<h:inputText
value=
"#{eventorgView.event.nextBillNumber}"
/>
<h:inputText
value=
"#{eventorgView.event.endTime}"
>
<f:convertDateTime
/>
<h:outputLabel
value=
"#{i18n['event.startTime']}:"
/>
</h:inputText>
<h:inputText
value=
"#{eventorgView.event.startTime}"
>
<h:outputLabel
value=
"#{i18n['event.defaultRole']}:"
/>
<f:convertDateTime
/>
</h:inputText>
<h:selectOneMenu
converter=
"#{roleConverter}"
value=
"#{eventorgView.event.defaultRole}"
>
<f:selectItems
var=
"role"
itemLabel=
"#{role.name}"
value=
"#{eventorgView.eventsRolelist}"
/>
<h:outputLabel
value=
"#{i18n['event.endTime']}:"
/>
</h:selectOneMenu>
<h:inputText
value=
"#{eventorgView.event.endTime}"
>
<f:convertDateTime
/>
<h:commandButton
id=
"commitbtn"
action=
"#{eventorgView.saveEvent()}"
value=
"#{i18n['event.save']}"
/>
</h:inputText>
</h:panelGrid>
<h:outputLabel
value=
"#{i18n['event.defaultRole']}:"
/>
</h:form>
<h:selectOneMenu
converter=
"#{roleConverter}"
value=
"#{eventorgView.event.defaultRole}"
>
<f:selectItems
var=
"role"
itemLabel=
"#{role.name}"
value=
"#{eventorgView.event.roles}"
/>
</h:selectOneMenu>
<h:commandButton
id=
"commitbtn"
action=
"#{eventorgView.saveEvent()}"
value=
"#{i18n['event.save']}"
/>
</h:panelGrid>
</h:form>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
...
...
code/LanBortalWeb/WebContent/eventorg/list.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
<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:f=
"http://java.sun.com/jsf/core"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:h=
"http://java.sun.com/jsf/html"
<h:body>
xmlns:f=
"http://java.sun.com/jsf/core"
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
<f:metadata>
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<f:event
type=
"preRenderView"
listener=
"#{eventorgView.initListView}"
/>
<h:body>
</f:metadata>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.eventorg.list"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form>
<h:form>
<h:dataTable
border=
"1"
id=
"eventorgs"
value=
"#{eventorgView.organisations}"
var=
"eventorg"
>
<h:dataTable
border=
"1"
id=
"eventorgs"
value=
"#{eventorgView.organisations}"
var=
"eventorg"
>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['eventorganiser.name']}"
/>
<h:outputText
value=
"${i18n['eventorganiser.name']}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{eventorg.organisation}"
/>
<h:outputText
value=
"#{eventorg.organisation}"
/>
</h:column>
</h:column>
<h:column
>
<h:column>
<h:commandButton
action=
"#{eventorgView.edit()}"
value=
"#{i18n['eventorg.edit']}"
/>
<h:link
outcome=
"/eventorg/edit"
value=
"#{i18n['eventorg.edit']}"
>
</h:column>
<f:param
name=
"id"
value=
"#{eventorg.id}"
/>
</h:link>
</h:dataTable>
</h:column>
</h:dataTable>
</h:form>
</h:form>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
</html>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/map/create.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<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:f=
"http://java.sun.com/jsf/core"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:map=
"http://java.sun.com/jsf/composite/cditools/map"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:map=
"http://java.sun.com/jsf/composite/cditools/map"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.role.edit"
/>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{mapManageView.initCreate}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form>
<h:form>
<h:panelGrid
columns=
"2"
>
<h:panelGrid
columns=
"2"
>
<h:outputText
value=
"#{i18n['map.name']}"
/>
<h:outputText
value=
"#{i18n['map.name']}"
/>
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
<h:commandButton
id=
"createrole"
value=
"#{i18n['map.create']}"
action=
"#{mapManageView.createMap}"
/>
<h:commandButton
id=
"createrole"
value=
"#{i18n['map.create']}"
action=
"#{mapManageView.createMap}"
/>
</h:panelGrid>
</h:panelGrid>
</h:form>
</h:form>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
...
...
code/LanBortalWeb/WebContent/pages/editNews.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<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:f=
"http://java.sun.com/jsf/core"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:news=
"http://java.sun.com/jsf/composite/cditools/pages"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:p=
"http://primefaces.org/ui"
>
xmlns:news=
"http://java.sun.com/jsf/composite/cditools/news"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:p=
"http://primefaces.org/ui"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:metadata>
...
@@ -18,7 +15,7 @@
...
@@ -18,7 +15,7 @@
<h:outputScript
target=
"head"
library=
"script"
name=
"jquery.min.js"
/>
<h:outputScript
target=
"head"
library=
"script"
name=
"jquery.min.js"
/>
<h:outputScript
target=
"head"
library=
"script"
name=
"textinputs_jquery.js"
/>
<h:outputScript
target=
"head"
library=
"script"
name=
"textinputs_jquery.js"
/>
<h:button
onclick=
"var sel = $('#newsform:editor').getSelection(); alert(sel.start +', ' + sel.end);"
value=
"Click me"
/>
<h:button
onclick=
"var sel = $('#newsform:editor').getSelection(); alert(sel.start +', ' + sel.end);"
value=
"Click me"
/>
<h:form
id=
"newsform"
>
<h:form
id=
"newsform"
>
...
...
code/LanBortalWeb/WebContent/pages/list.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<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: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:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{
site
ListView.initView}"
/>
<f:event
type=
"preRenderView"
listener=
"#{
news
ListView.initView}"
/>
</f:metadata>
</f:metadata>
<ui:param
name=
"thispage"
value=
"page.user.create"
/>
<ui:param
name=
"thispage"
value=
"page.user.create"
/>
...
@@ -18,7 +16,7 @@
...
@@ -18,7 +16,7 @@
<h:dataTable
styleClass=
"bordertable"
id=
"user"
value=
"#{newsListView.newsgroups}"
var=
"newsgroup"
>
<h:dataTable
styleClass=
"bordertable"
id=
"user"
value=
"#{newsListView.newsgroups}"
var=
"newsgroup"
>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
ID
#
</f:facet>
</f:facet>
<h:outputText
value=
"#{newsgroup.id}"
/>
<h:outputText
value=
"#{newsgroup.id}"
/>
</h:column>
</h:column>
...
...
code/LanBortalWeb/WebContent/resources/cditools/
new
s/edit.xhtml
→
code/LanBortalWeb/WebContent/resources/cditools/
page
s/edit.xhtml
View file @
7c2f4e4
File moved
code/LanBortalWeb/WebContent/resources/cditools/shop/readerevents.xhtml
View file @
7c2f4e4
<?xml version='1.0' encoding='UTF-8' ?>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:composite=
"http://java.sun.com/jsf/composite"
xmlns:composite=
"http://java.sun.com/jsf/composite"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:tools=
"http://java.sun.com/jsf/composite/tools"
>
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:tools=
"http://java.sun.com/jsf/composite/tools"
>
<composite:interface>
<composite:interface>
</composite:interface>
</composite:interface>
<composite:implementation>
<composite:implementation>
<h:dataTable
border=
"1"
id=
"event"
value=
"#{readerView.readerEvents}"
var=
"event"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['readerevent.']}"
/>
</f:facet>
<h:outputText
rendered=
"#{!empty event.printedCard}"
id=
"cardtag"
value=
"#{event.printedCard.rfidUid}"
/>
<h:outputText
rendered=
"#{empty event.printedCard}"
id=
"newtag"
value=
"#{event.value}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['reader.user']}"
/>
</f:facet>
<h:outputText
rendered=
"#{!empty event.printedCard}"
value=
"#{event.printedCard.user.wholeName} (#{event.printedCard.user.nick})"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['readerevent.seenSince']}"
/>
</f:facet>
<h:outputText
value=
"#{event.seenSince}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['gamepoints']}"
/>
</f:facet>
<h:outputText
value=
"#{event.gamePoint}"
/>
</h:column>
<h:column>
<h:commandButton
rendered=
"#{empty event.printedCard}"
action=
"#{readerView.selectEvent()}"
value=
"#{i18n['readerevent.associateToUser']}"
/>
<h:commandButton
rendered=
"#{!empty event.printedCard}"
action=
"#{readerView.selectEvent()}"
value=
"#{i18n['readerevent.shopToUser']}"
/>
</h:column>
<h:column>
<h:commandButton
rendered=
"#{!empty event.printedCard}"
action=
"#{readerView.editUser()}"
value=
"#{i18n['user.edit']}"
/>
</h:column>
</h:dataTable>
<h1>
#{readerView.readername}
</h1>
<h:form>
<h:dataTable
border=
"1"
id=
"event"
value=
"#{readerView.readerEvents}"
var=
"event"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['reader.tag']}"
/>
</f:facet>
<h:outputText
id=
"tag"
value=
"#{event.tag}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['reader.user']}"
/>
</f:facet>
<h:outputText
rendered=
"#{!empty event.event}"
value=
"#{event.event.printedCard.user.wholeName} (#{event.event.printedCard.user.nick})"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['reader.tag']}"
/>
</f:facet>
<h:dataTable
value=
"#{event.actions}"
var=
"action"
>
<h:column>
<h:outputText
value=
"#{action}"
/>
</h:column>
</h:dataTable>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['readerevent.seenSince']}"
/>
</f:facet>
<h:outputText
value=
"#{event.seenSince}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['gamepoints']}"
/>
</f:facet>
<h:outputText
value=
"#{event.event.gamePoint}"
/>
</h:column>
<h:column>
<h:link
rendered=
"#{empty event.event}"
outcome=
"/rfid/assocToUser"
value=
"#{i18n['readerevent.associateToUser']}"
>
<f:param
value=
"#{event.tag}"
var=
"tag"
/>
</h:link>
<h:link
rendered=
"#{!empty event.event}"
outcome=
"/user/edit"
value=
"#{i18n['user.edit']}"
>
<f:param
value=
"#{event.event.printedCard.user.id}"
var=
"userid"
/>
</h:link>
<!-- <h:commandButton rendered="#{!empty event.event}" action="#{readerView.editUser()}" value="#{i18n['user.edit']}" /> -->
<!-- <h:commandButton rendered="#{empty event.event}" action="#{readerView.selectEvent()}" -->
<!-- value="#{i18n['readerevent.associateToUser']}" -->
<!-- /> -->
<!-- <h:commandButton rendered="#{!empty event.event}" action="#{readerView.selectEvent()}" -->
<!-- value="#{i18n['readerevent.shopToUser']}" -->
<!-- /> -->
</h:column>
<h:column>
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</composite:implementation>
</html>
</html>
code/LanBortalWeb/WebContent/resources/cditools/shop/readerlist.xhtml
View file @
7c2f4e4
<?xml version='1.0' encoding='UTF-8' ?>
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:composite=
"http://java.sun.com/jsf/composite"
xmlns:composite=
"http://java.sun.com/jsf/composite"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:tools=
"http://java.sun.com/jsf/composite/tools"
>
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:tools=
"http://java.sun.com/jsf/composite/tools"
>
<composite:interface>
<composite:interface>
</composite:interface>
</composite:interface>
<composite:implementation>
<composite:implementation>
<h:dataTable
border=
"1"
id=
"reader"
value=
"#{readerListDataView.readers}"
var=
"rr"
>
<h:dataTable
border=
"1"
id=
"reader"
value=
"#{rfidContainer.readers}"
var=
"rr"
>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['reader.name']}"
/>
<h:outputText
value=
"${i18n['reader.name']}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{rr}"
/>
<h:outputText
value=
"#{rr
.identification
}"
/>
</h:column>
</h:column>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['reader.description']}"
/>
</f:facet>
<h:outputText
value=
"#{rr.description}"
/>
</h:column>
<h:column>
<h:link
outcome=
"/shop/showReaderEvents"
value=
"#{i18n['reader.select']}"
>
<h:link
outcome=
"/shop/showReaderEvents"
value=
"#{i18n['reader.select']}"
>
<f:param
value=
"#{rr}"
name=
"reader"
/>
<f:param
value=
"#{rr.id}"
name=
"readerId"
/>
</h:link>
</h:link>
</h:column>
</h:column>
</h:dataTable>
</h:dataTable>
</composite:implementation>
</composite:implementation>
</html>
</html>
code/LanBortalWeb/WebContent/resources/oldtools/shop/readerlist.xhtml
View file @
7c2f4e4
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
</h:link>
</h:link>
</h:column>
</h:column>
</h:dataTable>
</h:dataTable>
</composite:implementation>
</composite:implementation>
...
...
code/LanBortalWeb/WebContent/shop/assocToUser.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<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:f=
"http://java.sun.com/jsf/core"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:users=
"http://java.sun.com/jsf/composite/tools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.eventorg.list"
/>
<f:metadata>
<f:viewParam
name=
"userid"
value=
"#{userView.userid}"
/>
<f:event
type=
"preRenderView"
listener=
"#{productShopView.initView}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:outputText
rendered=
"#{!empty readerView.rfidevent.event}"
value=
"#{i18n['rfidevent.empty']}"
/>
<h:outputText
rendered=
"#{!empty readerView.rfidevent.event}"
value=
"#{i18n['rfidevent.empty']}"
/>
...
@@ -18,8 +21,8 @@
...
@@ -18,8 +21,8 @@
<h:outputText
value=
"#{readerView.rfidevent.tag}"
/>
<h:outputText
value=
"#{readerView.rfidevent.tag}"
/>
<h:outputLabel
value=
"#{i18n['rfidevent.insertplacecode']}"
/>
<h:outputLabel
value=
"#{i18n['rfidevent.insertplacecode']}"
/>
<h:form
id=
"placecodeform"
>
<h:form
id=
"placecodeform"
>
<h:inputText
value=
"#{readerView.placecode}"
/>
<h:inputText
value=
"#{readerView.placecode}"
/>
<h:commandButton
value=
"#{i18n['readerView.assocToPlacecode']}"
action=
"#{readerView.assocToPlacecode()}"
/>
<h:commandButton
value=
"#{i18n['readerView.assocToPlacecode']}"
action=
"#{readerView.assocToPlacecode()}"
/>
</h:form>
</h:form>
...
...
code/LanBortalWeb/WebContent/shop/listReaders.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
<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:f=
"http://java.sun.com/jsf/core"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:shop=
"http://java.sun.com/jsf/composite/cditools/shop"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:h=
"http://java.sun.com/jsf/html"
<h:body>
xmlns:f=
"http://java.sun.com/jsf/core"
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
xmlns:shop=
"http://java.sun.com/jsf/composite/cditools/shop"
<f:metadata>
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<f:event
type=
"preRenderView"
listener=
"#{readerListDataView.initView}"
/>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.shop.readerevents"
/>
</f:metadata>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<shop:readerlist
/>
</ui:define>
<shop:readerlist
/>
</ui:composition>
</ui:define>
</ui:composition>
</h:body>
</h:body>
</html>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/shop/rfidListener.xhtml
View file @
7c2f4e4
...
@@ -8,14 +8,12 @@
...
@@ -8,14 +8,12 @@
</h:head>
</h:head>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.permissionDenied"
/>
<ui:define
name=
"metadata"
>
<ui:define
name=
"metadata"
>
<f:metadata>
<f:metadata>
<f:viewParam
name=
"reader"
value=
"#{rfidView.reader}"
/>
<f:viewParam
name=
"reader"
value=
"#{rfidView.reader}"
/>
<f:viewParam
name=
"tag"
value=
"#{rfidView.tag}"
/>
<f:viewParam
name=
"tag"
value=
"#{rfidView.tag}"
/>
<f:viewParam
name=
"hash"
value=
"#{rfidView.hash}"
/>
<f:viewParam
name=
"hash"
value=
"#{rfidView.hash}"
/>
<f:event
type=
"preRenderView"
listener=
"#{rfidView.readTag}"
/>
<f:event
type=
"preRenderView"
listener=
"#{rfidView.readTag}"
/>
</f:metadata>
</f:metadata>
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
...
...
code/LanBortalWeb/WebContent/shop/showReaderEvents.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<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:f=
"http://java.sun.com/jsf/core"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:shop=
"http://java.sun.com/jsf/composite/cditools/shop"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:shop=
"http://java.sun.com/jsf/composite/cditools/shop"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.shop.readerevents"
/>
<f:metadata>
<f:metadata>
<f:viewParam
name=
"reader"
value=
"#{readerView.readername}"
/>
<f:viewParam
name=
"readerId"
value=
"#{readerNameContainer.readerId}"
/>
<f:event
type=
"preRenderView"
listener=
"#{readerView.initView}"
/>
<f:event
type=
"preRenderView"
listener=
"#{readerView.initReaderList}"
/>
</f:metadata><ui:define
name=
"content"
>
</f:metadata>
<shop:readerevents
rendered=
"#{!empty readerView.readername}"
/>
<shop:readerlist
rendered=
"#{empty readerView.readername}"
/>
<ui:define
name=
"content"
>
<shop:readerevents
rendered=
"#{!empty readerNameContainer.readerId}"
/>
<shop:readerlist
rendered=
"#{empty readerNameContainer.readerId}"
/>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
...
...
code/LanBortalWeb/WebContent/user/acceptInvite.xhtml
View file @
7c2f4e4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<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/tools/user"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:users=
"http://java.sun.com/jsf/composite/
cdi
tools/user"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
>
<h:body>
<h:body>
...
...
code/LanBortalWeb/WebContent/
rfid
/assocToUser.xhtml
→
code/LanBortalWeb/WebContent/
user
/assocToUser.xhtml
View file @
7c2f4e4
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<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:h=
"http://java.sun.com/jsf/html"
xmlns:users=
"http://java.sun.com/jsf/composite/cdiqtools/user"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:metadata>
<f:viewParam
name=
"userid"
value=
"#{userView.userid}"
/>
<f:viewParam
name=
"userid"
value=
"#{userView.userid}"
/>
<f:event
type=
"preRenderView"
listener=
"#{userView.initView}"
/>
<f:event
type=
"preRenderView"
listener=
"#{userView.initView}"
/>
</f:metadata>
</f:metadata>
<ui:param
name=
"thispage"
value=
"page.user.create"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<users:edit
creating=
"true"
commitaction=
"#{userView.createUser()}"
commitvalue=
"#{i18n['user.create']}"
/>
<users:edit
creating=
"true"
commitaction=
"#{userView.createUser()}"
commitvalue=
"#{i18n['user.create']}"
/>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
...
...
code/LanBortalWeb/WebContent/user/edit.xhtml
View file @
7c2f4e4
...
@@ -12,11 +12,9 @@
...
@@ -12,11 +12,9 @@
<f:event
type=
"preRenderView"
listener=
"#{userView.initView}"
/>
<f:event
type=
"preRenderView"
listener=
"#{userView.initView}"
/>
</f:metadata>
</f:metadata>
<!-- <ui:param name="thispage" value="page.user.edit" /> -->
<ui:define
name=
"title"
>
<ui:define
name=
"title"
>
<h1>
#{i18n['user.edit.title']}
</h1>
<h1>
#{i18n['user.edit.title']}
</h1>
<users:usertabs
tabId=
"edit"
/>
<users:usertabs
tabId=
"edit"
/>
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<users:edit
commitaction=
"#{userView.saveUser()}"
commitvalue=
"#{i18n['user.save']}"
/>
<users:edit
commitaction=
"#{userView.saveUser()}"
commitvalue=
"#{i18n['user.save']}"
/>
...
...
code/LanBortalWeb/WebContent/user/editcreate.xhtml
deleted
100644 → 0
View file @
50a80b4
<!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/tools/user"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.user.create"
/>
<ui:define
name=
"content"
>
<users:edit
creating=
"true"
commitaction=
"#{userView.createUser()}"
commitvalue=
"#{i18n['user.create']}"
/>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/oldview/view/BillView.java
View file @
7c2f4e4
...
@@ -19,7 +19,7 @@ import fi.insomnia.bortal.enums.Permission;
...
@@ -19,7 +19,7 @@ import fi.insomnia.bortal.enums.Permission;
import
fi.insomnia.bortal.enums.RolePermission
;
import
fi.insomnia.bortal.enums.RolePermission
;
import
fi.insomnia.bortal.model.Bill
;
import
fi.insomnia.bortal.model.Bill
;
@ManagedBean
(
name
=
"billView_ol
f
"
)
@ManagedBean
(
name
=
"billView_ol
d
"
)
@SessionScoped
@SessionScoped
public
class
BillView
{
public
class
BillView
{
...
...
code/LanBortalWeb/oldview/view/ReaderView.java
View file @
7c2f4e4
...
@@ -24,7 +24,7 @@ import fi.insomnia.bortal.model.User;
...
@@ -24,7 +24,7 @@ import fi.insomnia.bortal.model.User;
import
fi.insomnia.bortal.view.helpers.RfidEvent
;
import
fi.insomnia.bortal.view.helpers.RfidEvent
;
import
fi.insomnia.bortal.web.cdiview.RfidContainer
;
import
fi.insomnia.bortal.web.cdiview.RfidContainer
;
@
ManagedBean
(
name
=
"readerView"
)
@
Named
(
name
=
"readerView"
)
@SessionScoped
@SessionScoped
public
class
ReaderView
extends
GenericView
{
public
class
ReaderView
extends
GenericView
{
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/map/MapManageView.java
View file @
7c2f4e4
...
@@ -65,6 +65,13 @@ public class MapManageView extends GenericCDIView {
...
@@ -65,6 +65,13 @@ public class MapManageView extends GenericCDIView {
private
Integer
mapId
;
private
Integer
mapId
;
private
List
<
Product
>
productlist
;
private
List
<
Product
>
productlist
;
public
void
initCreate
()
{
if
(
super
.
requirePermissions
(
MapPermission
.
MANAGE_MAPS
))
{
super
.
beginConversation
();
}
}
public
void
initView
()
{
public
void
initView
()
{
if
(
super
.
requirePermissions
(
MapPermission
.
MANAGE_MAPS
))
{
if
(
super
.
requirePermissions
(
MapPermission
.
MANAGE_MAPS
))
{
map
=
eventmapBean
.
find
(
getMapId
());
map
=
eventmapBean
.
find
(
getMapId
());
...
@@ -102,6 +109,7 @@ public class MapManageView extends GenericCDIView {
...
@@ -102,6 +109,7 @@ public class MapManageView extends GenericCDIView {
}
}
public
String
createMap
()
{
public
String
createMap
()
{
try
{
try
{
map
=
eventmapBean
.
create
(
getMapname
());
map
=
eventmapBean
.
create
(
getMapname
());
}
catch
(
PermissionDeniedException
e
)
{
}
catch
(
PermissionDeniedException
e
)
{
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/menu/MenuView.java
View file @
7c2f4e4
...
@@ -61,7 +61,6 @@ public class MenuView {
...
@@ -61,7 +61,6 @@ public class MenuView {
submenu
=
new
ArrayList
<
JsfMenuitem
>();
submenu
=
new
ArrayList
<
JsfMenuitem
>();
for
(
MenuNavigation
navi
:
topPage
.
getChildren
())
{
for
(
MenuNavigation
navi
:
topPage
.
getChildren
())
{
logger
.
info
(
"Trying to add item {}"
,
navi
.
getKey
());
if
(
permbean
.
hasPermission
(
navi
.
getPermission
()))
{
if
(
permbean
.
hasPermission
(
navi
.
getPermission
()))
{
JsfMenuitem
thisitem
=
new
JsfMenuitem
(
navi
);
JsfMenuitem
thisitem
=
new
JsfMenuitem
(
navi
);
submenu
.
add
(
thisitem
);
submenu
.
add
(
thisitem
);
...
@@ -71,7 +70,6 @@ public class MenuView {
...
@@ -71,7 +70,6 @@ public class MenuView {
}
}
}
}
logger
.
info
(
"Initialized submenu {}"
,
submenu
);
}
}
return
submenu
;
return
submenu
;
...
@@ -95,8 +93,7 @@ public class MenuView {
...
@@ -95,8 +93,7 @@ public class MenuView {
}
}
for
(
MenuNavigation
m
:
menuitems
)
{
for
(
MenuNavigation
m
:
menuitems
)
{
if
(
m
.
getPermission
()
!=
null
&&
!
permbean
.
hasPermission
(
m
.
getPermission
()))
if
(
m
.
getPermission
()
!=
null
&&
!
permbean
.
hasPermission
(
m
.
getPermission
()))
{
{
continue
;
continue
;
}
}
...
@@ -110,7 +107,6 @@ public class MenuView {
...
@@ -110,7 +107,6 @@ public class MenuView {
thisitem
.
setItem
(
child
.
getItem
());
thisitem
.
setItem
(
child
.
getItem
());
break
;
break
;
}
}
}
}
}
}
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/organisation/EventOrgView.java
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
organisation
;
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
organisation
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
...
@@ -10,6 +11,7 @@ import javax.inject.Named;
...
@@ -10,6 +11,7 @@ import javax.inject.Named;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.beans.EventOrganiserBeanLocal
;
import
fi.insomnia.bortal.beans.EventOrganiserBeanLocal
;
import
fi.insomnia.bortal.model.EventOrganiser
;
import
fi.insomnia.bortal.model.EventOrganiser
;
import
fi.insomnia.bortal.model.LanEvent
;
import
fi.insomnia.bortal.model.User
;
import
fi.insomnia.bortal.model.User
;
import
fi.insomnia.bortal.web.annotations.LoggedIn
;
import
fi.insomnia.bortal.web.annotations.LoggedIn
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
...
@@ -31,17 +33,32 @@ public class EventOrgView extends GenericCDIView {
...
@@ -31,17 +33,32 @@ public class EventOrgView extends GenericCDIView {
private
EventOrganiser
eventorg
;
private
EventOrganiser
eventorg
;
private
Integer
orgId
;
private
Integer
orgId
;
private
String
createorgname
;
private
String
eventname
;
private
List
<
EventOrganiser
>
organisations
;
private
List
<
EventOrganiser
>
organisations
;
public
void
initEditView
()
{
private
Integer
eventid
;
if
(
orgId
!=
null
)
{
private
LanEvent
event
;
eventorg
=
eventorgbean
.
find
(
orgId
);
}
else
{
public
void
initCreate
()
eventorg
=
eventbean
.
getCurrentEvent
().
getOrganiser
();
{
if
(
super
.
requirePermissions
(
user
.
isSuperadmin
()))
{
super
.
beginConversation
();
}
}
if
(!
super
.
requirePermissions
(
user
.
isSuperadmin
()
||
(
eventorg
.
getAdmin
().
equals
(
user
))))
{
eventorg
=
null
;
}
public
void
initEdit
()
{
if
(
super
.
requirePermissions
(
user
.
isSuperadmin
()
||
(
eventorg
.
getAdmin
().
equals
(
user
)))
&&
eventorg
==
null
)
{
if
(
orgId
!=
null
)
{
eventorg
=
eventorgbean
.
find
(
orgId
);
}
else
{
eventorg
=
eventbean
.
getCurrentEvent
().
getOrganiser
();
}
super
.
beginConversation
();
}
}
}
}
...
@@ -56,6 +73,38 @@ public class EventOrgView extends GenericCDIView {
...
@@ -56,6 +73,38 @@ public class EventOrgView extends GenericCDIView {
}
}
}
}
public
void
initEditEvent
()
{
if
(
super
.
requirePermissions
(
user
.
isSuperadmin
()
||
(
eventbean
.
getCurrentEvent
().
getOrganiser
().
getAdmin
().
equals
(
user
)))
&&
getEvent
()
==
null
)
{
setEvent
(
eventorgbean
.
findEvent
(
eventid
));
}
}
public
String
createEvent
()
{
if
(
eventorg
.
getEvents
()
==
null
)
{
eventorg
.
setEvents
(
new
ArrayList
<
LanEvent
>());
}
setEvent
(
new
LanEvent
());
getEvent
().
setName
(
eventname
);
getEvent
().
setOrganiser
(
eventorg
);
eventname
=
""
;
eventorg
.
getEvents
().
add
(
getEvent
());
eventorgbean
.
save
(
eventorg
);
return
"/eventorg/editEvent"
;
}
public
String
create
()
{
eventorg
=
eventorgbean
.
create
(
createorgname
);
createorgname
=
""
;
return
"/eventorg/edit"
;
}
public
void
setEventorg
(
EventOrganiser
eventorg
)
{
public
void
setEventorg
(
EventOrganiser
eventorg
)
{
this
.
eventorg
=
eventorg
;
this
.
eventorg
=
eventorg
;
}
}
...
@@ -88,4 +137,36 @@ public class EventOrgView extends GenericCDIView {
...
@@ -88,4 +137,36 @@ public class EventOrgView extends GenericCDIView {
return
organisations
;
return
organisations
;
}
}
public
String
getCreateorgname
()
{
return
createorgname
;
}
public
void
setCreateorgname
(
String
createorgname
)
{
this
.
createorgname
=
createorgname
;
}
public
String
getEventname
()
{
return
eventname
;
}
public
void
setEventname
(
String
eventname
)
{
this
.
eventname
=
eventname
;
}
public
Integer
getEventid
()
{
return
eventid
;
}
public
void
setEventid
(
Integer
eventid
)
{
this
.
eventid
=
eventid
;
}
public
LanEvent
getEvent
()
{
return
event
;
}
public
void
setEvent
(
LanEvent
event
)
{
this
.
event
=
event
;
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/BillListView.java
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
shop
;
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
shop
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
...
@@ -9,6 +10,7 @@ import javax.inject.Inject;
...
@@ -9,6 +10,7 @@ import javax.inject.Inject;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
fi.insomnia.bortal.beans.BillBeanLocal
;
import
fi.insomnia.bortal.beans.BillBeanLocal
;
import
fi.insomnia.bortal.bortal.views.BillSummary
;
import
fi.insomnia.bortal.enums.apps.BillPermission
;
import
fi.insomnia.bortal.enums.apps.BillPermission
;
import
fi.insomnia.bortal.model.Bill
;
import
fi.insomnia.bortal.model.Bill
;
import
fi.insomnia.bortal.model.User
;
import
fi.insomnia.bortal.model.User
;
...
@@ -35,6 +37,8 @@ public class BillListView extends GenericCDIView {
...
@@ -35,6 +37,8 @@ public class BillListView extends GenericCDIView {
private
boolean
writeBill
;
private
boolean
writeBill
;
private
ArrayList
<
BillSummary
>
billsummary
;
public
void
initAllBills
()
{
public
void
initAllBills
()
{
if
(
super
.
requirePermissions
(
BillPermission
.
READ_ALL
))
{
if
(
super
.
requirePermissions
(
BillPermission
.
READ_ALL
))
{
beginConversation
();
beginConversation
();
...
@@ -43,6 +47,13 @@ public class BillListView extends GenericCDIView {
...
@@ -43,6 +47,13 @@ public class BillListView extends GenericCDIView {
}
}
}
}
public
void
initSummaryView
()
{
if
(
super
.
requirePermissions
(
BillPermission
.
READ_ALL
))
{
setBillsummary
(
new
ArrayList
<
BillSummary
>(
billbean
.
getBillLineSummary
()));
}
}
public
void
initUsersBills
()
{
public
void
initUsersBills
()
{
if
(
requirePermissions
(
BillPermission
.
VIEW_OWN
,
permbean
.
isLoggedIn
()))
{
if
(
requirePermissions
(
BillPermission
.
VIEW_OWN
,
permbean
.
isLoggedIn
()))
{
beginConversation
();
beginConversation
();
...
@@ -83,4 +94,13 @@ public class BillListView extends GenericCDIView {
...
@@ -83,4 +94,13 @@ public class BillListView extends GenericCDIView {
public
boolean
canReadAllBills
()
{
public
boolean
canReadAllBills
()
{
return
permbean
.
hasPermission
(
BillPermission
.
READ_ALL
);
return
permbean
.
hasPermission
(
BillPermission
.
READ_ALL
);
}
}
public
ArrayList
<
BillSummary
>
getBillsummary
()
{
return
billsummary
;
}
public
void
setBillsummary
(
ArrayList
<
BillSummary
>
billsummary
)
{
this
.
billsummary
=
billsummary
;
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ReaderListDataView.java
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
shop
;
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
shop
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.model.ListDataModel
;
import
javax.faces.model.ListDataModel
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.beans.ReaderBeanLocal
;
import
fi.insomnia.bortal.enums.apps.ShopPermission
;
import
fi.insomnia.bortal.model.Reader
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
@Named
@Named
@
Conversation
Scoped
@
Request
Scoped
public
class
ReaderListDataView
extends
GenericCDIView
{
public
class
ReaderListDataView
extends
GenericCDIView
{
/**
/**
*
*
*/
*/
private
static
final
long
serialVersionUID
=
-
601822388844764143L
;
private
static
final
long
serialVersionUID
=
-
601822388844764143L
;
private
ListDataModel
<
String
>
readers
;
@
Inject
@
EJB
private
Reader
View
readerview
;
private
Reader
BeanLocal
readerbean
;
@Inject
private
ListDataModel
<
Reader
>
readers
;
private
transient
RfidContainer
container
;
public
ListDataModel
<
String
>
getReaders
()
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ReaderListDataView
.
class
);
{
if
(
readers
==
null
)
{
super
.
beginConversation
();
readers
=
new
ListDataModel
<
String
>(
getContainer
().
getReaders
());
}
return
readers
;
}
public
String
selectReader
()
public
void
initView
()
{
{
readerview
.
setReadername
(
readers
.
getRowData
());
return
null
;
}
public
void
setReaders
(
ListDataModel
<
String
>
readers
)
{
super
.
requirePermissions
(
ShopPermission
.
SHOP_TO_OTHERS
);
this
.
readers
=
readers
;
}
public
RfidContainer
getContainer
()
{
return
container
;
}
}
public
void
setContainer
(
RfidContainer
container
)
{
public
ListDataModel
<
Reader
>
getReaders
()
this
.
container
=
container
;
{
}
public
ReaderView
getReaderview
()
{
if
(
readers
==
null
)
return
readerview
;
{
}
readers
=
new
ListDataModel
<
Reader
>(
readerbean
.
getReaders
());
}
return
readers
;
public
void
setReaderview
(
ReaderView
readerview
)
{
this
.
readerview
=
readerview
;
}
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ReaderNameContainer.java
0 → 100644
View file @
7c2f4e4
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
shop
;
import
java.io.Serializable
;
import
javax.enterprise.context.SessionScoped
;
import
javax.inject.Named
;
@Named
@SessionScoped
public
class
ReaderNameContainer
implements
Serializable
{
private
static
final
long
serialVersionUID
=
571747919767505523L
;
private
Integer
readerId
;
public
Integer
getReaderId
()
{
return
readerId
;
}
public
void
setReaderId
(
Integer
readerId
)
{
this
.
readerId
=
readerId
;
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ReaderView.java
View file @
7c2f4e4
...
@@ -2,47 +2,54 @@ package fi.insomnia.bortal.web.cdiview.shop;
...
@@ -2,47 +2,54 @@ package fi.insomnia.bortal.web.cdiview.shop;
import
java.util.List
;
import
java.util.List
;
import
javax.enterprise.context.SessionScoped
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
fi.insomnia.bortal.beans.ReaderBeanLocal
;
import
fi.insomnia.bortal.enums.apps.ShopPermission
;
import
fi.insomnia.bortal.enums.apps.ShopPermission
;
import
fi.insomnia.bortal.model.Reader
;
import
fi.insomnia.bortal.model.ReaderEvent
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
import
fi.insomnia.bortal.web.helpers.RfidEvent
;
@Named
@Named
@
Sess
ionScoped
@
Conversat
ionScoped
public
class
ReaderView
extends
GenericCDIView
{
public
class
ReaderView
extends
GenericCDIView
{
private
static
final
long
serialVersionUID
=
571747919767505523L
;
private
static
final
long
serialVersionUID
=
802344850073689859L
;
private
String
readername
;
@Inject
@Inject
private
transient
RfidContainer
container
;
private
ReaderNameContainer
name
container
;
public
void
initView
()
{
@EJB
super
.
requirePermissions
(
permbean
.
hasPermission
(
ShopPermission
.
SHOP_TO_OTHERS
));
private
ReaderBeanLocal
readerbean
;
}
private
List
<
Reader
>
readers
;
public
List
<
RfidEvent
>
getReaderEvents
()
{
public
void
initReaderList
()
{
return
container
.
getReaderEvents
(
readername
);
super
.
requirePermissions
(
ShopPermission
.
SHOP_TO_OTHERS
);
}
}
public
void
setReadername
(
String
readername
)
{
public
List
<
ReaderEvent
>
getReaderEvents
()
this
.
readername
=
readername
;
{
return
readerbean
.
getReaderEvents
(
namecontainer
.
getReaderId
());
}
}
public
String
getReadername
()
{
public
List
<
Reader
>
getReaders
()
return
readername
;
{
if
(
readers
==
null
)
{
readers
=
readerbean
.
getReaders
();
}
return
readers
;
}
}
public
void
setContainer
(
RfidContainer
container
)
{
public
ReaderNameContainer
getNamecontainer
(
)
{
this
.
container
=
container
;
return
name
container
;
}
}
public
RfidContainer
getContainer
(
)
{
public
void
setNamecontainer
(
ReaderNameContainer
namecontainer
)
{
return
container
;
this
.
namecontainer
=
name
container
;
}
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/RfidContainer.java
deleted
100644 → 0
View file @
50a80b4
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
shop
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.ApplicationScoped
;
import
javax.inject.Named
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.model.LanEvent
;
import
fi.insomnia.bortal.model.ReaderEvent
;
import
fi.insomnia.bortal.web.helpers.RfidEvent
;
@Named
@ApplicationScoped
public
class
RfidContainer
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RfidContainer
.
class
);
private
final
Map
<
Integer
,
Map
<
String
,
List
<
RfidEvent
>>>
events
=
Collections
.
synchronizedMap
(
new
HashMap
<
Integer
,
Map
<
String
,
List
<
RfidEvent
>>>());
@EJB
private
EventBeanLocal
evbean
;
public
synchronized
void
foundTag
(
String
reader
,
String
tag
,
ReaderEvent
revent
)
{
LanEvent
currEv
=
evbean
.
getCurrentEvent
();
if
(!
events
.
containsKey
(
currEv
.
getId
()))
{
events
.
put
(
currEv
.
getId
(),
Collections
.
synchronizedMap
(
new
HashMap
<
String
,
List
<
RfidEvent
>>()));
}
Map
<
String
,
List
<
RfidEvent
>>
eventMap
=
events
.
get
(
currEv
.
getId
());
logger
.
debug
(
"Found tag {} tag {}"
,
reader
,
tag
);
if
(!
eventMap
.
containsKey
(
reader
))
{
eventMap
.
put
(
reader
,
new
LinkedList
<
RfidEvent
>());
}
List
<
RfidEvent
>
readerevents
=
eventMap
.
get
(
reader
);
while
(
readerevents
.
size
()
>
20
)
{
readerevents
.
remove
(
readerevents
.
size
()
-
1
);
logger
.
debug
(
"Cleaning readerevents fro reader {}"
,
reader
);
}
if
(
readerevents
.
size
()
>
0
&&
readerevents
.
get
(
0
).
getTag
().
equals
(
tag
))
{
readerevents
.
get
(
0
).
seen
();
}
else
{
readerevents
.
add
(
0
,
new
RfidEvent
(
reader
,
tag
,
revent
));
logger
.
debug
(
"Readerevents size {}"
,
readerevents
.
size
());
}
}
public
List
<
String
>
getReaders
()
{
LanEvent
currEv
=
evbean
.
getCurrentEvent
();
if
(
events
.
containsKey
(
currEv
.
getId
()))
{
Set
<
String
>
retset
=
events
.
get
(
currEv
.
getId
()).
keySet
();
ArrayList
<
String
>
ret
=
new
ArrayList
<
String
>();
ret
.
addAll
(
retset
);
return
ret
;
}
return
null
;
}
public
List
<
RfidEvent
>
getReaderEvents
(
String
readername
)
{
LanEvent
currEv
=
evbean
.
getCurrentEvent
();
if
(
events
.
containsKey
(
currEv
.
getId
()))
{
return
events
.
get
(
currEv
.
getId
()).
get
(
readername
);
}
return
null
;
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/RfidView.java
View file @
7c2f4e4
...
@@ -2,7 +2,6 @@ package fi.insomnia.bortal.web.cdiview.shop;
...
@@ -2,7 +2,6 @@ package fi.insomnia.bortal.web.cdiview.shop;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.enterprise.context.RequestScoped
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -26,15 +25,11 @@ public class RfidView extends GenericCDIView {
...
@@ -26,15 +25,11 @@ public class RfidView extends GenericCDIView {
@EJB
@EJB
private
transient
ReaderBeanLocal
readerbean
;
private
transient
ReaderBeanLocal
readerbean
;
@Inject
private
transient
RfidContainer
container
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RfidView
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RfidView
.
class
);
public
void
readTag
()
{
public
void
readTag
()
{
ReaderEvent
revent
=
readerbean
.
checkTag
(
reader
,
tag
,
hash
);
ReaderEvent
revent
=
readerbean
.
checkTag
(
reader
,
tag
,
hash
);
logger
.
debug
(
"at view Got revent from bean: {}"
,
revent
);
logger
.
debug
(
"at view Got readerevent from bean: {}"
,
revent
);
getContainer
().
foundTag
(
reader
,
tag
,
revent
);
}
}
...
@@ -62,12 +57,4 @@ public class RfidView extends GenericCDIView {
...
@@ -62,12 +57,4 @@ public class RfidView extends GenericCDIView {
this
.
hash
=
hash
;
this
.
hash
=
hash
;
}
}
public
void
setContainer
(
RfidContainer
container
)
{
this
.
container
=
container
;
}
public
RfidContainer
getContainer
()
{
return
container
;
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/converter/GenericIntegerEntityConverter.java
View file @
7c2f4e4
...
@@ -58,16 +58,11 @@ public abstract class GenericIntegerEntityConverter<T extends ModelInterface<Int
...
@@ -58,16 +58,11 @@ public abstract class GenericIntegerEntityConverter<T extends ModelInterface<Int
T
ret
=
null
;
T
ret
=
null
;
Integer
id
=
null
;
Integer
id
=
null
;
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
try
{
id
=
Integer
.
parseInt
(
value
);
id
=
Integer
.
parseInt
(
value
);
if
(
id
!=
null
&&
id
>
0
)
{
if
(
id
!=
null
)
{
ret
=
find
(
id
);
ret
=
find
(
id
);
}
}
catch
(
NumberFormatException
nfe
)
{
if
(
value
==
null
||
!
value
.
equals
(
"null"
))
{
throw
nfe
;
}
}
}
}
}
logger
.
debug
(
"Converted String {} to Integer {} became object {}"
,
new
Object
[]
{
value
,
id
,
ret
});
logger
.
debug
(
"Converted String {} to Integer {} became object {}"
,
new
Object
[]
{
value
,
id
,
ret
});
return
ret
;
return
ret
;
...
@@ -86,7 +81,7 @@ public abstract class GenericIntegerEntityConverter<T extends ModelInterface<Int
...
@@ -86,7 +81,7 @@ public abstract class GenericIntegerEntityConverter<T extends ModelInterface<Int
}
}
if
(
ret
==
null
)
if
(
ret
==
null
)
{
{
ret
=
"
null
"
;
ret
=
"
0
"
;
}
}
return
ret
;
return
ret
;
}
}
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/helpers/RfidEvent.java
deleted
100644 → 0
View file @
50a80b4
package
fi
.
insomnia
.
bortal
.
web
.
helpers
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
import
fi.insomnia.bortal.model.ReaderEvent
;
public
class
RfidEvent
{
public
RfidEvent
(
String
reader
,
String
tag
,
ReaderEvent
revent
)
{
this
.
reader
=
reader
;
this
.
tag
=
tag
;
this
.
event
=
revent
;
}
public
void
seen
()
{
time
=
Calendar
.
getInstance
();
}
public
String
getSeenSince
()
{
long
diffSec
=
(
Calendar
.
getInstance
().
getTimeInMillis
()
-
time
.
getTimeInMillis
())
/
1000
;
long
secs
=
diffSec
%
60
;
long
diffMin
=
diffSec
/
60
;
long
mins
=
diffMin
%
60
;
long
hours
=
diffMin
/
60
;
StringBuilder
ret
=
new
StringBuilder
();
if
(
hours
>
0
)
{
ret
.
append
(
hours
).
append
(
" h "
);
}
if
(
hours
>
0
||
mins
>
0
)
{
ret
.
append
(
mins
).
append
(
" min "
);
}
ret
.
append
(
secs
).
append
(
" sec"
);
return
ret
.
toString
();
}
private
Calendar
time
=
Calendar
.
getInstance
();
private
String
reader
;
private
String
tag
;
private
ReaderEvent
event
;
private
List
<
String
>
actions
=
new
ArrayList
<
String
>();
public
Calendar
getTime
()
{
return
time
;
}
public
void
setTime
(
Calendar
time
)
{
this
.
time
=
time
;
}
public
String
getReader
()
{
return
reader
;
}
public
void
setReader
(
String
reader
)
{
this
.
reader
=
reader
;
}
public
String
getTag
()
{
return
tag
;
}
public
void
setTag
(
String
tag
)
{
this
.
tag
=
tag
;
}
public
ReaderEvent
getEvent
()
{
return
event
;
}
public
void
setEvent
(
ReaderEvent
event
)
{
this
.
event
=
event
;
}
public
List
<
String
>
getActions
()
{
return
actions
;
}
public
void
setActions
(
List
<
String
>
actions
)
{
this
.
actions
=
actions
;
}
public
void
addMessage
(
String
msg
)
{
this
.
actions
.
add
(
msg
);
}
}
\ No newline at end of file
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