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-03-13 15:21:53 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c76aca7f53ff7899591276ab682377cadc93097b
c76aca7f
1 parent
27aa6d0c
Refactoring int -> Integer pour les Id et changement nommage pour contourner ambiguïté Author
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
42 additions
and
34 deletions
src/main/java/org/legrog/entities/IndexedPublisher.java
src/main/java/org/legrog/entities/Publisher.java
src/main/java/org/legrog/entities/PublisherAction.java
src/main/java/org/legrog/entities/PublisherVersion.java
src/main/java/org/legrog/web/publisher/ListPublisherVersionsView.java
src/main/java/org/legrog/web/publisher/PublisherServiceDefault.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/test/java/org/legrog/web/publisher/ListPublisherVersionsViewTest.java
src/main/java/org/legrog/entities/IndexedPublisher.java
View file @
c76aca7
...
...
@@ -9,7 +9,7 @@ import javax.persistence.Lob;
public
class
IndexedPublisher
{
@Id
@Field
private
int
publisherId
;
private
Integer
publisherId
;
@Field
private
String
publisherName
;
@Lob
...
...
@@ -32,7 +32,7 @@ public class IndexedPublisher {
//no args constructor to make it proxyable
}
public
int
getPublisherId
()
{
public
Integer
getPublisherId
()
{
return
publisherId
;
}
...
...
@@ -44,7 +44,7 @@ public class IndexedPublisher {
return
publisherHistory
;
}
public
void
setPublisherId
(
int
publisherId
)
{
public
void
setPublisherId
(
Integer
publisherId
)
{
this
.
publisherId
=
publisherId
;
}
...
...
src/main/java/org/legrog/entities/Publisher.java
View file @
c76aca7
...
...
@@ -15,7 +15,7 @@ public class Publisher /* extends org.roliste.data.DbLinkableEntity */ {
// TODO Attention, en v2 Linkable implique Traceable (journalisable) qui devrait aussi être évalué
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
int
publisherId
;
private
Integer
publisherId
;
@OneToOne
private
PublisherVersion
validatedVersion
;
...
...
@@ -26,11 +26,11 @@ public class Publisher /* extends org.roliste.data.DbLinkableEntity */ {
@OneToMany
(
mappedBy
=
"publisher"
,
fetch
=
FetchType
.
EAGER
)
private
Set
<
PublisherAction
>
actions
;
public
int
getPublisherId
()
{
public
Integer
getPublisherId
()
{
return
publisherId
;
}
public
void
setPublisherId
(
int
publisherId
)
{
public
void
setPublisherId
(
Integer
publisherId
)
{
this
.
publisherId
=
publisherId
;
}
...
...
src/main/java/org/legrog/entities/PublisherAction.java
View file @
c76aca7
...
...
@@ -10,12 +10,12 @@ import java.sql.Timestamp;
public
class
PublisherAction
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
int
publisherActionId
;
private
Integer
publisherActionId
;
@Enumerated
private
ActionType
actionType
;
@ManyToOne
private
Account
publisherActionA
uth
or
;
private
Account
publisherActionA
ct
or
;
@ManyToOne
private
PublisherVersion
publisherVersion
;
...
...
@@ -25,8 +25,8 @@ public class PublisherAction {
@ManyToOne
private
Publisher
publisher
;
public
void
setPublisherActionA
uthor
(
Account
publisherActionAuth
or
)
{
this
.
publisherActionA
uthor
=
publisherActionAuth
or
;
public
void
setPublisherActionA
ctor
(
Account
publisherActionAct
or
)
{
this
.
publisherActionA
ctor
=
publisherActionAct
or
;
}
public
void
setPublisherActionDatetime
(
Timestamp
publisherActionDatetime
)
{
...
...
@@ -49,8 +49,8 @@ public class PublisherAction {
return
actionType
;
}
public
Account
getPublisherActionA
uth
or
()
{
return
publisherActionA
uth
or
;
public
Account
getPublisherActionA
ct
or
()
{
return
publisherActionA
ct
or
;
}
public
PublisherVersion
getPublisherVersion
()
{
...
...
@@ -65,10 +65,18 @@ public class PublisherAction {
return
publisher
;
}
public
Integer
getPublisherActionId
()
{
return
publisherActionId
;
}
public
void
setPublisherActionId
(
Integer
publisherActionId
)
{
this
.
publisherActionId
=
publisherActionId
;
}
@Override
public
String
toString
()
{
return
"publisherActionId = "
+
publisherActionId
+
", actionType = "
+
actionType
+
", publisherActionAuthor = "
+
publisherActionA
uth
or
+
", publisherVersion = "
+
publisherVersion
+
", publisherActionAuthor = "
+
publisherActionA
ct
or
+
", publisherVersion = "
+
publisherVersion
+
", publisherActionDatetime = "
+
publisherActionDatetime
+
", publisher = "
+
publisher
;
}
}
\ No newline at end of file
...
...
src/main/java/org/legrog/entities/PublisherVersion.java
View file @
c76aca7
...
...
@@ -12,7 +12,7 @@ import java.sql.Timestamp;
public
class
PublisherVersion
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
int
publisherVersionId
;
private
Integer
publisherVersionId
;
@ManyToOne
private
Publisher
publisher
;
private
String
publisherName
;
...
...
@@ -29,7 +29,7 @@ public class PublisherVersion {
@Lob
private
String
publisherHistory
;
@ManyToOne
private
Account
publisherVersion
Auth
or
;
private
Account
publisherVersion
Creat
or
;
private
Timestamp
publisherVersionDatetime
;
public
Timestamp
getPublisherVersionDatetime
()
{
...
...
@@ -112,11 +112,11 @@ public class PublisherVersion {
this
.
publisherURL
=
publisherURL
;
}
public
int
getPublisherVersionId
()
{
public
Integer
getPublisherVersionId
()
{
return
publisherVersionId
;
}
public
void
setPublisherVersionId
(
int
publisherVersionId
)
{
public
void
setPublisherVersionId
(
Integer
publisherVersionId
)
{
this
.
publisherVersionId
=
publisherVersionId
;
}
...
...
@@ -136,12 +136,12 @@ public class PublisherVersion {
this
.
publisherAddressCountry
=
publisherAddressCountry
;
}
public
Account
getPublisherVersion
Auth
or
()
{
return
publisherVersion
Auth
or
;
public
Account
getPublisherVersion
Creat
or
()
{
return
publisherVersion
Creat
or
;
}
public
void
setPublisherVersion
Author
(
Account
publisherVersionAuth
or
)
{
this
.
publisherVersion
Author
=
publisherVersionAuth
or
;
public
void
setPublisherVersion
Creator
(
Account
publisherVersionCreat
or
)
{
this
.
publisherVersion
Creator
=
publisherVersionCreat
or
;
}
@Override
...
...
@@ -151,7 +151,7 @@ public class PublisherVersion {
", Region = "
+
publisherAddressRegion
+
", Ville = "
+
publisherAddressLocality
+
", Pays = "
+
publisherAddressCountry
+
", Telephone = "
+
publisherTelephone
+
", email = "
+
publisherEmail
+
", URL = "
+
publisherURL
+
", History = "
+
publisherHistory
+
", Version Author = "
+
publisherVersion
Auth
or
+
", Version DateTime = "
+
publisherVersionDatetime
;
", Version Author = "
+
publisherVersion
Creat
or
+
", Version DateTime = "
+
publisherVersionDatetime
;
}
public
Publisher
getPublisher
()
{
...
...
src/main/java/org/legrog/web/publisher/ListPublisherVersionsView.java
View file @
c76aca7
...
...
@@ -83,7 +83,7 @@ public class ListPublisherVersionsView implements Serializable {
*/
protected
void
filterOnID
()
{
publisherVersions
=
publisherVersions
.
stream
()
.
filter
(
version
->
version
.
getPublisher
().
getPublisherId
()
==
publisherId
)
.
filter
(
version
->
version
.
getPublisher
().
getPublisherId
()
.
equals
(
publisherId
)
)
.
collect
(
Collectors
.
toList
());
}
...
...
src/main/java/org/legrog/web/publisher/PublisherServiceDefault.java
View file @
c76aca7
...
...
@@ -58,7 +58,7 @@ public class PublisherServiceDefault implements PublisherService {
publisherVersions
.
add
(
publisherVersion
);
publisher
.
setVersions
(
publisherVersions
);
publisherVersion
.
setPublisher
(
publisher
);
publisherVersion
.
setPublisherVersion
Auth
or
(
sharedService
.
getCurrentUser
());
publisherVersion
.
setPublisherVersion
Creat
or
(
sharedService
.
getCurrentUser
());
publisherVersion
.
setPublisherVersionDatetime
(
new
Timestamp
(
new
Date
().
getTime
()));
this
.
savePublisherVersion
(
publisherVersion
);
this
.
savePublisher
(
publisher
);
...
...
@@ -72,7 +72,7 @@ public class PublisherServiceDefault implements PublisherService {
publisherVersionSet
.
add
(
publisherVersion
);
publisher
.
setVersions
(
publisherVersionSet
);
publisherVersion
.
setPublisher
(
publisher
);
publisherVersion
.
setPublisherVersion
Auth
or
(
sharedService
.
getCurrentUser
());
publisherVersion
.
setPublisherVersion
Creat
or
(
sharedService
.
getCurrentUser
());
publisherVersion
.
setPublisherVersionDatetime
(
new
Timestamp
(
new
Date
().
getTime
()));
this
.
savePublisherVersion
(
publisherVersion
);
this
.
savePublisher
(
publisher
);
...
...
@@ -85,7 +85,7 @@ public class PublisherServiceDefault implements PublisherService {
Publisher
publisher
=
publisherVersion
.
getPublisher
();
publisher
.
setValidatedVersion
(
publisherVersion
);
PublisherAction
publisherAction
=
new
PublisherAction
();
publisherAction
.
setPublisherActionA
uth
or
(
sharedService
.
getCurrentUser
());
publisherAction
.
setPublisherActionA
ct
or
(
sharedService
.
getCurrentUser
());
publisherAction
.
setPublisherActionDatetime
(
new
Timestamp
(
new
Date
().
getTime
()));
publisherAction
.
setActionType
(
ActionType
.
VALIDATE
);
publisherAction
.
setPublisherVersion
(
publisherVersion
);
...
...
src/main/java/org/legrog/web/publisher/PublisherVersionView.java
View file @
c76aca7
...
...
@@ -199,7 +199,7 @@ public class PublisherVersionView implements Serializable {
if
(
publisherVersion
==
null
)
{
throw
new
IllegalStateException
(
"Publisher version not found"
);
}
publisherVersionAuthor
=
publisherVersion
.
getPublisherVersion
Auth
or
();
publisherVersionAuthor
=
publisherVersion
.
getPublisherVersion
Creat
or
();
publisherVersionDatetime
=
publisherVersion
.
getPublisherVersionDatetime
();
}
...
...
src/main/java/org/legrog/web/publisher/listPublisherActions.xhtml
View file @
c76aca7
...
...
@@ -21,7 +21,7 @@
</h:column>
<h:column>
<f:facet
name=
"header"
/>
${action.publisherActionA
uth
or.displayName}
${action.publisherActionA
ct
or.displayName}
</h:column>
<h:column>
<f:facet
name=
"header"
/>
...
...
@@ -57,7 +57,7 @@
</h:column>
<h:column>
<f:facet
name=
"header"
>
Version Author
</f:facet>
${action.publisherVersion.publisherVersion
Auth
or.displayName}
${action.publisherVersion.publisherVersion
Creat
or.displayName}
</h:column>
<h:column>
<f:facet
name=
"header"
>
Version Datetime
</f:facet>
...
...
src/main/java/org/legrog/web/publisher/listPublisherVersions.xhtml
View file @
c76aca7
...
...
@@ -41,7 +41,7 @@
<h:column>
<f:facet
name=
"header"
/>
<div
jsf:rendered=
"#{version.publisherVersionId == version.publisher.validatedVersion.publisherVersionId}"
>
${listPublisherVersionsView.getLastValidate(version.publisher).publisherActionA
uth
or.displayName}
${listPublisherVersionsView.getLastValidate(version.publisher).publisherActionA
ct
or.displayName}
</div>
</h:column>
<h:column>
...
...
@@ -80,7 +80,7 @@
</h:column>
<h:column>
<f:facet
name=
"header"
>
Version Author
</f:facet>
${version.publisherVersion
Auth
or.displayName}
${version.publisherVersion
Creat
or.displayName}
</h:column>
<h:column>
<f:facet
name=
"header"
>
Version Datetime
</f:facet>
...
...
src/main/java/org/legrog/web/publisher/publisherVersion.xhtml
View file @
c76aca7
...
...
@@ -59,7 +59,7 @@
</h:column>
<h:column>
<f:facet
name=
"header"
/>
${action.publisherActionA
uth
or.displayName}
${action.publisherActionA
ct
or.displayName}
</h:column>
<h:column>
<f:facet
name=
"header"
/>
...
...
src/test/java/org/legrog/web/publisher/ListPublisherVersionsViewTest.java
View file @
c76aca7
...
...
@@ -55,8 +55,8 @@ public class ListPublisherVersionsViewTest {
publisherVersion2
.
setPublisherVersionId
(
2
);
publisher
=
new
Publisher
();
publisher1
=
new
Publisher
();
publisher
.
setPublisherId
(
0
);
publisher1
.
setPublisherId
(
1
);
publisher
.
setPublisherId
(
new
Integer
(
0
)
);
publisher1
.
setPublisherId
(
new
Integer
(
1
)
);
publisherVersion
.
setPublisher
(
publisher
);
publisherVersion1
.
setPublisher
(
publisher1
);
publisherVersion2
.
setPublisher
(
publisher
);
...
...
Please
register
or
login
to post a comment