Commit ada8f7f9 authored by andypower's avatar andypower

ADD Upgrade to GWT 2.7.0

REF removed deprecated script tags on gwt.xml files
ADD injected resource script from source code
parent d82dced6
/target/
\ No newline at end of file
......@@ -5,7 +5,7 @@
<groupId>org.geosdi</groupId>
<artifactId>geoplatform-resources</artifactId>
<version>1.2.12</version>
<version>1.2.12-gwt2.7.x</version>
<packaging>jar</packaging>
<name>Geo-Platform :: == OpenLayers 1.2.12 Resources Module</name>
......@@ -29,6 +29,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gwtVersion>2.7.0</gwtVersion>
</properties>
<developers>
......@@ -42,6 +43,17 @@
<role>Project Management Committee (PMC) Member</role>
</roles>
</developer>
<developer>
<name>Nazzareno Sileno</name>
<id>nazzareno.sileno</id>
<email>nazzareno.sileno@geosdi.org</email>
<organization>geoSDI</organization>
<roles>
<role>Java Developer</role>
<role>Project Management Committee (PMC) Member</role>
</roles>
<timezone>+1</timezone>
</developer>
</developers>
<repositories>
......@@ -77,7 +89,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version>
<version>${gwtVersion}</version>
<executions>
<!-- GWT version detected from dependencyManagement -->
<execution>
......@@ -88,16 +100,66 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
<!-- TODO: the resources stuff hardcodes paths to source + test directories,
we should be able to use some properties here -->
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<include>**/*.txt</include>
<include>**/*.sql</include>
<include>**/*.html</include>
<include>**/*.xml</include>
<include>**/*.utf</include>
<include>**/*.properties</include>
<include>**/*.serialized</include>
<include>**/*.xsd</include>
<include>META-INF/*.jai</include>
<include>META-INF/mailcap</include>
<include>META-INF/services/**</include>
<include>applicationContext.xml</include>
<include>**/*.ftl</include>
<include>**/*.css</include>
<include>**/*.js</include>
<include>**/*.png</include>
<include>**/*.gif</include>
<include>**/*.sld</include>
<include>**/*.ico</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>2.4</version>
<version>2.9</version>
</extension>
</extensions>
</build>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
</dependency>
</dependencies>
</project>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.geosdi.geoplatform.gui.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.HeadElement;
import com.google.gwt.dom.client.ScriptElement;
import org.geosdi.geoplatform.gui.client.resources.OpenLayersResources;
/**
* @author Nazzareno Sileno - CNR IMAA geoSDI Group
* @email nazzareno.sileno@geosdi.org
*/
public class GWTOLResources implements EntryPoint {
private static HeadElement head;
public void onModuleLoad() {
inject(OpenLayersResources.RESOURCES.proj4jsCompressed().getText());
inject(OpenLayersResources.RESOURCES.tmerc().getText());
inject(OpenLayersResources.RESOURCES.merc().getText());
inject(OpenLayersResources.RESOURCES.utm().getText());
// inject(OpenLayersResources.RESOURCES.EPSG4326().getText());
inject(OpenLayersResources.RESOURCES.EPSG900913().getText());
inject(OpenLayersResources.RESOURCES.EPSG3857().getText());
}
/**
* <p>
* Create
* {@code <script type="text/javascript" language="javascript">...</script>}
* element in the Document Header. </p>
*
* @param javascript
*/
public static void inject(String javascript) {
assert (javascript != null && !javascript.equals("")) : "Javascript must not be null or Empty String";
HeadElement head = getHead();
ScriptElement element = createScriptElement();
element.setText(javascript);
head.appendChild(element);
}
public static void inject(String... javascripts) {
assert javascripts != null : "The element passed must not be null";
for (String javascript : javascripts) {
inject(javascript);
}
}
protected static HeadElement getHead() {
if (head == null) {
Element element = Document.get().getElementsByTagName("head").getItem(
0);
assert element != null : "The host HTML page does not have a <head> element"
+ " which is required by GPAbstractInjector";
head = HeadElement.as(element);
}
return head;
}
protected static ScriptElement createScriptElement() {
ScriptElement script = Document.get().createScriptElement();
script.setAttribute(
ScriptKeywordEnum.SCRIPT_LANGUAGE.getValue().getKey(),
ScriptKeywordEnum.SCRIPT_LANGUAGE.getValue().getValue());
script.setAttribute(
ScriptKeywordEnum.SCRIPT_TYPE.getValue().getKey(),
ScriptKeywordEnum.SCRIPT_TYPE.getValue().getValue());
script.setAttribute(
ScriptKeywordEnum.SCRIPT_CHARSET.getValue().getKey(),
ScriptKeywordEnum.SCRIPT_CHARSET.getValue().getValue());
return script;
}
}
/**
*
* geo-platform
* Rich webgis framework
* http://geo-platform.org
* ====================================================================
*
* Copyright (C) 2008-2014 geoSDI Group (CNR IMAA - Potenza - ITALY).
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. This program is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. You should have received a copy of the GNU General
* Public License along with this program. If not, see http://www.gnu.org/licenses/
*
* ====================================================================
*
* Linking this library statically or dynamically with other modules is
* making a combined work based on this library. Thus, the terms and
* conditions of the GNU General Public License cover the whole combination.
*
* As a special exception, the copyright holders of this library give you permission
* to link this library with independent modules to produce an executable, regardless
* of the license terms of these independent modules, and to copy and distribute
* the resulting executable under terms of your choice, provided that you also meet,
* for each linked independent module, the terms and conditions of the license of
* that module. An independent module is a module which is not derived from or
* based on this library. If you modify this library, you may extend this exception
* to your version of the library, but you are not obligated to do so. If you do not
* wish to do so, delete this exception statement from your version.
*/
package org.geosdi.geoplatform.gui.client;
/**
* @author Nazzareno Sileno - CNR IMAA geoSDI Group
* @email nazzareno.sileno@geosdi.org
*/
public class ScriptKeyword {
private String key;
private String value;
public ScriptKeyword(String theKey, String theValue) {
this.key = theKey;
this.value = theValue;
}
/**
* @return the key
*/
public String getKey() {
return key;
}
/**
* @return the value
*/
public String getValue() {
return value;
}
@Override
public int hashCode() {
int hash = 3;
hash = 37 * hash + (this.key != null ? this.key.hashCode() : 0);
hash = 37 * hash + (this.value != null ? this.value.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ScriptKeyword other = (ScriptKeyword) obj;
if ((this.key == null) ? (other.key != null) : !this.key.equals(other.key)) {
return false;
}
if ((this.value == null) ? (other.value != null) : !this.value.equals(other.value)) {
return false;
}
return true;
}
@Override
public String toString() {
return "ScriptKeyword{ " + "key = " + key + ", value = " + value + '}';
}
}
/**
*
* geo-platform
* Rich webgis framework
* http://geo-platform.org
* ====================================================================
*
* Copyright (C) 2008-2014 geoSDI Group (CNR IMAA - Potenza - ITALY).
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. This program is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. You should have received a copy of the GNU General
* Public License along with this program. If not, see http://www.gnu.org/licenses/
*
* ====================================================================
*
* Linking this library statically or dynamically with other modules is
* making a combined work based on this library. Thus, the terms and
* conditions of the GNU General Public License cover the whole combination.
*
* As a special exception, the copyright holders of this library give you permission
* to link this library with independent modules to produce an executable, regardless
* of the license terms of these independent modules, and to copy and distribute
* the resulting executable under terms of your choice, provided that you also meet,
* for each linked independent module, the terms and conditions of the license of
* that module. An independent module is a module which is not derived from or
* based on this library. If you modify this library, you may extend this exception
* to your version of the library, but you are not obligated to do so. If you do not
* wish to do so, delete this exception statement from your version.
*/
package org.geosdi.geoplatform.gui.client;
/**
* @author Nazzareno Sileno - CNR IMAA geoSDI Group
* @email nazzareno.sileno@geosdi.org
*/
public enum ScriptKeywordEnum {
SCRIPT_TYPE(new ScriptKeyword("type", "text/javascript")),
SCRIPT_LANGUAGE(new ScriptKeyword("language", "javascript")),
SCRIPT_CHARSET(new ScriptKeyword("charset", "UTF-8"));
private ScriptKeyword value;
ScriptKeywordEnum(ScriptKeyword theValue) {
this.value = theValue;
}
/**
* @return the value
*/
public ScriptKeyword getValue() {
return value;
}
}
/**
*
* geo-platform Rich webgis framework http://geo-platform.org
* ====================================================================
*
* Copyright (C) 2008-2014 geoSDI Group (CNR IMAA - Potenza - ITALY).
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version. This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/
*
* ====================================================================
*
* Linking this library statically or dynamically with other modules is making a
* combined work based on this library. Thus, the terms and conditions of the
* GNU General Public License cover the whole combination.
*
* As a special exception, the copyright holders of this library give you
* permission to link this library with independent modules to produce an
* executable, regardless of the license terms of these independent modules, and
* to copy and distribute the resulting executable under terms of your choice,
* provided that you also meet, for each linked independent module, the terms
* and conditions of the license of that module. An independent module is a
* module which is not derived from or based on this library. If you modify this
* library, you may extend this exception to your version of the library, but
* you are not obligated to do so. If you do not wish to do so, delete this
* exception statement from your version.
*/
package org.geosdi.geoplatform.gui.client.resources;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ClientBundle.Source;
import com.google.gwt.resources.client.TextResource;
/**
* @author Nazzareno Sileno - CNR IMAA geoSDI Group
* @email nazzareno.sileno@geosdi.org
*/
public interface OpenLayersResources extends ClientBundle {
public static final OpenLayersResources RESOURCES = GWT.create(OpenLayersResources.class);
@Source(value = "lib/proj4js-compressed.js")
TextResource proj4jsCompressed();
@Source(value = "lib/projCode/tmerc.js")
TextResource tmerc();
@Source(value = "lib/projCode/merc.js")
TextResource merc();
@Source(value = "lib/projCode/utm.js")
TextResource utm();
@Source(value = "lib/defs/EPSG4326.js")
TextResource EPSG4326();
@Source(value = "lib/defs/EPSG900913.js")