Skip to content
This repository has been archived by the owner on May 31, 2018. It is now read-only.

Commit

Permalink
Legacy portage
Browse files Browse the repository at this point in the history
  • Loading branch information
jreznot committed Jul 3, 2013
1 parent 7335f9c commit 532aad4
Show file tree
Hide file tree
Showing 8 changed files with 233 additions and 72 deletions.
2 changes: 1 addition & 1 deletion WebContent/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<description>
Vaadin application class to start</description>
<param-name>application</param-name>
<param-value>org.vaadin.applet.sample.AppletIntegrationSampleApplication</param-value>
<param-value>org.vaadin.applet.sample.AppletIntegrationSampleUI</param-value>
</init-param>
<init-param>
<description>
Expand Down
170 changes: 170 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.haulmont.thirdparty</groupId>
<artifactId>appletintegration</artifactId>
<packaging>jar</packaging>
<version>1.2.9</version>
<name>Vaadin AppletIntegration Addon</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>7.1.0</vaadin.version>
<vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
<jdkVersion>1.7</jdkVersion>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${jdkVersion}</source>
<target>${jdkVersion}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifestFile>WebContent/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/WebContent/VAADIN/widgetsets</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<configuration>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<webappDirectory>${basedir}/WebContent/VAADIN/widgetsets
</webappDirectory>
<hostedWebapp>${basedir}/WebContent/VAADIN/widgetsets
</hostedWebapp>
<noServer>true</noServer>
<draftCompile>false</draftCompile>
<compileReport>true</compileReport>
<style>OBF</style>
<strict>true</strict>
<runTarget>http://localhost:8080/</runTarget>
</configuration>
<executions>
<execution>
<configuration>
</configuration>
<goals>
<goal>resources</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<webAppSourceDirectory>${basedir}/WebContent</webAppSourceDirectory>
<webAppConfig>
<baseResource implementation="org.mortbay.resource.ResourceCollection">
<resourcesAsCSV>${basedir}/WebContent</resourcesAsCSV>
</baseResource>
</webAppConfig>
</configuration>
</plugin>
</plugins>
</build>
</project>
9 changes: 3 additions & 6 deletions src/org/vaadin/applet/AbstractVaadinApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import java.lang.reflect.Method;
import java.util.Locale;

import com.vaadin.terminal.StreamVariable;

