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
Jean-Francois Leveque
2017-01-18 16:24:43 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b9a5da47032c6c35456a1ff6a1a3a473e5751c4f
b9a5da47
1 parent
e0ee771d
Suppression d'un champ non maintenable (éditeur actif) et adaptations pour migration éditeur.
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
47 deletions
migration/creeV3Publisher+Version+Action.sql
src/main/java/org/legrog/entities/PublisherVersion.java
src/main/java/org/legrog/web/publisher/PublisherVersionView.java
src/main/java/org/legrog/web/publisher/listPublisherActions.xhtml
src/main/java/org/legrog/web/publisher/listPublisherVersions.xhtml
src/main/java/org/legrog/web/publisher/publisherVersion.xhtml
src/main/resources/META-INF/persistence.xml
src/test/java/org/legrog/web/publisher/PublisherVersionViewTest.java
migration/creeV3Publisher+Version+Action.sql
View file @
b9a5da4
tee
creeV3Publisher
+
Version
+
Action
.
log
SET
foreign_key_checks
=
0
;
create
table
Publisher
(
publisherId
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
validatedVersion
int
(
11
),
validatedVersion
_publisherVersionId
int
(
11
),
PRIMARY
KEY
(
'publisherId'
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
insert
into
Publisher
(
publisherId
,
validatedVersion
)
insert
into
Publisher
(
publisherId
,
validatedVersion
_publisherVersionId
)
select
ID_EDITEUR
,
ID_EDITEUR
from
editeur
;
create
table
PublisherVersion
(
...
...
@@ -22,7 +24,6 @@ create table PublisherVersion (
publisherTelephone
varchar
(
25
),
publisherEmail
varchar
(
50
),
publisherURL
varchar
(
100
),
publisherActive
TINYINT
(
1
),
publisherHistory
longtext
,
publisherVersionAuthor_userId
int
(
11
),
publisherVersionDatetime
DATETIME
,
...
...
@@ -33,10 +34,10 @@ insert into PublisherVersion (publisherVersionId, publisher_publisherId,
publisherName
,
publisherStreetAddress
,
publisherPostalCode
,
publisherPostOfficeBoxNumber
,
publisherAddressRegion
,
publisherAddressLocality
,
publisherAddressCountry_countryId
,
publisherTelephone
,
publisherEmail
,
publisherURL
,
publisherActive
,
publisherTelephone
,
publisherEmail
,
publisherURL
,
publisherHistory
,
publisherVersionAuthor_userId
,
publisherVersionDatetime
)
select
ID_EDITEUR
,
ID_EDITEUR
,
NOM_EDITEUR
,
ADR_EDITEUR
,
CP_EDITEUR
,
NULL
,
NULL
,
VILLE
,
countryId
,
TEL_EDITEUR
,
EMAIL_EDITEUR
,
URL_EDITEUR
,
NULL
,
NULL
,
VILLE
,
countryId
,
TEL_EDITEUR
,
EMAIL_EDITEUR
,
URL_EDITEUR
,
HISTORIQUE
,
ID_UTILISATEUR
,
DATE_ACTION
from
editeur
e
left
join
Country
on
countryName
=
e
.
PAYS
...
...
@@ -45,7 +46,7 @@ where j.DATE_ACTION = (select max(DATE_ACTION) from journal j2
where
j2
.
ID_JOURNALISABLE
=
e
.
ID_EDITEUR
)
union
select
ID_EDITEUR
,
ID_EDITEUR
,
NOM_EDITEUR
,
ADR_EDITEUR
,
CP_EDITEUR
,
NULL
,
NULL
,
VILLE
,
countryId
,
TEL_EDITEUR
,
EMAIL_EDITEUR
,
URL_EDITEUR
,
NULL
,
NULL
,
VILLE
,
countryId
,
TEL_EDITEUR
,
EMAIL_EDITEUR
,
URL_EDITEUR
,
HISTORIQUE
,
null
,
null
from
editeur
e
left
join
Country
on
countryName
=
e
.
PAYS
...
...
@@ -72,6 +73,8 @@ where j.DATE_ACTION = (select max(DATE_ACTION) from journal j2
where
j2
.
ID_JOURNALISABLE
=
e
.
ID_EDITEUR
)
;
SET
foreign_key_checks
=
1
;
show
create
table
Publisher
;
show
create
table
PublisherVersion
;
...
...
src/main/java/org/legrog/entities/PublisherVersion.java
View file @
b9a5da4
...
...
@@ -28,7 +28,7 @@ public class PublisherVersion {
private
String
publisherTelephone
;
private
String
publisherEmail
;
private
String
publisherURL
;
private
boolean
publisherActive
;
@Lob
private
String
publisherHistory
;
@ManyToOne
private
Account
publisherVersionAuthor
;
...
...
@@ -42,14 +42,6 @@ public class PublisherVersion {
this
.
publisherVersionDatetime
=
publisherVersionDatetime
;
}
public
boolean
isPublisherActive
()
{
return
publisherActive
;
}
public
void
setPublisherActive
(
boolean
publisherActive
)
{
this
.
publisherActive
=
publisherActive
;
}
public
String
getPublisherHistory
()
{
return
publisherHistory
;
}
...
...
@@ -160,7 +152,7 @@ public class PublisherVersion {
publisherStreetAddress
+
", CP = "
+
publisherPostalCode
+
", BP = "
+
publisherPostOfficeBoxNumber
+
", Region = "
+
publisherAddressRegion
+
", Ville = "
+
publisherAddressLocality
+
", Pays = "
+
publisherAddressCountry
+
", Telephone = "
+
publisherTelephone
+
", email = "
+
publisherEmail
+
", URL = "
+
publisherURL
+
",
actif = "
+
publisherActive
+
",
History = "
+
publisherHistory
+
", URL = "
+
publisherURL
+
", History = "
+
publisherHistory
+
", Version Author = "
+
publisherVersionAuthor
+
", Version DateTime = "
+
publisherVersionDatetime
;
}
...
...
src/main/java/org/legrog/web/publisher/PublisherVersionView.java
View file @
b9a5da4
...
...
@@ -41,7 +41,6 @@ public class PublisherVersionView implements Serializable {
private
String
publisherTelephone
;
private
String
publisherEmail
;
private
String
publisherURL
;
private
boolean
publisherActive
;
private
String
publisherHistory
;
private
transient
Account
publisherVersionAuthor
;
private
Timestamp
publisherVersionDatetime
;
...
...
@@ -86,7 +85,6 @@ public class PublisherVersionView implements Serializable {
publisherTelephone
=
null
;
publisherEmail
=
null
;
publisherURL
=
null
;
publisherActive
=
false
;
publisherHistory
=
null
;
// Je ne pense pas que la ligne suivante soit nécessaire
publisher
=
null
;
...
...
@@ -108,7 +106,6 @@ public class PublisherVersionView implements Serializable {
private
PublisherVersion
getNewPublisherVersion
()
{
PublisherVersion
publisherVersion
=
new
PublisherVersion
();
publisherVersion
.
setPublisherActive
(
publisherActive
);
publisherVersion
.
setPublisherAddressCountry
(
publisherAddressCountry
);
publisherVersion
.
setPublisherAddressLocality
(
publisherAddressLocality
);
publisherVersion
.
setPublisherAddressRegion
(
publisherAddressRegion
);
...
...
@@ -149,8 +146,8 @@ public class PublisherVersionView implements Serializable {
}
public
void
update
()
{
logger
.
trace
(
"debut update, attributs locaux, publisherA
ctive = {} publisherA
ddressCountry = {} publisherAddressLocality = {} publisherAddressRegion = {} publisherEmail = {} publisherHistory = {} publisherName = {} publisherPostalCode = {} publisherPostOfficeBoxNumber = {} publisherStreetAddress = {} publisherTelephone {} publisherURL {}"
,
publisherA
ctive
,
publisherA
ddressCountry
,
publisherAddressLocality
,
publisherAddressRegion
,
logger
.
trace
(
"debut update, attributs locaux, publisherAddressCountry = {} publisherAddressLocality = {} publisherAddressRegion = {} publisherEmail = {} publisherHistory = {} publisherName = {} publisherPostalCode = {} publisherPostOfficeBoxNumber = {} publisherStreetAddress = {} publisherTelephone {} publisherURL {}"
,
publisherAddressCountry
,
publisherAddressLocality
,
publisherAddressRegion
,
publisherEmail
,
publisherHistory
,
publisherName
,
publisherPostalCode
,
publisherPostOfficeBoxNumber
,
publisherStreetAddress
,
publisherTelephone
,
publisherURL
);
...
...
@@ -191,7 +188,6 @@ public class PublisherVersionView implements Serializable {
publisherTelephone
=
publisherVersion
.
getPublisherTelephone
();
publisherEmail
=
publisherVersion
.
getPublisherEmail
();
publisherURL
=
publisherVersion
.
getPublisherURL
();
publisherActive
=
publisherVersion
.
isPublisherActive
();
publisherHistory
=
publisherVersion
.
getPublisherHistory
();
publisher
=
publisherVersion
.
getPublisher
();
...
...
@@ -296,14 +292,6 @@ public class PublisherVersionView implements Serializable {
this
.
publisherURL
=
publisherURL
;
}
public
boolean
isPublisherActive
()
{
return
publisherActive
;
}
public
void
setPublisherActive
(
boolean
publisherActive
)
{
this
.
publisherActive
=
publisherActive
;
}
public
String
getPublisherHistory
()
{
return
publisherHistory
;
}
...
...
src/main/java/org/legrog/web/publisher/listPublisherActions.xhtml
View file @
b9a5da4
...
...
@@ -65,10 +65,6 @@
${action.publisherVersion.publisherURL}
</h:column>
<h:column>
<f:facet
name=
"header"
>
Active ?
</f:facet>
${action.publisherVersion.publisherActive}
</h:column>
<h:column>
<f:facet
name=
"header"
>
History
</f:facet>
${action.publisherVersion.publisherHistory}
</h:column>
...
...
src/main/java/org/legrog/web/publisher/listPublisherVersions.xhtml
View file @
b9a5da4
...
...
@@ -94,10 +94,6 @@
${version.publisherURL}
</h:column>
<h:column>
<f:facet
name=
"header"
>
Active ?
</f:facet>
${version.publisherActive}
</h:column>
<h:column>
<f:facet
name=
"header"
>
History
</f:facet>
${version.publisherHistory}
</h:column>
...
...
src/main/java/org/legrog/web/publisher/publisherVersion.xhtml
View file @
b9a5da4
...
...
@@ -53,9 +53,6 @@
<label
for=
"publisherURL"
>
publisherURL
</label>
<input
type=
"text"
id=
"publisherURL"
jsf:value=
'#{publisherVersionView.publisherURL}'
jsf:disabled=
"#{not publisherVersionView.editMode}"
/>
<label
for=
"publisherActive"
>
publisherActive
</label>
<input
type=
"checkbox"
id=
"publisherActive"
jsf:disabled=
"#{not publisherVersionView.editMode}"
jsf:value=
"#{publisherVersionView.publisherActive}"
/>
<label
for=
"publisherHistory"
>
publisherHistory
</label>
<textarea
id=
"publisherHistory"
rows=
""
cols=
""
jsf:disabled=
"#{not publisherVersionView.editMode}"
jsf:value=
"#{publisherVersionView.publisherHistory}"
/>
...
...
src/main/resources/META-INF/persistence.xml
View file @
b9a5da4
...
...
@@ -22,6 +22,9 @@
<jta-data-source>
v3Database
</jta-data-source>
<exclude-unlisted-classes>
false
</exclude-unlisted-classes>
<properties>
<property
name=
"hibernate.connection.CharSet"
value=
"utf8"
/>
<property
name=
"hibernate.connection.characterEncoding"
value=
"utf8"
/>
<property
name=
"hibernate.connection.useUnicode"
value=
"true"
/>
<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"
/>
...
...
src/test/java/org/legrog/web/publisher/PublisherVersionViewTest.java
View file @
b9a5da4
...
...
@@ -58,7 +58,6 @@ public class PublisherVersionViewTest {
publisherVersion
.
setPublisherTelephone
(
"G"
);
publisherVersion
.
setPublisherEmail
(
"H"
);
publisherVersion
.
setPublisherURL
(
"I"
);
publisherVersion
.
setPublisherActive
(
true
);
publisherVersion
.
setPublisherHistory
(
"J"
);
publisherVersion
.
setPublisher
(
new
Publisher
());
...
...
@@ -97,7 +96,6 @@ public class PublisherVersionViewTest {
assertThat
(
publisherVersionView
.
getPublisherEmail
()).
isNull
();
assertThat
(
publisherVersionView
.
getPublisherURL
()).
isNull
();
assertThat
(
publisherVersionView
.
getPublisherHistory
()).
isNull
();
assertThat
(
publisherVersionView
.
isPublisherActive
()).
isFalse
();
assertThat
(
publisherVersionView
.
isEditMode
()).
isTrue
();
}
...
...
@@ -117,7 +115,6 @@ public class PublisherVersionViewTest {
publisherVersionView
.
setPublisherTelephone
(
"7"
);
publisherVersionView
.
setPublisherEmail
(
"8"
);
publisherVersionView
.
setPublisherURL
(
"9"
);
publisherVersionView
.
setPublisherActive
(
false
);
publisherVersionView
.
setPublisherHistory
(
"10"
);
publisherVersionView
.
cancel
();
...
...
@@ -163,7 +160,6 @@ public class PublisherVersionViewTest {
assertThat
(
publisherVersionView
.
getPublisherTelephone
()).
isEqualTo
(
"G"
);
assertThat
(
publisherVersionView
.
getPublisherEmail
()).
isEqualTo
(
"H"
);
assertThat
(
publisherVersionView
.
getPublisherURL
()).
isEqualTo
(
"I"
);
assertThat
(
publisherVersionView
.
isPublisherActive
()).
isTrue
();
assertThat
(
publisherVersionView
.
getPublisherHistory
()).
isEqualTo
(
"J"
);
assertThat
(
publisherVersionView
.
isNewPublisher
()).
isFalse
();
}
...
...
@@ -277,7 +273,6 @@ public class PublisherVersionViewTest {
publisherVersionView
.
setPublisherTelephone
(
"7"
);
publisherVersionView
.
setPublisherEmail
(
"8"
);
publisherVersionView
.
setPublisherURL
(
"9"
);
publisherVersionView
.
setPublisherActive
(
true
);
publisherVersionView
.
setPublisherHistory
(
"10"
);
publisherVersionView
.
setPublisher
(
publisherMock
);
}
...
...
@@ -349,7 +344,6 @@ public class PublisherVersionViewTest {
publisherVersionView
.
setPublisherTelephone
(
"G"
);
publisherVersionView
.
setPublisherEmail
(
"H"
);
publisherVersionView
.
setPublisherURL
(
"I"
);
publisherVersionView
.
setPublisherActive
(
true
);
publisherVersionView
.
setPublisherHistory
(
"J"
);
publisherVersionView
.
setPublisher
(
publisherMock
);
}
...
...
Please
register
or
login
to post a comment