JR Utily

Merge branch 'infra' into historiqueEditeur

Conflicts:
	src/main/java/org/legrog/presentation/ListPublisherRevisionsBean.java
	src/main/java/org/legrog/presentation/ListPublisherRevisionsView.java
	src/main/java/org/legrog/web/publisher/ListPublisherRevisionsBean.java
	src/main/java/org/legrog/web/publisher/PublisherRevisionView.java
	src/main/java/org/legrog/web/publisher/PublisherService.java
Showing 37 changed files with 482 additions and 415 deletions
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 3 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4 - <modelVersion>4.0.0</modelVersion> 4 + <modelVersion>4.0.0</modelVersion>
5 - 5 +
6 - <groupId>org.legrog</groupId> 6 + <groupId>org.legrog</groupId>
7 - <artifactId>grog-cubi</artifactId> 7 + <artifactId>grog-cubi</artifactId>
8 - <version>1.0-SNAPSHOT</version> 8 + <version>3.0-SNAPSHOT</version>
9 - <packaging>war</packaging> 9 + <packaging>war</packaging>
10 - <name>GRoG Cubi Webapp (TomEE dev)</name> 10 +
11 - <url>http://tomee.apache.org</url> 11 + <name>Web-application of GROG</name>
12 - 12 + <url>http://legrog.org</url>
13 - <properties> 13 + <description>
14 - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 14 + Le Guide du Roliste Galactique (GROG) est une encyclopedie en ligne référençant tous les jeux de rôles connus.
15 - <spring.platform-bom.version>2.0.7.RELEASE</spring.platform-bom.version> 15 + Cette version CUBI est la 3e mouture du site.
16 - <omnifaces.version>2.5.1</omnifaces.version> 16 + </description>
17 - <primefaces.version>6.0</primefaces.version> 17 +
18 - <myfaces.version>2.2.10</myfaces.version> 18 +
19 - <tomee.javaee-api.version>7.0</tomee.javaee-api.version> 19 + <properties>
20 - <assertj-core.version>1.6.1</assertj-core.version> 20 + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
21 - <openjpa.version>2.4.1</openjpa.version> 21 + <spring.platform-bom.version>2.0.7.RELEASE</spring.platform-bom.version>
22 - </properties> 22 + <omnifaces.version>2.5.1</omnifaces.version>
23 - 23 + <primefaces.version>6.0</primefaces.version>
24 - <dependencyManagement> 24 + <myfaces.version>2.2.10</myfaces.version>
25 - <dependencies> 25 + <tomee.javaee-api.version>7.0</tomee.javaee-api.version>
26 - <dependency> 26 + <assertj-core.version>1.6.1</assertj-core.version>
27 - <groupId>io.spring.platform</groupId> 27 + <openjpa.version>2.4.1</openjpa.version>
28 - <artifactId>platform-bom</artifactId> 28 + <rewrite.version>3.4.1.Final</rewrite.version>
29 - <!-- Nécessaire à la compilation --> 29 + <hibernate-commons-annotations.version>5.0.1.Final</hibernate-commons-annotations.version>
30 - <version>${spring.platform-bom.version}</version> 30 + <hibernate-jpa-2.1-api.version>1.0.0.Final</hibernate-jpa-2.1-api.version>
31 - <type>pom</type> 31 + </properties>
32 - <scope>import</scope> 32 +
33 - </dependency> 33 + <dependencyManagement>
34 - </dependencies>
35 - </dependencyManagement>
36 -
37 - <dependencies>
38 - <!-- **** PREREQUIS MIGRATION **** -->
39 - <!-- https://mvnrepository.com/artifact/org.omnifaces/omnifaces -->
40 - <dependency>
41 - <groupId>org.omnifaces</groupId>
42 - <artifactId>omnifaces</artifactId>
43 - <!-- Nécessaire à la compilation -->
44 - <version>${omnifaces.version}</version>
45 - </dependency>
46 -
47 - <!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
48 - <dependency>
49 - <groupId>org.primefaces</groupId>
50 - <artifactId>primefaces</artifactId>
51 - <!-- Nécessaire à la compilation -->
52 - <version>${primefaces.version}</version>
53 - </dependency>
54 -
55 - <dependency>
56 - <groupId>org.apache.myfaces.core</groupId>
57 - <artifactId>myfaces-api</artifactId>
58 - <!-- Nécessaire à la compilation -->
59 - <version>${myfaces.version}</version>
60 - </dependency>
61 - <dependency>
62 - <groupId>org.apache.myfaces.core</groupId>
63 - <artifactId>myfaces-impl</artifactId>
64 - <!-- Nécessaire à l'exécution -->
65 - <version>${myfaces.version}</version>
66 - </dependency>
67 - <!-- **** FRAMEWORK : JSF + CDI **** -->
68 -
69 - <dependency>
70 - <groupId>org.apache.tomee</groupId>
71 - <artifactId>javaee-api</artifactId>
72 - <!-- Nécessaire à la compilation -->
73 - <version>${tomee.javaee-api.version}</version>
74 - <scope>provided</scope>
75 - </dependency>
76 -
77 -
78 - <!-- **** TOOLS : LOGS + UTILS **** -->
79 - <dependency>
80 - <groupId>org.slf4j</groupId>
81 - <artifactId>slf4j-api</artifactId>
82 - </dependency>
83 -
84 - <dependency>
85 - <groupId>ch.qos.logback</groupId>
86 - <artifactId>logback-classic</artifactId>
87 - </dependency>
88 -
89 -
90 - <!-- **** DATA MANAGEMENT **** -->
91 -
92 - <dependency>
93 - <groupId>com.h2database</groupId>
94 - <artifactId>h2</artifactId>
95 - </dependency>
96 -
97 - <dependency>
98 - <groupId>org.springframework.data</groupId>
99 - <artifactId>spring-data-jpa</artifactId>
100 - </dependency>
101 -
102 -
103 - <!-- **** TEST SCOPE **** -->
104 -
105 -
106 - <dependency>
107 - <groupId>junit</groupId>
108 - <artifactId>junit</artifactId>
109 - <scope>test</scope>
110 - </dependency>
111 -
112 - <dependency>
113 - <groupId>org.mockito</groupId>
114 - <artifactId>mockito-core</artifactId>
115 - <scope>test</scope>
116 - </dependency>
117 -
118 - <dependency>
119 - <groupId>org.assertj</groupId>
120 - <artifactId>assertj-core</artifactId>
121 - <version>${assertj-core.version}</version>
122 - <scope>test</scope>
123 - </dependency>
124 -<!--
125 - <dependency>
126 - <groupId>org.apache.openjpa</groupId>
127 - <artifactId>openjpa</artifactId>
128 - <version>${openjpa.version}</version>
129 - <scope>test</scope>
130 - </dependency>
131 --->
132 - <!-- to test with TomEE and Arquillian
133 - <dependency>
134 - <groupId>org.apache.tomee</groupId>
135 - <artifactId>arquillian-tomee-remote</artifactId>
136 - <version>7.0.1</version>
137 - <scope>test</scope>
138 - </dependency>
139 - <dependency>
140 - <groupId>org.jboss.arquillian.junit</groupId>
141 - <artifactId>arquillian-junit-container</artifactId>
142 - <version>1.1.10.Final</version>
143 - <scope>test</scope>
144 - </dependency>
145 - <dependency>
146 - <groupId>junit</groupId>
147 - <artifactId>junit</artifactId>
148 - <version>4.12</version>
149 - <scope>test</scope>
150 - </dependency>
151 - -->
152 -
153 - <!-- to test with OpenEJB embedded and Arquillian
154 - <dependency>
155 - <groupId>org.apache.tomee</groupId>
156 - <artifactId>arquillian-openejb-embedded</artifactId>
157 - <version>{project.version}</version>
158 - <scope>test</scope>
159 - </dependency>
160 - <dependency>
161 - <groupId>org.jboss.arquillian.junit</groupId>
162 - <artifactId>arquillian-junit-container</artifactId>
163 - <version>1.1.10.Final</version>
164 - <scope>test</scope>
165 - </dependency>
166 - <dependency>
167 - <groupId>junit</groupId>
168 - <artifactId>junit</artifactId>
169 - <version>4.12</version>
170 - <scope>test</scope>
171 - </dependency>
172 - -->
173 - <!-- Hibernate -->
174 - <dependency>
175 - <groupId>antlr</groupId>
176 - <artifactId>antlr</artifactId>
177 -<!-- <version>2.7.7</version>-->
178 - </dependency>
179 - <dependency>
180 - <groupId>dom4j</groupId>
181 - <artifactId>dom4j</artifactId>
182 -<!-- <version>1.6.1</version>-->
183 - </dependency>
184 - <dependency>
185 - <groupId>org.hibernate.common</groupId>
186 - <artifactId>hibernate-commons-annotations</artifactId>
187 - <!-- Nécessaire -->
188 - <version>5.0.1.Final</version>
189 - </dependency>
190 - <dependency>
191 - <groupId>org.hibernate.javax.persistence</groupId>
192 - <artifactId>hibernate-jpa-2.1-api</artifactId>
193 - <!-- Nécessaire -->
194 - <version>1.0.0.Final</version>
195 - <scope>compile</scope>
196 - </dependency>
197 - <dependency>
198 - <groupId>org.hibernate</groupId>
199 - <artifactId>hibernate-core</artifactId>
200 -<!-- <version>5.2.3.Final</version>-->
201 - </dependency>
202 - <dependency>
203 - <groupId>org.hibernate</groupId>
204 - <artifactId>hibernate-ehcache</artifactId>
205 -<!-- <version>5.2.3.Final</version>-->
206 - </dependency>
207 - <dependency>
208 - <groupId>org.hibernate</groupId>
209 - <artifactId>hibernate-entitymanager</artifactId>
210 -<!-- <version>5.2.3.Final</version>-->
211 - </dependency>
212 - <dependency>
213 - <groupId>org.hibernate</groupId>
214 - <artifactId>hibernate-validator</artifactId>
215 -<!-- <version>5.2.3.Final</version>-->
216 - </dependency>
217 - <dependency>
218 - <groupId>org.jboss.logging</groupId>
219 - <artifactId>jboss-logging</artifactId>
220 -<!-- <version>3.3.0.Final</version>-->
221 - </dependency>
222 - <dependency>
223 - <groupId>org.javassist</groupId>
224 - <artifactId>javassist</artifactId>
225 -<!-- <version>3.20.0-GA</version>-->
226 - </dependency>
227 - </dependencies>
228 -
229 - <build>
230 - <plugins>
231 - <plugin>
232 - <groupId>org.apache.maven.plugins</groupId>
233 - <artifactId>maven-compiler-plugin</artifactId>
234 - <version>3.5.1</version>
235 - </plugin>
236 - <plugin>
237 - <groupId>org.apache.maven.plugins</groupId>
238 - <artifactId>maven-surefire-plugin</artifactId>
239 - <version>2.19.1</version>
240 - </plugin>
241 - <plugin>
242 - <groupId>org.apache.maven.plugins</groupId>
243 - <artifactId>maven-war-plugin</artifactId>
244 - <version>2.6</version>
245 - <configuration>
246 - <failOnMissingWebXml>false</failOnMissingWebXml>
247 - </configuration>
248 - </plugin>
249 - <plugin>
250 - <groupId>org.apache.tomee.maven</groupId>
251 - <artifactId>tomee-maven-plugin</artifactId>
252 - <version>7.0.1</version>
253 - <configuration>
254 - <context>ROOT</context>
255 - </configuration>
256 - </plugin>
257 - <!--
258 - <plugin>
259 - <groupId>org.apache.openjpa</groupId>
260 - <artifactId>openjpa-maven-plugin</artifactId>
261 - <version>${openjpa.version}</version>
262 - <configuration>
263 - <includes>**/entities/*.class</includes>
264 - <excludes>**/entities/XML*.class</excludes>
265 - <addDefaultConstructor>true</addDefaultConstructor>
266 - <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
267 - </configuration>
268 - <executions>
269 - <execution>
270 - <id>enhancer</id>
271 - <phase>process-classes</phase>
272 - <goals>
273 - <goal>enhance</goal>
274 - </goals>
275 - </execution>
276 - </executions>
277 <dependencies> 34 <dependencies>
278 - <dependency> 35 + <dependency>
279 - <groupId>org.apache.openjpa</groupId> 36 + <groupId>io.spring.platform</groupId>
280 - <artifactId>openjpa</artifactId> 37 + <artifactId>platform-bom</artifactId>
281 - <- set the version to be the same as the level in your runtime 38 + <version>${spring.platform-bom.version}</version>
282 - <version>${openjpa.version}</version> 39 + <type>pom</type>
283 - </dependency> 40 + <scope>import</scope>
41 + </dependency>
284 </dependencies> 42 </dependencies>
285 - </plugin> 43 + </dependencyManagement>
286 - --> 44 +
287 - </plugins> 45 + <dependencies>
288 - </build> 46 +
289 - 47 +
290 - <repositories> 48 + <!-- **** FRAMEWORK : JSF + CDI **** -->
291 - <repository> 49 +
292 - <id>apache-snapshot</id> 50 + <dependency>
293 - <name>Apache Snapshot Repository</name> 51 + <groupId>org.apache.tomee</groupId>
294 - <url>https://repository.apache.org/content/groups/snapshots/</url> 52 + <artifactId>javaee-api</artifactId>
295 - </repository> 53 + <version>${tomee.javaee-api.version}</version>
296 - </repositories> 54 + <scope>provided</scope>
55 + </dependency>
56 +
57 + <!-- https://mvnrepository.com/artifact/org.omnifaces/omnifaces -->
58 + <dependency>
59 + <groupId>org.omnifaces</groupId>
60 + <artifactId>omnifaces</artifactId>
61 + <version>${omnifaces.version}</version>
62 + </dependency>
63 +
64 + <!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
65 + <dependency>
66 + <groupId>org.primefaces</groupId>
67 + <artifactId>primefaces</artifactId>
68 + <version>${primefaces.version}</version>
69 + </dependency>
70 +
71 + <dependency>
72 + <groupId>org.apache.myfaces.core</groupId>
73 + <artifactId>myfaces-api</artifactId>
74 + <version>${myfaces.version}</version>
75 + </dependency>
76 + <dependency>
77 + <groupId>org.apache.myfaces.core</groupId>
78 + <artifactId>myfaces-impl</artifactId>
79 + <version>${myfaces.version}</version>
80 + <scope>runtime</scope>
81 + </dependency>
82 +
83 +
84 +
85 +
86 + <!-- Rewriting tool -->
87 +
88 + <!--<dependency>-->
89 + <!--<groupId>com.ocpsoft</groupId>-->
90 + <!--<artifactId>prettyfaces-jsf2</artifactId>-->
91 + <!--<version>3.3.3</version>-->
92 + <!--</dependency>-->
93 + <!-- -->
94 +
95 +<!-- **** TOOLS : LOGS + UTILS **** -->
96 +
97 + <dependency>
98 + <groupId>org.slf4j</groupId>
99 + <artifactId>slf4j-api</artifactId>
100 + </dependency>
101 +
102 + <dependency>
103 + <groupId>ch.qos.logback</groupId>
104 + <artifactId>logback-classic</artifactId>
105 + </dependency>
106 +
107 +
108 + <!-- **** DATA MANAGEMENT **** -->
109 +
110 + <dependency>
111 + <groupId>com.h2database</groupId>
112 + <artifactId>h2</artifactId>
113 + </dependency>
114 +
115 + <dependency>
116 + <groupId>org.springframework.data</groupId>
117 + <artifactId>spring-data-jpa</artifactId>
118 + </dependency>
119 +
120 +
121 + <!-- **** TEST SCOPE **** -->
122 +
123 +
124 + <dependency>
125 + <groupId>junit</groupId>
126 + <artifactId>junit</artifactId>
127 + <scope>test</scope>
128 + </dependency>
129 +
130 + <dependency>
131 + <groupId>org.mockito</groupId>
132 + <artifactId>mockito-core</artifactId>
133 + <scope>test</scope>
134 + </dependency>
135 +
136 + <dependency>
137 + <groupId>org.assertj</groupId>
138 + <artifactId>assertj-core</artifactId>
139 + <version>${assertj-core.version}</version>
140 + <scope>test</scope>
141 + </dependency>
142 + <!--
143 + <dependency>
144 + <groupId>org.apache.openjpa</groupId>
145 + <artifactId>openjpa</artifactId>
146 + <version>${openjpa.version}</version>
147 + <scope>test</scope>
148 + </dependency>
149 + -->
150 + <!-- to test with TomEE and Arquillian
151 + <dependency>
152 + <groupId>org.apache.tomee</groupId>
153 + <artifactId>arquillian-tomee-remote</artifactId>
154 + <version>7.0.1</version>
155 + <scope>test</scope>
156 + </dependency>
157 + <dependency>
158 + <groupId>org.jboss.arquillian.junit</groupId>
159 + <artifactId>arquillian-junit-container</artifactId>
160 + <version>1.1.10.Final</version>
161 + <scope>test</scope>
162 + </dependency>
163 + <dependency>
164 + <groupId>junit</groupId>
165 + <artifactId>junit</artifactId>
166 + <version>4.12</version>
167 + <scope>test</scope>
168 + </dependency>
169 + -->
170 +
171 + <!-- to test with OpenEJB embedded and Arquillian
172 + <dependency>
173 + <groupId>org.apache.tomee</groupId>
174 + <artifactId>arquillian-openejb-embedded</artifactId>
175 + <version>{project.version}</version>
176 + <scope>test</scope>
177 + </dependency>
178 + <dependency>
179 + <groupId>org.jboss.arquillian.junit</groupId>
180 + <artifactId>arquillian-junit-container</artifactId>
181 + <version>1.1.10.Final</version>
182 + <scope>test</scope>
183 + </dependency>
184 + <dependency>
185 + <groupId>junit</groupId>
186 + <artifactId>junit</artifactId>
187 + <version>4.12</version>
188 + <scope>test</scope>
189 + </dependency>
190 + -->
191 + <!-- Hibernate -->
192 + <dependency>
193 + <groupId>antlr</groupId>
194 + <artifactId>antlr</artifactId>
195 + </dependency>
196 + <dependency>
197 + <groupId>dom4j</groupId>
198 + <artifactId>dom4j</artifactId>
199 + </dependency>
200 + <dependency>
201 + <groupId>org.hibernate.common</groupId>
202 + <artifactId>hibernate-commons-annotations</artifactId>
203 + <version>${hibernate-commons-annotations.version}</version>
204 + </dependency>
205 + <dependency>
206 + <groupId>org.hibernate.javax.persistence</groupId>
207 + <artifactId>hibernate-jpa-2.1-api</artifactId>
208 + <version>${hibernate-jpa-2.1-api.version}</version>
209 + </dependency>
210 + <dependency>
211 + <groupId>org.hibernate</groupId>
212 + <artifactId>hibernate-core</artifactId>
213 + </dependency>
214 + <dependency>
215 + <groupId>org.hibernate</groupId>
216 + <artifactId>hibernate-ehcache</artifactId>
217 + </dependency>
218 + <dependency>
219 + <groupId>org.hibernate</groupId>
220 + <artifactId>hibernate-entitymanager</artifactId>
221 + </dependency>
222 + <dependency>
223 + <groupId>org.hibernate</groupId>
224 + <artifactId>hibernate-validator</artifactId>
225 + </dependency>
226 + <dependency>
227 + <groupId>org.jboss.logging</groupId>
228 + <artifactId>jboss-logging</artifactId>
229 + </dependency>
230 + <dependency>
231 + <groupId>org.javassist</groupId>
232 + <artifactId>javassist</artifactId>
233 + </dependency>
234 + </dependencies>
235 +
236 + <build>
237 + <plugins>
238 + <plugin>
239 + <groupId>org.apache.maven.plugins</groupId>
240 + <artifactId>maven-compiler-plugin</artifactId>
241 + <version>3.5.1</version>
242 + </plugin>
243 + <plugin>
244 + <groupId>org.apache.maven.plugins</groupId>
245 + <artifactId>maven-surefire-plugin</artifactId>
246 + <version>2.19.1</version>
247 + </plugin>
248 + <plugin>
249 + <groupId>org.apache.maven.plugins</groupId>
250 + <artifactId>maven-war-plugin</artifactId>
251 + <version>2.6</version>
252 + <configuration>
253 + <failOnMissingWebXml>false</failOnMissingWebXml>
254 + <webResources>
255 + <resource>
256 + <!-- this is relative to the pom.xml directory -->
257 + <directory>src/main/java/org/legrog/web</directory>
258 + <excludes>
259 + <exclude>**/*.java</exclude>
260 + </excludes>
261 +
262 + </resource>
263 + </webResources>
264 +
265 + </configuration>
266 + </plugin>
267 + <plugin>
268 + <groupId>org.apache.tomee.maven</groupId>
269 + <artifactId>tomee-maven-plugin</artifactId>
270 + <version>7.0.1</version>
271 + <configuration>
272 + <context>ROOT</context>
273 +
274 +
275 + </configuration>
276 + </plugin>
277 + <!--
278 + <plugin>
279 + <groupId>org.apache.openjpa</groupId>
280 + <artifactId>openjpa-maven-plugin</artifactId>
281 + <version>${openjpa.version}</version>
282 + <configuration>
283 + <includes>**/entities/*.class</includes>
284 + <excludes>**/entities/XML*.class</excludes>
285 + <addDefaultConstructor>true</addDefaultConstructor>
286 + <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
287 + </configuration>
288 + <executions>
289 + <execution>
290 + <id>enhancer</id>
291 + <phase>process-classes</phase>
292 + <goals>
293 + <goal>enhance</goal>
294 + </goals>
295 + </execution>
296 + </executions>
297 + <dependencies>
298 + <dependency>
299 + <groupId>org.apache.openjpa</groupId>
300 + <artifactId>openjpa</artifactId>
301 + <- set the version to be the same as the level in your runtime
302 + <version>${openjpa.version}</version>
303 + </dependency>
304 + </dependencies>
305 + </plugin>
306 + -->
307 + </plugins>
308 + </build>
309 +
310 + <repositories>
311 + <repository>
312 + <id>apache-snapshot</id>
313 + <name>Apache Snapshot Repository</name>
314 + <url>https://repository.apache.org/content/groups/snapshots/</url>
315 + </repository>
316 + </repositories>
297 317
298 </project> 318 </project>
......
1 -package org.legrog.application;
2 -
3 -import org.legrog.entities.PublisherRevision;
4 -
5 -import java.util.List;
6 -
7 -public interface PublisherRevisionService {
8 - void addPublisherRevision(PublisherRevision publisherRevision);
9 -
10 - List<PublisherRevision> getAllPublisherRevisions();
11 -
12 - PublisherRevision getPublisherRevision(Integer publisherRevisionId);
13 -}
1 -package org.legrog.application;
2 -
3 -import org.legrog.entities.PublisherRevision;
4 -import org.legrog.entities.PublisherRevisionRepository;
5 -
6 -import javax.ejb.Stateless;
7 -import javax.inject.Inject;
8 -import java.util.List;
9 -
10 -@Stateless
11 -public class PublisherRevisionServiceSpring implements PublisherRevisionService {
12 - @Inject
13 - PublisherRevisionRepository publisherRevisionRepository;
14 -
15 - public void addPublisherRevision(PublisherRevision publisherRevision) {
16 - publisherRevisionRepository.save(publisherRevision);
17 - }
18 -
19 - public List<PublisherRevision> getAllPublisherRevisions() {
20 - return publisherRevisionRepository.findAll();
21 - }
22 -
23 - public PublisherRevision getPublisherRevision(Integer publisherRevisionId) {
24 - return publisherRevisionRepository.findOne(publisherRevisionId);
25 - }
26 -}
...\ No newline at end of file ...\ No newline at end of file
1 -package org.legrog.presentation; 1 +package org.legrog.web.book;
2 2
3 -import org.legrog.application.BookService;
4 import org.legrog.entities.Book; 3 import org.legrog.entities.Book;
5 4
6 import javax.enterprise.context.RequestScoped; 5 import javax.enterprise.context.RequestScoped;
......
1 -package org.legrog.application; 1 +package org.legrog.web.book;
2 2
3 import org.legrog.entities.Book; 3 import org.legrog.entities.Book;
4 4
......
1 -package org.legrog.application; 1 +package org.legrog.web.book;
2 2
3 import org.legrog.entities.Book; 3 import org.legrog.entities.Book;
4 import org.slf4j.Logger; 4 import org.slf4j.Logger;
...@@ -8,7 +8,6 @@ import javax.ejb.Stateless; ...@@ -8,7 +8,6 @@ import javax.ejb.Stateless;
8 import javax.enterprise.inject.Alternative; 8 import javax.enterprise.inject.Alternative;
9 import javax.inject.Inject; 9 import javax.inject.Inject;
10 import javax.persistence.EntityManager; 10 import javax.persistence.EntityManager;
11 -import javax.persistence.PersistenceContext;
12 import javax.persistence.criteria.CriteriaQuery; 11 import javax.persistence.criteria.CriteriaQuery;
13 import java.util.List; 12 import java.util.List;
14 13
......
1 -package org.legrog.application; 1 +package org.legrog.web.book;
2 2
3 3
4 import org.legrog.entities.Book; 4 import org.legrog.entities.Book;
5 import org.legrog.entities.BookRepository; 5 import org.legrog.entities.BookRepository;
6 +import org.legrog.web.book.BookService;
6 import org.slf4j.Logger; 7 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
8 9
9 import javax.ejb.Stateless; 10 import javax.ejb.Stateless;
10 -import javax.enterprise.inject.Alternative;
11 import javax.inject.Inject; 11 import javax.inject.Inject;
12 import java.util.List; 12 import java.util.List;
13 13
......
1 -package org.legrog.presentation; 1 +package org.legrog.web.publisher;
2 2
3 -import org.legrog.application.PublisherRevisionService; 3 +import org.legrog.web.xyz.SharedService;
4 -import org.legrog.application.PublisherService; 4 +import org.legrog.web.user.UserService;
5 -import org.legrog.application.SharedService;
6 -import org.legrog.application.UserService;
7 import org.legrog.entities.Country; 5 import org.legrog.entities.Country;
8 import org.legrog.entities.Publisher; 6 import org.legrog.entities.Publisher;
9 import org.legrog.entities.PublisherRevision; 7 import org.legrog.entities.PublisherRevision;
...@@ -15,9 +13,8 @@ import javax.annotation.PostConstruct; ...@@ -15,9 +13,8 @@ import javax.annotation.PostConstruct;
15 import javax.enterprise.context.RequestScoped; 13 import javax.enterprise.context.RequestScoped;
16 import javax.inject.Inject; 14 import javax.inject.Inject;
17 import javax.inject.Named; 15 import javax.inject.Named;
18 -import java.util.Date;
19 import java.sql.Timestamp; 16 import java.sql.Timestamp;
20 -import java.time.ZoneId; 17 +import java.util.Date;
21 import java.util.HashSet; 18 import java.util.HashSet;
22 import java.util.List; 19 import java.util.List;
23 import java.util.Random; 20 import java.util.Random;
...@@ -33,8 +30,7 @@ public class AddPublisherBean { ...@@ -33,8 +30,7 @@ public class AddPublisherBean {
33 private UserService userService; 30 private UserService userService;
34 @Inject 31 @Inject
35 private PublisherService publisherService; 32 private PublisherService publisherService;
36 - @Inject 33 +
37 - private PublisherRevisionService publisherRevisionService;
38 34
39 private String publisherName; 35 private String publisherName;
40 private String publisherStreetAddress; 36 private String publisherStreetAddress;
...@@ -82,8 +78,11 @@ public class AddPublisherBean { ...@@ -82,8 +78,11 @@ public class AddPublisherBean {
82 // End TODO 78 // End TODO
83 publisherRevision.setPublisherRevisionAuthor(user); 79 publisherRevision.setPublisherRevisionAuthor(user);
84 logger.info(publisherRevision.toString()); 80 logger.info(publisherRevision.toString());
81 +
82 + // FIXME un seul appel logique à faire (pour la gestion du rollback)
85 publisherService.addPublisher(publisher); 83 publisherService.addPublisher(publisher);
86 - publisherRevisionService.addPublisherRevision(publisherRevision); 84 + publisherService.addPublisherRevision(publisherRevision);
85 +
87 // Test de récupération de l'Id 86 // Test de récupération de l'Id
88 logger.info(publisherRevision.toString()); 87 logger.info(publisherRevision.toString());
89 return "success"; 88 return "success";
......
1 -package org.legrog.presentation; 1 +package org.legrog.web.publisher;
2 2
3 -import org.legrog.application.PublisherRevisionService;
4 -import org.legrog.application.PublisherService;
5 -import org.legrog.entities.Publisher;
6 import org.legrog.entities.PublisherRevision; 3 import org.legrog.entities.PublisherRevision;
7 import org.slf4j.Logger; 4 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory; 5 import org.slf4j.LoggerFactory;
...@@ -11,8 +8,6 @@ import javax.annotation.PostConstruct; ...@@ -11,8 +8,6 @@ import javax.annotation.PostConstruct;
11 import javax.enterprise.context.RequestScoped; 8 import javax.enterprise.context.RequestScoped;
12 import javax.inject.Inject; 9 import javax.inject.Inject;
13 import javax.inject.Named; 10 import javax.inject.Named;
14 -import java.util.ArrayList;
15 -import java.util.Iterator;
16 import java.util.List; 11 import java.util.List;
17 12
18 @Named 13 @Named
...@@ -21,7 +16,7 @@ public class ListPublisherRevisionsView { ...@@ -21,7 +16,7 @@ public class ListPublisherRevisionsView {
21 Logger logger = LoggerFactory.getLogger(getClass()); 16 Logger logger = LoggerFactory.getLogger(getClass());
22 17
23 @Inject 18 @Inject
24 - PublisherRevisionService publisherRevisionService; 19 + PublisherService publisherService;
25 20
26 private Integer publisherId; 21 private Integer publisherId;
27 22
...@@ -48,17 +43,14 @@ public class ListPublisherRevisionsView { ...@@ -48,17 +43,14 @@ public class ListPublisherRevisionsView {
48 */ 43 */
49 @PostConstruct 44 @PostConstruct
50 public void init() { 45 public void init() {
51 - publisherRevisions = publisherRevisionService.getAllPublisherRevisions(); 46 + publisherRevisions = publisherService.getAllPublisherRevisions();
52 logger.info("init"); 47 logger.info("init");
53 } 48 }
54 49
55 public void setView() { 50 public void setView() {
56 logger.info("setView"); 51 logger.info("setView");
57 logger.info("publisherId = " + publisherId); 52 logger.info("publisherId = " + publisherId);
58 - viewAll = false; 53 + viewAll = ( publisherId == null ) ;
59 - if (publisherId == null) {
60 - viewAll = true;
61 - }
62 } 54 }
63 55
64 public Integer getPublisherId() { 56 public Integer getPublisherId() {
......
1 -package org.legrog.presentation; 1 +package org.legrog.web.publisher;
2 2
3 -import org.legrog.application.PublisherRevisionService; 3 +import org.legrog.web.xyz.SharedService;
4 -import org.legrog.application.PublisherService; 4 +import org.legrog.web.user.UserService;
5 -import org.legrog.application.SharedService;
6 -import org.legrog.application.UserService;
7 import org.legrog.entities.Country; 5 import org.legrog.entities.Country;
8 import org.legrog.entities.Publisher; 6 import org.legrog.entities.Publisher;
9 import org.legrog.entities.PublisherRevision; 7 import org.legrog.entities.PublisherRevision;
...@@ -17,7 +15,11 @@ import javax.inject.Inject; ...@@ -17,7 +15,11 @@ import javax.inject.Inject;
17 import javax.inject.Named; 15 import javax.inject.Named;
18 import java.io.Serializable; 16 import java.io.Serializable;
19 import java.sql.Timestamp; 17 import java.sql.Timestamp;
20 -import java.util.*; 18 +import java.util.Date;
19 +import java.util.HashSet;
20 +import java.util.List;
21 +import java.util.Random;
22 +import java.util.Set;
21 23
22 @Named 24 @Named
23 @ViewScoped 25 @ViewScoped
...@@ -26,8 +28,7 @@ public class PublisherRevisionView implements Serializable { ...@@ -26,8 +28,7 @@ public class PublisherRevisionView implements Serializable {
26 28
27 @Inject 29 @Inject
28 private PublisherService publisherService; 30 private PublisherService publisherService;
29 - @Inject 31 +
30 - PublisherRevisionService publisherRevisionService;
31 @Inject 32 @Inject
32 UserService userService; 33 UserService userService;
33 @Inject 34 @Inject
...@@ -111,7 +112,7 @@ public class PublisherRevisionView implements Serializable { ...@@ -111,7 +112,7 @@ public class PublisherRevisionView implements Serializable {
111 public void add() { 112 public void add() {
112 Publisher publisher = new Publisher(); 113 Publisher publisher = new Publisher();
113 PublisherRevision publisherRevision = new PublisherRevision(); 114 PublisherRevision publisherRevision = new PublisherRevision();
114 - HashSet<PublisherRevision> publisherRevisions = new HashSet<PublisherRevision>(); 115 + Set<PublisherRevision> publisherRevisions = new HashSet<PublisherRevision>();
115 publisherRevisions.add(publisherRevision); 116 publisherRevisions.add(publisherRevision);
116 publisher.setRevisions(publisherRevisions); 117 publisher.setRevisions(publisherRevisions);
117 118
...@@ -119,8 +120,10 @@ public class PublisherRevisionView implements Serializable { ...@@ -119,8 +120,10 @@ public class PublisherRevisionView implements Serializable {
119 120
120 setValues(publisherRevision); 121 setValues(publisherRevision);
121 122
123 + // FIXME un seul appel logique à faire (pour la gestion du rollback)
122 publisherService.addPublisher(publisher); 124 publisherService.addPublisher(publisher);
123 - publisherRevisionService.addPublisherRevision(publisherRevision); 125 + publisherService.addPublisherRevision(publisherRevision);
126 +
124 newPublisher = false; 127 newPublisher = false;
125 publisherRevisionId = publisherRevision.getPublisherRevisionId(); 128 publisherRevisionId = publisherRevision.getPublisherRevisionId();
126 publisherId = publisher.getPublisherId(); 129 publisherId = publisher.getPublisherId();
...@@ -135,8 +138,10 @@ public class PublisherRevisionView implements Serializable { ...@@ -135,8 +138,10 @@ public class PublisherRevisionView implements Serializable {
135 138
136 setValues(publisherRevision); 139 setValues(publisherRevision);
137 140
141 + // FIXME un seul appel logique à faire (pour la gestion du rollback)
138 publisherService.addRevisionToPublisher(publisher, publisherRevision); 142 publisherService.addRevisionToPublisher(publisher, publisherRevision);
139 - publisherRevisionService.addPublisherRevision(publisherRevision); 143 + publisherService.addPublisherRevision(publisherRevision);
144 +
140 editMode = false; 145 editMode = false;
141 } 146 }
142 147
...@@ -144,7 +149,8 @@ public class PublisherRevisionView implements Serializable { ...@@ -144,7 +149,8 @@ public class PublisherRevisionView implements Serializable {
144 logger.debug("publisherRevisionId = {}", this.publisherRevisionId); 149 logger.debug("publisherRevisionId = {}", this.publisherRevisionId);
145 150
146 if (publisherRevisionId != 0) { 151 if (publisherRevisionId != 0) {
147 - PublisherRevision publisherRevision = publisherRevisionService.getPublisherRevision(publisherRevisionId); 152 +
153 + PublisherRevision publisherRevision = publisherService.getPublisherRevision(publisherRevisionId);
148 154
149 logger.debug("Found a publisher revision : {}", publisherRevision.toString()); 155 logger.debug("Found a publisher revision : {}", publisherRevision.toString());
150 156
......
1 -package org.legrog.application; 1 +package org.legrog.web.publisher;
2 2
3 import org.legrog.entities.Publisher; 3 import org.legrog.entities.Publisher;
4 import org.legrog.entities.PublisherRevision; 4 import org.legrog.entities.PublisherRevision;
...@@ -6,6 +6,7 @@ import org.legrog.entities.PublisherRevision; ...@@ -6,6 +6,7 @@ import org.legrog.entities.PublisherRevision;
6 import java.util.List; 6 import java.util.List;
7 7
8 public interface PublisherService { 8 public interface PublisherService {
9 +
9 void addPublisher(Publisher publisher); 10 void addPublisher(Publisher publisher);
10 11
11 void addRevisionToPublisher(Publisher publisher, PublisherRevision publisherRevision); 12 void addRevisionToPublisher(Publisher publisher, PublisherRevision publisherRevision);
...@@ -13,4 +14,10 @@ public interface PublisherService { ...@@ -13,4 +14,10 @@ public interface PublisherService {
13 List<Publisher> getAllPublishers(); 14 List<Publisher> getAllPublishers();
14 15
15 Publisher getPublisher(Integer publisherId); 16 Publisher getPublisher(Integer publisherId);
17 +
18 + void addPublisherRevision(PublisherRevision publisherRevision);
19 +
20 + List<PublisherRevision> getAllPublisherRevisions();
21 +
22 + PublisherRevision getPublisherRevision(Integer publisherRevisionId);
16 } 23 }
......
1 -package org.legrog.application; 1 +package org.legrog.web.publisher;
2 2
3 3
4 import org.legrog.entities.Publisher; 4 import org.legrog.entities.Publisher;
5 import org.legrog.entities.PublisherRepository; 5 import org.legrog.entities.PublisherRepository;
6 import org.legrog.entities.PublisherRevision; 6 import org.legrog.entities.PublisherRevision;
7 +import org.legrog.entities.PublisherRevisionRepository;
7 8
8 import javax.ejb.Stateless; 9 import javax.ejb.Stateless;
9 import javax.inject.Inject; 10 import javax.inject.Inject;
...@@ -15,6 +16,21 @@ public class PublisherServiceSpring implements PublisherService { ...@@ -15,6 +16,21 @@ public class PublisherServiceSpring implements PublisherService {
15 @Inject 16 @Inject
16 PublisherRepository publisherRepository; 17 PublisherRepository publisherRepository;
17 18
19 + @Inject
20 + PublisherRevisionRepository publisherRevisionRepository;
21 +
22 + public void addPublisherRevision(PublisherRevision publisherRevision) {
23 + publisherRevisionRepository.save(publisherRevision);
24 + }
25 +
26 + public List<PublisherRevision> getAllPublisherRevisions() {
27 + return publisherRevisionRepository.findAll();
28 + }
29 +
30 + public PublisherRevision getPublisherRevision(Integer publisherRevisionId) {
31 + return publisherRevisionRepository.findOne(publisherRevisionId);
32 + }
33 +
18 public void addPublisher(Publisher publisher) { 34 public void addPublisher(Publisher publisher) {
19 publisherRepository.save(publisher); 35 publisherRepository.save(publisher);
20 } 36 }
......
1 -package org.legrog.presentation; 1 +package org.legrog.web.user;
2 2
3 -import org.legrog.application.UserService;
4 import org.legrog.entities.User; 3 import org.legrog.entities.User;
5 4
6 import javax.annotation.PostConstruct; 5 import javax.annotation.PostConstruct;
......
1 -package org.legrog.presentation; 1 +package org.legrog.web.user;
2 2
3 -import org.legrog.application.SharedService; 3 +import org.legrog.web.xyz.SharedService;
4 -import org.legrog.application.UserService;
5 import org.legrog.entities.*; 4 import org.legrog.entities.*;
6 import org.slf4j.Logger; 5 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory; 6 import org.slf4j.LoggerFactory;
8 7
9 import javax.annotation.PostConstruct; 8 import javax.annotation.PostConstruct;
10 -import javax.enterprise.context.RequestScoped;
11 import javax.faces.bean.ManagedProperty; 9 import javax.faces.bean.ManagedProperty;
12 import javax.faces.bean.SessionScoped; 10 import javax.faces.bean.SessionScoped;
13 -import javax.faces.context.ExternalContext;
14 -import javax.faces.context.FacesContext;
15 -import javax.faces.view.ViewScoped;
16 import javax.inject.Inject; 11 import javax.inject.Inject;
17 import javax.inject.Named; 12 import javax.inject.Named;
18 -import java.io.IOException;
19 import java.util.ArrayList; 13 import java.util.ArrayList;
20 import java.util.Date; 14 import java.util.Date;
21 import java.util.List; 15 import java.util.List;
......
1 -package org.legrog.application; 1 +package org.legrog.web.user;
2 2
3 import org.legrog.entities.User; 3 import org.legrog.entities.User;
4 4
......
1 -package org.legrog.application; 1 +package org.legrog.web.user;
2 2
3 import org.legrog.entities.User; 3 import org.legrog.entities.User;
4 import org.legrog.entities.UserRepository; 4 import org.legrog.entities.UserRepository;
......
1 -package org.legrog.presentation; 1 +package org.legrog.web.xyz;
2 2
3 -import org.legrog.application.SharedService;
4 import org.legrog.entities.Country; 3 import org.legrog.entities.Country;
5 4
6 import javax.enterprise.context.RequestScoped; 5 import javax.enterprise.context.RequestScoped;
......
1 -package org.legrog.presentation; 1 +package org.legrog.web.xyz;
2 2
3 -import org.legrog.application.SharedService;
4 import org.legrog.entities.Country; 3 import org.legrog.entities.Country;
5 4
6 import javax.annotation.PostConstruct; 5 import javax.annotation.PostConstruct;
......
1 -package org.legrog.application; 1 +package org.legrog.web.xyz;
2 2
3 import org.legrog.entities.Country; 3 import org.legrog.entities.Country;
4 import org.legrog.entities.DisplayNameMask; 4 import org.legrog.entities.DisplayNameMask;
......
1 -package org.legrog.application; 1 +package org.legrog.web.xyz;
2 2
3 import org.legrog.entities.*; 3 import org.legrog.entities.*;
4 //import org.slf4j.Logger; 4 //import org.slf4j.Logger;
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +
3 +<body jsf:id="root-body" xmlns="http://www.w3.org/1999/xhtml"
4 + xmlns:h="http://xmlns.jcp.org/jsf/html"
5 + xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
6 + xmlns:f="http://xmlns.jcp.org/jsf/core"
7 + xmlns:jsf="http://xmlns.jcp.org/jsf">
8 +<p>
9 + I'm looking for something
10 +</p>
11 +
12 +<p>
13 +And this is my string : #{testRootView.foo}
14 +</p>
15 +
16 +
17 +<p>
18 + And this is another string : #{testRootView.bar}
19 +</p>
20 +
21 +</body>
1 +package org.legrog.web.xyz;
2 +
3 +import javax.inject.Named;
4 +import java.io.Serializable;
5 +
6 +@Named
7 +@javax.enterprise.context.RequestScoped
8 +//@URLMapping(id = "testroot", pattern = "/testRoot/#{bar : testRootView.bar}", viewId = "xyz/TestRoot.jsf")
9 +public class TestRootView implements Serializable {
10 +
11 + String foo = "my first String";
12 +
13 + String bar ="";
14 +
15 +//
16 +// public void init() {
17 +// if (number == null) {
18 +// foo = "my second String";
19 +// } else {
20 +// foo = "my string #"+number;
21 +// }
22 +//
23 +// }
24 +
25 + public String getFoo() {
26 + return foo;
27 + }
28 +
29 + public void setFoo(String foo) {
30 + this.foo = foo;
31 + }
32 +
33 + public String getBar() {
34 + return bar;
35 + }
36 +
37 + public void setBar(String bar) {
38 + this.bar = bar;
39 + }
40 +}
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<configuration>
3 +
4 + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
5 + <layout class="ch.qos.logback.classic.PatternLayout">
6 + <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
7 + </layout>
8 + </appender>
9 +
10 + <logger name="org.legrog" level="DEBUG"/>
11 +
12 + <root level="warn">
13 + <appender-ref ref="STDOUT" />
14 + </root>
15 +</configuration>
...\ No newline at end of file ...\ No newline at end of file
...@@ -17,92 +17,92 @@ ...@@ -17,92 +17,92 @@
17 <from-view-id>/index.xhtml</from-view-id> 17 <from-view-id>/index.xhtml</from-view-id>
18 <navigation-case> 18 <navigation-case>
19 <from-outcome>addBook</from-outcome> 19 <from-outcome>addBook</from-outcome>
20 - <to-view-id>/book.xhtml</to-view-id> 20 + <to-view-id>/book/book.xhtml</to-view-id>
21 </navigation-case> 21 </navigation-case>
22 <navigation-case> 22 <navigation-case>
23 <from-outcome>listBooks</from-outcome> 23 <from-outcome>listBooks</from-outcome>
24 - <to-view-id>/result.xhtml</to-view-id> 24 + <to-view-id>/book/result.xhtml</to-view-id>
25 </navigation-case> 25 </navigation-case>
26 <navigation-case> 26 <navigation-case>
27 <from-outcome>addCountry</from-outcome> 27 <from-outcome>addCountry</from-outcome>
28 - <to-view-id>/addCountry.xhtml</to-view-id> 28 + <to-view-id>/xyz/addCountry.xhtml</to-view-id>
29 </navigation-case> 29 </navigation-case>
30 <navigation-case> 30 <navigation-case>
31 <from-outcome>listCountries</from-outcome> 31 <from-outcome>listCountries</from-outcome>
32 - <to-view-id>/listCountries.xhtml</to-view-id> 32 + <to-view-id>/xyz/listCountries.xhtml</to-view-id>
33 </navigation-case> 33 </navigation-case>
34 <navigation-case> 34 <navigation-case>
35 <from-outcome>addUser</from-outcome> 35 <from-outcome>addUser</from-outcome>
36 - <to-view-id>/updateUser.xhtml</to-view-id> 36 + <to-view-id>/user/updateUser.xhtml</to-view-id>
37 </navigation-case> 37 </navigation-case>
38 <navigation-case> 38 <navigation-case>
39 <from-outcome>listUsers</from-outcome> 39 <from-outcome>listUsers</from-outcome>
40 - <to-view-id>/listUsers.xhtml</to-view-id> 40 + <to-view-id>/user/listUsers.xhtml</to-view-id>
41 </navigation-case> 41 </navigation-case>
42 </navigation-rule> 42 </navigation-rule>
43 <navigation-rule> 43 <navigation-rule>
44 - <from-view-id>/addPublisher.xhtml</from-view-id> 44 + <from-view-id>/publisher/addPublisher.xhtml</from-view-id>
45 <navigation-case> 45 <navigation-case>
46 <from-outcome>success</from-outcome> 46 <from-outcome>success</from-outcome>
47 - <to-view-id>/listPublisherRevisions.xhtml</to-view-id> 47 + <to-view-id>/publisher/listPublisherRevisions.xhtml</to-view-id>
48 </navigation-case> 48 </navigation-case>
49 </navigation-rule> 49 </navigation-rule>
50 <navigation-rule> 50 <navigation-rule>
51 - <from-view-id>/addCountry.xhtml</from-view-id> 51 + <from-view-id>/xyz/addCountry.xhtml</from-view-id>
52 <navigation-case> 52 <navigation-case>
53 <from-outcome>success</from-outcome> 53 <from-outcome>success</from-outcome>
54 - <to-view-id>/listCountries.xhtml</to-view-id> 54 + <to-view-id>/xyz/listCountries.xhtml</to-view-id>
55 </navigation-case> 55 </navigation-case>
56 </navigation-rule> 56 </navigation-rule>
57 57
58 <navigation-rule> 58 <navigation-rule>
59 - <from-view-id>/addUser_short.xhtml</from-view-id> 59 + <from-view-id>/user/addUser_short.xhtml</from-view-id>
60 <navigation-case> 60 <navigation-case>
61 <from-outcome>success</from-outcome> 61 <from-outcome>success</from-outcome>
62 - <to-view-id>/listUsers_short.xhtml</to-view-id> 62 + <to-view-id>/user/listUsers_short.xhtml</to-view-id>
63 </navigation-case> 63 </navigation-case>
64 </navigation-rule> 64 </navigation-rule>
65 65
66 <navigation-rule> 66 <navigation-rule>
67 - <from-view-id>/book.xhtml</from-view-id> 67 + <from-view-id>/book/book.xhtml</from-view-id>
68 <navigation-case> 68 <navigation-case>
69 <from-outcome>success</from-outcome> 69 <from-outcome>success</from-outcome>
70 - <to-view-id>/result.xhtml</to-view-id> 70 + <to-view-id>/book/result.xhtml</to-view-id>
71 </navigation-case> 71 </navigation-case>
72 </navigation-rule> 72 </navigation-rule>
73 73
74 <navigation-rule> 74 <navigation-rule>
75 - <from-view-id>/result.xhtml</from-view-id> 75 + <from-view-id>/book/result.xhtml</from-view-id>
76 <navigation-case> 76 <navigation-case>
77 <from-outcome>back</from-outcome> 77 <from-outcome>back</from-outcome>
78 - <to-view-id>/book.xhtml</to-view-id> 78 + <to-view-id>/book/book.xhtml</to-view-id>
79 </navigation-case> 79 </navigation-case>
80 </navigation-rule> 80 </navigation-rule>
81 81
82 <navigation-rule> 82 <navigation-rule>
83 - <from-view-id>/updateUser.xhtml</from-view-id> 83 + <from-view-id>/user/updateUser.xhtml</from-view-id>
84 <navigation-case> 84 <navigation-case>
85 <from-outcome>cancel</from-outcome> 85 <from-outcome>cancel</from-outcome>
86 - <to-view-id>/listUsers.xhtml</to-view-id> 86 + <to-view-id>/user/listUsers.xhtml</to-view-id>
87 </navigation-case> 87 </navigation-case>
88 <navigation-case> 88 <navigation-case>
89 <from-outcome>success</from-outcome> 89 <from-outcome>success</from-outcome>
90 - <to-view-id>/listUsers.xhtml</to-view-id> 90 + <to-view-id>/user/listUsers.xhtml</to-view-id>
91 </navigation-case> 91 </navigation-case>
92 </navigation-rule> 92 </navigation-rule>
93 <navigation-rule> 93 <navigation-rule>
94 - <from-view-id>/listUsers.xhtml</from-view-id> 94 + <from-view-id>/user/listUsers.xhtml</from-view-id>
95 <navigation-case> 95 <navigation-case>
96 <from-outcome>add</from-outcome> 96 <from-outcome>add</from-outcome>
97 - <to-view-id>/updateUser.xhtml</to-view-id> 97 + <to-view-id>/user/updateUser.xhtml</to-view-id>
98 </navigation-case> 98 </navigation-case>
99 </navigation-rule> 99 </navigation-rule>
100 100
101 <navigation-rule> 101 <navigation-rule>
102 - <from-view-id>/listPublisherRevisions.xhtml</from-view-id> 102 + <from-view-id>/publisher/listPublisherRevisions.xhtml</from-view-id>
103 <navigation-case> 103 <navigation-case>
104 <from-outcome>view</from-outcome> 104 <from-outcome>view</from-outcome>
105 - <to-view-id>/publisherRevision.xhtml</to-view-id> 105 + <to-view-id>/publisher/publisherRevision.xhtml</to-view-id>
106 </navigation-case> 106 </navigation-case>
107 </navigation-rule> 107 </navigation-rule>
108 </faces-config> 108 </faces-config>
...\ No newline at end of file ...\ No newline at end of file
......
1 -package org.legrog.application; 1 +package org.legrog.web.book;
2 2
3 import org.junit.Before; 3 import org.junit.Before;
4 import org.junit.Test; 4 import org.junit.Test;
5 import org.junit.runner.RunWith; 5 import org.junit.runner.RunWith;
6 import org.legrog.entities.Book; 6 import org.legrog.entities.Book;
7 +import org.legrog.web.book.BookServiceOld;
7 import org.mockito.Answers; 8 import org.mockito.Answers;
8 import org.mockito.Mock; 9 import org.mockito.Mock;
9 import org.mockito.Mockito; 10 import org.mockito.Mockito;
......