Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
JR Utily
2016-10-17 15:20:34 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f21d05b9e6539bc4a00faaa28f6cdd286ac1493b
f21d05b9
1 parent
2e045c8d
exemple d'insert multiligne
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
87 deletions
src/main/java/org/legrog/presentation/UpdateUserBean.java
src/main/resources/META-INF/persistence.xml
src/main/webapp/WEB-INF/classes/import.sql
src/main/java/org/legrog/presentation/UpdateUserBean.java
View file @
f21d05b
...
...
@@ -9,8 +9,10 @@ import org.slf4j.LoggerFactory;
import
javax.annotation.PostConstruct
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.bean.ManagedProperty
;
import
javax.faces.bean.SessionScoped
;
import
javax.faces.context.ExternalContext
;
import
javax.faces.context.FacesContext
;
import
javax.faces.view.ViewScoped
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
java.io.IOException
;
...
...
@@ -19,7 +21,7 @@ import java.util.Date;
import
java.util.List
;
@Named
@
Request
Scoped
@
Session
Scoped
public
class
UpdateUserBean
{
@Inject
private
UserService
userService
;
...
...
@@ -63,13 +65,7 @@ public class UpdateUserBean {
private
boolean
activated
;
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
add
()
{
...
...
@@ -161,6 +157,104 @@ public class UpdateUserBean {
return
"success"
;
}
@PostConstruct
public
void
init
()
{
Logger
logger
=
LoggerFactory
.
getLogger
(
UpdateUserBean
.
class
);
logger
.
info
(
"init"
);
allDisplayNameMasks
=
sharedService
.
getAllDisplayNameMasks
();
availableUserRoles
=
sharedService
.
getAvailableUserRoles
();
availableUserProperties
=
sharedService
.
getAvailableUserProperties
();
}
public
List
<
UserRole
>
getAvailableUserRoles
()
{
return
availableUserRoles
;
}
public
void
setAvailableUserRoles
(
List
<
UserRole
>
availableUserRoles
)
{
this
.
availableUserRoles
=
availableUserRoles
;
}
public
String
getPresentation
()
{
return
presentation
;
}
public
void
setPresentation
(
String
presentation
)
{
this
.
presentation
=
presentation
;
}
public
List
<
UserProperty
>
getAvailableUserProperties
()
{
return
availableUserProperties
;
}
public
void
setAvailableUserProperties
(
List
<
UserProperty
>
availableUserProperties
)
{
this
.
availableUserProperties
=
availableUserProperties
;
}
public
List
<
UserAttribute
>
getUserAttributes
()
{
return
userAttributes
;
}
public
void
setUserAttributes
(
List
<
UserAttribute
>
userAttributes
)
{
this
.
userAttributes
=
userAttributes
;
}
public
boolean
isCriticProvider
()
{
return
criticProvider
;
}
public
void
setCriticProvider
(
boolean
criticProvider
)
{
this
.
criticProvider
=
criticProvider
;
}
public
boolean
isVisible
()
{
return
visible
;
}
public
void
setVisible
(
boolean
visible
)
{
this
.
visible
=
visible
;
}
public
boolean
isActivated
()
{
return
activated
;
}
public
void
setActivated
(
boolean
activated
)
{
this
.
activated
=
activated
;
}
public
UserService
getUserService
()
{
return
userService
;
}
public
void
setUserService
(
UserService
userService
)
{
this
.
userService
=
userService
;
}
public
SharedService
getSharedService
()
{
return
sharedService
;
}
public
void
setSharedService
(
SharedService
sharedService
)
{
this
.
sharedService
=
sharedService
;
}
public
int
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
int
userId
)
{
this
.
userId
=
userId
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getFirstName
()
{
return
firstName
;
}
...
...
@@ -201,14 +295,6 @@ public class UpdateUserBean {
this
.
allDisplayNameMasks
=
allDisplayNameMasks
;
}
public
int
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
int
userId
)
{
this
.
userId
=
userId
;
}
public
String
getEmail
()
{
return
email
;
}
...
...
@@ -240,69 +326,4 @@ public class UpdateUserBean {
public
void
setRoles
(
List
<
UserRole
>
roles
)
{
this
.
roles
=
roles
;
}
@PostConstruct
public
void
init
()
{
Logger
logger
=
LoggerFactory
.
getLogger
(
UpdateUserBean
.
class
);
logger
.
info
(
"init"
);
allDisplayNameMasks
=
sharedService
.
getAllDisplayNameMasks
();
availableUserRoles
=
sharedService
.
getAvailableUserRoles
();
availableUserProperties
=
sharedService
.
getAvailableUserProperties
();
}
public
List
<
UserRole
>
getAvailableUserRoles
()
{
return
availableUserRoles
;
}
public
void
setAvailableUserRoles
(
List
<
UserRole
>
availableUserRoles
)
{
this
.
availableUserRoles
=
availableUserRoles
;
}
public
String
getPresentation
()
{
return
presentation
;
}
public
void
setPresentation
(
String
presentation
)
{
this
.
presentation
=
presentation
;
}
public
List
<
UserProperty
>
getAvailableUserProperties
()
{
return
availableUserProperties
;
}
public
void
setAvailableUserProperties
(
List
<
UserProperty
>
availableUserProperties
)
{
this
.
availableUserProperties
=
availableUserProperties
;
}
public
List
<
UserAttribute
>
getUserAttributes
()
{
return
userAttributes
;
}
public
void
setUserAttributes
(
List
<
UserAttribute
>
userAttributes
)
{
this
.
userAttributes
=
userAttributes
;
}
public
boolean
isCriticProvider
()
{
return
criticProvider
;
}
public
void
setCriticProvider
(
boolean
criticProvider
)
{
this
.
criticProvider
=
criticProvider
;
}
public
boolean
isVisible
()
{
return
visible
;
}
public
void
setVisible
(
boolean
visible
)
{
this
.
visible
=
visible
;
}
public
boolean
isActivated
()
{
return
activated
;
}
public
void
setActivated
(
boolean
activated
)
{
this
.
activated
=
activated
;
}
}
\ No newline at end of file
...
...
src/main/resources/META-INF/persistence.xml
View file @
f21d05b
...
...
@@ -9,7 +9,7 @@
<properties>
<property
name=
"hibernate.hbm2ddl.auto"
value=
"create-drop"
/>
<property
name=
"hibernate.hbm2ddl.import_files"
value=
"import.sql"
/>
<!-- <property name="hibernate.hbm2ddl.import_files_sql_extractor" value="org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor" />--
>
<property
name=
"hibernate.hbm2ddl.import_files_sql_extractor"
value=
"org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor"
/
>
</properties>
</persistence-unit>
...
...
src/main/webapp/WEB-INF/classes/import.sql
View file @
f21d05b
...
...
@@ -20,12 +20,15 @@ INSERT INTO UserProperty VALUES (2, 'avatar', 'Lien vers une icône ou une photo
INSERT
INTO
UserProperty
VALUES
(
3
,
'tagline'
,
'Ligne de présentation pour les contributeurs'
,
TRUE
);
INSERT
INTO
UserProperty
VALUES
(
4
,
'taille_listes'
,
'Nombre d
''
éléments affichés dans les listes'
,
TRUE
);
INSERT
INTO
UserProperty
VALUES
(
5
,
'skin'
,
'Thème visuel'
,
TRUE
);
INSERT
INTO
UserTable
(
USER_ID
,
username
,
password
,
firstName
,
lastName
,
nickname
,
email
,
activated
,
anonymous
,
visible
,
criticProvider
)
VALUES
(
1
,
'one'
,
'one'
,
'Derrick'
,
'Moss'
,
'one'
,
'one@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
);
INSERT
INTO
UserTable
(
USER_ID
,
username
,
password
,
firstName
,
lastName
,
nickname
,
email
,
activated
,
anonymous
,
visible
,
criticProvider
)
VALUES
(
2
,
'two'
,
'two'
,
'Portia'
,
'Lin'
,
'two'
,
'two@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
);
INSERT
INTO
UserTable
(
USER_ID
,
username
,
password
,
firstName
,
lastName
,
nickname
,
email
,
activated
,
anonymous
,
visible
,
criticProvider
)
VALUES
(
3
,
'three'
,
'three'
,
'Marcus'
,
'Boone'
,
'three'
,
'three@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
);
INSERT
INTO
UserTable
(
USER_ID
,
username
,
password
,
firstName
,
lastName
,
nickname
,
email
,
activated
,
anonymous
,
visible
,
criticProvider
)
VALUES
(
4
,
'four'
,
'four'
,
'Ryo'
,
'Tetsuda'
,
'four'
,
'four@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
);
INSERT
INTO
UserTable
(
USER_ID
,
username
,
password
,
firstName
,
lastName
,
nickname
,
email
,
activated
,
anonymous
,
visible
,
criticProvider
)
VALUES
(
5
,
'five'
,
'five'
,
'Emily'
,
'Kolburn'
,
'five'
,
'five@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
);
INSERT
INTO
UserTable
(
USER_ID
,
username
,
password
,
firstName
,
lastName
,
nickname
,
email
,
activated
,
anonymous
,
visible
,
criticProvider
)
VALUES
(
6
,
'six'
,
'six'
,
'Kal'
,
'Varrik'
,
'six'
,
'six@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
);
INSERT
INTO
UserTable
(
USER_ID
,
username
,
password
,
firstName
,
lastName
,
nickname
,
email
,
activated
,
anonymous
,
visible
,
criticProvider
)
VALUES
(
1
,
'one'
,
'one'
,
'Derrick'
,
'Moss'
,
'one'
,
'one@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
),
(
2
,
'two'
,
'two'
,
'Portia'
,
'Lin'
,
'two'
,
'two@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
),
(
3
,
'three'
,
'three'
,
'Marcus'
,
'Boone'
,
'three'
,
'three@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
),
(
4
,
'four'
,
'four'
,
'Ryo'
,
'Tetsuda'
,
'four'
,
'four@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
),
(
5
,
'five'
,
'five'
,
'Emily'
,
'Kolburn'
,
'five'
,
'five@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
),
(
6
,
'six'
,
'six'
,
'Kal'
,
'Varrik'
,
'six'
,
'six@raza.org'
,
TRUE
,
FALSE
,
TRUE
,
TRUE
);
INSERT
INTO
UserTable_UserRole
VALUES
(
1
,
2
);
INSERT
INTO
UserTable_UserRole
VALUES
(
2
,
2
);
INSERT
INTO
UserTable_UserRole
VALUES
(
3
,
2
);
...
...
Please
register
or
login
to post a comment