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,7 @@ import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.Set;
@Named
@ViewScoped
......@@ -35,7 +35,6 @@ public class PublisherRevisionView implements Serializable {
private boolean editMode;
private boolean newPublisher;
private int publisherId;
// Données temporaires d'un PublisherRevision
private int publisherRevisionId;
private String publisherName;
......@@ -119,7 +118,7 @@ public class PublisherRevisionView implements Serializable {
publisherRevisionService.addPublisherRevision(publisherRevision);
newPublisher = false;
publisherRevisionId = publisherRevision.getPublisherRevisionId();
publisherId = publisher.getPublisherId();
// int publisherId = publisher.getPublisherId();
this.publisher = publisher;
publisherRevisionAuthor = publisherRevision.getPublisherRevisionAuthor();
publisherRevisionDatetime = publisherRevision.getPublisherRevisionDatetime();
......
......@@ -20,31 +20,30 @@
</ul>
<a jsf:outcome="listPublisherRevisions" jsf:rendered="#{not listPublisherRevisionsView.viewAll}">Voir tous les éditeurs</a>
<h:outputText rendered="#{listPublisherRevisionsView.publisherRevisions.isEmpty()}">Liste des révisions est vide</h:outputText>
<p jsf:rendered="#{listPublisherRevisionsView.publisherRevisions.isEmpty()}">Liste des révisions est vide</p>
<h:dataTable value="#{listPublisherRevisionsView.publisherRevisions}" var="revision">
<h:column>
<f:facet name="header">Visualiser ou Modifier</f:facet>
<h:link outcome="view">Visualiser ou Modifier Version
<f:param name="publisherRevisionId" value="#{revision.publisherRevisionId}"/>
</h:link>
<a jsf:outcome="publisherRevision">Visualiser ou Modifier Version
<f:param name="publisherRevisionId" value="#{revision.publisherRevisionId}"/>
</a>
</h:column>
<h:column rendered="#{listPublisherRevisionsView.viewAll}">
<f:facet name="header">Editeur</f:facet>
<h:link outcome="listPublisherRevisions">
Visualiser ou valider version éditeur
<a jsf:outcome="listPublisherRevisions">Visualiser ou valider version éditeur
<f:param name="publisherId" value="#{revision.publisher.publisherId}"/>
</h:link>
</a>
</h:column>
<h:column>
<f:facet name="header">Valide</f:facet>
<h:outputText rendered="#{revision.publisherRevisionId == revision.publisher.validatedRevision.publisherRevisionId}">Validé</h:outputText>
<h:outputText rendered="#{listPublisherRevisionsView.viewAll and revision.publisherRevisionId != revision.publisher.validatedRevision.publisherRevisionId}">Non validé</h:outputText>
<p jsf:rendered="#{revision.publisherRevisionId == revision.publisher.validatedRevision.publisherRevisionId}">Validé</p>
<p jsf:rendered="#{listPublisherRevisionsView.viewAll and revision.publisherRevisionId != revision.publisher.validatedRevision.publisherRevisionId}">Non validé</p>
<!-- https://www.mkyong.com/jsf2/4-ways-to-pass-parameter-from-jsf-page-to-backing-bean/ f:param, problème avec Method expression -->
<h:form rendered="#{not listPublisherRevisionsView.viewAll and revision.publisherRevisionId != revision.publisher.validatedRevision.publisherRevisionId}">
<h:commandButton action="#{listPublisherRevisionsView.validate()}" value="Valider">
<form action="" jsf:rendered="#{not listPublisherRevisionsView.viewAll and revision.publisherRevisionId != revision.publisher.validatedRevision.publisherRevisionId}">
<button jsf:action="#{listPublisherRevisionsView.validate()}">Valider
<f:param name="publisherRevisionId" value="#{revision.publisherRevisionId}"/>
</h:commandButton>
</h:form>
</button>
</form>
</h:column>
<h:column>
<f:facet name="header">Name</f:facet>
......
......@@ -18,10 +18,11 @@ INSERT INTO UserTable (USER_ID, username, password, firstName, lastName, nicknam
(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 Publisher () VALUES ();
INSERT INTO Publisher () VALUES ();
INSERT INTO Publisher () VALUES ();
INSERT INTO Publisher () VALUES ();
INSERT INTO Publisher VALUES ();
INSERT INTO Publisher VALUES ();
INSERT INTO Publisher VALUES ();
INSERT INTO Publisher VALUES ();
INSERT INTO PublisherRevision (publisher_PUBLISHER_ID, publisherName, publisherStreetAddress, publisherPostalCode,
publisherPostOfficeBoxNumber, publisherAddressRegion, publisherAddressLocality, publisherAddressCountry_COUNTRY_ID,
publisherTelephone, publisherEmail, publisherURL, publisherActive, publisherHistory, publisherRevisionAuthor_USER_ID,
......@@ -53,4 +54,4 @@ INSERT INTO UserTable_UserRole VALUES (3,2);
INSERT INTO UserTable_UserRole VALUES (4,2);
INSERT INTO UserTable_UserRole VALUES (5,2);
INSERT INTO UserTable_UserRole VALUES (6,2);
INSERT INTO UserTable_UserRole VALUES (5,4);
INSERT INTO UserTable_UserRole VALUES (5,4);
\ No newline at end of file
......
......@@ -4,98 +4,91 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<!--
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>home</from-outcome>
<to-view-id>/index.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>home</from-outcome>
<to-view-id>/index.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/index.xhtml</from-view-id>
<navigation-case>
<from-outcome>addBook</from-outcome>
<to-view-id>/book/book.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>listBooks</from-outcome>
<to-view-id>/book/result.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>addCountry</from-outcome>
<to-view-id>/xyz/addCountry.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>listCountries</from-outcome>
<to-view-id>/xyz/listCountries.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>addUser</from-outcome>
<to-view-id>/user/updateUser.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>listUsers</from-outcome>
<to-view-id>/user/listUsers.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/xyz/addCountry.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/xyz/listCountries.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/index.xhtml</from-view-id>
<navigation-case>
<from-outcome>addBook</from-outcome>
<to-view-id>/book/book.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>listBooks</from-outcome>
<to-view-id>/book/result.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>addCountry</from-outcome>
<to-view-id>/xyz/addCountry.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>listCountries</from-outcome>
<to-view-id>/xyz/listCountries.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>addUser</from-outcome>
<to-view-id>/user/updateUser.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>listUsers</from-outcome>
<to-view-id>/user/listUsers.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/xyz/addCountry.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/xyz/listCountries.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/user/addUser_short.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/user/listUsers_short.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/user/addUser_short.xhtml</from-view-id>
<navigation-rule>
<from-view-id>/book/book.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/user/listUsers_short.xhtml</to-view-id>
<from-outcome>success</from-outcome>
<to-view-id>/book/result.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/book/book.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/book/result.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/book/result.xhtml</from-view-id>
<navigation-case>
<from-outcome>back</from-outcome>
<to-view-id>/book/book.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</navigation-rule>
<navigation-rule>
<from-view-id>/user/updateUser.xhtml</from-view-id>
<navigation-rule>
<from-view-id>/book/result.xhtml</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/user/listUsers.xhtml</to-view-id>
<from-outcome>back</from-outcome>
<to-view-id>/book/book.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/user/listUsers.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/user/listUsers.xhtml</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/user/updateUser.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</navigation-rule>
<navigation-rule>
<from-view-id>/publisher/listPublisherRevisions.xhtml</from-view-id>
<navigation-case>
<from-outcome>view</from-outcome>
<to-view-id>/publisher/publisherRevision.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/user/updateUser.xhtml</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/user/listUsers.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/user/listUsers.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/user/listUsers.xhtml</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/user/updateUser.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
-->
</faces-config>
\ No newline at end of file
......