You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 12
Next »
- Wählen Sie im Menü File > New > RapidClipse Project.
Geben Sie bei Project name den Namen Ihres Projektes ein.
Optionen:
Der Assistent lädt automatisch alle für ein RapidClipse Projekt benötigten Libraries mit dazugehörigen Dependencies via Maven, u.a. Vaadin und Hibernate, legt ein RapidClipse Projekt an und generiert dazu die Dateien:
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="example"><provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<properties>
<property name="hibernate.archive.autodetection"
value="class, hbm" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.hbm2ddl.auto" value="validate" />
<property name="hibernate.transaction.auto_close_session"
value="false" />
</properties>
</persistence-unit>
</persistence>
pom.xml
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company</groupId>
<artifactId>example</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>ossrh-releases</id>
<url>
https://oss.sonatype.org/content/repositories/releases
</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.xdev-software</groupId>
<artifactId>xdev-server-core</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.xdev-software</groupId>
<artifactId>xdev-server-ui</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<name>Example</name>
</project>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>Example</display-name>
<context-param>
<param-name>persistenceUnit</param-name>
<param-value>example</param-value>
</context-param>
<listener>
<listener-class>com.xdev.communication.XdevHttpSessionListener</listener-class>
</listener>
</web-app>
MainUI.java
package com.company.example.ui;
import com.vaadin.annotations.Push;
import com.vaadin.annotations.Theme;
import com.vaadin.server.VaadinRequest;
import com.xdev.ui.XdevUI;
import com.xdev.ui.navigation.XdevNavigator;
@Push
@Theme("Example")
public class MainUI extends XdevUI {
public MainUI() {
super();
}
/**
* {@inheritDoc}
*/
@Override
public void init(VaadinRequest request) {
this.initUI();
}
/*
* WARNING: Do NOT edit!<br>The content of this method is always regenerated
* by the UI designer.
*/
// <generated-code name="initUI">
private void initUI() {
this.navigator = new XdevNavigator(this, this);
this.navigator.addView("", MainView.class);
this.setSizeFull();
} // </generated-code>
// <generated-code name="variables">
private XdevNavigator navigator; // </generated-code>
}
MainView.java
package com.company.example.ui;
import com.xdev.ui.XdevGridLayout;
import com.xdev.ui.XdevView;
public class MainView extends XdevView {
/**
*
*/
public MainView() {
super();
this.initUI();
}
/*
* WARNING: Do NOT edit!<br>The content of this method is always regenerated
* by the UI designer.
*/
// <generated-code name="initUI">
private void initUI() {
this.gridLayout = new XdevGridLayout();
this.gridLayout.setSizeFull();
this.setContent(this.gridLayout);
this.setSizeFull();
} // </generated-code>
// <generated-code name="variables">
private XdevGridLayout gridLayout; // </generated-code>
}
Servlet.java
package com.company.example.ui;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.xdev.communication.XdevServlet;
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = MainUI.class)
public class Servlet extends XdevServlet {
public Servlet() {
super();
}
}