- Timestamp:
- 11/03/11 17:44:07 (7 months ago)
- Location:
- trunk/pustefix-samples/pustefix-cditest/src/main
- Files:
-
- 3 added
- 6 modified
-
java/org/pustefixframework/example/PasswordCheckService.java (added)
-
java/org/pustefixframework/example/cditest/RegistrationHandler.java (modified) (3 diffs)
-
java/org/pustefixframework/example/cditest/ResultState.java (modified) (2 diffs)
-
java/org/pustefixframework/example/cditest/TestState.java (added)
-
java/org/pustefixframework/example/cditest/User.java (modified) (3 diffs)
-
java/org/pustefixframework/example/cditest/UserRegistry.java (added)
-
webapp/WEB-INF/spring.xml (modified) (1 diff)
-
webapp/dyntxt/statuscodeinfo.xml (modified) (1 diff)
-
webapp/dyntxt/statusmessages.xml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pustefix-samples/pustefix-cditest/src/main/java/org/pustefixframework/example/cditest/RegistrationHandler.java
r6020 r6043 18 18 package org.pustefixframework.example.cditest; 19 19 20 import org.springframework.beans.factory.annotation.Autowired;20 import javax.inject.Inject; 21 21 22 22 import de.schlund.pfixcore.generator.IHandler; … … 31 31 Registration registration = (Registration)wrapper; 32 32 user.setName(registration.getUsername()); 33 user.setPassword(registration.getPassword()); 34 boolean ok = user.register(); 35 System.out.println("OK: "+ok); 36 if(!ok) { 37 registration.addSCodeUsername(StatusCodes.FAILURE); 38 } 33 39 } 34 40 35 41 public boolean isActive(Context context) throws Exception { 36 return user.getName() == null;42 return !user.isRegistered(); 37 43 } 38 44 39 45 public boolean needsData(Context context) throws Exception { 40 return user.getName() == null;46 return !user.isRegistered(); 41 47 } 42 48 … … 50 56 } 51 57 52 @ Autowired58 @Inject 53 59 public void setUser(User user) { 54 60 this.user = user; -
trunk/pustefix-samples/pustefix-cditest/src/main/java/org/pustefixframework/example/cditest/ResultState.java
r6020 r6043 1 1 package org.pustefixframework.example.cditest; 2 2 3 import org.springframework.beans.factory.annotation.Autowired;3 import javax.inject.Inject; 4 4 5 5 import de.schlund.pfixcore.workflow.Context; … … 16 16 } 17 17 18 @ Autowired18 @Inject 19 19 public void setUser(User user) { 20 20 this.user = user; -
trunk/pustefix-samples/pustefix-cditest/src/main/java/org/pustefixframework/example/cditest/User.java
r6020 r6043 21 21 22 22 import javax.enterprise.context.SessionScoped; 23 import javax.inject.Inject; 23 24 import javax.inject.Named; 24 25 … … 28 29 29 30 private static final long serialVersionUID = -5836404564337831979L; 31 32 @Inject 33 private UserRegistry userRegistry; 30 34 31 35 private String name; 32 36 private String password; 33 37 private boolean registered; 38 34 39 public String getName() { 35 40 return name; … … 47 52 this.password = password; 48 53 } 49 54 55 public boolean register() { 56 registered = userRegistry.register(this); 57 return registered; 58 } 59 60 public boolean isRegistered() { 61 return registered; 62 } 63 50 64 } -
trunk/pustefix-samples/pustefix-cditest/src/main/webapp/WEB-INF/spring.xml
r6020 r6043 9 9 <context:annotation-config/> 10 10 11 12 <bean id="pwdcheck" class="org.pustefixframework.example.PasswordCheckService"> 13 <property name="strength" value="1"/> 14 </bean> 15 11 16 </beans> -
trunk/pustefix-samples/pustefix-cditest/src/main/webapp/dyntxt/statuscodeinfo.xml
r6020 r6043 5 5 http://www.pustefix-framework.org/2008/namespace/statuscodeinfo.xsd"> 6 6 7 <statuscodes class="org.pustefixframework.example. numberguess.StatusCodes">7 <statuscodes class="org.pustefixframework.example.cditest.StatusCodes"> 8 8 <file>statusmessages.xml</file> 9 9 </statuscodes> -
trunk/pustefix-samples/pustefix-cditest/src/main/webapp/dyntxt/statusmessages.xml
r6020 r6043 4 4 <part name="success"> 5 5 <theme name="default"> 6 Congratulations, you guessed right!!!6 Registration succeeded. 7 7 </theme> 8 8 </part> … … 10 10 <part name="failure"> 11 11 <theme name="default"> 12 Sorry, that's wrong, expected number was <pfx:argref pos="1"/>.12 Registration failed. 13 13 </theme> 14 14 </part>
