Giter VIP home page Giter VIP logo

book-examples's Introduction

Book Examples

Source code for the code examples in the Book of Vaadin and some more.

Requirements:

  • Eclipse IDE for Java EE Developers
  • Java 8 JDK installed in Eclipse
  • Apache TomEE 1.7 or newer
  • Vaadin Plugin for Eclipse
  1. Cloning

You have two options:

a) To clone the repository read-only from Github:

$ git clone https://github.com/vaadin/book-examples

b) To clone the repository from the read-write code review repository:

$ git clone ssh://<username>@dev.vaadin.com:29418/book-examples.git

Where <username> is your username in the review system.

See the contribution instructions for information about registering: https://vaadin.com/wiki/-/wiki/Main/Contributing+Code. Also note the required repository configuration for submitting code for review.

  1. Importing

You should create the server before importing, as the project files may refer to it as a compilation target. Not sure if it is relevant

  1. Create TomEE server in Eclipse

  2. In the Servers view, right-click → NewServer

  3. In the "New Server" wizard: - Select ApacheTomcat 7.0 Server - Set Server name: "Apache TomEE 1.7 at localhost" - Click Next

  4. In the Tomcat Servet step: - Name: "Apache TomEE 1.7 at localhost" - Installation Directory: "/opt/apache-tomee-webprofile-1.7.1" - JRE: Workbench default or Java 8 JRE - Click Finish

  5. Import project

  6. FileImportExisting projects intro workspace

  7. In the import wizard: - Select the cloned project directory - Click Finish

  8. Building


  1. Some Vaadin add-ons may require a snapshot version, which must be built and installed to the local Maven repository.

    For example, for Vaadin Charts:

    $ git clone https://github.com/vaadin/charts
    $ cd charts
    $ mvn install -DskipTests
  1. Refresh Ivy
  • Right-click on project, select IvyRefresh
  1. Install license keys for commercial Vaadin add-ons (Charts, etc.)

  2. Compile the widget set

  3. Select Java Resources → src/com.vaadin.book.widgetset/BookExamplesWidgetSet.gwt.xml

  4. Click Compile Widgetset in the toolbar (requires Vaadin Plugin for Eclipse)

You can also compile the themes here, or let them be compiled on-the-fly.

  1. Deployment

Just add the project to the previously created TomEE server.

You should then be able to run the application with:

http://localhost:8080/book-examples-vaadin7/book
  1. Development

Things you should notice:

  • The examples are formatted by hand, so you must not have any automatic code formatting enabled in your Eclipse default settings.
  1. Contributions

Contributions must go through the Gerrit code review system.

  • You must install the commit-msg hook as instructed
  • You must push to review as instructed

book-examples's People

Contributors

alvarezguille avatar artur- avatar juhopiirainen avatar magi42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

book-examples's Issues

Update theme

The theme should be updated according to its design. It's currently done only partially.

The update requires some structural updates.

Migrate to Maven

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.book should 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.examples package. 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.applications package 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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.