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,
...@@ -53,4 +54,4 @@ INSERT INTO UserTable_UserRole VALUES (3,2); ...@@ -53,4 +54,4 @@ INSERT INTO UserTable_UserRole VALUES (3,2);
53 INSERT INTO UserTable_UserRole VALUES (4,2); 54 INSERT INTO UserTable_UserRole VALUES (4,2);
54 INSERT INTO UserTable_UserRole VALUES (5,2); 55 INSERT INTO UserTable_UserRole VALUES (5,2);
55 INSERT INTO UserTable_UserRole VALUES (6,2); 56 INSERT INTO UserTable_UserRole VALUES (6,2);
56 -INSERT INTO UserTable_UserRole VALUES (5,4); 57 +INSERT INTO UserTable_UserRole VALUES (5,4);
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -4,98 +4,91 @@ ...@@ -4,98 +4,91 @@
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 + <!--
8 + <navigation-rule>
9 + <from-view-id>*</from-view-id>
10 + <navigation-case>
11 + <from-outcome>home</from-outcome>
12 + <to-view-id>/index.xhtml</to-view-id>
13 + </navigation-case>
14 + </navigation-rule>
7 15
8 - <navigation-rule> 16 + <navigation-rule>
9 - <from-view-id>*</from-view-id> 17 + <from-view-id>/index.xhtml</from-view-id>
10 - <navigation-case> 18 + <navigation-case>
11 - <from-outcome>home</from-outcome> 19 + <from-outcome>addBook</from-outcome>
12 - <to-view-id>/index.xhtml</to-view-id> 20 + <to-view-id>/book/book.xhtml</to-view-id>
13 - </navigation-case> 21 + </navigation-case>
14 - </navigation-rule> 22 + <navigation-case>
23 + <from-outcome>listBooks</from-outcome>
24 + <to-view-id>/book/result.xhtml</to-view-id>
25 + </navigation-case>
26 + <navigation-case>
27 + <from-outcome>addCountry</from-outcome>
28 + <to-view-id>/xyz/addCountry.xhtml</to-view-id>
29 + </navigation-case>
30 + <navigation-case>
31 + <from-outcome>listCountries</from-outcome>
32 + <to-view-id>/xyz/listCountries.xhtml</to-view-id>
33 + </navigation-case>
34 + <navigation-case>
35 + <from-outcome>addUser</from-outcome>
36 + <to-view-id>/user/updateUser.xhtml</to-view-id>
37 + </navigation-case>
38 + <navigation-case>
39 + <from-outcome>listUsers</from-outcome>
40 + <to-view-id>/user/listUsers.xhtml</to-view-id>
41 + </navigation-case>
42 + </navigation-rule>
43 + <navigation-rule>
44 + <from-view-id>/xyz/addCountry.xhtml</from-view-id>
45 + <navigation-case>
46 + <from-outcome>success</from-outcome>
47 + <to-view-id>/xyz/listCountries.xhtml</to-view-id>
48 + </navigation-case>
49 + </navigation-rule>
15 50
16 - <navigation-rule> 51 + <navigation-rule>
17 - <from-view-id>/index.xhtml</from-view-id> 52 + <from-view-id>/user/addUser_short.xhtml</from-view-id>
18 - <navigation-case> 53 + <navigation-case>
19 - <from-outcome>addBook</from-outcome> 54 + <from-outcome>success</from-outcome>
20 - <to-view-id>/book/book.xhtml</to-view-id> 55 + <to-view-id>/user/listUsers_short.xhtml</to-view-id>
21 - </navigation-case> 56 + </navigation-case>
22 - <navigation-case> 57 + </navigation-rule>
23 - <from-outcome>listBooks</from-outcome>
24 - <to-view-id>/book/result.xhtml</to-view-id>
25 - </navigation-case>
26 - <navigation-case>
27 - <from-outcome>addCountry</from-outcome>
28 - <to-view-id>/xyz/addCountry.xhtml</to-view-id>
29 - </navigation-case>
30 - <navigation-case>
31 - <from-outcome>listCountries</from-outcome>
32 - <to-view-id>/xyz/listCountries.xhtml</to-view-id>
33 - </navigation-case>
34 - <navigation-case>
35 - <from-outcome>addUser</from-outcome>
36 - <to-view-id>/user/updateUser.xhtml</to-view-id>
37 - </navigation-case>
38 - <navigation-case>
39 - <from-outcome>listUsers</from-outcome>
40 - <to-view-id>/user/listUsers.xhtml</to-view-id>
41 - </navigation-case>
42 - </navigation-rule>
43 - <navigation-rule>
44 - <from-view-id>/xyz/addCountry.xhtml</from-view-id>
45 - <navigation-case>
46 - <from-outcome>success</from-outcome>
47 - <to-view-id>/xyz/listCountries.xhtml</to-view-id>
48 - </navigation-case>
49 - </navigation-rule>
50 58
51 - <navigation-rule> 59 + <navigation-rule>
52 - <from-view-id>/user/addUser_short.xhtml</from-view-id> 60 + <from-view-id>/book/book.xhtml</from-view-id>
53 <navigation-case> 61 <navigation-case>
54 - <from-outcome>success</from-outcome> 62 + <from-outcome>success</from-outcome>
55 - <to-view-id>/user/listUsers_short.xhtml</to-view-id> 63 + <to-view-id>/book/result.xhtml</to-view-id>
56 </navigation-case> 64 </navigation-case>
57 - </navigation-rule> 65 + </navigation-rule>
58 -
59 - <navigation-rule>
60 - <from-view-id>/book/book.xhtml</from-view-id>
61 - <navigation-case>
62 - <from-outcome>success</from-outcome>
63 - <to-view-id>/book/result.xhtml</to-view-id>
64 - </navigation-case>
65 - </navigation-rule>
66 -
67 - <navigation-rule>
68 - <from-view-id>/book/result.xhtml</from-view-id>
69 - <navigation-case>
70 - <from-outcome>back</from-outcome>
71 - <to-view-id>/book/book.xhtml</to-view-id>
72 - </navigation-case>
73 - </navigation-rule>
74 66
75 - <navigation-rule> 67 + <navigation-rule>
76 - <from-view-id>/user/updateUser.xhtml</from-view-id> 68 + <from-view-id>/book/result.xhtml</from-view-id>
77 <navigation-case> 69 <navigation-case>
78 - <from-outcome>cancel</from-outcome> 70 + <from-outcome>back</from-outcome>
79 - <to-view-id>/user/listUsers.xhtml</to-view-id> 71 + <to-view-id>/book/book.xhtml</to-view-id>
80 </navigation-case> 72 </navigation-case>
81 - <navigation-case> 73 + </navigation-rule>
82 - <from-outcome>success</from-outcome>
83 - <to-view-id>/user/listUsers.xhtml</to-view-id>
84 - </navigation-case>
85 - </navigation-rule>
86 - <navigation-rule>
87 - <from-view-id>/user/listUsers.xhtml</from-view-id>
88 - <navigation-case>
89 - <from-outcome>add</from-outcome>
90 - <to-view-id>/user/updateUser.xhtml</to-view-id>
91 - </navigation-case>
92 - </navigation-rule>
93 74
94 - <navigation-rule> 75 + <navigation-rule>
95 - <from-view-id>/publisher/listPublisherRevisions.xhtml</from-view-id> 76 + <from-view-id>/user/updateUser.xhtml</from-view-id>
96 - <navigation-case> 77 + <navigation-case>
97 - <from-outcome>view</from-outcome> 78 + <from-outcome>cancel</from-outcome>
98 - <to-view-id>/publisher/publisherRevision.xhtml</to-view-id> 79 + <to-view-id>/user/listUsers.xhtml</to-view-id>
99 - </navigation-case> 80 + </navigation-case>
100 - </navigation-rule> 81 + <navigation-case>
82 + <from-outcome>success</from-outcome>
83 + <to-view-id>/user/listUsers.xhtml</to-view-id>
84 + </navigation-case>
85 + </navigation-rule>
86 + <navigation-rule>
87 + <from-view-id>/user/listUsers.xhtml</from-view-id>
88 + <navigation-case>
89 + <from-outcome>add</from-outcome>
90 + <to-view-id>/user/updateUser.xhtml</to-view-id>
91 + </navigation-case>
92 + </navigation-rule>
93 + -->
101 </faces-config> 94 </faces-config>
...\ No newline at end of file ...\ No newline at end of file
......