Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
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 40fac604
authored
Jun 18, 2014
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into user_selectable_groups
2 parents
0f125c44
76b0b752
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
15 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
code/MoyaDatabase/src/META-INF/persistence.xml
code/MoyaDatabase/src/fi/codecrew/moya/model/Lecture.java
code/MoyaDatabase/src/fi/codecrew/moya/model/converters/JsonAttributeConverter.java
code/MoyaWeb/WebContent/lectures/viewLectures.xhtml
code/MoyaWeb/WebContent/resources/cditools/user/eventuserlist.xhtml
code/MoyaWeb/WebContent/resources/cditools/user/list.xhtml
code/MoyaWeb/src/fi/codecrew/moya/web/lecture/LectureUserView.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
View file @
40fac60
...
...
@@ -297,6 +297,7 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation
adminlectures
=
adminmenu
.
addPage
(
null
,
null
);
adminlectures
.
setKey
(
"topnavi.adminlectures"
);
adminlectures
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/lectureadmin/manageLectureGroups"
),
LecturePermission
.
MANAGE
);
adminlectures
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/lectureadmin/manageLectures"
),
LecturePermission
.
MANAGE
).
setVisible
(
false
);;
...
...
code/MoyaDatabase/src/META-INF/persistence.xml
View file @
40fac60
...
...
@@ -5,10 +5,7 @@
<persistence-unit
name=
"MoyaDb"
>
<jta-data-source>
jdbc/moyaDb
</jta-data-source>
<properties>
<property
name=
"eclipselink.ddl-generation"
value=
"create-tables"
/>
<property
name=
"eclipselink.cache.size.default"
value=
"16384"
/>
<property
name=
"eclipselink.ddl-generation.output-mode"
value=
"sql-script"
/>
<property
name=
"eclipselink.logging.logger"
value=
"ServerLogger"
/>
<property
name=
"eclipselink.jdbc.uppercase-columns"
value=
"false"
/>
<property
name=
"eclipselink.target-database"
...
...
@@ -18,6 +15,7 @@
<property
name=
"eclipselink.target-server"
value=
"Glassfish"
/>
<property
name=
"eclipselink.session.customizer"
value=
"fi.codecrew.moya.database.eclipselink.MoyaSessionCustomizer"
/>
<property
name=
"eclipselink.ddl-generation"
value=
"none"
/>
</properties>
</persistence-unit>
...
...
code/MoyaDatabase/src/fi/codecrew/moya/model/Lecture.java
View file @
40fac60
...
...
@@ -184,8 +184,8 @@ public class Lecture extends GenericEntity {
newLecture
.
setName
(
getName
());
newLecture
.
setHours
(
getHours
());
newLecture
.
setMaxParticipantsCount
(
getMaxParticipantsCount
());
newLecture
.
setStartTime
(
getStartTim
e
());
newLecture
.
setOpenForRoles
(
getOpenForRoles
(
));
newLecture
.
setStartTime
(
(
Calendar
)
getStartTime
().
clon
e
());
newLecture
.
setOpenForRoles
(
new
ArrayList
<
Role
>(
getOpenForRoles
()
));
return
newLecture
;
}
...
...
code/MoyaDatabase/src/fi/codecrew/moya/model/converters/JsonAttributeConverter.java
View file @
40fac60
...
...
@@ -21,7 +21,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
* JsonObject -> PGobject
*/
public
PGobject
convertToDatabaseColumn
(
JsonObject
jsonObject
)
{
log
.
info
(
"Converting JsonObject to PGobject. Original JsonObject: {}"
,
jsonObject
);
//
log.info("Converting JsonObject to PGobject. Original JsonObject: {}", jsonObject);
PGobject
pgObject
=
new
PGobject
();
pgObject
.
setType
(
"json"
);
...
...
@@ -34,7 +34,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
}
catch
(
SQLException
e
)
{
log
.
warn
(
"PGobject.setValue() threw an exception. Should not happen. Something is wrong."
,
e
);
}
log
.
info
(
"Converted JsonObject to PGobject: {}"
,
pgObject
);
//
log.info("Converted JsonObject to PGobject: {}", pgObject);
return
pgObject
;
}
...
...
@@ -42,11 +42,11 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
* PGobject -> JsonObject
*/
public
JsonObject
convertToEntityAttribute
(
PGobject
pgObject
)
{
log
.
info
(
"Converting PGobject to JsonObject. Original PGobject: {}"
,
pgObject
);
//
log.info("Converting PGobject to JsonObject. Original PGobject: {}", pgObject);
// Convert null values to empty object
if
(
pgObject
==
null
)
{
log
.
info
(
"PGobject was null. Retruning an empty JsonObject."
);
//
log.info("PGobject was null. Retruning an empty JsonObject.");
return
Json
.
createObjectBuilder
().
build
();
}
...
...
@@ -63,7 +63,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
if
(
stringValue
!=
null
&&
!
stringValue
.
toLowerCase
().
equals
(
"null"
))
{
JsonReader
jsonReader
=
Json
.
createReader
(
new
StringReader
(
stringValue
));
JsonObject
jsonObject
=
jsonReader
.
readObject
();
log
.
info
(
"Converted PGobject to JsonObject: {}"
,
jsonObject
);
//
log.info("Converted PGobject to JsonObject: {}", jsonObject);
return
jsonObject
;
}
else
{
log
.
info
(
"Null value. Returning empty JsonObject"
);
...
...
code/MoyaWeb/WebContent/lectures/viewLectures.xhtml
View file @
40fac60
...
...
@@ -7,7 +7,7 @@
<f:event
type=
"preRenderView"
listener=
"#{lectureUserView.initView()}"
/>
</f:metadata>
<ui:define
name=
"title"
>
<ui:define
rendered=
"#{lectureUserView.lectureGroupsVisible}"
name=
"title"
>
<h1>
#{i18n['viewlectures.title']}
</h1>
</ui:define>
...
...
@@ -15,7 +15,7 @@
<h:form
id=
"viewlecturesform"
>
<p:fieldset
id=
"lectureGroups"
legend=
"#{i18n['lecture.selectgroup']}"
>
<p:fieldset
rendered=
"#{lectureUserView.lectureGroupsVisible}"
id=
"lectureGroups"
legend=
"#{i18n['lecture.selectgroup']}"
>
<p:dataTable
value=
"#{lectureUserView.lectureGroups}"
var=
"lectureGroup"
>
<p:column
headerText=
"#{i18n['lectureGroup.name']}"
>
<h:outputText
value=
"#{lectureGroup.name}"
/>
...
...
@@ -33,7 +33,7 @@
</p:fieldset>
<h1>
<h:outputText
id=
"title"
value=
"#{lectureUserView.currentLectureGroup.name}"
/>
<h:outputText
id=
"title"
value=
"#{lectureUserView.currentLectureGroup.name}"
/>
</h1>
...
...
code/MoyaWeb/WebContent/resources/cditools/user/eventuserlist.xhtml
View file @
40fac60
...
...
@@ -10,7 +10,7 @@
<p:dataTable
styleClass=
"bordertable"
id=
"usertable"
value=
"#{userSearchView.eventuserModel}"
rows=
"100
0
"
paginator=
"true"
lazy=
"true"
var=
"user"
>
<p:dataTable
styleClass=
"bordertable"
id=
"usertable"
value=
"#{userSearchView.eventuserModel}"
rows=
"100"
paginator=
"true"
lazy=
"true"
var=
"user"
>
<p:column
headerText=
"#{i18n['user.nick']}"
sortBy=
"#{user.nick}"
>
<h:outputText
styleClass=
"hoverable"
value=
"#{(empty user.nick)?'----':user.nick}"
/>
...
...
code/MoyaWeb/WebContent/resources/cditools/user/list.xhtml
View file @
40fac60
...
...
@@ -9,7 +9,7 @@
<composite:implementation>
<h:outputScript
library=
"primefaces"
name=
"jquery/jquery.js"
target=
"head"
/>
<p:dataTable
id=
"user"
value=
"#{userSearchView.userModel}"
rows=
"
5
00"
var=
"wra"
paginator=
"true"
lazy=
"true"
>
<p:dataTable
id=
"user"
value=
"#{userSearchView.userModel}"
rows=
"
1
00"
var=
"wra"
paginator=
"true"
lazy=
"true"
>
<p:column
sortBy=
"#{wra.user.nick}"
headerText=
"#{i18n['user.nick']}"
>
<h:outputText
value=
"#{(empty wra.user.nick)?'----':wra.user.nick}"
/>
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/lecture/LectureUserView.java
View file @
40fac60
...
...
@@ -43,6 +43,12 @@ public class LectureUserView extends GenericCDIView {
super
.
beginConversation
();
}
}
public
boolean
isLectureGroupsVisible
()
{
if
(
lectureBean
.
getLectureGroups
().
size
()
<=
1
)
return
false
;
return
true
;
}
public
ListDataModel
<
LectureGroup
>
getLectureGroups
()
{
lectureGroups
=
new
ListDataModel
<
LectureGroup
>(
lectureBean
.
getLectureGroups
());
...
...
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