Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7e22d2bb
authored
Oct 26, 2012
by
Antti Tönkyrä
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of codecrew.fi:bortal
2 parents
31fdc4a0
a62b9c85
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
443 additions
and
298 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/FoodWaveBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PermissionBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PlaceBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ProductPBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/RoleBean.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/FoodWaveBeanLocal.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/RoleBeanLocal.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/BillLine.java
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/apps/MapPermission.java
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/apps/ShopPermission.java
code/LanBortalWeb/WebContent/foodadmin/createTemplate.xhtml
code/LanBortalWeb/WebContent/foodadmin/editTemplate.xhtml
code/LanBortalWeb/WebContent/foodadmin/listTemplates.xhtml
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
code/LanBortalWeb/WebContent/foodwave/list.xhtml
code/LanBortalWeb/WebContent/foodwave/listTemplates.xhtml
code/LanBortalWeb/WebContent/resources/cditools/foodwave/listTemplates.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveFoodView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/user/UserView.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/FoodWaveBean.java
View file @
7e22d2b
package
fi
.
insomnia
.
bortal
.
beans
;
package
fi
.
insomnia
.
bortal
.
beans
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
javax.annotation.security.DeclareRoles
;
import
javax.annotation.security.DeclareRoles
;
...
@@ -11,14 +12,16 @@ import sun.reflect.generics.reflectiveObjects.NotImplementedException;
...
@@ -11,14 +12,16 @@ import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import
fi.insomnia.bortal.enums.apps.ShopPermission
;
import
fi.insomnia.bortal.enums.apps.ShopPermission
;
import
fi.insomnia.bortal.facade.FoodWaveFacade
;
import
fi.insomnia.bortal.facade.FoodWaveFacade
;
import
fi.insomnia.bortal.facade.FoodWaveTemplateFacade
;
import
fi.insomnia.bortal.facade.FoodWaveTemplateFacade
;
import
fi.insomnia.bortal.facade.ProductFacade
;
import
fi.insomnia.bortal.model.FoodWave
;
import
fi.insomnia.bortal.model.FoodWave
;
import
fi.insomnia.bortal.model.FoodWaveTemplate
;
import
fi.insomnia.bortal.model.FoodWaveTemplate
;
import
fi.insomnia.bortal.model.Product
;
/**
/**
* Session Bean implementation class FoodWaveBean
* Session Bean implementation class FoodWaveBean
*/
*/
@Stateless
@Stateless
@DeclareRoles
(
ShopPermission
.
S_MANAGE_PRODUCTS
)
@DeclareRoles
(
{
ShopPermission
.
S_MANAGE_PRODUCTS
,
ShopPermission
.
S_SHOP_FOODWAVE
,
ShopPermission
.
S_MANAGE_FOODWAVES
}
)
public
class
FoodWaveBean
implements
FoodWaveBeanLocal
{
public
class
FoodWaveBean
implements
FoodWaveBeanLocal
{
@EJB
@EJB
...
@@ -26,6 +29,8 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
...
@@ -26,6 +29,8 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
@EJB
@EJB
private
FoodWaveFacade
foodWaveFacade
;
private
FoodWaveFacade
foodWaveFacade
;
@EJB
private
ProductFacade
productfacade
;
@Override
@Override
@RolesAllowed
(
ShopPermission
.
S_MANAGE_PRODUCTS
)
@RolesAllowed
(
ShopPermission
.
S_MANAGE_PRODUCTS
)
...
@@ -38,7 +43,7 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
...
@@ -38,7 +43,7 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
public
void
createFoodWave
(
FoodWave
fw
)
{
public
void
createFoodWave
(
FoodWave
fw
)
{
foodWaveFacade
.
create
(
fw
);
foodWaveFacade
.
create
(
fw
);
}
}
@Override
@Override
@RolesAllowed
(
ShopPermission
.
S_MANAGE_PRODUCTS
)
@RolesAllowed
(
ShopPermission
.
S_MANAGE_PRODUCTS
)
public
FoodWaveTemplate
saveOrCreateTemplate
(
FoodWaveTemplate
template
)
{
public
FoodWaveTemplate
saveOrCreateTemplate
(
FoodWaveTemplate
template
)
{
...
@@ -57,11 +62,12 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
...
@@ -57,11 +62,12 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
}
}
@Override
@Override
@RolesAllowed
(
"SHOP/READ"
)
@RolesAllowed
(
ShopPermission
.
S_SHOP_FOODWAVE
)
public
List
<
FoodWave
>
getOpenFoodWaves
()
{
public
List
<
FoodWave
>
getOpenFoodWaves
()
{
return
foodWaveFacade
.
getOpenFoodWaves
();
return
foodWaveFacade
.
getOpenFoodWaves
();
}
}
@RolesAllowed
({
ShopPermission
.
S_SHOP_FOODWAVE
,
ShopPermission
.
S_MANAGE_FOODWAVES
})
public
FoodWave
findFoodwave
(
Integer
foodwaveId
)
{
public
FoodWave
findFoodwave
(
Integer
foodwaveId
)
{
return
foodWaveFacade
.
find
(
foodwaveId
);
return
foodWaveFacade
.
find
(
foodwaveId
);
}
}
...
@@ -81,10 +87,34 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
...
@@ -81,10 +87,34 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
public
FoodWaveTemplate
findTemplate
(
Integer
templateId
)
{
public
FoodWaveTemplate
findTemplate
(
Integer
templateId
)
{
return
fwtFacade
.
find
(
templateId
);
return
fwtFacade
.
find
(
templateId
);
}
}
@Override
@Override
public
List
<
FoodWave
>
getEventFoodWaves
()
{
public
List
<
FoodWave
>
getEventFoodWaves
()
{
return
foodWaveFacade
.
getEventFoodWaves
();
return
foodWaveFacade
.
getEventFoodWaves
();
}
}
@Override
@RolesAllowed
(
ShopPermission
.
S_MANAGE_FOODWAVES
)
public
FoodWaveTemplate
addProductToTemplate
(
FoodWaveTemplate
template
,
Product
product
)
{
template
=
fwtFacade
.
reload
(
template
);
if
(
product
.
getId
()
==
null
)
{
productfacade
.
create
(
product
);
}
else
{
product
=
productfacade
.
reload
(
product
);
}
if
(
product
.
getFoodWaveTemplates
()
==
null
)
{
product
.
setFoodWaveTemplates
(
new
ArrayList
<
FoodWaveTemplate
>());
}
if
(
template
.
getProducts
()
==
null
)
{
template
.
setProducts
(
new
ArrayList
<
Product
>());
}
template
.
getProducts
().
add
(
product
);
product
.
getFoodWaveTemplates
().
add
(
template
);
return
template
;
}
}
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PermissionBean.java
View file @
7e22d2b
...
@@ -51,6 +51,7 @@ import fi.insomnia.bortal.model.User;
...
@@ -51,6 +51,7 @@ import fi.insomnia.bortal.model.User;
MapPermission
.
S_MANAGE_MAPS
,
MapPermission
.
S_MANAGE_MAPS
,
MapPermission
.
S_MANAGE_OTHERS
,
MapPermission
.
S_MANAGE_OTHERS
,
MapPermission
.
S_BUY_PLACES
,
MapPermission
.
S_BUY_PLACES
,
MapPermission
.
S_RELEASE_PLACE
,
ShopPermission
.
S_LIST_ALL_PRODUCTS
,
ShopPermission
.
S_LIST_ALL_PRODUCTS
,
ShopPermission
.
S_LIST_USERPRODUCTS
,
ShopPermission
.
S_LIST_USERPRODUCTS
,
...
@@ -58,6 +59,7 @@ import fi.insomnia.bortal.model.User;
...
@@ -58,6 +59,7 @@ import fi.insomnia.bortal.model.User;
ShopPermission
.
S_MANAGE_PRODUCTS
,
ShopPermission
.
S_MANAGE_PRODUCTS
,
ShopPermission
.
S_SHOP_PRODUCTS
,
ShopPermission
.
S_SHOP_PRODUCTS
,
ShopPermission
.
S_SHOP_FOODWAVE
,
ShopPermission
.
S_SHOP_FOODWAVE
,
ShopPermission
.
S_MANAGE_FOODWAVES
,
BillPermission
.
S_CREATE_BILL
,
BillPermission
.
S_CREATE_BILL
,
BillPermission
.
S_READ_ALL
,
BillPermission
.
S_READ_ALL
,
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/PlaceBean.java
View file @
7e22d2b
...
@@ -459,7 +459,7 @@ public class PlaceBean implements PlaceBeanLocal {
...
@@ -459,7 +459,7 @@ public class PlaceBean implements PlaceBeanLocal {
* @return true when successfull, on any erroro false.
* @return true when successfull, on any erroro false.
*/
*/
@Override
@Override
@RolesAllowed
(
MapPermission
.
S_BUY_PLACES
)
@RolesAllowed
(
{
MapPermission
.
S_RELEASE_PLACE
,
MapPermission
.
S_MANAGE_OTHERS
}
)
public
boolean
releasePlace
(
Place
place
)
{
public
boolean
releasePlace
(
Place
place
)
{
place
=
placeFacade
.
find
(
place
.
getId
());
place
=
placeFacade
.
find
(
place
.
getId
());
EventUser
user
=
permbean
.
getCurrentUser
();
EventUser
user
=
permbean
.
getCurrentUser
();
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ProductPBean.java
View file @
7e22d2b
...
@@ -86,6 +86,10 @@ public class ProductPBean {
...
@@ -86,6 +86,10 @@ public class ProductPBean {
if
(
foodwave
!=
null
)
{
if
(
foodwave
!=
null
)
{
ret
.
setFoodWave
(
foodwave
);
ret
.
setFoodWave
(
foodwave
);
if
(
foodwave
.
getAccountEvents
()
==
null
)
{
foodwave
.
setAccountEvents
(
new
ArrayList
<
AccountEvent
>());
}
foodwave
.
getAccountEvents
().
add
(
ret
);
}
}
List
<
DiscountInstance
>
accEventdiscounts
=
ret
.
getDiscountInstances
();
List
<
DiscountInstance
>
accEventdiscounts
=
ret
.
getDiscountInstances
();
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/RoleBean.java
View file @
7e22d2b
...
@@ -39,10 +39,10 @@ public class RoleBean implements RoleBeanLocal {
...
@@ -39,10 +39,10 @@ public class RoleBean implements RoleBeanLocal {
// private static final String PUBLIC_ROLE_NAME =
// private static final String PUBLIC_ROLE_NAME =
// BeanRole.ANONYMOUS.toString();
// BeanRole.ANONYMOUS.toString();
@SuppressWarnings
(
"unused"
)
@SuppressWarnings
(
"unused"
)
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RoleBean
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RoleBean
.
class
);
@Resource
@Resource
private
SessionContext
sc
;
private
SessionContext
sc
;
@EJB
@EJB
...
@@ -172,12 +172,6 @@ public class RoleBean implements RoleBeanLocal {
...
@@ -172,12 +172,6 @@ public class RoleBean implements RoleBeanLocal {
}
}
@Override
@Override
@RolesAllowed
(
UserPermission
.
S_READ_ROLES
)
public
List
<
Role
>
getRoles
(
EventUser
user
)
{
return
roleFacade
.
findForUser
(
user
);
}
@Override
@RolesAllowed
(
UserPermission
.
S_WRITE_ROLES
)
@RolesAllowed
(
UserPermission
.
S_WRITE_ROLES
)
public
void
saveRoles
(
EventUser
usr
,
List
<
Role
>
usersRoles
)
{
public
void
saveRoles
(
EventUser
usr
,
List
<
Role
>
usersRoles
)
{
...
@@ -193,4 +187,10 @@ public class RoleBean implements RoleBeanLocal {
...
@@ -193,4 +187,10 @@ public class RoleBean implements RoleBeanLocal {
}
}
}
}
}
}
@Override
@RolesAllowed
(
UserPermission
.
S_READ_ROLES
)
public
List
<
Role
>
getRoles
(
EventUser
selectedUser
)
{
return
roleFacade
.
findForUser
(
selectedUser
);
}
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/FoodWaveBeanLocal.java
View file @
7e22d2b
...
@@ -6,6 +6,7 @@ import javax.ejb.Local;
...
@@ -6,6 +6,7 @@ import javax.ejb.Local;
import
fi.insomnia.bortal.model.FoodWave
;
import
fi.insomnia.bortal.model.FoodWave
;
import
fi.insomnia.bortal.model.FoodWaveTemplate
;
import
fi.insomnia.bortal.model.FoodWaveTemplate
;
import
fi.insomnia.bortal.model.Product
;
@Local
@Local
public
interface
FoodWaveBeanLocal
{
public
interface
FoodWaveBeanLocal
{
...
@@ -29,4 +30,6 @@ public interface FoodWaveBeanLocal {
...
@@ -29,4 +30,6 @@ public interface FoodWaveBeanLocal {
public
List
<
FoodWave
>
getEventFoodWaves
();
public
List
<
FoodWave
>
getEventFoodWaves
();
public
void
createFoodWave
(
FoodWave
fw
);
public
void
createFoodWave
(
FoodWave
fw
);
FoodWaveTemplate
addProductToTemplate
(
FoodWaveTemplate
template
,
Product
currentProduct
);
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/RoleBeanLocal.java
View file @
7e22d2b
...
@@ -34,6 +34,6 @@ public interface RoleBeanLocal {
...
@@ -34,6 +34,6 @@ public interface RoleBeanLocal {
public
void
saveRoles
(
EventUser
usr
,
List
<
Role
>
usersRoles
);
public
void
saveRoles
(
EventUser
usr
,
List
<
Role
>
usersRoles
);
List
<
Role
>
getRoles
(
EventUser
u
ser
);
public
List
<
Role
>
getRoles
(
EventUser
selectedU
ser
);
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/BillLine.java
View file @
7e22d2b
...
@@ -117,6 +117,8 @@ public class BillLine extends GenericEntity {
...
@@ -117,6 +117,8 @@ public class BillLine extends GenericEntity {
this
.
setUnitPrice
(
product
.
getPrice
().
abs
());
this
.
setUnitPrice
(
product
.
getPrice
().
abs
());
this
.
setVat
(
product
.
getVat
());
this
.
setVat
(
product
.
getVat
());
this
.
setFoodwave
(
foodwave
);
this
.
setFoodwave
(
foodwave
);
}
}
...
...
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/apps/MapPermission.java
View file @
7e22d2b
...
@@ -6,7 +6,7 @@ public enum MapPermission implements IAppPermission {
...
@@ -6,7 +6,7 @@ public enum MapPermission implements IAppPermission {
MANAGE_OTHERS
,
// ("Manage other users reservations in map"),
MANAGE_OTHERS
,
// ("Manage other users reservations in map"),
BUY_PLACES
,
// ("Reserve and buy places from map"),
BUY_PLACES
,
// ("Reserve and buy places from map"),
VIEW
,
// ("View maps"),
VIEW
,
// ("View maps"),
MANAGE_MAPS
,
// ("Create and modify maps")
MANAGE_MAPS
,
RELEASE_PLACE
,
// ("Create and modify maps")
;
;
...
@@ -14,7 +14,7 @@ public enum MapPermission implements IAppPermission {
...
@@ -14,7 +14,7 @@ public enum MapPermission implements IAppPermission {
public
static
final
String
S_BUY_PLACES
=
"MAP/BUY_PLACES"
;
public
static
final
String
S_BUY_PLACES
=
"MAP/BUY_PLACES"
;
public
static
final
String
S_VIEW
=
"MAP/VIEW"
;
public
static
final
String
S_VIEW
=
"MAP/VIEW"
;
public
static
final
String
S_MANAGE_MAPS
=
"MAP/MANAGE_MAPS"
;
public
static
final
String
S_MANAGE_MAPS
=
"MAP/MANAGE_MAPS"
;
public
static
final
String
S_RELEASE_PLACE
=
"MAP/RELEASE_PLACE"
;
private
final
String
fullName
;
private
final
String
fullName
;
private
final
String
key
;
private
final
String
key
;
private
static
final
String
I18N_HEADER
=
"bortalApplication.map."
;
private
static
final
String
I18N_HEADER
=
"bortalApplication.map."
;
...
...
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/apps/ShopPermission.java
View file @
7e22d2b
...
@@ -10,6 +10,7 @@ public enum ShopPermission implements IAppPermission {
...
@@ -10,6 +10,7 @@ public enum ShopPermission implements IAppPermission {
SHOP_PRODUCTS
,
// ("Shop products to self"),
SHOP_PRODUCTS
,
// ("Shop products to self"),
MANAGE_PRODUCTS
,
// ("Create and modify products"),
MANAGE_PRODUCTS
,
// ("Create and modify products"),
SHOP_FOODWAVE
,
// Shop for food
SHOP_FOODWAVE
,
// Shop for food
MANAGE_FOODWAVES
,
;
;
...
@@ -19,6 +20,7 @@ public enum ShopPermission implements IAppPermission {
...
@@ -19,6 +20,7 @@ public enum ShopPermission implements IAppPermission {
public
static
final
String
S_SHOP_PRODUCTS
=
"SHOP/SHOP_PRODUCTS"
;
public
static
final
String
S_SHOP_PRODUCTS
=
"SHOP/SHOP_PRODUCTS"
;
public
static
final
String
S_MANAGE_PRODUCTS
=
"SHOP/MANAGE_PRODUCTS"
;
public
static
final
String
S_MANAGE_PRODUCTS
=
"SHOP/MANAGE_PRODUCTS"
;
public
static
final
String
S_SHOP_FOODWAVE
=
"SHOP/SHOP_FOODWAVE"
;
public
static
final
String
S_SHOP_FOODWAVE
=
"SHOP/SHOP_FOODWAVE"
;
public
static
final
String
S_MANAGE_FOODWAVES
=
"SHOP/MANAGE_FOODWAVES"
;
private
final
String
fullName
;
private
final
String
fullName
;
private
final
String
key
;
private
final
String
key
;
...
...
code/LanBortalWeb/WebContent/foodadmin/createTemplate.xhtml
View file @
7e22d2b
...
@@ -23,101 +23,102 @@
...
@@ -23,101 +23,102 @@
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form>
<h:form>
<p:wizard>
<!-- <p:wizard>
<p:tab
id=
"basicinfo"
title=
"#{i18n['foodwavetemplate.basicinfo']}"
>
<p:tab id="basicinfo" title="#{i18n['foodwavetemplate.basicinfo']}"> -->
<h:panelGrid
columns=
"3"
>
<h:panelGrid
columns=
"3"
>
<h:outputLabel
for=
"name"
<h:outputLabel
for=
"name"
value=
"#{i18n['foodwavetemplate.name']}"
/>
value=
"#{i18n['foodwavetemplate.name']}"
/>
<h:inputText
id=
"name"
value=
"#{foodWaveView.template.name}"
<h:inputText
id=
"name"
value=
"#{foodWaveView.template.name}"
required=
"true"
requiredMessage=
"Name required"
/>
required=
"true"
requiredMessage=
"Name required"
/>
<h:message
for=
"name"
/>
<h:message
for=
"name"
/>
<h:outputLabel
for=
"description"
<h:outputLabel
for=
"description"
value=
"#{i18n['foodwavetemplate.description']}"
/>
value=
"#{i18n['foodwavetemplate.description']}"
/>
<h:inputText
id=
"description"
<h:inputText
id=
"description"
value=
"#{foodWaveView.template.description}"
required=
"true"
value=
"#{foodWaveView.template.description}"
required=
"true"
requiredMessage=
"Description required"
/>
requiredMessage=
"Description required"
/>
<h:message
for=
"description"
/>
<h:message
for=
"description"
/>
</h:panelGrid>
</h:panelGrid>
</p:tab>
<!--
</p:tab>
<p:tab id="selectproducts"
<p:tab id="selectproducts"
title=
"#{i18n['foodwavetemplate.selectproducts']}"
>
title="#{i18n['foodwavetemplate.selectproducts']}">
-->
<h:messages
/>
<h:messages
/>
<h:panelGrid
columns=
"4"
>
<h:panelGrid
columns=
"4"
>
<h:outputText
value=
"#{i18n['foodwavetemplate.productname']}"
/>
<h:outputText
value=
"#{i18n['foodwavetemplate.productname']}"
/>
<h:outputText
<h:outputText
value=
"#{i18n['foodwavetemplate.productdescription']}"
/>
value=
"#{i18n['foodwavetemplate.productdescription']}"
/>
<h:outputText
value=
"#{i18n['foodwavetemplate.price']}"
/>
<h:outputText
value=
"#{i18n['foodwavetemplate.price']}"
/>
<h:outputText
value=
" "
/>
<h:outputText
value=
" "
/>
<h:inputText
id=
"productname"
<h:inputText
id=
"productname"
value=
"#{foodWaveView.currentProduct.name}"
/>
value=
"#{foodWaveView.currentProduct.name}"
/>
<h:inputText
id=
"productdescription"
<h:inputText
id=
"productdescription"
value=
"#{foodWaveView.currentProduct.description}"
/>
value=
"#{foodWaveView.currentProduct.description}"
/>
<h:inputText
id=
"price"
<h:inputText
id=
"price"
value=
"#{foodWaveView.currentProduct.price}"
/>
value=
"#{foodWaveView.currentProduct.price}"
/>
<p:commandButton
value=
"#{i18n['foodwavetemplate.addproduct']}"
<p:commandButton
value=
"#{i18n['foodwavetemplate.addproduct']}"
actionListener=
"#{foodWaveView.addProductToTemplate}"
actionListener=
"#{foodWaveView.addProductToTemplate}"
update=
"productTable"
/>
update=
"productTable"
/>
</h:panelGrid>
</h:panelGrid>
<p:dataTable
name=
"productTable"
id=
"productTable"
<p:dataTable
name=
"productTable"
id=
"productTable"
value=
"#{foodWaveView.template.products}"
var=
"product"
value=
"#{foodWaveView.template.products}"
var=
"product"
editable=
"true"
>
editable=
"true"
>
<p:column
headerText=
"#{i18n['foodwavetemplate.productname']}"
>
<p:column
headerText=
"#{i18n['foodwavetemplate.productname']}"
>
<p:cellEditor>
<p:cellEditor>
<f:facet
name=
"output"
>
<f:facet
name=
"output"
>
<h:outputText
value=
"#{product.name}"
/>
<h:outputText
value=
"#{product.name}"
/>
</f:facet>
</f:facet>
<f:facet
name=
"input"
>
<f:facet
name=
"input"
>
<p:inputText
value=
"#{product.name}"
style=
"width:100%"
<p:inputText
value=
"#{product.name}"
style=
"width:100%"
required=
"true"
requiredMessage=
"Name required"
/>
required=
"true"
requiredMessage=
"Name required"
/>
</f:facet>
</f:facet>
</p:cellEditor>
</p:cellEditor>
</p:column>
</p:column>
<p:column
<p:column
headerText=
"#{i18n['foodwavetemplate.productdescription']}"
>
headerText=
"#{i18n['foodwavetemplate.productdescription']}"
>
<p:cellEditor>
<p:cellEditor>
<f:facet
name=
"output"
>
<f:facet
name=
"output"
>
<h:outputText
value=
"#{product.description}"
/>
<h:outputText
value=
"#{product.description}"
/>
</f:facet>
</f:facet>
<f:facet
name=
"input"
>
<f:facet
name=
"input"
>
<p:inputText
value=
"#{product.description}"
style=
"width:100%"
<p:inputText
value=
"#{product.description}"
style=
"width:100%"
required=
"true"
requiredMessage=
"Description required"
/>
required=
"true"
requiredMessage=
"Description required"
/>
</f:facet>
</f:facet>
</p:cellEditor>
</p:cellEditor>
</p:column>
</p:column>
<p:column
headerText=
"#{i18n['foodwavetemplate.price']}"
>
<p:column
headerText=
"#{i18n['foodwavetemplate.price']}"
>
<p:cellEditor>
<p:cellEditor>
<f:facet
name=
"output"
>
<f:facet
name=
"output"
>
<h:outputText
value=
"#{product.price}"
/>
<h:outputText
value=
"#{product.price}"
/>
</f:facet>
</f:facet>
<f:facet
name=
"input"
>
<f:facet
name=
"input"
>
<p:inputText
value=
"#{product.price}"
style=
"width:100%"
<p:inputText
value=
"#{product.price}"
style=
"width:100%"
required=
"true"
requiredMessage=
"Price required"
/>
required=
"true"
requiredMessage=
"Price required"
/>
</f:facet>
</f:facet>
</p:cellEditor>
</p:cellEditor>
</p:column>
</p:column>
<p:column
headerText=
"#{i18n['foodwavetemplate.editRow']}"
<p:column
headerText=
"#{i18n['foodwavetemplate.editRow']}"
style=
"width:20px"
>
style=
"width:20px"
>
<p:rowEditor
/>
<p:rowEditor
/>
</p:column>
</p:column>
<p:column
headerText=
"#{i18n['foodwavetemplate.actions']}"
<p:column
headerText=
"#{i18n['foodwavetemplate.actions']}"
style=
"width:20px;"
>
style=
"width:20px;"
>
<p:commandButton
<p:commandButton
value=
"#{i18n['foodwavetemplate.removeFromList']}"
value=
"#{i18n['foodwavetemplate.removeFromList']}"
action=
"#{foodWaveView.removeProductFromList(product)}"
action=
"#{foodWaveView.removeProductFromList(product)}"
update=
"productTable"
/>
update=
"productTable"
/>
</p:column>
</p:column>
</p:dataTable>
</p:dataTable>
<h:commandButton
action=
"#{foodWaveView.saveTemplate()}"
<h:commandButton
action=
"#{foodWaveView.saveTemplate()}"
value=
"#{i18n['foodwavetemplate.savetemplate']}"
/>
value=
"#{i18n['foodwavetemplate.savetemplate']}"
>
</p:tab>
<f:param
value=
"#{foodWaveView.templateId}"
name=
"id"
/>
</h:commandButton>
>
<!-- </p:tab> -->
<
/p:wizard
>
<
!-- </p:wizard> --
>
</h:form>
</h:form>
...
...
code/LanBortalWeb/WebContent/foodadmin/editTemplate.xhtml
View file @
7e22d2b
<!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"
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:products=
"http://java.sun.com/jsf/composite/cditools/products"
xmlns:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:p=
"http://primefaces.org/ui"
>
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:products=
"http://java.sun.com/jsf/composite/cditools/products"
xmlns:users=
"http://java.sun.com/jsf/composite/cditools/user"
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>
<f:event
type=
"preRenderView"
listener=
"#{foodWaveView.initEditTemplate()}"
/>
<f:viewParam
name=
"id"
value=
"#{foodWaveView.templateId}"
/>
<f:viewParam
name=
"id"
value=
"#{foodWaveView.templateId}"
/>
<f:event
type=
"preRenderView"
listener=
"#{foodWaveView.initEditTemplate()}"
/>
</f:metadata>
</f:metadata>
<ui:define
name=
"title"
>
<ui:define
name=
"title"
>
...
@@ -18,41 +26,130 @@
...
@@ -18,41 +26,130 @@
<h:form>
<h:form>
<p:panel
header=
"#{i18n['foodwavetemplate.edit']}"
>
<p:panel
header=
"#{i18n['foodwavetemplate.edit']}"
>
<h:panelGrid
columns=
"3"
>
<h:panelGrid
columns=
"3"
>
<h:outputLabel
for=
"name"
value=
"#{i18n['foodwavetemplate.name']}"
/>
<h:outputLabel
for=
"name"
value=
"#{i18n['foodwave.template.name']}"
/>
<h:inputText
id=
"name"
value=
"#{foodWaveView.template.name}"
/>
<h:inputText
id=
"name"
value=
"#{foodWaveView.template.name}"
/>
<h:message
for=
"name"
/>
<h:message
for=
"name"
/>
<h:outputLabel
for=
"desc"
value=
"#{i18n['foodwavetemplate.description']}"
/>
<h:outputLabel
for=
"desc"
<h:inputText
id=
"desc"
value=
"#{foodWaveView.template.description}"
/>
value=
"#{i18n['foodwave.template.description']}"
/>
<h:inputText
id=
"desc"
value=
"#{foodWaveView.template.description}"
/>
<h:message
for=
"desc"
/>
<h:message
for=
"desc"
/>
<h:outputText
value=
" "
/>
<h:outputText
value=
" "
/>
<h:commandButton
action=
"#{foodWaveView.saveTemplate()}"
value=
"#{i18n['foodwavetemplate.save']}"
/>
<h:commandButton
action=
"#{foodWaveView.saveTemplate()}"
value=
"#{i18n['foodwavetemplate.save']}"
/>
</h:panelGrid>
</h:panelGrid>
<h:selectOneMenu
value=
"#{foodWaveView.currentProduct}"
converter=
"#{productConverter}"
>
<f:selectItems
value=
"#{foodWaveView.products}"
var=
"product"
itemLabel=
"#{product.name}"
></f:selectItems>
</h:selectOneMenu>
<p:commandButton
value=
"#{i18n['foodwavetemplate.addproduct']}"
actionListener=
"#{foodWaveView.addProductToTemplate}"
update=
"productTable"
/>
<!-- <h:panelGrid columns="4">
<h:outputText value="#{i18n['foodwavetemplate.productname']}" />
<h:outputText
value="#{i18n['foodwavetemplate.productdescription']}" />
<h:outputText value="#{i18n['foodwavetemplate.price']}" />
<h:outputText value=" " />
<h:inputText id="productname"
value="#{foodWaveView.currentProduct.name}" />
<h:inputText id="productdescription"
value="#{foodWaveView.currentProduct.description}" />
<h:inputText id="price"
value="#{foodWaveView.currentProduct.price}" />
<p:commandButton value="#{i18n['foodwavetemplate.addproduct']}"
actionListener="#{foodWaveView.addProductToTemplate}"
update="productTable" />
</h:panelGrid>
-->
<p:dataTable
name=
"productTable"
id=
"productTable"
value=
"#{foodWaveView.template.products}"
var=
"product"
editable=
"true"
>
<p:column
headerText=
"#{i18n['foodwavetemplate.productname']}"
>
<p:cellEditor>
<f:facet
name=
"output"
>
<h:outputText
value=
"#{product.name}"
/>
</f:facet>
<f:facet
name=
"input"
>
<p:inputText
value=
"#{product.name}"
style=
"width:100%"
required=
"true"
requiredMessage=
"Name required"
/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column
headerText=
"#{i18n['foodwavetemplate.productdescription']}"
>
<p:cellEditor>
<f:facet
name=
"output"
>
<h:outputText
value=
"#{product.description}"
/>
</f:facet>
<f:facet
name=
"input"
>
<p:inputText
value=
"#{product.description}"
style=
"width:100%"
required=
"true"
requiredMessage=
"Description required"
/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column
headerText=
"#{i18n['foodwavetemplate.price']}"
>
<p:cellEditor>
<f:facet
name=
"output"
>
<h:outputText
value=
"#{product.price}"
/>
</f:facet>
<f:facet
name=
"input"
>
<p:inputText
value=
"#{product.price}"
style=
"width:100%"
required=
"true"
requiredMessage=
"Price required"
/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column
headerText=
"#{i18n['foodwavetemplate.editRow']}"
style=
"width:20px"
>
<p:rowEditor
/>
</p:column>
<p:column
headerText=
"#{i18n['foodwavetemplate.actions']}"
style=
"width:20px;"
>
<p:commandButton
value=
"#{i18n['foodwavetemplate.removeFromList']}"
action=
"#{foodWaveView.removeProductFromList(product)}"
update=
"productTable"
/>
</p:column>
</p:dataTable>
<h:commandButton
action=
"#{foodWaveView.saveTemplate()}"
value=
"#{i18n['foodwavetemplate.savetemplate']}"
/>
<!-- -->
</p:panel>
</p:panel>
</h:form>
<h:form>
<p:panel
header=
"#{i18n['foodwavetemplate.createwave']}"
>
<p:panel
header=
"#{i18n['foodwavetemplate.createwave']}"
>
<h:panelGrid
columns=
"3"
>
<h:panelGrid
columns=
"3"
>
<h:outputLabel
for=
"waveName"
value=
"#{i18n['foodwavetemplate.waveName']}"
/>
<h:outputLabel
for=
"waveName"
<h:inputText
id=
"waveName"
value=
"#{foodWaveView.selectedFoodWave.name}"
/>
value=
"#{i18n['foodwavetemplate.waveName']}"
/>
<h:inputText
id=
"waveName"
value=
"#{foodWaveView.selectedFoodWave.name}"
/>
<h:message
for=
"waveName"
/>
<h:message
for=
"waveName"
/>
<h:outputLabel
for=
"waveMaxFoods"
value=
"#{i18n['foodwavetemplate.maxfoods']}"
/>
<h:outputLabel
for=
"waveMaxFoods"
<h:inputText
id=
"waveMaxFoods"
value=
"#{foodWaveView.selectedFoodWave.maximumFoods}"
/>
value=
"#{i18n['foodwavetemplate.maxfoods']}"
/>
<h:inputText
id=
"waveMaxFoods"
value=
"#{foodWaveView.selectedFoodWave.maximumFoods}"
/>
<h:message
for=
"waveMaxFoods"
/>
<h:message
for=
"waveMaxFoods"
/>
<h:outputLabel
for=
"startTime"
value=
"#{i18n['foodwavetemplate.startTime']}"
/>
<h:outputLabel
for=
"startTime"
<p:calendar
id=
"startTime"
value=
"#{foodWaveView.startDate}"
pattern=
"dd.MM.yyyy HH:mm"
/>
value=
"#{i18n['foodwavetemplate.startTime']}"
/>
<p:calendar
id=
"startTime"
value=
"#{foodWaveView.startDate}"
pattern=
"dd.MM.yyyy HH:mm"
/>
<h:message
for=
"startTime"
/>
<h:message
for=
"startTime"
/>
</h:panelGrid>
</h:panelGrid>
<h:commandButton
action=
"#{foodWaveView.createFoodwave()}"
value=
"#{i18n['foodwavetemplate.createFoodwave']}"
/>
<h:commandButton
action=
"#{foodWaveView.createFoodwave()}"
value=
"#{i18n['foodwavetemplate.createFoodwave']}"
/>
</p:panel>
</p:panel>
</h:form>
</h:form>
<ui:fragment>
</ui:fragment>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
...
...
code/LanBortalWeb/WebContent/foodadmin/listTemplates.xhtml
View file @
7e22d2b
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<h:outputText
value=
"#{foodwaveTemplate.name}"
/>
<h:outputText
value=
"#{foodwaveTemplate.name}"
/>
</h:column>
</h:column>
<h:column>
<h:column>
<h:link
value=
"
LOL
"
outcome=
"/foodadmin/editTemplate"
>
<h:link
value=
"
#{i18n['foodadmin.editTemplate']}
"
outcome=
"/foodadmin/editTemplate"
>
<f:param
value=
"#{foodwaveTemplate.id}"
name=
"id"
/>
<f:param
value=
"#{foodwaveTemplate.id}"
name=
"id"
/>
</h:link>
</h:link>
</h:column>
</h:column>
...
...
code/LanBortalWeb/WebContent/foodmanager/listOrders.xhtml
View file @
7e22d2b
...
@@ -6,8 +6,9 @@
...
@@ -6,8 +6,9 @@
<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=
"#{foodWaveView.initFoodwaveBillLineList}"
/>
<f:viewParam
name=
"foodwaveid"
value=
"#{foodWaveView.foodWaveId}"
required=
"true"
/>
<f:event
type=
"preRenderView"
listener=
"#{foodWaveView.initFoodwaveAccountEventList}"
/>
<f:event
type=
"preRenderView"
listener=
"#{foodWaveView.initFoodWaveOrderList}"
/>
<!-- <f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" /> -->
</f:metadata>
</f:metadata>
<ui:define
name=
"title"
>
<ui:define
name=
"title"
>
...
@@ -32,14 +33,14 @@
...
@@ -32,14 +33,14 @@
</f:facet>
</f:facet>
<h:link
outcome=
"/foodmanager/listOrders"
<h:link
outcome=
"/foodmanager/listOrders"
value=
"#{foodwave.template.name}"
>
value=
"#{foodwave.template.name}"
>
<f:param
name=
"foodwaveid"
value=
"#{
billLine.quantiny
}"
/>
<f:param
name=
"foodwaveid"
value=
"#{
foodWaveView.billLines.rowCount
}"
/>
</h:link>
</h:link>
</h:column>
</h:column>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['billLine.unitprice']}"
/>
<h:outputText
value=
"${i18n['billLine.unitprice']}"
/>
</f:facet>
</f:facet>
<h:link
outcome=
"/foodmanager/listOrders"
value=
"#{
billLine.unit
price}"
>
<h:link
outcome=
"/foodmanager/listOrders"
value=
"#{
foodWaveView.currentProduct.
price}"
>
<f:param
name=
"foodwaveid"
value=
"#{foodwave.id}"
/>
<f:param
name=
"foodwaveid"
value=
"#{foodwave.id}"
/>
</h:link>
</h:link>
</h:column>
</h:column>
...
@@ -47,18 +48,18 @@
...
@@ -47,18 +48,18 @@
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['foodWave.unconfirmedOrders']}"
/>
<h:outputText
value=
"${i18n['foodWave.unconfirmedOrders']}"
/>
</f:facet>
</f:facet>
<h:link
outcome=
"/foodmanager/listOrders"
value=
"#{food
wave.billLines.size()
}"
>
<h:link
outcome=
"/foodmanager/listOrders"
value=
"#{food
WaveView.billLines.rowCount
}"
>
<f:param
name=
"foodwaveid"
value=
"#{foodwave.id}"
/>
<f:param
name=
"foodwaveid"
value=
"#{foodwave.id}"
/>
</h:link>
</h:link>
</h:column>
</h:column>
<!--
<h:column>
<h:column>
<f:facet name="header">
<f:facet name="header">
<h:outputText value="${i18n['foodWave.totalReserved']}" />
<h:outputText value="${i18n['foodWave.totalReserved']}" />
</f:facet>
</f:facet>
<h:link
outcome=
"/foodmanager/listOrders"
value=
"#{food
wave.reservedCount
}"
>
<h:link outcome="/foodmanager/listOrders" value="#{food
WaveView.currentProduct.totalreserved
}">
<f:param name="foodwaveid" value="#{foodwave.id}" />
<f:param name="foodwaveid" value="#{foodwave.id}" />
</h:link>
</h:link>
</h:column>
</h:column>
-->
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['foodWave.time']}"
/>
<h:outputText
value=
"${i18n['foodWave.time']}"
/>
...
...
code/LanBortalWeb/WebContent/foodwave/list.xhtml
View file @
7e22d2b
...
@@ -13,12 +13,12 @@
...
@@ -13,12 +13,12 @@
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
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"
<f:
viewParam
name=
"templateid"
value=
"#{foodWaveView.templateId}"
/>
listener=
"#{foodWaveView.initTemplateList
}"
/>
<f:event
type=
"preRenderView"
listener=
"#{foodWaveView.initListFoodwaves
}"
/>
</f:metadata>
</f:metadata>
<ui:define
name=
"title"
>
<ui:define
name=
"title"
>
<h1>
#{i18n['user.
shop
.title']}
</h1>
<h1>
#{i18n['user.
foodwavelist
.title']}
</h1>
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
</h:column>
</h:column>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"${i18n['foodWave.template
.
name']}"
/>
<h:outputText
value=
"${i18n['foodWave.templatename']}"
/>
</f:facet>
</f:facet>
<h:link
outcome=
"/foodwave/listProducts"
<h:link
outcome=
"/foodwave/listProducts"
value=
"#{foodwave.template.name}"
>
value=
"#{foodwave.template.name}"
>
...
...
code/LanBortalWeb/WebContent/foodwave/listTemplates.xhtml
View file @
7e22d2b
...
@@ -15,9 +15,7 @@
...
@@ -15,9 +15,7 @@
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<foodwave:listTemplates
selectaction=
"#{foodWaveView.selectTemplate}"
items=
"#{foodWaveView.templates}"
<foodwave:listTemplates
outcome=
"/foodwave/list"
items=
"#{foodWaveView.templates}"
/>
commitValue=
"#{i18n['food']}"
/>
</ui:define>
</ui:define>
...
...
code/LanBortalWeb/WebContent/resources/cditools/foodwave/listTemplates.xhtml
View file @
7e22d2b
<?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"
<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:h=
"http://java.sun.com/jsf/html"
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:f=
"http://java.sun.com/jsf/core"
xmlns:composite=
"http://java.sun.com/jsf/composite"
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"
>
<composite:interface>
<composite:interface>
<composite:attribute
name=
"items"
required=
"true"
/>
<composite:attribute
name=
"items"
required=
"true"
/>
<composite:attribute
name=
"selectaction"
<composite:attribute
name=
"outcome"
required=
"true"
/>
method-signature=
"java.lang.String action()"
required=
"true"
/>
</composite:interface>
</composite:interface>
<composite:implementation>
<composite:implementation>
...
@@ -21,29 +15,26 @@
...
@@ -21,29 +15,26 @@
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<h:outputScript
library=
"primefaces"
name=
"jquery/jquery.js"
/>
<h:outputScript
library=
"primefaces"
name=
"jquery/jquery.js"
/>
<h:form>
<h:dataTable
columnClasses=
"nowrap,numalign,numalign,nowrap,numalign"
styleClass=
"bordertable"
id=
"billcart"
value=
"#{cc.attrs.items}"
var=
"template"
>
<h:dataTable
columnClasses=
"nowrap,numalign,numalign,nowrap,numalign"
<h:column>
styleClass=
"bordertable"
id=
"billcart"
value=
"#{cc.attrs.items}"
<f:facet
name=
"header"
>
var=
"template"
>
<h:outputText
id=
"name"
value=
"${i18n['foodWave.name']}"
/>
<h:column>
</f:facet>
<f:facet
name=
"header"
>
<h:link
outcome=
"#{cc.attrs.outcome}"
value=
"#{template.name}"
>
<h:outputText
id=
"name"
value=
"${i18n['foodWave.name']}"
/>
<f:param
name=
"templateid"
value=
"#{template.id}"
/>
</f:facet>
</h:link>
<h:commandLink
action=
"#{cc.attrs.selectaction}"
</h:column>
value=
"#{template.name}"
/>
<h:column>
</h:column>
<f:facet
name=
"header"
>
<h:column>
<h:outputText
value=
"${i18n['foodWave.description']}"
/>
<f:facet
name=
"header"
>
</f:facet>
<h:outputText
value=
"${i18n['foodWave.description']}"
/>
<h:outputText
id=
"description"
value=
"#{template.description}"
/>
</f:facet>
</h:column>
<h:outputText
id=
"description"
value=
"#{template.description}"
/>
</h:column>
</h:dataTable>
</h:dataTable>
</h:form>
</composite:implementation>
</composite:implementation>
</html>
</html>
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveFoodView.java
View file @
7e22d2b
...
@@ -9,6 +9,9 @@ import javax.faces.model.ListDataModel;
...
@@ -9,6 +9,9 @@ import javax.faces.model.ListDataModel;
import
javax.inject.Inject
;
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.AccountEventBeanLocal
;
import
fi.insomnia.bortal.beans.AccountEventBeanLocal
;
import
fi.insomnia.bortal.beans.BillBeanLocal
;
import
fi.insomnia.bortal.beans.BillBeanLocal
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
...
@@ -34,62 +37,54 @@ public class FoodWaveFoodView extends GenericCDIView {
...
@@ -34,62 +37,54 @@ public class FoodWaveFoodView extends GenericCDIView {
@EJB
@EJB
private
FoodWaveBeanLocal
foodWaveBean
;
private
FoodWaveBeanLocal
foodWaveBean
;
@EJB
@EJB
EventBeanLocal
eventBean
;
EventBeanLocal
eventBean
;
@EJB
@EJB
private
AccountEventBeanLocal
accountEventBean
;
private
AccountEventBeanLocal
accountEventBean
;
@EJB
@EJB
private
BillBeanLocal
billBean
;
private
BillBeanLocal
billBean
;
private
FoodWave
foodWave
=
null
;
private
FoodWave
foodWave
=
null
;
@EJB
@EJB
private
transient
ProductBeanLocal
productBean
;
private
transient
ProductBeanLocal
productBean
;
@Inject
@Inject
@SelectedUser
@SelectedUser
private
EventUser
user
;
private
EventUser
user
;
@Inject
@Inject
private
BillEditView
billEditView
;
private
BillEditView
billEditView
;
private
Integer
foodwaveid
=
0
;
private
Integer
foodwaveid
=
0
;
private
ListDataModel
<
Product
>
products
;
private
ListDataModel
<
Product
>
products
;
private
transient
ListDataModel
<
ProductShopItem
>
shoppingcart
;
private
transient
ListDataModel
<
ProductShopItem
>
shoppingcart
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FoodWaveFoodView
.
class
);
public
void
initFoodWaveFoods
()
{
public
void
initFoodWaveFoods
()
{
if
(
requirePermissions
(
ShopPermission
.
LIST_USERPRODUCTS
)
&&
getFoodwaveid
()
>
0
&&
getShoppingcart
()
==
null
)
{
if
(
requirePermissions
(
ShopPermission
.
LIST_USERPRODUCTS
)
&&
getFoodwaveid
()
>
0
&&
getShoppingcart
()
==
null
)
{
foodWave
=
foodWaveBean
.
findFoodwave
(
getFoodwaveid
());
logger
.
debug
(
"Foodwave {}"
,
foodWave
);
setFoodWave
(
foodWaveBean
.
findFoodwave
(
getFoodwaveid
()));
shoppingcart
=
new
ListDataModel
<
ProductShopItem
>(
ProductShopItem
.
productGTList
(
foodWave
.
getTemplate
().
getProducts
()));
setShoppingcart
(
new
ListDataModel
<
ProductShopItem
>(
ProductShopItem
.
productGTList
(
getFoodWave
().
getTemplate
().
getProducts
()
)));
System
.
out
.
println
(
"beginconversation"
);
this
.
beginConversation
();
this
.
beginConversation
();
//products = new ListDataModel<Product>(getFoodWave().getTemplate().getProducts());
}
}
}
}
public
ListDataModel
<
Product
>
getProducts
()
{
public
ListDataModel
<
Product
>
getProducts
()
{
return
products
;
return
products
;
}
}
public
void
setProducts
(
ListDataModel
<
Product
>
products
)
{
public
void
setProducts
(
ListDataModel
<
Product
>
products
)
{
this
.
products
=
products
;
this
.
products
=
products
;
}
}
public
Integer
getFoodwaveid
()
{
public
Integer
getFoodwaveid
()
{
return
foodwaveid
;
return
foodwaveid
;
}
}
...
@@ -109,10 +104,10 @@ public class FoodWaveFoodView extends GenericCDIView {
...
@@ -109,10 +104,10 @@ public class FoodWaveFoodView extends GenericCDIView {
public
String
add
(
Integer
count
)
{
public
String
add
(
Integer
count
)
{
ProductShopItem
item
=
getShoppingcart
().
getRowData
();
ProductShopItem
item
=
getShoppingcart
().
getRowData
();
item
.
setCount
(
item
.
getCount
().
add
(
BigDecimal
.
valueOf
(
count
)));
item
.
setCount
(
item
.
getCount
().
add
(
BigDecimal
.
valueOf
(
count
)));
System
.
out
.
println
(
"foobar"
+
item
.
getCount
());
System
.
out
.
println
(
"foobar"
+
item
.
getCount
());
return
null
;
return
null
;
}
}
public
String
addOne
()
public
String
addOne
()
{
{
return
add
(
1
);
return
add
(
1
);
...
@@ -131,15 +126,13 @@ public class FoodWaveFoodView extends GenericCDIView {
...
@@ -131,15 +126,13 @@ public class FoodWaveFoodView extends GenericCDIView {
return
ret
;
return
ret
;
}
}
/**
* Just create bills, they are nice <insert picture of bill gates here>
/**
*
* Just create bills, they are nice
* <insert picture of bill gates here>
* @return
* @return
*/
*/
public
Bill
createBillFromShoppingcart
()
{
public
Bill
createBillFromShoppingcart
()
{
Bill
bill
=
new
Bill
(
eventBean
.
getCurrentEvent
(),
user
);
Bill
bill
=
new
Bill
(
eventBean
.
getCurrentEvent
(),
user
);
bill
.
setOurReference
(
eventBean
.
getCurrentEvent
().
getName
());
bill
.
setOurReference
(
eventBean
.
getCurrentEvent
().
getName
());
...
@@ -152,26 +145,24 @@ public class FoodWaveFoodView extends GenericCDIView {
...
@@ -152,26 +145,24 @@ public class FoodWaveFoodView extends GenericCDIView {
return
bill
;
return
bill
;
}
}
public
String
buyFromCounter
()
{
public
String
buyFromCounter
()
{
createBillFromShoppingcart
();
createBillFromShoppingcart
();
return
"/foodwave/ThanksForOrderingFromCounter"
;
return
"/foodwave/ThanksForOrderingFromCounter"
;
}
}
public
String
buyFromInternet
()
{
public
String
buyFromInternet
()
{
Bill
bill
=
createBillFromShoppingcart
();
Bill
bill
=
createBillFromShoppingcart
();
if
(
bill
!=
null
)
{
if
(
bill
!=
null
)
{
getBillEditView
().
setBillid
(
bill
.
getId
());
getBillEditView
().
setBillid
(
bill
.
getId
());
return
"/bill/showBill?faces-redirect=true&IncludeViewParams=true"
;
return
"/bill/showBill?faces-redirect=true&IncludeViewParams=true"
;
}
}
return
null
;
return
null
;
}
}
public
void
setUser
(
EventUser
user
)
{
public
void
setUser
(
EventUser
user
)
{
this
.
user
=
user
;
this
.
user
=
user
;
...
@@ -199,20 +190,12 @@ public class FoodWaveFoodView extends GenericCDIView {
...
@@ -199,20 +190,12 @@ public class FoodWaveFoodView extends GenericCDIView {
return
false
;
return
false
;
}
}
public
BillEditView
getBillEditView
()
{
public
BillEditView
getBillEditView
()
{
return
billEditView
;
return
billEditView
;
}
}
public
void
setBillEditView
(
BillEditView
billEditView
)
{
public
void
setBillEditView
(
BillEditView
billEditView
)
{
this
.
billEditView
=
billEditView
;
this
.
billEditView
=
billEditView
;
}
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodWaveView.java
View file @
7e22d2b
...
@@ -3,8 +3,8 @@ package fi.insomnia.bortal.web.cdiview.shop;
...
@@ -3,8 +3,8 @@ package fi.insomnia.bortal.web.cdiview.shop;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.TreeSet
;
import
java.util.TreeSet
;
import
java.util.Vector
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.enterprise.context.ConversationScoped
;
...
@@ -14,7 +14,10 @@ import javax.inject.Named;
...
@@ -14,7 +14,10 @@ import javax.inject.Named;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.beans.FoodWaveBeanLocal
;
import
fi.insomnia.bortal.beans.FoodWaveBeanLocal
;
import
fi.insomnia.bortal.beans.ProductBeanLocal
;
import
fi.insomnia.bortal.enums.apps.ShopPermission
;
import
fi.insomnia.bortal.enums.apps.ShopPermission
;
import
fi.insomnia.bortal.model.AccountEvent
;
import
fi.insomnia.bortal.model.BillLine
;
import
fi.insomnia.bortal.model.FoodWave
;
import
fi.insomnia.bortal.model.FoodWave
;
import
fi.insomnia.bortal.model.FoodWaveTemplate
;
import
fi.insomnia.bortal.model.FoodWaveTemplate
;
import
fi.insomnia.bortal.model.Product
;
import
fi.insomnia.bortal.model.Product
;
...
@@ -32,26 +35,36 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -32,26 +35,36 @@ public class FoodWaveView extends GenericCDIView {
@Inject
@Inject
private
FoodWaveFoodView
foodWaveFoodView
;
private
FoodWaveFoodView
foodWaveFoodView
;
private
ListDataModel
<
FoodWaveTemplate
>
templates
;
private
FoodWaveTemplate
template
;
private
FoodWaveTemplate
template
;
private
Integer
templateId
;
private
Integer
templateId
;
@EJB
@EJB
private
EventBeanLocal
eventbean
;
private
EventBeanLocal
eventbean
;
@EJB
private
ListDataModel
<
FoodWave
>
foodWaves
;
private
ProductBeanLocal
productbeanlocal
;
private
FoodWave
selectedFoodWave
=
null
;
private
FoodWave
selectedFoodWave
=
null
;
private
Date
startDate
;
private
Date
startDate
;
private
Product
currentProduct
;
private
Product
currentProduct
;
private
ListDataModel
<
BillLine
>
billLines
;
private
Integer
foodWaveId
;
private
ListDataModel
<
AccountEvent
>
accountEventLines
;
private
List
<
FoodWave
>
foodWaves
;
public
List
<
Product
>
getProducts
()
{
return
productbeanlocal
.
getProducts
();
}
public
void
initTemplateList
()
{
public
void
initTemplateList
()
{
if
(
super
.
requirePermissions
(
ShopPermission
.
LIST_USERPRODUCTS
))
{
super
.
requirePermissions
(
ShopPermission
.
SHOP_FOODWAVE
);
}
setTemplates
(
new
ListDataModel
<
FoodWaveTemplate
>(
foodWaveBean
.
getTemplates
()));
public
void
initFoodwaveManagerList
()
{
super
.
beginConversation
();
if
(
super
.
requirePermissions
(
ShopPermission
.
MANAGE_FOODWAVES
))
{
foodWaves
=
foodWaveBean
.
getEventFoodWaves
();
}
}
}
}
...
@@ -60,18 +73,34 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -60,18 +73,34 @@ public class FoodWaveView extends GenericCDIView {
Calendar
c
=
Calendar
.
getInstance
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
startDate
);
c
.
setTime
(
startDate
);
selectedFoodWave
.
setTime
(
c
);
selectedFoodWave
.
setTime
(
c
);
foodWaveBean
.
createFoodWave
(
selectedFoodWave
);
foodWaveBean
.
createFoodWave
(
selectedFoodWave
);
// initFoodwaveManagerList();
return
"/foodadmin/listTemplates"
;
return
"/foodmanager/listFoodwaves"
;
}
public
void
initListFoodwaves
()
{
if
(
super
.
requirePermissions
(
ShopPermission
.
SHOP_FOODWAVE
)
&&
template
==
null
)
{
if
(
templateId
!=
null
)
{
template
=
foodWaveBean
.
findTemplate
(
templateId
);
foodWaves
=
template
.
getFoodwaves
();
}
else
{
foodWaves
=
foodWaveBean
.
getOpenFoodWaves
();
}
super
.
beginConversation
();
}
}
}
public
void
initEditTemplate
()
{
public
void
initEditTemplate
()
{
if
(
super
.
requirePermissions
(
ShopPermission
.
MANAGE_PRODUCTS
)
&&
template
==
null
)
if
(
super
.
requirePermissions
(
ShopPermission
.
MANAGE_PRODUCTS
)
&&
template
==
null
)
{
{
template
=
foodWaveBean
.
findTemplate
(
templateId
);
template
=
foodWaveBean
.
findTemplate
(
templateId
);
// prepare to make new foodwaves
selectedFoodWave
=
new
FoodWave
();
selectedFoodWave
=
new
FoodWave
();
selectedFoodWave
.
setTemplate
(
template
);
selectedFoodWave
.
setTemplate
(
template
);
super
.
beginConversation
();
super
.
beginConversation
();
...
@@ -85,27 +114,27 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -85,27 +114,27 @@ public class FoodWaveView extends GenericCDIView {
template
=
new
FoodWaveTemplate
();
template
=
new
FoodWaveTemplate
();
template
.
setProducts
(
new
ArrayList
<
Product
>());
template
.
setProducts
(
new
ArrayList
<
Product
>());
template
.
setEvent
(
eventbean
.
getCurrentEvent
());
template
.
setEvent
(
eventbean
.
getCurrentEvent
());
createNewProductSkeleton
();
createNewProductSkeleton
();
super
.
beginConversation
();
super
.
beginConversation
();
}
}
}
}
private
void
createNewProductSkeleton
()
{
private
void
createNewProductSkeleton
()
{
TreeSet
<
ProductFlag
>
ts
=
new
TreeSet
<
ProductFlag
>();
TreeSet
<
ProductFlag
>
ts
=
new
TreeSet
<
ProductFlag
>();
ts
.
add
(
ProductFlag
.
PREPAID_INSTANT_CREATE
);
ts
.
add
(
ProductFlag
.
PREPAID_INSTANT_CREATE
);
currentProduct
=
new
Product
();
currentProduct
=
new
Product
();
currentProduct
.
setProductFlags
(
ts
);
currentProduct
.
setProductFlags
(
ts
);
currentProduct
.
setEvent
(
eventbean
.
getCurrentEvent
());
currentProduct
.
setEvent
(
eventbean
.
getCurrentEvent
());
}
}
public
void
addProductToTemplate
()
{
public
void
addProductToTemplate
()
{
template
.
getProducts
().
add
(
currentProduct
);
template
=
foodWaveBean
.
addProductToTemplate
(
template
,
currentProduct
);
createNewProductSkeleton
();
createNewProductSkeleton
();
}
}
public
Product
getCurrentProduct
()
{
public
Product
getCurrentProduct
()
{
return
currentProduct
;
return
currentProduct
;
}
}
...
@@ -114,23 +143,33 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -114,23 +143,33 @@ public class FoodWaveView extends GenericCDIView {
this
.
currentProduct
=
currentProduct
;
this
.
currentProduct
=
currentProduct
;
}
}
public
void
initUserFoodWaveList
()
{
// public void initUserFoodWaveList() {
this
.
foodWaves
=
new
ListDataModel
<
FoodWave
>(
foodWaveBean
.
getOpenFoodWaves
());
// this.foodWaves = new
}
// ListDataModel<FoodWave>(foodWaveBean.getOpenFoodWaves());
// }
public
void
initFoodwaveManagerList
()
{
//
this
.
foodWaves
=
new
ListDataModel
<
FoodWave
>(
foodWaveBean
.
getEventFoodWaves
());
// public void initFoodwaveManagerList() {
}
// this.foodWaves = new
// ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
// }
public
void
initFoodWaveOrderList
()
{
if
(
super
.
requirePermissions
(
ShopPermission
.
MANAGE_FOODWAVES
)
&&
selectedFoodWave
==
null
)
{
selectedFoodWave
=
foodWaveBean
.
findFoodwave
(
foodWaveId
);
billLines
=
new
ListDataModel
<
BillLine
>(
selectedFoodWave
.
getBillLines
());
this
.
accountEventLines
=
new
ListDataModel
<
AccountEvent
>(
selectedFoodWave
.
getAccountEvents
());
super
.
beginConversation
();
}
public
String
editTemplate
()
{
setTemplate
(
getTemplates
().
getRowData
());
return
"/foodadmin/editTemplate"
;
}
}
public
String
saveTemplate
()
public
String
saveTemplate
()
{
{
setTemplate
(
foodWaveBean
.
saveOrCreateTemplate
(
getTemplate
()));
template
=
foodWaveBean
.
saveOrCreateTemplate
(
getTemplate
());
selectedFoodWave
=
new
FoodWave
();
selectedFoodWave
.
setTemplate
(
template
);
return
"/foodadmin/editTemplate"
;
return
"/foodadmin/editTemplate"
;
}
}
...
@@ -142,34 +181,8 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -142,34 +181,8 @@ public class FoodWaveView extends GenericCDIView {
this
.
template
=
template
;
this
.
template
=
template
;
}
}
public
ListDataModel
<
FoodWaveTemplate
>
getTemplates
()
{
public
List
<
FoodWaveTemplate
>
getTemplates
()
{
return
templates
;
return
foodWaveBean
.
getTemplates
();
}
public
void
setTemplates
(
ListDataModel
<
FoodWaveTemplate
>
templates
)
{
this
.
templates
=
templates
;
}
public
ListDataModel
<
FoodWave
>
getFoodWaves
()
{
return
foodWaves
;
}
public
String
selectFoodWave
()
{
if
(
foodWaves
.
isRowAvailable
())
{
// setSelectedFoodWave(foodWaves.getRowData());
}
return
"/foodwave/listProducts"
;
}
public
String
selectTemplate
()
{
if
(
templates
.
isRowAvailable
())
{
foodWaves
=
new
ListDataModel
<
FoodWave
>(
templates
.
getRowData
()
.
getOrderableFoodwaves
());
}
return
"/foodwave/list"
;
}
}
public
FoodWave
getSelectedFoodWave
()
{
public
FoodWave
getSelectedFoodWave
()
{
...
@@ -180,14 +193,6 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -180,14 +193,6 @@ public class FoodWaveView extends GenericCDIView {
this
.
selectedFoodWave
=
selectedFoodWave
;
this
.
selectedFoodWave
=
selectedFoodWave
;
}
}
private
FoodWaveFoodView
getFoodWaveFoodView
()
{
return
foodWaveFoodView
;
}
private
void
setFoodWaveFoodView
(
FoodWaveFoodView
foodWaveFoodView
)
{
this
.
foodWaveFoodView
=
foodWaveFoodView
;
}
public
Integer
getTemplateId
()
{
public
Integer
getTemplateId
()
{
return
templateId
;
return
templateId
;
}
}
...
@@ -197,7 +202,7 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -197,7 +202,7 @@ public class FoodWaveView extends GenericCDIView {
}
}
public
void
removeProductFromList
(
Product
product
)
{
public
void
removeProductFromList
(
Product
product
)
{
template
.
getProducts
().
remove
(
product
);
template
.
getProducts
().
remove
(
product
);
}
}
...
@@ -208,4 +213,29 @@ public class FoodWaveView extends GenericCDIView {
...
@@ -208,4 +213,29 @@ public class FoodWaveView extends GenericCDIView {
public
void
setStartDate
(
Date
startDate
)
{
public
void
setStartDate
(
Date
startDate
)
{
this
.
startDate
=
startDate
;
this
.
startDate
=
startDate
;
}
}
public
Integer
getFoodWaveId
()
{
return
foodWaveId
;
}
public
void
setFoodWaveId
(
Integer
foodWaveId
)
{
this
.
foodWaveId
=
foodWaveId
;
}
public
ListDataModel
<
BillLine
>
getBillLines
()
{
return
billLines
;
}
public
void
setBillLines
(
ListDataModel
<
BillLine
>
billLines
)
{
this
.
billLines
=
billLines
;
}
public
void
setFoodWaves
(
List
<
FoodWave
>
foodWaves
)
{
this
.
foodWaves
=
foodWaves
;
}
public
List
<
FoodWave
>
getFoodWaves
()
{
return
foodWaves
;
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/user/UserView.java
View file @
7e22d2b
...
@@ -130,6 +130,7 @@ public class UserView extends GenericCDIView {
...
@@ -130,6 +130,7 @@ public class UserView extends GenericCDIView {
usersRoles
=
rolebean
.
getRoles
(
getSelectedUser
());
usersRoles
=
rolebean
.
getRoles
(
getSelectedUser
());
}
}
return
usersRoles
;
return
usersRoles
;
}
}
public
String
crop
()
public
String
crop
()
...
...
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