/**
* This class can be used as base to implement Java Applets that integrate to
* Vaadin application.
Expand Down Expand Up @@ -78,7 +76,7 @@ private void setAction(String submitAction) {
* Submit actionUrl can be used to post multipart data
* back to the Vaadin server-side application.
*
* Note: This is not by the AppletIntegration automatically. It must be subclassed and a variable named "actionUrl" must be added to paintContent pointing to the {@link StreamVariable}.
* Note: This is not by the AppletIntegration automatically. It must be subclassed and a variable named "actionUrl" must be added to paintContent pointing to the {@link com.vaadin.server.StreamVariable}.
*
* @return
*/
Expand All @@ -89,7 +87,7 @@ protected String getActionUrl() {
/**
* Set the id of the applet in DOM.
*
* @param paintableId
* @param appletId
*/
private void setAppletId(String appletId) {
this.appletId = appletId;
Expand Down Expand Up @@ -128,7 +126,7 @@ protected String getPaintableId() {
/**
* Set the application session cookie. Called from init.
*
* @param appUrl
* @param appSessionCookie
*/
private void setApplicationSessionCookie(String appSessionCookie) {
sessionCookie = appSessionCookie;
Expand Down Expand Up @@ -488,7 +486,6 @@ public boolean isDebug() {
* second thread (with applet's permission) to execute the command.
*
* @param command
* @param params
*/
public void execute(String command) {
execute(command, null);
Expand Down
46 changes: 15 additions & 31 deletions src/org/vaadin/applet/AppletIntegration.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
package org.vaadin.applet;

import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
import com.vaadin.server.VaadinSession;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.LegacyComponent;
import org.vaadin.applet.client.ui.VAppletIntegration;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.vaadin.applet.client.ui.VAppletIntegration;

import com.vaadin.Application;
import com.vaadin.service.ApplicationContext;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.gwt.server.PortletApplicationContext;
import com.vaadin.terminal.gwt.server.WebApplicationContext;
import com.vaadin.ui.AbstractComponent;

/**
* Server side component for the VAppletIntegration widget.
*/
@com.vaadin.ui.ClientWidget(org.vaadin.applet.client.ui.VAppletIntegration.class)
public class AppletIntegration extends AbstractComponent {
public class AppletIntegration extends AbstractComponent implements LegacyComponent {

private static final long serialVersionUID = 6061722679712017720L;

Expand All @@ -34,7 +30,6 @@ public class AppletIntegration extends AbstractComponent {

@Override
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);

// Applet class
if (appletClass == null) {
Expand Down Expand Up @@ -94,16 +89,7 @@ public void paintContent(PaintTarget target) throws PaintException {
* @return
*/
protected String getHttpSessionId() {
Application app = getApplication();
if (app != null) {
ApplicationContext ctx = app.getContext();
if (ctx instanceof WebApplicationContext) {
return ((WebApplicationContext)ctx).getHttpSession().getId();
} else if (ctx instanceof PortletApplicationContext) {
return ((PortletApplicationContext)ctx).getHttpSession().getId();
}
}
return "";
return VaadinSession.getCurrent().getSession().getId();
}

/**
Expand Down Expand Up @@ -146,8 +132,6 @@ protected void setAppletClass(String appletClass) {
*
* This method is protected so that overriding classes can publish it if
* needed.
*
* @param appletClass
*/
protected String getAppletClass() {
return appletClass;
Expand All @@ -159,7 +143,7 @@ protected String getAppletClass() {
* This method is protected so that overriding classes can publish it if
* needed.
*
* @param appletClass
* @param appletArchives
*/
protected void setAppletArchives(List<String> appletArchives) {
this.appletArchives = appletArchives;
Expand All @@ -170,8 +154,6 @@ protected void setAppletArchives(List<String> appletArchives) {
*
* This method is protected so that overriding classes can publish it if
* needed.
*
* @param appletClass
*/
protected List<String> getAppletArchives() {
return appletArchives;
Expand Down Expand Up @@ -213,8 +195,6 @@ protected void setAppletParams(String paramName, String paramValue) {
*
* This method is protected so that overriding classes can publish it if
* needed.
*
* @param appletClass
*/
protected Map<String, String> getAppletParams() {
return Collections.unmodifiableMap(appletParams);
Expand Down Expand Up @@ -270,4 +250,8 @@ public String getName() {
return name;
}

}
@Override
public void changeVariables(Object o, Map<String, Object> stringObjectMap) {

}
}
8 changes: 4 additions & 4 deletions src/org/vaadin/applet/AppletintegrationWidgetset.gwt.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
<inherits name="com.vaadin.DefaultWidgetSet" />

<!--
Uncomment the following to compile the widgetset for one browser only.
Expand All @@ -18,5 +19,4 @@
Google Chrome.
-->
<!-- <set-property name="user.agent" value="gecko"/> -->

</module>
</module>
26 changes: 26 additions & 0 deletions src/org/vaadin/applet/client/ui/AppletIntegrationConnector.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.vaadin.applet.client.ui;

import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.Paintable;
import com.vaadin.client.UIDL;
import com.vaadin.client.ui.AbstractComponentConnector;
import com.vaadin.shared.ui.Connect;
import org.vaadin.applet.AppletIntegration;

/**
* @author artamonov
* @version $Id$
*/
@Connect(AppletIntegration.class)
public class AppletIntegrationConnector extends AbstractComponentConnector implements Paintable {

@Override
public VAppletIntegration getWidget() {
return (VAppletIntegration) super.getWidget();
}

@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
getWidget().updateFromUIDL(uidl, client);
}
}
Loading

0 comments on commit 532aad4

Please sign in to comment.