-
Notifications
You must be signed in to change notification settings - Fork 60
Migrate to Maven #5
Description
Vaadin Framework and the Eclipse plugin are migrating to Maven, so Book Examples should follow.
The project should be made a Maven multi-module project: an "examples view" library module (this could be made an add-on later) and about 4 web application modules using the examples library, as outlined below.
The library module would contain a view class, such as "ExamplesView", that builds the basic layout (title + menu + content area) and handles the examples application logic, such as handling menu changes, loading and displaying examples based on menu selection, displaying source code, and such.
The library module (book-examples-lib or something) should contain about the following:
- The layout part of BookExamplesUI in
com.vaadin.bookshould be extracted to the library module as an "ExamplesView" class or something. It should take the list of examples as parameter. They are currently in BookExamplesLibrary.java file. The UI class itself should go in the Framework examples module, and other example app modules should have a similar class. - Most of the classes in the
com.vaadin.book.examplespackage. The examples list earlier defined in BookExamplesLibrary should be allowed to be given as a parameter to the view class.
Because of possible conflicts with database and EE features, certain demos should be separated into separate applications:
- Framework & Pro Tools
book-examples-vaadin7- The current BookExamplesUI class should be here, except for the part for building the layout that is separated into the ExamplesView class, and the ExamplesView should be instantiated here and used as the root component of the UI. There's some actual example code in the UI class as well, so it should be in the application module.
- The list of examples defined in the BookExamplesLibrary should be here in some file, and passed to the ExamplesView as a parameter or something.
- The servlet class should be here as well. There's some example code there too.
- There's multiple widget sets and themes here, so I hope we can have those in the Maven project.
- Notice that there's multiple servlets in this app, in the
com.vaadin.book.applicationspackage and elsewhere.
- Examples application for the JPAContainer Add-on
book-examples-jpacontainer(maybe not necessary to separate) - Examples application for the CDI Add-on
book-examples-cdi. These examples use EE stuff that may cause conflicts with Spring stuff in the same web app. Maybe we'd need to separate just either CDI or Spring, but let's be even and fair. - Examples application for the Spring Add-on
book-examples-spring.
Also each of the other application modules would have a UI class and possibly also a servlet class. Note that most of the servlets are described in the web.xml file and not with a @WebServlet annotation.
Maybe there's need to have separate widget set modules, as the is in the old multi-module archetype, but hopefully it's not necessary. And there should be a separate build profile for the production build.
The TouchKit Sampler already is separated, actually into a separate repository (not in github.com/vaadin).