Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9d192d70
authored
Oct 28, 2010
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Paikkavaraus fiksattu,
1 parent
300141b7
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
155 additions
and
43 deletions
code/LanBortalAuthModule/.classpath
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/AccountEventBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PlaceBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PlaceGroupBean.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/PlaceBeanLocal.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/PlaceGroup.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/ReaderEvent_.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Reader_.java
code/LanBortalWeb/WebContent/product/createBill.xhtml
code/LanBortalWeb/WebContent/resources/tools/products/shop.xhtml
code/LanBortalWeb/WebContent/shop/shopToUser.xhtml
code/LanBortalWeb/WebContent/user/adminSendImage.xhtml
code/LanBortalWeb/WebContent/user/edit.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/view/ProductShopView.java
code/LanBortalWeb/src/fi/insomnia/bortal/view/UserView.java
code/LanBortalAuthModule/.classpath
View file @
9d192d7
...
...
@@ -2,13 +2,11 @@
<classpath>
<classpathentry
kind=
"src"
path=
"src"
/>
<classpathentry
combineaccessrules=
"false"
exported=
"true"
kind=
"src"
path=
"/LanBortalAuthModuleClient"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.jst.server.core.container/com.sun.enterprise.jst.server.runtimeTarget/GlassFish v3 Java EE 6"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"
>
<attributes>
<attribute
name=
"owner.project.facets"
value=
"java"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.jst.server.core.container/com.sun.enterprise.jst.server.runtimeTarget/GlassFish Server Open Source Edition 3 (Java EE 6)"
/>
<classpathentry
kind=
"lib"
path=
"/Users/jkj/Projects/Omnia/glassfish3/glassfish/lib/appserv-rt.jar"
/>
<classpathentry
kind=
"output"
path=
"bin"
/>
</classpath>
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/AccountEventBean.java
View file @
9d192d7
...
...
@@ -98,13 +98,16 @@ public class AccountEventBean implements AccountEventBeanLocal {
}
if
(
prodentry
.
getKey
().
isPrepaidInstant
()
&&
prodentry
.
getKey
().
getPlaces
()
!=
null
&&
prodentry
.
getKey
().
getPlaces
().
size
()
>
0
)
{
for
(
Place
p
:
prodentry
.
getKey
().
getPlaces
())
{
if
(!
p
.
isTaken
())
{
placebean
.
lockPlaces
(
shoppingUser
,
p
);
break
;
}
}
logger
.
debug
(
"Prepaidplace"
);
placebean
.
lockPlaceProduct
(
shoppingUser
,
prodentry
.
getKey
(),
BigDecimal
.
ONE
);
// for (Place p : prodentry.getKey().getPlaces()) {
// if (!p.isTaken()) {
// logger.debug("Locking user {} to place {}", shoppingUser,p);
// placebean.lockPlaces(shoppingUser, p);
// break;
// }
// }
}
ac
.
setSeller
(
seller
);
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillBean.java
View file @
9d192d7
...
...
@@ -199,7 +199,7 @@ public class BillBean implements BillBeanLocal {
if
(
prod
.
isPrepaidInstant
())
{
logger
.
debug
(
"Creating Bill prepaidInstant product {}, {}"
,
prod
.
getName
(),
bl
.
getQuantity
());
if
(
prod
.
getPlaces
().
size
()
>
0
)
{
placebean
.
lockPlace
s
(
bill
.
getUser
(),
prod
,
bl
.
getQuantity
());
placebean
.
lockPlace
Product
(
bill
.
getUser
(),
prod
,
bl
.
getQuantity
());
}
productBean
.
createAccountEvent
(
prod
,
bl
.
getQuantity
(),
bill
.
getUser
());
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PlaceBean.java
View file @
9d192d7
...
...
@@ -210,27 +210,46 @@ public class PlaceBean implements PlaceBeanLocal {
}
@Override
public
void
lockPlaces
(
User
user
,
Product
prod
,
BigDecimal
quantity
)
{
public
void
lockPlaceProduct
(
User
user
,
Product
prod
,
BigDecimal
quantity
)
{
user
=
userbean
.
mergeChanges
(
user
);
BigDecimal
loop
=
BigDecimal
.
ZERO
;
LanEvent
event
=
eventBean
.
getCurrentEvent
();
PlaceGroup
pg
=
new
PlaceGroup
(
event
,
Calendar
.
getInstance
(),
Calendar
.
getInstance
(),
true
);
pg
.
setCreator
(
user
);
pgfacade
.
create
(
pg
);
for
(
Place
p
:
prod
.
getPlaces
())
{
if
(!
p
.
isTaken
())
{
p
.
reserve
(
user
);
//
p.reserve(user);
p
.
buy
(
pg
);
pg
.
getMembers
().
add
(
new
GroupMembership
(
event
,
pg
,
p
,
gmemfacade
.
createInviteToken
(
event
)));
GroupMembership
currgm
=
new
GroupMembership
(
event
,
pg
,
p
,
gmemfacade
.
createInviteToken
(
event
));
placeFacade
.
merge
(
p
);
// pgbean.createGroupMembership(pg, p);
pg
.
getMembers
().
add
(
currgm
);
loop
=
loop
.
add
(
BigDecimal
.
ONE
);
if
(
quantity
.
equals
(
BigDecimal
.
ONE
))
{
boolean
gmassoc
=
false
;
for
(
GroupMembership
gm
:
user
.
getGroupMemberships
())
{
if
(
gm
.
getId
().
getEventId
().
equals
(
event
.
getId
()))
{
gmassoc
=
true
;
break
;
}
}
if
(!
gmassoc
)
{
user
.
getGroupMemberships
().
add
(
currgm
);
currgm
.
setUser
(
user
);
}
}
if
(
loop
.
compareTo
(
quantity
)
>=
0
)
{
break
;
}
}
}
pgfacade
.
create
(
pg
);
}
@Override
...
...
@@ -270,33 +289,42 @@ public class PlaceBean implements PlaceBeanLocal {
logger
.
warn
(
"Place {} is already taken"
,
place
);
throw
new
PermissionDeniedException
(
secubean
,
userbean
.
getCurrentUser
(),
"NO RIGHT"
);
}
userbean
.
fatalPermission
(
Permission
.
SHOP
,
RolePermission
.
EXECUTE
,
"User tried to lock place without SHOP:EXECUTE"
);
LanEvent
ev
=
eventBean
.
getCurrentEvent
();
PlaceGroup
pg
=
new
PlaceGroup
(
ev
,
Calendar
.
getInstance
(),
Calendar
.
getInstance
(),
true
);
pg
.
setCreator
(
user
);
user
.
getPlaceGroups
().
add
(
pg
);
place
.
reserve
(
user
);
place
.
buy
(
pg
);
pg
.
getMembers
().
add
(
new
GroupMembership
(
ev
,
pg
,
place
,
gmemfacade
.
createInviteToken
(
ev
)));
GroupMembership
newgm
=
new
GroupMembership
(
ev
,
pg
,
place
,
gmemfacade
.
createInviteToken
(
ev
));
pg
.
getMembers
().
add
(
newgm
);
boolean
foundGm
=
false
;
for
(
GroupMembership
gm
:
user
.
getGroupMemberships
())
{
logger
.
debug
(
"Checking users gm:s found: {}"
,
gm
);
if
(
gm
.
getId
().
getEventId
().
equals
(
ev
.
getId
()))
{
foundGm
=
true
;
break
;
}
}
logger
.
debug
(
"Foundgm {}"
,
foundGm
);
if
(!
foundGm
)
{
GroupMembership
gm
=
pg
.
getMembers
().
get
(
0
);
gm
.
setUser
(
user
);
user
.
getGroupMemberships
().
add
(
gm
);
logger
.
debug
(
"Membership not found. associating"
);
new
gm
.
setUser
(
user
);
user
.
getGroupMemberships
().
add
(
new
gm
);
// gmemfacade.merge(gm
);
userbean
.
mergeChanges
(
user
);
}
pgfacade
.
create
(
pg
);
place
=
placeFacade
.
merge
(
place
);
// userbean.mergeChanges(user);
return
placeFacade
.
merge
(
place
);
return
place
;
}
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PlaceGroupBean.java
View file @
9d192d7
...
...
@@ -165,7 +165,7 @@ public class PlaceGroupBean implements PlaceGroupBeanLocal {
@Override
public
void
releaseAndGenerateToken
(
GroupMembership
gmem
)
{
if
(!
userbean
.
getCurrentUser
().
equals
(
gmem
.
getPlaceGroup
().
getCreator
())
||
if
(!
userbean
.
getCurrentUser
().
getId
().
equals
(
gmem
.
getPlaceGroup
().
getCreator
().
getId
())
||
!
userbean
.
hasCurrentUserPermission
(
Permission
.
MAP
,
RolePermission
.
WRITE
))
{
throw
new
PermissionDeniedException
(
secubean
,
userbean
.
getCurrentUser
(),
"User tried to release and generate group membership: "
+
gmem
);
}
...
...
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/PlaceBeanLocal.java
View file @
9d192d7
...
...
@@ -21,7 +21,7 @@ import fi.insomnia.bortal.model.User;
* @author tuukka
*/
@Local
//@RemoteDestination
//
@RemoteDestination
public
interface
PlaceBeanLocal
{
Place
mergeChanges
(
Place
place
);
...
...
@@ -38,8 +38,6 @@ public interface PlaceBeanLocal {
boolean
buySelectedPlaces
(
EventMap
e
)
throws
BortalCatchableException
;
void
lockPlaces
(
User
user
,
Product
prod
,
BigDecimal
quantity
);
int
setBuyable
(
EventMap
map
,
String
buyableLike
,
boolean
b
);
Place
find
(
EventPk
id
);
...
...
@@ -48,4 +46,6 @@ public interface PlaceBeanLocal {
Place
lockPlaces
(
User
rowData
,
Place
place
);
void
lockPlaceProduct
(
User
user
,
Product
prod
,
BigDecimal
quantity
);
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/PlaceGroup.java
View file @
9d192d7
...
...
@@ -4,6 +4,7 @@
*/
package
fi
.
insomnia
.
bortal
.
model
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
...
...
@@ -70,7 +71,7 @@ public class PlaceGroup implements EventChildInterface {
private
User
creator
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"placeGroup"
)
private
List
<
GroupMembership
>
members
;
private
List
<
GroupMembership
>
members
=
new
ArrayList
<
GroupMembership
>()
;
@OneToMany
(
mappedBy
=
"group"
)
@OrderBy
(
"name"
)
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Reader.java
View file @
9d192d7
...
...
@@ -4,6 +4,8 @@
*/
package
fi
.
insomnia
.
bortal
.
model
;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.EmbeddedId
;
import
javax.persistence.Entity
;
...
...
@@ -13,6 +15,7 @@ import javax.persistence.Lob;
import
javax.persistence.ManyToOne
;
import
javax.persistence.NamedQueries
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
import
javax.persistence.Version
;
import
javax.persistence.UniqueConstraint
;
...
...
@@ -33,11 +36,14 @@ public class Reader extends GenericEventChild {
super
();
}
public
Reader
(
LanEvent
ev
,
String
iden
)
{
public
Reader
(
LanEvent
ev
,
String
iden
t
)
{
super
(
ev
);
this
.
identification
=
ident
;
}
private
Integer
gamepoints
;
private
Integer
maxEvents
;
/**
*
*/
...
...
@@ -71,6 +77,9 @@ public class Reader extends GenericEventChild {
@Column
(
name
=
"map_y"
)
private
Integer
mapY
;
@OneToMany
(
mappedBy
=
"reader"
)
private
List
<
ReaderEvent
>
events
;
public
String
getIdentification
()
{
return
identification
;
}
...
...
@@ -148,4 +157,28 @@ public class Reader extends GenericEventChild {
public
LanEvent
getEvent
()
{
return
event
;
}
public
void
setGamepoints
(
Integer
gamepoints
)
{
this
.
gamepoints
=
gamepoints
;
}
public
Integer
getGamepoints
()
{
return
gamepoints
;
}
public
void
setMaxEvents
(
Integer
maxEvents
)
{
this
.
maxEvents
=
maxEvents
;
}
public
Integer
getMaxEvents
()
{
return
maxEvents
;
}
public
void
setEvents
(
List
<
ReaderEvent
>
events
)
{
this
.
events
=
events
;
}
public
List
<
ReaderEvent
>
getEvents
()
{
return
events
;
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/ReaderEvent.java
View file @
9d192d7
...
...
@@ -40,6 +40,8 @@ public class ReaderEvent extends GenericEventChild {
@Column
(
name
=
"value"
)
private
String
value
;
private
Integer
gaepoint
;
@JoinColumns
({
@JoinColumn
(
name
=
"printed_cards_id"
,
referencedColumnName
=
"id"
,
nullable
=
false
,
updatable
=
false
),
@JoinColumn
(
name
=
"event_id"
,
referencedColumnName
=
"event_id"
,
nullable
=
false
,
updatable
=
false
,
insertable
=
false
)
})
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/ReaderEvent_.java
View file @
9d192d7
...
...
@@ -5,11 +5,12 @@ import javax.annotation.Generated;
import
javax.persistence.metamodel.SingularAttribute
;
import
javax.persistence.metamodel.StaticMetamodel
;
@Generated
(
value
=
"Dali"
,
date
=
"2010-10-28T
16:55:25.053
+0300"
)
@Generated
(
value
=
"Dali"
,
date
=
"2010-10-28T
21:00:17.154
+0300"
)
@StaticMetamodel
(
ReaderEvent
.
class
)
public
class
ReaderEvent_
extends
GenericEventChild_
{
public
static
volatile
SingularAttribute
<
ReaderEvent
,
Calendar
>
time
;
public
static
volatile
SingularAttribute
<
ReaderEvent
,
String
>
value
;
public
static
volatile
SingularAttribute
<
ReaderEvent
,
Integer
>
gaepoint
;
public
static
volatile
SingularAttribute
<
ReaderEvent
,
PrintedCard
>
printedCard
;
public
static
volatile
SingularAttribute
<
ReaderEvent
,
Reader
>
reader
;
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Reader_.java
View file @
9d192d7
package
fi
.
insomnia
.
bortal
.
model
;
import
javax.annotation.Generated
;
import
javax.persistence.metamodel.ListAttribute
;
import
javax.persistence.metamodel.SingularAttribute
;
import
javax.persistence.metamodel.StaticMetamodel
;
@Generated
(
value
=
"Dali"
,
date
=
"2010-10-28T
16:55:25.036
+0300"
)
@Generated
(
value
=
"Dali"
,
date
=
"2010-10-28T
21:00:17.122
+0300"
)
@StaticMetamodel
(
Reader
.
class
)
public
class
Reader_
extends
GenericEventChild_
{
public
static
volatile
SingularAttribute
<
Reader
,
Integer
>
gamepoints
;
public
static
volatile
SingularAttribute
<
Reader
,
Integer
>
maxEvents
;
public
static
volatile
SingularAttribute
<
Reader
,
String
>
identification
;
public
static
volatile
SingularAttribute
<
Reader
,
String
>
description
;
public
static
volatile
SingularAttribute
<
Reader
,
Location
>
location
;
...
...
@@ -14,4 +17,5 @@ public class Reader_ extends GenericEventChild_ {
public
static
volatile
SingularAttribute
<
Reader
,
LanEvent
>
event
;
public
static
volatile
SingularAttribute
<
Reader
,
Integer
>
mapX
;
public
static
volatile
SingularAttribute
<
Reader
,
Integer
>
mapY
;
public
static
volatile
ListAttribute
<
Reader
,
ReaderEvent
>
events
;
}
code/LanBortalWeb/WebContent/product/createBill.xhtml
View file @
9d192d7
...
...
@@ -12,8 +12,10 @@
<ui:define
name=
"content"
>
#{productShopView.initUsershoppable()}
<h:form
id=
"billshopform"
>
<products:shop
commitaction=
"#{productShopView.commitBillCart()}"
items=
"#{productShopView.billCart}"
commitValue=
"#{i18n['productshop.commit']}"
/>
</h:form>
</ui:define>
</ui:composition>
</h:body>
...
...
code/LanBortalWeb/WebContent/resources/tools/products/shop.xhtml
View file @
9d192d7
...
...
@@ -16,7 +16,7 @@
<h:outputScript
target=
"head"
library=
"script"
name=
"jquery.min.js"
/>
<h:outputScript
target=
"head"
library=
"script"
name=
"shopscript.js"
/>
<h:form
id=
"shopform"
>
<h:dataTable
border=
"0"
id=
"billcart"
value=
"#{cc.attrs.items}"
var=
"cart"
>
<h:column>
<f:facet
name=
"header"
>
...
...
@@ -48,7 +48,6 @@
</h:dataTable>
<h:commandButton
action=
"#{cc.attrs.commitaction}"
id=
"commitbutton"
value=
"#{cc.attrs.commitValue}"
/>
</h:form>
...
...
code/LanBortalWeb/WebContent/shop/shopToUser.xhtml
View file @
9d192d7
...
...
@@ -18,16 +18,16 @@
<h:outputText
value=
"#{productShopView.shoppingUser.accountBalance}"
>
<f:convertNumber
/>
</h:outputText>
<h:outputText
value=
"#{i18n['product.shopInstant']}"
/>
<h:selectBooleanCheckbox
value=
"#{productShopView.payInstant}"
/>
</h:panelGrid>
<h:form
id=
"shoppingcartform"
>
<h:outputText
value=
"#{i18n['product.shopInstant']}"
/>
<h:selectBooleanCheckbox
value=
"#{productShopView.payInstant}"
/>
<products:shop
commitaction=
"#{productShopView.commitShoppingCart()}"
items=
"#{productShopView.billCart}"
commitValue=
"#{i18n['productshop.commit']}"
/>
</h:form>
</ui:define>
...
...
code/LanBortalWeb/WebContent/user/adminSendImage.xhtml
View file @
9d192d7
...
...
@@ -19,13 +19,23 @@
</h:panelGrid>
<users:sendImage
/>
<h:dataTable
border=
"1"
id=
"user"
value=
"#{userView.user.userImageList}"
var=
"img"
>
#{userView.initUserimagelist()}
<h:dataTable
border=
"1"
id=
"user"
value=
"#{userView.userImageList}"
var=
"img"
>
<h:column>
<h:outputText
value=
"#{img.name}"
/>
</h:column>
<h:column>
<h:outputText
value=
"#{img.mimeType}"
/>
</h:column>
<h:column>
<a
href=
"#"
onclick=
"window.open('#{request.contextPath}/Userimage?imageid=#{img.id}', 'imagesubmitpopup', 'height=240,width=320'); this.target='imagesubmitpopup'; return true; "
>
Näytä kuva
</a>
</h:column>
<h:column>
<h:commandButton
action=
"#{userView.setDefaultImage()}"
value=
"Set default image"
/>
</h:column>
</h:dataTable>
...
...
code/LanBortalWeb/WebContent/user/edit.xhtml
View file @
9d192d7
...
...
@@ -28,6 +28,13 @@
<h:dataTable
border=
"1"
id=
"placegroup"
value=
"#{userView.placegroups}"
var=
"placegroup"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"ID"
/>
</f:facet>
<h:outputText
value=
"#{placegroup.id.id}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['placegroup.name']}"
/>
</f:facet>
<h:outputText
value=
"#{placegroup.name}"
/>
...
...
@@ -69,6 +76,9 @@
<h:column>
<h:outputText
value=
"#{place.name}"
/>
</h:column>
<h:column>
<h:outputText
rendered=
"#{! empty place.placeReserver}"
value=
"#{place.placeReserver.user.nick}"
/>
</h:column>
</h:dataTable>
</h:column>
<h:column>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/view/ProductShopView.java
View file @
9d192d7
...
...
@@ -38,7 +38,7 @@ import fi.insomnia.bortal.view.helpers.ProductShopItem;
@ManagedBean
(
name
=
"productShopView"
)
@SessionScoped
public
class
ProductShopView
{
public
class
ProductShopView
extends
GenericView
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProductShopView
.
class
);
@EJB
...
...
@@ -107,6 +107,7 @@ public class ProductShopView {
while
(
cartIter
.
hasNext
())
{
ProductShopItem
shopitem
=
cartIter
.
next
();
if
(
shopitem
.
getCount
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
if
(
shopMap
.
containsKey
(
shopitem
.
getProduct
()))
{
FacesContext
.
getCurrentInstance
().
addMessage
(
null
,
new
FacesMessage
(
I18n
.
get
(
"productshop.productFoundTwice"
)));
return
null
;
...
...
@@ -116,12 +117,12 @@ public class ProductShopView {
}
List
<
AccountEvent
>
executed
=
accountEventBean
.
shopCash
(
shoppingUser
,
shopMap
,
isPayInstant
());
this
.
addFaceMessage
(
"Tuotteet ostettu"
);
return
"success"
;
}
public
void
initUsershoppable
()
{
setPayInstant
(
tru
e
);
setPayInstant
(
fals
e
);
logger
.
debug
(
"Creating new BillCart"
);
userBean
.
fatalPermission
(
Permission
.
BILL
,
RolePermission
.
EXECUTE
);
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/view/UserView.java
View file @
9d192d7
...
...
@@ -27,6 +27,7 @@ import fi.insomnia.bortal.model.GroupMembership;
import
fi.insomnia.bortal.model.PlaceGroup
;
import
fi.insomnia.bortal.model.Role
;
import
fi.insomnia.bortal.model.User
;
import
fi.insomnia.bortal.model.UserImage
;
import
fi.insomnia.bortal.utilities.I18n
;
@ManagedBean
(
name
=
"userView"
)
...
...
@@ -53,6 +54,7 @@ public class UserView extends GenericView {
private
String
passwordcheck
;
@EJB
private
UtilBeanLocal
utilbean
;
private
ListDataModel
<
UserImage
>
userImageList
;
public
void
initCreateuser
()
{
user
=
new
User
();
...
...
@@ -65,6 +67,12 @@ public class UserView extends GenericView {
}
public
String
setDefaultImage
()
{
user
.
setCurrentImage
(
userImageList
.
getRowData
());
userBean
.
mergeChanges
(
user
);
return
null
;
}
public
String
edit
()
{
userBean
.
fatalPermission
(
Permission
.
USER_MANAGEMENT
,
RolePermission
.
READ
);
...
...
@@ -154,6 +162,10 @@ public class UserView extends GenericView {
}
return
ret
;
}
public
void
initUserimagelist
()
{
setUserImageList
(
new
ListDataModel
<
UserImage
>(
user
.
getUserImageList
()));
}
public
String
saveUser
()
{
...
...
@@ -256,4 +268,12 @@ public class UserView extends GenericView {
return
shopview
;
}
public
void
setUserImageList
(
ListDataModel
<
UserImage
>
userImageList
)
{
this
.
userImageList
=
userImageList
;
}
public
ListDataModel
<
UserImage
>
getUserImageList
()
{
return
userImageList
;
}
}
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