Skip to content
Snippets Groups Projects
Commit 372cfe69 authored by Goik Martin's avatar Goik Martin
Browse files

Hello UI

parent 560ae5e8
No related branches found
No related tags found
No related merge requests found
...@@ -17,17 +17,58 @@ ...@@ -17,17 +17,58 @@
<section xml:id="sda1SectVaadinMavenConfig"> <section xml:id="sda1SectVaadinMavenConfig">
<title>Configuring Maven.</title> <title>Configuring Maven.</title>
<para>The <productname xlink:href="http://vaadin.com">Vaadin</productname> <glosslist>
Maven repository does not allow for tool searching. Thus artifactId and <glossentry>
related attributes of required dependencies must be identified in advance. <glossterm>Searching for artifacts</glossterm>
If e.g. <code>maven-cdi</code> is being required <link
xlink:href="http://vaadin.com/nexus/#nexus-search">http://vaadin.com/nexus/#nexus-search</link> <glossdef>
tells us:</para> <para>The <productname
xlink:href="http://vaadin.com">Vaadin</productname> Maven repository
<programlisting language="none">&lt;dependency&gt; does not allow for tool searching. Thus artifactId and related
attributes of required dependencies must be identified in advance.
If e.g. <code>maven-cdi</code> is being required <link
xlink:href="http://vaadin.com/nexus/#nexus-search">http://vaadin.com/nexus/#nexus-search</link>
tells us:</para>
<programlisting language="none">&lt;dependency&gt;
&lt;groupId&gt;com.vaadin&lt;/groupId&gt; &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
&lt;artifactId&gt;vaadin-cdi&lt;/artifactId&gt; &lt;artifactId&gt;vaadin-cdi&lt;/artifactId&gt;
&lt;version&gt;1.0.2&lt;/version&gt; &lt;version&gt;1.0.2&lt;/version&gt;
&lt;/dependency&gt;</programlisting> &lt;/dependency&gt;</programlisting>
</glossdef>
</glossentry>
<glossentry>
<glossterm>Jetty configuration</glossterm>
<glossdef>
<para>The jetty plugin searches for source code changes. You may
want to adjust its scan interval in
<filename>pom.xml</filename>:</para>
<programlisting language="none">&lt;plugin&gt;
&lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
&lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
&lt;configuration&gt;
<emphasis role="bold">&lt;scanIntervalSeconds&gt;2&lt;/scanIntervalSeconds&gt;</emphasis>
&lt;/configuration&gt;
&lt;/plugin&gt;</programlisting>
</glossdef>
</glossentry>
</glosslist>
</section>
<section xml:id="sda1SectVaadinTips">
<title><productname>Vaadin</productname> related hints</title>
<orderedlist>
<listitem>
<para/>
</listitem>
<listitem>
<para/>
</listitem>
</orderedlist>
</section> </section>
</chapter> </chapter>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.hdm-stuttgart.mi</groupId> <groupId>de.hdm-stuttgart.mi</groupId>
<artifactId>company</artifactId> <artifactId>company</artifactId>
<version>1.0</version> <version>1.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Company</name> <name>Company</name>
<url>http://www.mi.hdm-stuttgart.de/freedocs</url> <url>http://www.mi.hdm-stuttgart.de/freedocs</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> <vaadin.version>7.2.0</vaadin.version>
<vaadin.jpacontainer.version>3.2.0</vaadin.jpacontainer.version>
<build> </properties>
<plugins>
<plugin> <build>
<groupId>org.apache.maven.plugins</groupId> <plugins>
<artifactId>maven-compiler-plugin</artifactId> <plugin>
<version>3.2</version> <groupId>org.apache.maven.plugins</groupId>
<configuration> <artifactId>maven-compiler-plugin</artifactId>
<source>1.8</source> <version>3.2</version>
<target>1.8</target> <configuration>
</configuration> <source>1.8</source>
</plugin> <target>1.8</target>
</configuration>
<plugin> </plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <plugin>
<version>2.10.1</version> <groupId>org.apache.maven.plugins</groupId>
<configuration> <artifactId>maven-javadoc-plugin</artifactId>
<linksource>true</linksource> <version>2.10.1</version>
</configuration> <configuration>
</plugin> <linksource>true</linksource>
</configuration>
<plugin> </plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <plugin>
<version>2.5</version> <groupId>org.apache.maven.plugins</groupId>
</plugin> <artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<plugin> </plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId> <plugin>
<version>2.5.2</version> <groupId>org.apache.maven.plugins</groupId>
</plugin> <artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<plugin> </plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <plugin>
<version>2.5</version> <groupId>org.apache.maven.plugins</groupId>
</plugin> <artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
</plugins> </plugin>
<plugin>
</build> <groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<dependencies> <configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
<dependency> </configuration>
<groupId>org.hibernate</groupId> </plugin>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.0.0.CR1</version> </plugins>
</dependency>
</build>
<dependency> <repositories>
<groupId>org.hibernate.javax.persistence</groupId> <repository>
<artifactId>hibernate-jpa-2.1-api</artifactId> <id>EclipseLink Repo</id>
<version>1.0.0.Final</version> <url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
</dependency> </repository>
<repository>
<dependency> <id>vaadin-addons</id>
<groupId>org.hibernate</groupId> <url>http://maven.vaadin.com/vaadin-addons</url>
<artifactId>hibernate-c3p0</artifactId> </repository>
<version>5.0.0.CR1</version> <repository>
</dependency> <id>vaadin-snapshots</id>
<name>Vaadin snapshot repository</name>
<dependency> <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<groupId>mysql</groupId> </repository>
<artifactId>mysql-connector-java</artifactId> </repositories>
<version>5.1.34</version> <dependencies>
</dependency> <dependency>
<groupId>com.vaadin</groupId>
<dependency> <artifactId>vaadin-server</artifactId>
<groupId>junit</groupId> <version>${vaadin.version}</version>
<artifactId>junit</artifactId> </dependency>
<version>4.12</version> <dependency>
<scope>test</scope> <groupId>com.vaadin</groupId>
</dependency> <artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
<dependency> </dependency>
<groupId>org.apache.logging.log4j</groupId> <dependency>
<artifactId>log4j-api</artifactId> <groupId>com.vaadin</groupId>
<version>2.1</version> <artifactId>vaadin-themes</artifactId>
</dependency> <version>${vaadin.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>javax.servlet</groupId>
<artifactId>log4j-core</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>2.1</version> <version>3.1.0</version>
</dependency> <scope>provided</scope>
</dependency>
</dependencies>
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>jpacontainer</artifactId>
<version>${vaadin.jpacontainer.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.0.0.CR1</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>5.0.0.CR1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project> </project>
...@@ -15,6 +15,7 @@ import javax.persistence.UniqueConstraint; ...@@ -15,6 +15,7 @@ import javax.persistence.UniqueConstraint;
@Table( @Table(
uniqueConstraints= {@UniqueConstraint(columnNames={"email"})} uniqueConstraints= {@UniqueConstraint(columnNames={"email"})}
) )
@SuppressWarnings("javadoc")
public class Employee { public class Employee {
protected Employee(){} protected Employee(){}
......
...@@ -11,17 +11,16 @@ import javax.persistence.OneToMany; ...@@ -11,17 +11,16 @@ import javax.persistence.OneToMany;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.Cascade;
@Entity @Entity
@Table( @Table(
uniqueConstraints= {@UniqueConstraint(columnNames={"name"})} uniqueConstraints= {@UniqueConstraint(columnNames={"name"})}
) )
@SuppressWarnings("javadoc")
public class Project { public class Project {
protected Project(){} protected Project(){}
public Project(final String name){ public Project(final String name){
this.name = name; this.name = name;
} }
......
...@@ -14,6 +14,7 @@ import javax.persistence.UniqueConstraint; ...@@ -14,6 +14,7 @@ import javax.persistence.UniqueConstraint;
@Table( @Table(
uniqueConstraints= {@UniqueConstraint(columnNames={"project", "employee"})} uniqueConstraints= {@UniqueConstraint(columnNames={"project", "employee"})}
) )
@SuppressWarnings("javadoc")
public class WorksFor { public class WorksFor {
protected WorksFor (){} protected WorksFor (){}
......
package de.hdm_stuttgart.mi.company.ui;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Title;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
/**
* Starting example
*
*/
@Title("Intro")
@Theme("valo")
public class HelloUi extends UI {
private static final long serialVersionUID = -307591917714387247L;
@Override
protected void init(VaadinRequest request) {
// The root of the component hierarchy
VerticalLayout content = new VerticalLayout();
content.setSizeFull(); // Use entire window
setContent(content); // Attach to the UI
// Add some component
content.addComponent(new Label("Hello!"));
// Layout inside layout
HorizontalLayout hor = new HorizontalLayout();
hor.setSizeFull(); // Use all available space
// // Couple of horizontally laid out components
// Tree tree = new Tree("My Tree",
// TreeExample.createTreeContent());
// hor.addComponent(tree);
//
// Table table = new Table("My Table",
// TableExample.generateContent());
// table.setSizeFull();
// hor.addComponent(table);
// hor.setExpandRatio(table, 1); // Expand to fill
content.addComponent(hor);
content.setExpandRatio(hor, 1); // Expand to fill
}
/** Deployed as a Servlet or Portlet.
*
* You can specify additional servlet parameters like the URI and UI
* class name and turn on production mode when you have finished developing the application.
*/
@WebServlet(urlPatterns = "/*")
@VaadinServletConfiguration(ui = HelloUi.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {
/**
*
*/
private static final long serialVersionUID = -2771410633323765889L;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment