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 23f6c563
authored
Oct 07, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Menu separator and user sorting stuff.
1 parent
f1577fdc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
9 deletions
code/LanBortalUtilities/src/fi/insomnia/bortal/utilities/SearchQuery.java
code/LanBortalWeb/WebContent/resources/cditools/user/list.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/PaginationView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/map/PlaceView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/menu/PrimeMenuView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ReaderView.java
code/LanBortalUtilities/src/fi/insomnia/bortal/utilities/SearchQuery.java
View file @
23f6c56
...
...
@@ -9,13 +9,14 @@ public class SearchQuery implements Serializable {
private
int
pagesize
=
20
;
private
String
sort
=
null
;
private
String
search
=
null
;
private
Boolean
direction
=
false
;
public
SearchQuery
()
{
super
();
}
public
SearchQuery
(
int
page
,
int
pagesize
,
String
sort
,
String
search
)
{
public
SearchQuery
(
int
page
,
int
pagesize
,
String
sort
,
String
search
,
boolean
direction
)
{
super
();
this
.
page
=
page
;
this
.
pagesize
=
pagesize
;
...
...
@@ -69,4 +70,12 @@ public class SearchQuery implements Serializable {
}
}
public
Boolean
isDirection
()
{
return
direction
;
}
public
void
setDirection
(
Boolean
direction
)
{
this
.
direction
=
direction
;
}
}
code/LanBortalWeb/WebContent/resources/cditools/user/list.xhtml
View file @
23f6c56
...
...
@@ -40,6 +40,7 @@
<h:link
value=
"#{i18n['user.firstNames']}"
includeViewParams=
"true"
>
<f:param
name=
"sort"
value=
"firstnames"
/>
<f:param
name=
"page"
value=
"0"
/>
<f:param
name=
"direction"
value=
"#{(userSearchView.sort eq 'firstnames')? !userSearchView.direction :userSearchView.direction }"
/>
</h:link>
</f:facet>
<h:outputText
value=
"#{user.firstnames}"
/>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/PaginationView.java
View file @
23f6c56
...
...
@@ -19,6 +19,7 @@ public abstract class PaginationView<T extends ModelInterface> extends GenericCD
private
SearchQuery
searchQuery
=
new
SearchQuery
();
protected
Long
resultcount
=
0L
;
private
Long
pagecount
=
0L
;
// protected String sort;
// protected String search;
private
List
<
T
>
results
;
...
...
@@ -148,4 +149,12 @@ public abstract class PaginationView<T extends ModelInterface> extends GenericCD
this
.
searchQuery
=
searchQuery
;
}
public
Boolean
isDirection
()
{
return
searchQuery
.
isDirection
();
}
public
void
setDirection
(
Boolean
direction
)
{
searchQuery
.
setDirection
(
direction
);
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/map/PlaceView.java
View file @
23f6c56
...
...
@@ -158,7 +158,7 @@ public class PlaceView extends GenericCDIView {
public
String
searchUser
()
{
super
.
beginConversation
();
userlist
=
new
ListDataModel
<
User
>(
userbean
.
getUsers
(
new
SearchQuery
(
0
,
0
,
null
,
searchuser
)).
getResults
());
userlist
=
new
ListDataModel
<
User
>(
userbean
.
getUsers
(
new
SearchQuery
(
0
,
0
,
null
,
searchuser
,
false
)).
getResults
());
return
null
;
}
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/menu/PrimeMenuView.java
View file @
23f6c56
...
...
@@ -7,6 +7,7 @@ import javax.enterprise.context.RequestScoped;
import
javax.inject.Named
;
import
org.primefaces.component.menuitem.MenuItem
;
import
org.primefaces.component.separator.Separator
;
import
org.primefaces.component.submenu.Submenu
;
import
org.primefaces.model.DefaultMenuModel
;
import
org.primefaces.model.MenuModel
;
...
...
@@ -66,6 +67,7 @@ public class PrimeMenuView extends GenericCDIView {
}
else
{
Submenu
subm
=
addSubmenu
(
m
);
if
(
subm
!=
null
)
{
menuModel
.
addSubmenu
(
subm
);
...
...
@@ -85,14 +87,20 @@ public class PrimeMenuView extends GenericCDIView {
ret
.
setLabel
(
I18n
.
get
(
m
.
getKey
()));
for
(
MenuNavigation
child
:
m
.
getChildren
())
{
if
(
child
.
getItem
()
!=
null
&&
child
.
getChildren
().
isEmpty
())
{
MenuItem
item
=
mkMenuitem
(
child
);
if
(
item
!=
null
)
if
(
child
.
getChildren
().
isEmpty
())
{
if
(
child
.
getItem
()
!=
null
)
{
item
.
setValue
(
I18n
.
get
(
child
.
getKey
()));
ret
.
getChildren
().
add
(
item
);
MenuItem
item
=
mkMenuitem
(
child
);
if
(
item
!=
null
)
{
item
.
setValue
(
I18n
.
get
(
child
.
getKey
()));
ret
.
getChildren
().
add
(
item
);
}
}
else
if
(
ret
.
getChildCount
()
>
0
)
{
ret
.
getChildren
().
add
(
new
Separator
());
}
}
else
{
Submenu
subm
=
addSubmenu
(
child
);
if
(
subm
!=
null
)
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ReaderView.java
View file @
23f6c56
...
...
@@ -73,7 +73,7 @@ public class ReaderView extends GenericCDIView {
if
(
usersearch
==
null
||
usersearch
.
length
()
<
2
)
{
super
.
addFaceMessage
(
"user.tooShortSearch"
);
}
else
{
userlist
=
UserCardWrapper
.
initWrapper
(
userbean
.
getUsers
(
new
SearchQuery
(
0
,
0
,
null
,
usersearch
)).
getResults
(),
userbean
);
userlist
=
UserCardWrapper
.
initWrapper
(
userbean
.
getUsers
(
new
SearchQuery
(
0
,
0
,
null
,
usersearch
,
false
)).
getResults
(),
userbean
);
}
return
null
;
...
...
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