Jean-Francois Leveque

https://tree.taiga.io/project/jr-utily-grog-v3/us/44 Implementer l'historisation pour les éditeurs

https://tree.taiga.io/project/jr-utily-grog-v3/task/80 Minimalisation des namespaces de la page de liste
...@@ -18,7 +18,6 @@ import java.sql.Timestamp; ...@@ -18,7 +18,6 @@ import java.sql.Timestamp;
18 import java.util.Date; 18 import java.util.Date;
19 import java.util.HashSet; 19 import java.util.HashSet;
20 import java.util.List; 20 import java.util.List;
21 -import java.util.Random;
22 import java.util.Set; 21 import java.util.Set;
23 22
24 @Named 23 @Named
...@@ -36,7 +35,6 @@ public class PublisherRevisionView implements Serializable { ...@@ -36,7 +35,6 @@ public class PublisherRevisionView implements Serializable {
36 private boolean editMode; 35 private boolean editMode;
37 private boolean newPublisher; 36 private boolean newPublisher;
38 37
39 - private int publisherId;
40 // Données temporaires d'un PublisherRevision 38 // Données temporaires d'un PublisherRevision
41 private int publisherRevisionId; 39 private int publisherRevisionId;
42 private String publisherName; 40 private String publisherName;
...@@ -122,7 +120,7 @@ public class PublisherRevisionView implements Serializable { ...@@ -122,7 +120,7 @@ public class PublisherRevisionView implements Serializable {
122 120
123 newPublisher = false; 121 newPublisher = false;
124 publisherRevisionId = publisherRevision.getPublisherRevisionId(); 122 publisherRevisionId = publisherRevision.getPublisherRevisionId();
125 - publisherId = publisher.getPublisherId(); 123 +// int publisherId = publisher.getPublisherId();
126 this.publisher = publisher; 124 this.publisher = publisher;
127 publisherRevisionAuthor = publisherRevision.getPublisherRevisionAuthor(); 125 publisherRevisionAuthor = publisherRevision.getPublisherRevisionAuthor();
128 publisherRevisionDatetime = publisherRevision.getPublisherRevisionDatetime(); 126 publisherRevisionDatetime = publisherRevision.getPublisherRevisionDatetime();
......
...@@ -20,31 +20,30 @@ ...@@ -20,31 +20,30 @@
20 </ul> 20 </ul>
21 21
22 <a jsf:outcome="listPublisherRevisions" jsf:rendered="#{not listPublisherRevisionsView.viewAll}">Voir tous les éditeurs</a> 22 <a jsf:outcome="listPublisherRevisions" jsf:rendered="#{not listPublisherRevisionsView.viewAll}">Voir tous les éditeurs</a>
23 - <h:outputText rendered="#{listPublisherRevisionsView.publisherRevisions.isEmpty()}">Liste des révisions est vide</h:outputText> 23 + <p jsf:rendered="#{listPublisherRevisionsView.publisherRevisions.isEmpty()}">Liste des révisions est vide</p>
24 <h:dataTable value="#{listPublisherRevisionsView.publisherRevisions}" var="revision"> 24 <h:dataTable value="#{listPublisherRevisionsView.publisherRevisions}" var="revision">
25 <h:column> 25 <h:column>
26 <f:facet name="header">Visualiser ou Modifier</f:facet> 26 <f:facet name="header">Visualiser ou Modifier</f:facet>
27 - <h:link outcome="view">Visualiser ou Modifier Version 27 + <a jsf:outcome="publisherRevision">Visualiser ou Modifier Version
28 <f:param name="publisherRevisionId" value="#{revision.publisherRevisionId}"/> 28 <f:param name="publisherRevisionId" value="#{revision.publisherRevisionId}"/>
29 - </h:link> 29 + </a>
30 </h:column> 30 </h:column>
31 <h:column rendered="#{listPublisherRevisionsView.viewAll}"> 31 <h:column rendered="#{listPublisherRevisionsView.viewAll}">
32 <f:facet name="header">Editeur</f:facet> 32 <f:facet name="header">Editeur</f:facet>
33 - <h:link outcome="listPublisherRevisions"> 33 + <a jsf:outcome="listPublisherRevisions">Visualiser ou valider version éditeur
34 - Visualiser ou valider version éditeur
35 <f:param name="publisherId" value="#{revision.publisher.publisherId}"/> 34 <f:param name="publisherId" value="#{revision.publisher.publisherId}"/>
36 - </h:link> 35 + </a>
37 </h:column> 36 </h:column>
38 <h:column> 37 <h:column>
39 <f:facet name="header">Valide</f:facet> 38 <f:facet name="header">Valide</f:facet>
40 - <h:outputText rendered="#{revision.publisherRevisionId == revision.publisher.validatedRevision.publisherRevisionId}">Validé</h:outputText> 39 + <p jsf:rendered="#{revision.publisherRevisionId == revision.publisher.validatedRevision.publisherRevisionId}">Validé</p>
41 - <h:outputText rendered="#{listPublisherRevisionsView.viewAll and revision.publisherRevisionId != revision.publisher.validatedRevision.publisherRevisionId}">Non validé</h:outputText> 40 + <p jsf:rendered="#{listPublisherRevisionsView.viewAll and revision.publisherRevisionId != revision.publisher.validatedRevision.publisherRevisionId}">Non validé</p>
42 <!-- https://www.mkyong.com/jsf2/4-ways-to-pass-parameter-from-jsf-page-to-backing-bean/ f:param, problème avec Method expression --> 41 <!-- https://www.mkyong.com/jsf2/4-ways-to-pass-parameter-from-jsf-page-to-backing-bean/ f:param, problème avec Method expression -->
43 - <h:form rendered="#{not listPublisherRevisionsView.viewAll and revision.publisherRevisionId != revision.publisher.validatedRevision.publisherRevisionId}"> 42 + <form action="" jsf:rendered="#{not listPublisherRevisionsView.viewAll and revision.publisherRevisionId != revision.publisher.validatedRevision.publisherRevisionId}">
44 - <h:commandButton action="#{listPublisherRevisionsView.validate()}" value="Valider"> 43 + <button jsf:action="#{listPublisherRevisionsView.validate()}">Valider
45 <f:param name="publisherRevisionId" value="#{revision.publisherRevisionId}"/> 44 <f:param name="publisherRevisionId" value="#{revision.publisherRevisionId}"/>
46 - </h:commandButton> 45 + </button>
47 - </h:form> 46 + </form>
48 </h:column> 47 </h:column>
49 <h:column> 48 <h:column>
50 <f:facet name="header">Name</f:facet> 49 <f:facet name="header">Name</f:facet>
......
...@@ -18,10 +18,11 @@ INSERT INTO UserTable (USER_ID, username, password, firstName, lastName, nicknam ...@@ -18,10 +18,11 @@ INSERT INTO UserTable (USER_ID, username, password, firstName, lastName, nicknam
18 (5, 'five', 'five', 'Emily', 'Kolburn', 'five', 'five@raza.org', TRUE, FALSE, TRUE, TRUE), 18 (5, 'five', 'five', 'Emily', 'Kolburn', 'five', 'five@raza.org', TRUE, FALSE, TRUE, TRUE),
19 (6, 'six', 'six', 'Kal', 'Varrik', 'six', 'six@raza.org', TRUE, FALSE, TRUE, TRUE); 19 (6, 'six', 'six', 'Kal', 'Varrik', 'six', 'six@raza.org', TRUE, FALSE, TRUE, TRUE);
20 20
21 -INSERT INTO Publisher () VALUES (); 21 +INSERT INTO Publisher VALUES ();
22 -INSERT INTO Publisher () VALUES (); 22 +INSERT INTO Publisher VALUES ();
23 -INSERT INTO Publisher () VALUES (); 23 +INSERT INTO Publisher VALUES ();
24 -INSERT INTO Publisher () VALUES (); 24 +INSERT INTO Publisher VALUES ();
25 +
25 INSERT INTO PublisherRevision (publisher_PUBLISHER_ID, publisherName, publisherStreetAddress, publisherPostalCode, 26 INSERT INTO PublisherRevision (publisher_PUBLISHER_ID, publisherName, publisherStreetAddress, publisherPostalCode,
26 publisherPostOfficeBoxNumber, publisherAddressRegion, publisherAddressLocality, publisherAddressCountry_COUNTRY_ID, 27 publisherPostOfficeBoxNumber, publisherAddressRegion, publisherAddressLocality, publisherAddressCountry_COUNTRY_ID,
27 publisherTelephone, publisherEmail, publisherURL, publisherActive, publisherHistory, publisherRevisionAuthor_USER_ID, 28 publisherTelephone, publisherEmail, publisherURL, publisherActive, publisherHistory, publisherRevisionAuthor_USER_ID,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 4 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
5 http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" 5 http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
6 version="2.0"> 6 version="2.0">
7 - 7 + <!--
8 <navigation-rule> 8 <navigation-rule>
9 <from-view-id>*</from-view-id> 9 <from-view-id>*</from-view-id>
10 <navigation-case> 10 <navigation-case>
...@@ -90,12 +90,5 @@ ...@@ -90,12 +90,5 @@
90 <to-view-id>/user/updateUser.xhtml</to-view-id> 90 <to-view-id>/user/updateUser.xhtml</to-view-id>
91 </navigation-case> 91 </navigation-case>
92 </navigation-rule> 92 </navigation-rule>
93 - 93 + -->
94 - <navigation-rule>
95 - <from-view-id>/publisher/listPublisherRevisions.xhtml</from-view-id>
96 - <navigation-case>
97 - <from-outcome>view</from-outcome>
98 - <to-view-id>/publisher/publisherRevision.xhtml</to-view-id>
99 - </navigation-case>
100 - </navigation-rule>
101 </faces-config> 94 </faces-config>
...\ No newline at end of file ...\ No newline at end of file
......