Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8f777902
authored
Dec 17, 2011
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pikkumuutoksia.....
1 parent
0b1e54fb
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
33 additions
and
7 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/UtilBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/BillFacade.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/News.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/NewsGroup.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/PollQuestion.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Role.java
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/apps/ShopPermission.java
code/LanBortalUtilities/src/fi/insomnia/bortal/utilities/UglyFix.java
code/LanBortalWeb/WebContent/poll/thankYou.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/handler/SessionHandler.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/poll/PollView.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillBean.java
View file @
8f77790
...
@@ -105,7 +105,9 @@ public class BillBean implements BillBeanLocal {
...
@@ -105,7 +105,9 @@ public class BillBean implements BillBeanLocal {
private
void
generateBillNumber
(
Bill
bill
)
{
private
void
generateBillNumber
(
Bill
bill
)
{
if
(
bill
.
getBillNumber
()
==
null
||
bill
.
getBillNumber
()
==
0
)
{
if
(
bill
.
getBillNumber
()
==
null
||
bill
.
getBillNumber
()
==
0
)
{
LanEvent
currEvent
=
eventbean
.
getCurrentEvent
();
LanEvent
currEvent
=
eventbean
.
getCurrentEvent
();
Integer
billnr
=
billFacade
.
getBiggestBillNumber
(
currEvent
);
Integer
billnr
=
billFacade
.
getBiggestBillNumber
();
if
(
billnr
==
null
||
billnr
<
currEvent
.
getNextBillNumber
())
{
if
(
billnr
==
null
||
billnr
<
currEvent
.
getNextBillNumber
())
{
billnr
=
currEvent
.
getNextBillNumber
();
billnr
=
currEvent
.
getNextBillNumber
();
}
else
{
}
else
{
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/UtilBean.java
View file @
8f77790
...
@@ -26,6 +26,7 @@ import javax.jms.Session;
...
@@ -26,6 +26,7 @@ import javax.jms.Session;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.enums.apps.SpecialPermission
;
import
fi.insomnia.bortal.model.User
;
import
fi.insomnia.bortal.model.User
;
import
fi.insomnia.bortal.model.UserImage
;
import
fi.insomnia.bortal.model.UserImage
;
import
fi.insomnia.bortal.util.MailMessage
;
import
fi.insomnia.bortal.util.MailMessage
;
...
@@ -35,7 +36,7 @@ import fi.insomnia.bortal.util.MailMessage;
...
@@ -35,7 +36,7 @@ import fi.insomnia.bortal.util.MailMessage;
*/
*/
@Stateless
@Stateless
@LocalBean
@LocalBean
@DeclareRoles
(
"SUPERADMIN"
)
@DeclareRoles
(
{
SpecialPermission
.
S_SUPERADMIN
}
)
public
class
UtilBean
implements
UtilBeanLocal
{
public
class
UtilBean
implements
UtilBeanLocal
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UtilBean
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
UtilBean
.
class
);
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/BillFacade.java
View file @
8f77790
...
@@ -15,7 +15,6 @@ import org.slf4j.LoggerFactory;
...
@@ -15,7 +15,6 @@ import org.slf4j.LoggerFactory;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.model.Bill
;
import
fi.insomnia.bortal.model.Bill
;
import
fi.insomnia.bortal.model.Bill_
;
import
fi.insomnia.bortal.model.Bill_
;
import
fi.insomnia.bortal.model.LanEvent
;
@Stateless
@Stateless
@LocalBean
@LocalBean
...
@@ -44,7 +43,7 @@ public class BillFacade extends EventChildGenericFacade<Bill> {
...
@@ -44,7 +43,7 @@ public class BillFacade extends EventChildGenericFacade<Bill> {
//
//
// }
// }
public
Integer
getBiggestBillNumber
(
LanEvent
e
)
{
public
Integer
getBiggestBillNumber
()
{
// SELECT max(b.billNumber) from Bill b where b.event = :event
// SELECT max(b.billNumber) from Bill b where b.event = :event
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Integer
>
cq
=
cb
.
createQuery
(
Integer
.
class
);
CriteriaQuery
<
Integer
>
cq
=
cb
.
createQuery
(
Integer
.
class
);
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/News.java
View file @
8f77790
...
@@ -44,6 +44,10 @@ public class News extends GenericEntity {
...
@@ -44,6 +44,10 @@ public class News extends GenericEntity {
@Temporal
(
TemporalType
.
TIMESTAMP
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
expire
;
private
Date
expire
;
@ManyToOne
()
@JoinColumn
(
nullable
=
false
)
private
User
creator
;
public
Date
getPublish
()
{
public
Date
getPublish
()
{
return
publish
;
return
publish
;
}
}
...
@@ -123,4 +127,12 @@ public class News extends GenericEntity {
...
@@ -123,4 +127,12 @@ public class News extends GenericEntity {
this
.
group
=
newsGroupsId
;
this
.
group
=
newsGroupsId
;
}
}
public
User
getCreator
()
{
return
creator
;
}
public
void
setCreator
(
User
creator
)
{
this
.
creator
=
creator
;
}
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/NewsGroup.java
View file @
8f77790
...
@@ -33,6 +33,7 @@ public class NewsGroup extends GenericEntity {
...
@@ -33,6 +33,7 @@ public class NewsGroup extends GenericEntity {
*/
*/
private
static
final
long
serialVersionUID
=
4014463478275469802L
;
private
static
final
long
serialVersionUID
=
4014463478275469802L
;
public
static
final
String
EVENT_ID_COLUMN
=
"event_id"
;
public
static
final
String
EVENT_ID_COLUMN
=
"event_id"
;
@ManyToOne
()
@ManyToOne
()
@JoinColumn
(
name
=
EVENT_ID_COLUMN
,
nullable
=
false
)
@JoinColumn
(
name
=
EVENT_ID_COLUMN
,
nullable
=
false
)
private
LanEvent
event
;
private
LanEvent
event
;
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/PollQuestion.java
View file @
8f77790
...
@@ -41,6 +41,7 @@ public class PollQuestion extends GenericEntity {
...
@@ -41,6 +41,7 @@ public class PollQuestion extends GenericEntity {
@Lob
@Lob
private
String
question
;
private
String
question
;
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
private
Integer
choices
=
1
;
private
Integer
choices
=
1
;
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Role.java
View file @
8f77790
...
@@ -179,4 +179,5 @@ public class Role extends GenericEntity {
...
@@ -179,4 +179,5 @@ public class Role extends GenericEntity {
public
List
<
ApplicationPermission
>
getPermissions
()
{
public
List
<
ApplicationPermission
>
getPermissions
()
{
return
permissions
;
return
permissions
;
}
}
}
}
code/LanBortalUtilities/src/fi/insomnia/bortal/enums/apps/ShopPermission.java
View file @
8f77790
...
@@ -8,7 +8,9 @@ public enum ShopPermission implements IAppPermission {
...
@@ -8,7 +8,9 @@ public enum ShopPermission implements IAppPermission {
LIST_ALL_PRODUCTS
(
"List all products in shop"
),
LIST_ALL_PRODUCTS
(
"List all products in shop"
),
SHOP_TO_OTHERS
(
"Shop to other users"
),
SHOP_TO_OTHERS
(
"Shop to other users"
),
SHOP_PRODUCTS
(
"Shop products to self"
),
SHOP_PRODUCTS
(
"Shop products to self"
),
MANAGE_PRODUCTS
(
"Create and modify products"
);
MANAGE_PRODUCTS
(
"Create and modify products"
),
;
public
static
final
String
S_LIST_USERPRODUCTS
=
"SHOP/LIST_USERPRODUCTS"
;
public
static
final
String
S_LIST_USERPRODUCTS
=
"SHOP/LIST_USERPRODUCTS"
;
public
static
final
String
S_LIST_ALL_PRODUCTS
=
"SHOP/LIST_ALL_PRODUCTS"
;
public
static
final
String
S_LIST_ALL_PRODUCTS
=
"SHOP/LIST_ALL_PRODUCTS"
;
...
@@ -22,6 +24,7 @@ public enum ShopPermission implements IAppPermission {
...
@@ -22,6 +24,7 @@ public enum ShopPermission implements IAppPermission {
private
ShopPermission
(
String
desc
)
{
private
ShopPermission
(
String
desc
)
{
this
.
description
=
desc
;
this
.
description
=
desc
;
fullName
=
new
StringBuilder
().
append
(
getParent
().
toString
()).
append
(
DELIMITER
).
append
(
toString
()).
toString
();
fullName
=
new
StringBuilder
().
append
(
getParent
().
toString
()).
append
(
DELIMITER
).
append
(
toString
()).
toString
();
}
}
@Override
@Override
...
...
code/LanBortalUtilities/src/fi/insomnia/bortal/utilities/UglyFix.java
View file @
8f77790
...
@@ -5,6 +5,7 @@ import org.slf4j.Logger;
...
@@ -5,6 +5,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
public
class
UglyFix
{
public
class
UglyFix
{
// Don't touch. Fix old byte to String conversion bugs in passwords
// Don't touch. Fix old byte to String conversion bugs in passwords
private
static
final
byte
FIXSTR
[]
=
{
-
17
,
-
65
,
-
67
};
private
static
final
byte
FIXSTR
[]
=
{
-
17
,
-
65
,
-
67
};
...
...
code/LanBortalWeb/WebContent/poll/thankYou.xhtml
View file @
8f77790
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
<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.poll.answered"
/>
<ui:param
name=
"thispage"
value=
"page.poll.answered"
/>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/handler/SessionHandler.java
View file @
8f77790
...
@@ -17,7 +17,6 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -17,7 +17,6 @@ import javax.servlet.http.HttpServletRequest;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.HostnameFilter
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.beans.EventBeanLocal
;
import
fi.insomnia.bortal.beans.PermissionBeanLocal
;
import
fi.insomnia.bortal.beans.PermissionBeanLocal
;
import
fi.insomnia.bortal.beans.RoleBeanLocal
;
import
fi.insomnia.bortal.beans.RoleBeanLocal
;
...
@@ -154,7 +153,7 @@ public class SessionHandler {
...
@@ -154,7 +153,7 @@ public class SessionHandler {
}
}
return
preurlString
;
return
preurlString
;
}
}
public
boolean
isInDevelopmentMode
()
{
public
boolean
isInDevelopmentMode
()
{
return
BortalLocalContextHolder
.
isInDevelopmentMode
();
return
BortalLocalContextHolder
.
isInDevelopmentMode
();
}
}
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/poll/PollView.java
View file @
8f77790
...
@@ -79,9 +79,13 @@ public class PollView extends GenericCDIView {
...
@@ -79,9 +79,13 @@ public class PollView extends GenericCDIView {
poll
=
pollBean
.
find
(
pollId
);
poll
=
pollBean
.
find
(
pollId
);
pages
=
new
HashMap
<
Integer
,
List
<
QuestionWrapper
>>();
pages
=
new
HashMap
<
Integer
,
List
<
QuestionWrapper
>>();
logger
.
info
(
"initializing poll {}"
,
poll
);
logger
.
info
(
"initializing poll {}"
,
poll
);
for
(
PollQuestion
q
:
getPoll
().
getQuestions
())
{
for
(
PollQuestion
q
:
getPoll
().
getQuestions
())
{
if
(!
getPages
().
containsKey
(
q
.
getPage
()))
{
if
(!
getPages
().
containsKey
(
q
.
getPage
()))
{
getPages
().
put
(
q
.
getPage
(),
new
LinkedList
<
QuestionWrapper
>());
getPages
().
put
(
q
.
getPage
(),
new
LinkedList
<
QuestionWrapper
>());
}
}
getPages
().
get
(
q
.
getPage
()).
add
(
new
QuestionWrapper
(
q
));
getPages
().
get
(
q
.
getPage
()).
add
(
new
QuestionWrapper
(
q
));
...
...
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