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 f0611443
authored
Jun 18, 2014
by
Juho Salli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'master'
Pieniä korjailuja ja muutoksia
2 parents
9366fc3c
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 @
f061144
...
@@ -297,6 +297,7 @@ public class MenuBean implements MenuBeanLocal {
...
@@ -297,6 +297,7 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation
adminlectures
=
adminmenu
.
addPage
(
null
,
null
);
MenuNavigation
adminlectures
=
adminmenu
.
addPage
(
null
,
null
);
adminlectures
.
setKey
(
"topnavi.adminlectures"
);
adminlectures
.
setKey
(
"topnavi.adminlectures"
);
adminlectures
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/lectureadmin/manageLectureGroups"
),
LecturePermission
.
MANAGE
);
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 @
f061144
...
@@ -5,10 +5,7 @@
...
@@ -5,10 +5,7 @@
<persistence-unit
name=
"MoyaDb"
>
<persistence-unit
name=
"MoyaDb"
>
<jta-data-source>
jdbc/moyaDb
</jta-data-source>
<jta-data-source>
jdbc/moyaDb
</jta-data-source>
<properties>
<properties>
<property
name=
"eclipselink.ddl-generation"
value=
"create-tables"
/>
<property
name=
"eclipselink.cache.size.default"
value=
"16384"
/>
<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.logging.logger"
value=
"ServerLogger"
/>
<property
name=
"eclipselink.jdbc.uppercase-columns"
value=
"false"
/>
<property
name=
"eclipselink.jdbc.uppercase-columns"
value=
"false"
/>
<property
name=
"eclipselink.target-database"
<property
name=
"eclipselink.target-database"
...
@@ -18,6 +15,7 @@
...
@@ -18,6 +15,7 @@
<property
name=
"eclipselink.target-server"
value=
"Glassfish"
/>
<property
name=
"eclipselink.target-server"
value=
"Glassfish"
/>
<property
name=
"eclipselink.session.customizer"
<property
name=
"eclipselink.session.customizer"
value=
"fi.codecrew.moya.database.eclipselink.MoyaSessionCustomizer"
/>
value=
"fi.codecrew.moya.database.eclipselink.MoyaSessionCustomizer"
/>
<property
name=
"eclipselink.ddl-generation"
value=
"none"
/>
</properties>
</properties>
</persistence-unit>
</persistence-unit>
...
...
code/MoyaDatabase/src/fi/codecrew/moya/model/Lecture.java
View file @
f061144
...
@@ -184,8 +184,8 @@ public class Lecture extends GenericEntity {
...
@@ -184,8 +184,8 @@ public class Lecture extends GenericEntity {
newLecture
.
setName
(
getName
());
newLecture
.
setName
(
getName
());
newLecture
.
setHours
(
getHours
());
newLecture
.
setHours
(
getHours
());
newLecture
.
setMaxParticipantsCount
(
getMaxParticipantsCount
());
newLecture
.
setMaxParticipantsCount
(
getMaxParticipantsCount
());
newLecture
.
setStartTime
(
getStartTim
e
());
newLecture
.
setStartTime
(
(
Calendar
)
getStartTime
().
clon
e
());
newLecture
.
setOpenForRoles
(
getOpenForRoles
(
));
newLecture
.
setOpenForRoles
(
new
ArrayList
<
Role
>(
getOpenForRoles
()
));
return
newLecture
;
return
newLecture
;
}
}
...
...
code/MoyaDatabase/src/fi/codecrew/moya/model/converters/JsonAttributeConverter.java
View file @
f061144
...
@@ -21,7 +21,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
...
@@ -21,7 +21,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
* JsonObject -> PGobject
* JsonObject -> PGobject
*/
*/
public
PGobject
convertToDatabaseColumn
(
JsonObject
jsonObject
)
{
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
pgObject
=
new
PGobject
();
pgObject
.
setType
(
"json"
);
pgObject
.
setType
(
"json"
);
...
@@ -34,7 +34,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
...
@@ -34,7 +34,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
log
.
warn
(
"PGobject.setValue() threw an exception. Should not happen. Something is wrong."
,
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
;
return
pgObject
;
}
}
...
@@ -42,11 +42,11 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
...
@@ -42,11 +42,11 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
* PGobject -> JsonObject
* PGobject -> JsonObject
*/
*/
public
JsonObject
convertToEntityAttribute
(
PGobject
pgObject
)
{
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
// Convert null values to empty object
if
(
pgObject
==
null
)
{
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
();
return
Json
.
createObjectBuilder
().
build
();
}
}
...
@@ -63,7 +63,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
...
@@ -63,7 +63,7 @@ public class JsonAttributeConverter implements AttributeConverter<JsonObject, PG
if
(
stringValue
!=
null
&&
!
stringValue
.
toLowerCase
().
equals
(
"null"
))
{
if
(
stringValue
!=
null
&&
!
stringValue
.
toLowerCase
().
equals
(
"null"
))
{
JsonReader
jsonReader
=
Json
.
createReader
(
new
StringReader
(
stringValue
));
JsonReader
jsonReader
=
Json
.
createReader
(
new
StringReader
(
stringValue
));
JsonObject
jsonObject
=
jsonReader
.
readObject
();
JsonObject
jsonObject
=
jsonReader
.
readObject
();
log
.
info
(
"Converted PGobject to JsonObject: {}"
,
jsonObject
);
//
log.info("Converted PGobject to JsonObject: {}", jsonObject);
return
jsonObject
;
return
jsonObject
;
}
else
{
}
else
{
log
.
info
(
"Null value. Returning empty JsonObject"
);
log
.
info
(
"Null value. Returning empty JsonObject"
);
...
...
code/MoyaWeb/WebContent/lectures/viewLectures.xhtml
View file @
f061144
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<f:event
type=
"preRenderView"
listener=
"#{lectureUserView.initView()}"
/>
<f:event
type=
"preRenderView"
listener=
"#{lectureUserView.initView()}"
/>
</f:metadata>
</f:metadata>
<ui:define
name=
"title"
>
<ui:define
rendered=
"#{lectureUserView.lectureGroupsVisible}"
name=
"title"
>
<h1>
#{i18n['viewlectures.title']}
</h1>
<h1>
#{i18n['viewlectures.title']}
</h1>
</ui:define>
</ui:define>
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<h:form
id=
"viewlecturesform"
>
<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:dataTable
value=
"#{lectureUserView.lectureGroups}"
var=
"lectureGroup"
>
<p:column
headerText=
"#{i18n['lectureGroup.name']}"
>
<p:column
headerText=
"#{i18n['lectureGroup.name']}"
>
<h:outputText
value=
"#{lectureGroup.name}"
/>
<h:outputText
value=
"#{lectureGroup.name}"
/>
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</p:fieldset>
</p:fieldset>
<h1>
<h1>
<h:outputText
id=
"title"
value=
"#{lectureUserView.currentLectureGroup.name}"
/>
<h:outputText
id=
"title"
value=
"#{lectureUserView.currentLectureGroup.name}"
/>
</h1>
</h1>
...
...
code/MoyaWeb/WebContent/resources/cditools/user/eventuserlist.xhtml
View file @
f061144
...
@@ -10,7 +10,7 @@
...
@@ -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}"
>
<p:column
headerText=
"#{i18n['user.nick']}"
sortBy=
"#{user.nick}"
>
<h:outputText
styleClass=
"hoverable"
value=
"#{(empty user.nick)?'----':user.nick}"
/>
<h:outputText
styleClass=
"hoverable"
value=
"#{(empty user.nick)?'----':user.nick}"
/>
...
...
code/MoyaWeb/WebContent/resources/cditools/user/list.xhtml
View file @
f061144
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<composite:implementation>
<composite:implementation>
<h:outputScript
library=
"primefaces"
name=
"jquery/jquery.js"
target=
"head"
/>
<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']}"
>
<p:column
sortBy=
"#{wra.user.nick}"
headerText=
"#{i18n['user.nick']}"
>
<h:outputText
value=
"#{(empty wra.user.nick)?'----':wra.user.nick}"
/>
<h:outputText
value=
"#{(empty wra.user.nick)?'----':wra.user.nick}"
/>
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/lecture/LectureUserView.java
View file @
f061144
...
@@ -43,6 +43,12 @@ public class LectureUserView extends GenericCDIView {
...
@@ -43,6 +43,12 @@ public class LectureUserView extends GenericCDIView {
super
.
beginConversation
();
super
.
beginConversation
();
}
}
}
}
public
boolean
isLectureGroupsVisible
()
{
if
(
lectureBean
.
getLectureGroups
().
size
()
<=
1
)
return
false
;
return
true
;
}
public
ListDataModel
<
LectureGroup
>
getLectureGroups
()
{
public
ListDataModel
<
LectureGroup
>
getLectureGroups
()
{
lectureGroups
=
new
ListDataModel
<
LectureGroup
>(
lectureBean
.
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