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 9c07bb3c
authored
Apr 12, 2017
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add product dependency i18n, delete, etc
1 parent
488fc14f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
53 additions
and
0 deletions
code/moya-beans-client/ejbModule/fi/codecrew/moya/beans/ProductBeanLocal.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ProductBean.java
code/moya-database/src/main/java/fi/codecrew/moya/model/Product.java
code/moya-database/src/main/java/fi/codecrew/moya/model/ProductDependency.java
code/moya-web/WebContent/product/edit.xhtml
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/shop/ProductView.java
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n.properties
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n_en.properties
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n_fi.properties
code/moya-beans-client/ejbModule/fi/codecrew/moya/beans/ProductBeanLocal.java
View file @
9c07bb3
...
@@ -93,4 +93,6 @@ public interface ProductBeanLocal {
...
@@ -93,4 +93,6 @@ public interface ProductBeanLocal {
void
deleteProductOptionGroup
(
ProductOptionGroup
group
);
void
deleteProductOptionGroup
(
ProductOptionGroup
group
);
Product
reload
(
Product
product
);
Product
reload
(
Product
product
);
Product
delete
(
ProductDependency
dep
);
}
}
code/moya-beans/ejbModule/fi/codecrew/moya/beans/ProductBean.java
View file @
9c07bb3
...
@@ -660,5 +660,12 @@ public class ProductBean implements ProductBeanLocal {
...
@@ -660,5 +660,12 @@ public class ProductBean implements ProductBeanLocal {
return
productFacade
.
reload
(
product
);
return
productFacade
.
reload
(
product
);
}
}
@Override
public
Product
delete
(
ProductDependency
dep
)
{
Product
prod
=
productFacade
.
reload
(
dep
.
getDependant
());
prod
.
getProductDependencies
().
remove
(
dep
);
return
prod
;
}
}
}
code/moya-database/src/main/java/fi/codecrew/moya/model/Product.java
View file @
9c07bb3
...
@@ -153,6 +153,7 @@ public class Product extends GenericEntity {
...
@@ -153,6 +153,7 @@ public class Product extends GenericEntity {
private
List
<
ProductOptionGroup
>
productOptionGroups
;
private
List
<
ProductOptionGroup
>
productOptionGroups
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"dependant"
)
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"dependant"
)
@PrivateOwned
@OrderBy
(
"priority"
)
@OrderBy
(
"priority"
)
private
List
<
ProductDependency
>
productDependencies
=
new
ArrayList
<>();
private
List
<
ProductDependency
>
productDependencies
=
new
ArrayList
<>();
...
...
code/moya-database/src/main/java/fi/codecrew/moya/model/ProductDependency.java
View file @
9c07bb3
...
@@ -15,6 +15,10 @@ public class ProductDependency extends GenericEntity {
...
@@ -15,6 +15,10 @@ public class ProductDependency extends GenericEntity {
public
static
enum
DependencyType
{
public
static
enum
DependencyType
{
// Dependant product can be bought maximum of supported product number of times
// Dependant product can be bought maximum of supported product number of times
MAX_SUPPORTED_COUNT
,
MAX_SUPPORTED_COUNT
,
;
public
String
getI18nKey
()
{
return
"product.dependency."
+
name
();
}
}
}
@Enumerated
(
EnumType
.
STRING
)
@Enumerated
(
EnumType
.
STRING
)
...
...
code/moya-web/WebContent/product/edit.xhtml
View file @
9c07bb3
This diff is collapsed.
Click to expand it.
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/shop/ProductView.java
View file @
9c07bb3
...
@@ -61,6 +61,7 @@ public class ProductView extends GenericCDIView {
...
@@ -61,6 +61,7 @@ public class ProductView extends GenericCDIView {
private
ListDataModel
<
ProductLimitation
>
productLimits
;
private
ListDataModel
<
ProductLimitation
>
productLimits
;
private
ListDataModel
<
ProductOptionGroup
>
productOptionGroups
;
private
ListDataModel
<
ProductOptionGroup
>
productOptionGroups
;
private
ListDataModel
<
ProductDependency
>
productDependencies
;
private
ProductOption
productOption
=
null
;
private
ProductOption
productOption
=
null
;
...
@@ -84,9 +85,16 @@ public class ProductView extends GenericCDIView {
...
@@ -84,9 +85,16 @@ public class ProductView extends GenericCDIView {
public
void
createProductDependency
(){
public
void
createProductDependency
(){
product
.
getProductDependencies
().
add
(
dependency
);
product
.
getProductDependencies
().
add
(
dependency
);
dependency
.
setDependant
(
product
);
dependency
.
setDependant
(
product
);
dependency
=
new
ProductDependency
();
dependency
=
new
ProductDependency
();
product
=
prodbean
.
mergeChanges
(
product
);
product
=
prodbean
.
mergeChanges
(
product
);
productDependencies
=
null
;
}
public
void
deleteProductDependency
(){
ProductDependency
dep
=
getProductDependencies
().
getRowData
();
product
=
prodbean
.
delete
(
dep
);
productDependencies
=
null
;
}
}
public
ProductDependency
.
DependencyType
[]
getDependencyTypes
(){
public
ProductDependency
.
DependencyType
[]
getDependencyTypes
(){
...
@@ -295,4 +303,11 @@ public class ProductView extends GenericCDIView {
...
@@ -295,4 +303,11 @@ public class ProductView extends GenericCDIView {
public
void
setDependency
(
ProductDependency
dependency
)
{
public
void
setDependency
(
ProductDependency
dependency
)
{
this
.
dependency
=
dependency
;
this
.
dependency
=
dependency
;
}
}
public
ListDataModel
<
ProductDependency
>
getProductDependencies
(){
if
(
productDependencies
==
null
&&
product
!=
null
){
productDependencies
=
new
ListDataModel
<>(
product
.
getProductDependencies
());
}
return
productDependencies
;
}
}
}
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n.properties
View file @
9c07bb3
...
@@ -1589,3 +1589,11 @@ reservequeue.reservingTimeIsUpAlert=Timeslot for your place reservation has time
...
@@ -1589,3 +1589,11 @@ reservequeue.reservingTimeIsUpAlert=Timeslot for your place reservation has time
mapView.reserveTimeLeft
=
Time to reserve places
mapView.reserveTimeLeft
=
Time to reserve places
queuemgmt.queueEnabled
=
Queue is ENABLED
queuemgmt.queueEnabled
=
Queue is ENABLED
queuemgmt.queueDisabled
=
Queue is DISABLED (enable from Edit event -page)
queuemgmt.queueDisabled
=
Queue is DISABLED (enable from Edit event -page)
product.dependency.add
=
Add product dependency
product.dependency.create
=
Create
product.dependency.supporter
=
Depended product
product.dependency.type
=
Dependency type
product.dependency.priority
=
Priority
productDependency.delete
=
Delete
product.dependency.multiplier
=
Multiplier
product.dependency.MAX_SUPPORTED_COUNT
=
Only up to same number of products can be bought
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n_en.properties
View file @
9c07bb3
...
@@ -1867,3 +1867,11 @@ reservequeue.reservingTimeIsUpAlert=Timeslot for your place reservation has time
...
@@ -1867,3 +1867,11 @@ reservequeue.reservingTimeIsUpAlert=Timeslot for your place reservation has time
mapView.reserveTimeLeft
=
Time to reserve places
mapView.reserveTimeLeft
=
Time to reserve places
queuemgmt.queueEnabled
=
Queue is ENABLED
queuemgmt.queueEnabled
=
Queue is ENABLED
queuemgmt.queueDisabled
=
Queue is DISABLED (enable from Edit event -page)
queuemgmt.queueDisabled
=
Queue is DISABLED (enable from Edit event -page)
product.dependency.add
=
Add product dependency
product.dependency.create
=
Create
product.dependency.supporter
=
Depended product
product.dependency.type
=
Dependency type
product.dependency.priority
=
Priority
productDependency.delete
=
Delete
product.dependency.multiplier
=
Multiplier
product.dependency.MAX_SUPPORTED_COUNT
=
Only up to same number of products can be bought
code/moya-web/src/main/resources/fi/codecrew/moya/resources/i18n_fi.properties
View file @
9c07bb3
...
@@ -1854,3 +1854,11 @@ reservequeue.reservingTimeIsUpAlert=Sinulle varattu varausauka on kulunut loppuu
...
@@ -1854,3 +1854,11 @@ reservequeue.reservingTimeIsUpAlert=Sinulle varattu varausauka on kulunut loppuu
mapView.reserveTimeLeft
=
Aikaa varata paikkasi
mapView.reserveTimeLeft
=
Aikaa varata paikkasi
queuemgmt.queueEnabled
=
Varausjono ON k
\u
00E4yt
\u
00F6ss
\u
00E4
queuemgmt.queueEnabled
=
Varausjono ON k
\u
00E4yt
\u
00F6ss
\u
00E4
queuemgmt.queueDisabled
=
K
\u
00E4ytt
\u
00E4j
\u
00E4jono EI OLE k
\u
00E4yt
\u
00F6ss
\u
00E4 (ota k
\u
00E4yttoon tapahtuman tiedot -sivulta)
queuemgmt.queueDisabled
=
K
\u
00E4ytt
\u
00E4j
\u
00E4jono EI OLE k
\u
00E4yt
\u
00F6ss
\u
00E4 (ota k
\u
00E4yttoon tapahtuman tiedot -sivulta)
product.dependency.add
=
Lis
\u
00E4
\u
00E4 tuoteriippuvuus
product.dependency.create
=
Luo uusi
product.dependency.supporter
=
Tuote josta on riippuvuus
product.dependency.type
=
Riippuvuuden tyyppi
product.dependency.priority
=
Prioriteetti
productDependency.delete
=
Poista
product.dependency.multiplier
=
Kerroin
product.dependency.MAX_SUPPORTED_COUNT
=
Tuotteita voi ostaa enint
\u
00E4
\u
00E4n saman m
\u
00E4
\u
00E4r
\u
00E4n
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