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 b36ae048
authored
Oct 13, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate correct sort for menus
1 parent
a6b6adb4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
1 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/MenuBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/MenuNavigationFacade.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/MenuBeanLocal.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/MenuNavigation.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/MenuBean.java
View file @
b36ae04
This diff is collapsed.
Click to expand it.
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/MenuNavigationFacade.java
View file @
b36ae04
...
...
@@ -71,6 +71,8 @@ public class MenuNavigationFacade extends IntegerPkGenericFacade<MenuNavigation>
cb
.
equal
(
root
.
get
(
MenuNavigation_
.
event
),
eventbean
.
getCurrentEvent
()),
cb
.
isTrue
(
root
.
get
(
MenuNavigation_
.
visible
)));
cq
.
orderBy
(
cb
.
asc
(
root
.
get
(
MenuNavigation_
.
sort
)));
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
...
...
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/MenuBeanLocal.java
View file @
b36ae04
...
...
@@ -17,4 +17,6 @@ public interface MenuBeanLocal {
List
<
MenuNavigation
>
getTopmenus
();
void
flushOldMenu
();
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/MenuNavigation.java
View file @
b36ae04
...
...
@@ -82,8 +82,9 @@ public class MenuNavigation extends GenericEntity implements Comparable<MenuNavi
super
();
}
public
MenuNavigation
(
LanEvent
ev
,
String
keyString
)
{
public
MenuNavigation
(
LanEvent
ev
,
String
keyString
,
Integer
sort
)
{
super
();
this
.
sort
=
sort
;
this
.
event
=
ev
;
this
.
key
=
keyString
;
this
.
visible
=
true
;
...
...
@@ -183,8 +184,11 @@ public class MenuNavigation extends GenericEntity implements Comparable<MenuNavi
// used only for initialization function...
public
MenuNavigation
addPage
(
Menuitem
item
,
IAppPermission
permission
)
{
int
childSort
=
100
;
if
(
children
==
null
)
{
children
=
new
ArrayList
<
MenuNavigation
>();
}
else
{
childSort
=
children
.
get
(
children
.
size
()
-
1
).
getSort
()
+
10
;
}
MenuNavigation
add
=
new
MenuNavigation
();
if
(
item
!=
null
)
...
...
@@ -196,6 +200,7 @@ public class MenuNavigation extends GenericEntity implements Comparable<MenuNavi
add
.
setPermission
(
permission
);
add
.
setParent
(
this
);
add
.
setVisible
(
true
);
add
.
setSort
(
childSort
);
children
.
add
(
add
);
return
add
;
...
...
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