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 d84249ae
authored
Apr 05, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keskeneräisiä menujuttuja..
1 parent
9efd3cda
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
0 deletions
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/menu/MenuRequestView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/menu/PageGroup.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/menu/MenuRequestView.java
0 → 100644
View file @
d84249a
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
menu
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.context.FacesContext
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.servlet.http.HttpServletRequest
;
@Named
@RequestScoped
public
class
MenuRequestView
{
private
String
pagename
;
@Inject
private
FacesContext
context
;
public
String
getPagename
()
{
if
(
pagename
==
null
)
{
HttpServletRequest
req
=
(
HttpServletRequest
)
getContext
().
getExternalContext
().
getRequest
();
String
[]
splitted
=
req
.
getServletPath
().
split
(
"\\."
);
if
(
splitted
.
length
>
0
)
{
pagename
=
splitted
[
0
];
}
}
return
pagename
;
}
public
FacesContext
getContext
()
{
return
context
;
}
public
void
setContext
(
FacesContext
context
)
{
this
.
context
=
context
;
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/menu/PageGroup.java
0 → 100644
View file @
d84249a
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
menu
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
fi.insomnia.bortal.enums.apps.IAppPermission
;
public
class
PageGroup
{
private
final
String
name
;
private
final
List
<
MenuGroup
>
menugroups
;
private
MenuGroup
currentMenugroup
;
private
final
Map
<
String
,
Menuitem
>
pages
;
public
PageGroup
(
String
name
)
{
this
.
name
=
name
;
this
.
menugroups
=
new
ArrayList
<
MenuGroup
>();
pages
=
new
HashMap
<
String
,
Menuitem
>();
}
public
String
getName
()
{
return
name
;
}
public
Menuitem
addPage
(
String
url
,
IAppPermission
perm
)
{
Menuitem
ret
=
currentMenugroup
.
addPage
(
url
,
perm
);
pages
.
put
(
url
,
ret
);
return
ret
;
}
public
void
initMenugroup
(
String
menuname
)
{
currentMenugroup
=
new
MenuGroup
(
menuname
);
menugroups
.
add
(
currentMenugroup
);
}
}
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