ccordenier / tapestry5-hotel-booking Goto Github PK
View Code? Open in Web Editor NEWSeam like 'Hotel booking' demonstration Web application for Tapestry 5
License: Other
Seam like 'Hotel booking' demonstration Web application for Tapestry 5
License: Other
The application has a basic user authentication system, so we need
Readme broken link !
http://spreadthesource.com/2010/09/wooki-0-4-is-out-whats-next/
Qu'est-ce que tu deviens Christophe ? 💃
:)
Katia
We must provide a page that will show the available hotels
We will implement everything via Tapestry Services, the seam has a default conversation mechanism, we will have to see if it's worthy or not.
Personally, i prefer the stateless way, let's see !
Of course we need unit and integration test.
Demonstrate how fun it is to implement test with Tapestry :)
This includes :
The error message "Passwords are not the same" is shown. Values of input fields should are lost
User must be able to change its password
have a look to the new solution without conversations and see how can we make it work perfectly :D
This includes :
This includes
Code from master must be merged into Tynamo Branch. We will use Tynamo Conversations module to implement the conversations.
For instance i get: "Esplanade L�opold-Robert 2"
Should just be handled by setting encoding for the resources maven plugin i guess (haven't tried)
This includes
A conversation component exists on tynamo and another one Tapestry jumpstart, see which one suits the best :) We need to allow the user to have a state per browser tabs
I got this when trying to mvn run the app in a new machine.
I had to add
<repository>
<id>jboss</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
Not sure if it's possible to fix this without adding yet another repository to the pom :(
I get this hibernate / tapestry-hibernate exception when simply switching the tapestry-release-version property to 5.2.4 :
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.annotations.common.reflection.java.JavaReflectionManager
at org.hibernate.cfg.Configuration.createReflectionManager(Configuration.java:2938)
at org.hibernate.cfg.Configuration.createReflectionManager(Configuration.java:2934)
at org.hibernate.cfg.Configuration.reset(Configuration.java:305)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:296)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:300)
at org.hibernate.cfg.AnnotationConfiguration.<init>(AnnotationConfiguration.java:74)
at org.apache.tapestry5.internal.hibernate.HibernateSessionSourceImpl.<init>(HibernateSessionSourceImpl.java:38)
at org.apache.tapestry5.hibernate.HibernateCoreModule.buildHibernateSessionSource(HibernateCoreModule.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tapestry5.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:64)
... 139 more
Perhaps the tapestry-hibernate module needs specific hib version - reporting now / could investigate tomorrow
Implement the logout feature
See if tapestry spring webflow will be useful here
/**
Define JS initializer method for ajaxlaoder component.
*/
Tapestry.Initializer.initAjaxLoader = function(params) {
/** Observe zone-update */
$(params.zone).observeAction(Tapestry.ZONE_UPDATED_EVENT, function() {
$(params.loader).hide();
});
/**
Which processes the following check:
if (Tapestry.pageLoaded)
return true;
I thought the page isn't loaded yet so this always returns true, which - I suppose - simulates a click on the link, which goes back in the same loop till the stack explodes as the page will never load faster than the JS call ! So I thought to trigger the event after the page is fully loaded. And that's what I have already done in the above code snippet.
The current message is: "You must provide a value for Fcaptcha."
Add some groovy tests
Available when the user has not already logged in
Why code tests in Java? I now code all my unit and integration tests in Groovy.
com.tap5.hotelbooking.app0.services.AppModule
Why is this named this way? Is it supposed to be under src/test/java?
contributeApplicationDefauls() is incorreclty named; you should use a @Contribute annotation with the @ApplicationDefaults marker annotation.
com.tap5.hotelbooking.app0.services.TestModule
Why does this exist? It doesn't do anything.
BookHotelTest
cleanup(): If this is a test, make it a test. Using @afterclass is sloppy for something that's really a test.
Use test scheduling if order of operations really counts.
Why are you specifying a testName attribute that's identical to the method name? Dont Repeat Yourself.
ConversationModule
I try to have a single Module class per package, so I'd create a com.tap5.conversation.services.conversation
package and refactor the module and services into it.
Is all this conversation stuff appropriate for the application? Seems like overkill!
ConversationWorker
There's a method, ClassTransformation.matchMethodsWithAnnotation(), for this. Less code is good.
Also TransformMethod.addOperationAfter() would be more succinct, though the operation doesn't execute
if the advised method throws an runtime exception, so it may not be appropriate.
AnonymousAccess
The JavaDoc is incorrect; this method enables (not prevents) annonymous access to pages.
HotelBookingConstants
Is the extra level of indirection actually useful? I'd just hard-code the values inside AuthenticationFilter.
Also, this is in a package named "annotations".
HibernateCrudServiceDAO
I have a similar set of DAO's in one of my projects; I tend to use the @Inject annotation, rather
than constructor injection, to simplify life for anyone that extends the class.
CrudServiceDAO
Empty JavaDoc doesn't count and some of these methods, such as create(), do quite a lot that isn't obvious.
HibernateModule
Tapestry would automatically check com.tap5.hotelbooking.entities for Hibernate entities, so if you refactor the domain objects there, it wouldn't be necessary to contribute to HibernateEntityPackageManager.
QueryParameters
Does this class actually help much? Is doesn't seem to be used.
com.tap5.hotelbooking.data.Workspace
Does not appear to be used.
Authenticated
Ok as a component; I really envisioned this kind of functionality as a good example of using a custom type of Binding.
e.g. <t:test if="has-role:admin">
AjaxLoader
Rename field renderSupport to javascriptSupport.
initMoreLink() why is this named this way?
afterRender() why have the @AfterRender annotation if following the naming convention?
HotelClass
Why use Long, not long, for the stars parameter?
IfNotNull
If this needed? The normal Object -> Boolean coercion treats null as false.
Layout
getUser(): Why bother with a temporary variable? Are you that allergic to multiple returns from such a short method?
AuthenticationException
Does this need to be a checked exception? It's never caught by anthing. If it's a runtime exception that's never
specifically caught anywhere, why not just use RuntimeException?
Layout.java / Layout.tml
Remove the sidebarTitle parameter it is not used. Change the page templates to not set it.
Implement the booking page to allow authenticated user to book a hotel
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.