Revision 245

View differences:

org.gvsig.about/trunk/org.gvsig.scripting.app/distribution/distribution.xml
1
<assembly>
2
</assembly>
0 3

  
org.gvsig.about/trunk/org.gvsig.scripting.app/org.gvsig.scripting.app.extension/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
	<modelVersion>4.0.0</modelVersion>
6
	<artifactId>org.gvsig.scripting.app.extension</artifactId>
7
	<packaging>jar</packaging>
8
	<name>org.gvsig.scripting.app.extension</name>
9
	<parent>
10
		<groupId>org.gvsig</groupId>
11
		<artifactId>org.gvsig.scripting.app</artifactId>
12
		<version>1.0.0-SNAPSHOT</version>
13
	</parent>
14
	<dependencies>
15
		<dependency>
16
			<groupId>org.gvsig</groupId>
17
			<artifactId>org.gvsig.andami</artifactId>
18
		</dependency>
19
		<dependency>
20
			<groupId>org.gvsig</groupId>
21
			<artifactId>org.gvsig.tools.lib</artifactId>
22
		</dependency>
23
		<dependency>
24
			<groupId>org.gvsig</groupId>
25
			<artifactId>org.gvsig.about.api</artifactId>
26
		</dependency>
27
		<dependency>
28
			<groupId>org.gvsig</groupId>
29
			<artifactId>org.gvsig.scripting.lib.api</artifactId>
30
		</dependency>
31
		<dependency>
32
			<groupId>org.gvsig</groupId>
33
			<artifactId>org.gvsig.scripting.swing.api</artifactId>
34
		</dependency>
35
		<dependency>
36
			<groupId>org.gvsig</groupId>
37
			<artifactId>org.gvsig.scripting.lib.impl</artifactId>
38
		</dependency>
39
		<dependency>
40
			<groupId>org.gvsig</groupId>
41
			<artifactId>org.gvsig.scripting.swing.impl</artifactId>
42
		</dependency>
43
	</dependencies>
44

  
45
	<profiles>
46
		<profile>
47
			<id>create-installer</id>
48
			<build>
49
				<plugins>
50
					<plugin>
51
						<groupId>org.gvsig</groupId>
52
						<artifactId>org.gvsig.installer.maven</artifactId>
53
						<configuration>
54
							<javaVM>j1_6</javaVM>
55
						</configuration>
56
					</plugin>
57
				</plugins>
58
			</build>
59
		</profile>
60
	</profiles>
61
</project>
0 62

  
org.gvsig.about/trunk/org.gvsig.scripting.app/org.gvsig.scripting.app.extension/distribution/distribution.xml
1
<assembly>
2
	<id>distribution</id>
3
	<formats>
4
		<format>dir</format>
5
	</formats>
6
	<fileSets>
7
		<!-- Estructure for the extension -->
8
		<fileSet>
9
			<directory>src/main/resources</directory>
10
			<outputDirectory>${extension.install.dir.name}
11
			</outputDirectory>
12
		</fileSet>
13
	</fileSets>
14
	<files>
15
		<file>
16
			<source>package.info</source>
17
			<outputDirectory>${extension.install.dir.name}
18
			</outputDirectory>
19
		</file>
20
	</files>
21
	<dependencySets>
22
		<dependencySet>
23
			<outputDirectory>${extension.install.dir.name}/${library-dir}
24
			</outputDirectory>
25
			<includes>
26
				<include>org.gvsig:org.gvsig.scripting.app.extension</include>
27
				<!-- Only needed if we want to support Java 1.5
28
				<include>org.apache.bsf:bsf-api</include>
29
				-->
30
				<include>org.ini4j:ini4j</include>
31
				<include>org.codehaus.groovy:groovy-all</include>
32
				<!--
33
				JRuby doesn't work by default on gvSIG, maybe the problems are 
34
				related to the PluginClassLoader or to the way JRuby sets its
35
				internal classpath, so maybe setting the system property
36
				"org.jruby.embed.class.path" may solve the problem.
37
				See:
38
				http://kenai.com/projects/jruby/pages/RedBridge#Class_Path_%28Load_Path%29
39
				<include>org.jruby:jruby</include>
40
				-->
41
				<!-- Already included since Java 1.6
42
				<include>rhino:js</include>
43
				-->
44
				<include>org.python:jython</include>
45
				<include>thinlet:thinlet</include>
46
				<include>org.gvsig:org.gvsig.about.api</include>
47
				<include>org.gvsig:org.gvsig.scripting.thing</include>
48
				<include>org.gvsig:org.gvsig.scripting.lib.api</include>
49
				<include>org.gvsig:org.gvsig.scripting.swing.api</include>
50
				<include>org.gvsig:org.gvsig.scripting.lib.impl</include>
51
				<include>org.gvsig:org.gvsig.scripting.swing.impl</include>
52
			</includes>
53
		</dependencySet>
54
	</dependencySets>
55
</assembly>
0 56

  
org.gvsig.about/trunk/org.gvsig.scripting.app/org.gvsig.scripting.app.extension/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Tue Jan 11 13:45:07 CET 2011
3
buildNumber=1
org.gvsig.about/trunk/org.gvsig.scripting.app/org.gvsig.scripting.app.extension/src/main/resources/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="org.gvsig.app" />
4
	<resourceBundle name="text"/>
5
	<libraries library-dir="lib"/>
6
	<extensions>
7
		<extension class-name="org.gvsig.scripting.app.extension.ScriptingExtension"
8
			description="Extensi?n para el manejo de scripts en gvSIG."
9
			active="true"
10
			priority="1">
11
			<menu text="tools/Scripting/Scripting Launcher" 
12
				action-command="Launcher" icon="images/centerviewtopoint.png"
13
				position="1"/>
14
			<menu text="tools/Scripting/Scripting Composer" 
15
				action-command="Composer" icon="images/centerviewtopoint.png"
16
				position="2"/>
17
			<menu text="tools/Scripting/Scripting Installer" 
18
				action-command="Installer" icon="images/centerviewtopoint.png" 
19
				position="3"/>
20
			<tool-bar name="Scripting" position="5">
21
				<action-tool icon="images/centerviewtopoint.png" tooltip="Script_Launcher"
22
					action-command="Launcher" position="1"/>
23
				<action-tool icon="images/centerviewtopoint.png" tooltip="Script_Composer"
24
					action-command="Composer" position="2"/>
25
				<action-tool icon="images/centerviewtopoint.png" tooltip="Script_Installer"
26
					action-command="Installer" position="3"/>
27
			</tool-bar>
28
		</extension>	
29
	</extensions>
30
</plugin-config>
0 31

  
org.gvsig.about/trunk/org.gvsig.scripting.app/org.gvsig.scripting.app.extension/src/main/resources/build.number
1
#Build Number for ANT. Do not edit!
2
#Tue Apr 28 16:00:47 CEST 2009
3
build.number=2005
org.gvsig.about/trunk/org.gvsig.scripting.app/org.gvsig.scripting.app.extension/src/main/java/org/gvsig/scripting/app/extension/ScriptingExtension.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

  
23
package org.gvsig.scripting.app.extension;
24

  
25
import javax.swing.JFrame;
26
import javax.swing.JLabel;
27
import javax.swing.JPanel;
28

  
29
import org.gvsig.andami.plugins.Extension;
30
import org.gvsig.scripting.ScriptingManager;
31
import org.gvsig.scripting.swing.api.ScriptingSwingLocator;
32
import org.gvsig.scripting.swing.api.ScriptingUIManager;
33

  
34
public class ScriptingExtension extends Extension {
35

  
36
	static ScriptingUIManager uimanager;
37
		
38
	public void execute(String actionCommand) {
39

  
40
		//  Asignamos el locator e iniciamos la instancia
41
		uimanager = ScriptingSwingLocator.getUIManager();
42
		final ScriptingManager manager = uimanager.getManager();
43
		
44
		// Ejemplo de mecanismo de registro de paquetes para la Browser del Sistema
45
		/*URL u = Main.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts/");
46
		File f = new File(u.getPath());
47
		manager.registerSystemFolder("Tests", f);
48

  
49
		uimanager.addUserHelp("es",this.class.getResource("/"));*/
50
		
51
		if(actionCommand.toString().equals("Launcher")){
52
			showLauncher(manager);
53
		} else {
54
			if(actionCommand.toString().equals("Installer")){
55
				showInstaller(manager);
56
			}else{
57
				showComposer(manager);
58
			}
59
		}
60
		
61
	}
62
	
63
	public static void showLauncher(ScriptingManager manager) {
64
		showWindow(uimanager.createLauncher(), "Scripting Launcher");
65
//		JPanel panel = new JPanel();
66
//		JLabel label = new JLabel("Launcher");
67
//		panel.add(label);
68
//		
69
//		showWindow(panel, "Scripting Launcher");
70
		
71
	}
72
	
73
	public static void showComposer(ScriptingManager manager) {
74
		showWindow(uimanager.createComposer(), "Scripting Composer");
75
//		JPanel panel = new JPanel();
76
//		JLabel label = new JLabel("Composer");
77
//		panel.add(label);
78
//		
79
//		showWindow(panel, "Scripting Composer");
80
	}
81
	
82
	public static void showInstaller(ScriptingManager manager) {
83
		JPanel panel = new JPanel();
84
		JLabel label = new JLabel("Installer function under construction");
85
		panel.add(label);
86
		
87
		showWindow(panel, "Scripting Installer");
88
	}
89
	
90
	
91
	public static void showWindow(JPanel panel, String title){
92
		JFrame frame = new JFrame(title);
93
		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
94

  
95
		frame.setContentPane(panel);
96

  
97
		//Display the window.
98
		frame.pack();
99
		frame.setVisible(true);
100
	}
101
	
102
	
103
	public void initialize() {
104
		// Do nothing
105

  
106
	}
107

  
108
	public boolean isEnabled() {
109
		return true;
110
	}
111

  
112
	public boolean isVisible() {
113
		return true;
114
	}
115

  
116
}
0 117

  
org.gvsig.about/trunk/org.gvsig.scripting.app/org.gvsig.scripting.app.extension/src/test/java/org/gvsig/scripting/app/extension/AppTest.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

  
23
package org.gvsig.scripting.app.extension;
24

  
25
import junit.framework.Test;
26
import junit.framework.TestCase;
27
import junit.framework.TestSuite;
28

  
29
/**
30
 * Unit test for simple App.
31
 */
32
public class AppTest 
33
    extends TestCase
34
{
35
    /**
36
     * Create the test case
37
     *
38
     * @param testName name of the test case
39
     */
40
    public AppTest( String testName )
41
    {
42
        super( testName );
43
    }
44

  
45
    /**
46
     * @return the suite of tests being tested
47
     */
48
    public static Test suite()
49
    {
50
        return new TestSuite( AppTest.class );
51
    }
52

  
53
    /**
54
     * Rigourous Test :-)
55
     */
56
    public void testApp()
57
    {
58
        assertTrue( true );
59
    }
60
}
0 61

  
org.gvsig.about/trunk/org.gvsig.scripting.app/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Tue Jan 11 13:45:02 CET 2011
3
buildNumber=1
org.gvsig.about/trunk/org.gvsig.scripting.app/prepare-workspace.xml
1
<project name="org.gvsig.initial.build" default="prepare-workspace">
2
	
3
	<dirname property="org.gvsig.initial.build.basedir" file="${ant.file.org.gvsig.initial.build}"/>
4
	
5
	<property name="workspace.basedir" 
6
			  value="${org.gvsig.initial.build.basedir}/.."/>
7
	<property name="build.basedir" 
8
		      value="${workspace.basedir}/org.gvsig.maven.base.build"
9
		      description="Eclipse workspace location"/>
10
	<property name="build.jar.version" 
11
			 	  value="1.0.4" />
12
	<property name="build.jar.file" 
13
		 	  value="org.gvsig.maven.base.build-${build.jar.version}.jar" />
14
	
15
	<target name="prepare-workspace">
16
		
17
		<mkdir dir="target"/>
18
	
19
		<!-- Get the build jar file -->
20
		<get src="http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" 
21
			 dest="target/${build.jar.file}"
22
			 verbose="true"/>
23
		
24
		<!-- Unzip de build jar file into the workspace root folder -->
25
		<unzip src="target/${build.jar.file}"
26
		       dest="${workspace.basedir}">
27
		    <patternset>
28
		        <exclude name="META-INF/**"/>
29
		    </patternset>
30
		</unzip>
31
		
32
		<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug"/>
33
		
34
		<!-- Copy the maven launchers to the workspace metadata folder -->
35
		<copy todir="${workspace.basedir}/.metadata">
36
		    <fileset dir="${build.basedir}/eclipse-launchers"/>
37
		</copy>
38
		
39
		<!-- Configure the eclipse workspace -->
40
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace"/>
41

  
42
		<!-- Configure the gvSIG profile -->
43
		<ant antfile="${build.basedir}/check-gvsig-profile.xml" target="initialize"/>
44

  
45
		<!-- Compile, install and generate eclipse projects -->
46
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse"/>
47
		
48
		<echo>INFORMATION!!!</echo>
49
		<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo>
50
		
51
		<!-- TODO: copiar al proyecto de configuración general -->
52
	</target>
53
 	
54
	<target name="clean">
55
		<delete dir="target"/>
56
	</target>
57

  
58
</project>
0 59

  
org.gvsig.about/trunk/org.gvsig.scripting.app/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
	<modelVersion>4.0.0</modelVersion>
6
	<groupId>org.gvsig</groupId>
7
	<artifactId>org.gvsig.scripting.app</artifactId>
8
	<packaging>pom</packaging>
9
	<version>1.0.0-SNAPSHOT</version>
10
	<name>org.gvsig.scripting.app</name>
11
	<description>Scripting support for gvSIG</description>
12
	<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.scripting.app/${project.version}</url>
13
	<parent>
14
		<groupId>org.gvsig</groupId>
15
		<artifactId>org.gvsig.maven.base.extension.pom</artifactId>
16
		<version>1.0.6-SNAPSHOT</version>
17
	</parent>
18

  
19
	<scm>
20
		<connection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-scripting/trunk</connection>
21
		<developerConnection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-scripting/trunk</developerConnection>
22
		<url>https://forge.osor.eu/plugins/scmsvn/viewcvs.php/trunk/org.gvsig.scripting.app/?root=gvsig-scripting</url>
23
	</scm>
24

  
25
	<developers>
26
		<developer>
27
			<id>jjdelcerro</id>
28
			<name>Joaqu?n Jos? del Cerro</name>
29
			<email>jjdelcerro@gvsig.org</email>
30
			<roles>
31
				<role>Architect</role>
32
				<role>Developer</role>
33
			</roles>
34
		</developer>
35
		<developer>
36
			<id>jbadia</id>
37
			<name>Jos? Bad?a</name>
38
			<email>badia_jos@gva.es</email>
39
			<roles>
40
				<role>Developer</role>
41
			</roles>
42
		</developer>
43
	</developers>
44

  
45
	<distributionManagement>
46
		<site>
47
			<id>gvsig-repository</id>
48
			<url>scp://shell.forge.osor.eu/home/groups/gvsig-desktop/www/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.scripting.app/${project.version}</url>
49
		</site>
50
	</distributionManagement>
51
	<repositories>
52
		<repository>
53
			<id>gvsig-public-http-repository</id>
54
			<name>gvSIG maven public HTTP repository</name>
55
			<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository</url>
56
			<releases>
57
				<enabled>true</enabled>
58
				<updatePolicy>daily</updatePolicy>
59
				<checksumPolicy>warn</checksumPolicy>
60
			</releases>
61
			<snapshots>
62
				<enabled>true</enabled>
63
				<updatePolicy>daily</updatePolicy>
64
				<checksumPolicy>warn</checksumPolicy>
65
			</snapshots>
66
		</repository>
67
	</repositories>
68
	<build>
69
		<plugins>
70
			<plugin>
71
				<groupId>org.apache.maven.plugins</groupId>
72
				<artifactId>maven-release-plugin</artifactId>
73
				<configuration>
74
					<tagBase>https://svn.forge.osor.eu/svn/gvsig-scripting/tags</tagBase>
75
				</configuration>
76
			</plugin>
77
		</plugins>
78
	</build>
79
	<dependencyManagement>
80
		<dependencies>
81
			<dependency>
82
				<groupId>org.gvsig</groupId>
83
				<artifactId>org.gvsig.andami</artifactId>
84
				<version>2.0-SNAPSHOT</version>
85
			</dependency>
86
			<dependency>
87
				<groupId>org.gvsig</groupId>
88
				<artifactId>org.gvsig.tools.lib</artifactId>
89
				<version>2.1.0-SNAPSHOT</version>
90
			</dependency>
91
			<dependency>
92
				<groupId>org.gvsig</groupId>
93
				<artifactId>org.gvsig.about.api</artifactId>
94
				<version>1.0.0-SNAPSHOT</version>
95
			</dependency>
96
			<dependency>
97
				<groupId>org.gvsig</groupId>
98
				<artifactId>org.gvsig.scripting.lib.api</artifactId>
99
				<version>1.0.0-SNAPSHOT</version>
100
			</dependency>
101
			<dependency>
102
				<groupId>org.gvsig</groupId>
103
				<artifactId>org.gvsig.scripting.swing.api</artifactId>
104
				<version>1.0.0-SNAPSHOT</version>
105
			</dependency>
106
			<dependency>
107
				<groupId>org.gvsig</groupId>
108
				<artifactId>org.gvsig.scripting.lib.impl</artifactId>
109
				<version>1.0.0-SNAPSHOT</version>
110
			</dependency>
111
			<dependency>
112
				<groupId>org.gvsig</groupId>
113
				<artifactId>org.gvsig.scripting.swing.impl</artifactId>
114
				<version>1.0.0-SNAPSHOT</version>
115
			</dependency>
116
		</dependencies>
117
	</dependencyManagement>
118
	<modules>
119
		<module>org.gvsig.scripting.app.extension</module>
120
	</modules>
121

  
122
</project>
0 123

  
org.gvsig.about/trunk/org.gvsig.scripting.app/README.txt
1
The first time you checkout the current project to a new workspace, 
2
you have to prepare it to be able to work easily with maven from
3
eclipse itself.
4

  
5
Perform the following steps:
6

  
7
1.- Launch the *prepare-workspace.xml* ant build file. 
8
    You can do it by loading the file into the ant view, 
9
    and running the default task, or right-clicking the 
10
    file from the package explorer or the navigator and
11
    select the option: *Run as > Ant build*. 
12
    
13
2.- Restart eclipse.
14

  
15
3.- Import the subprojects of the project you have just checked out.
16

  
17
Those steps are only needed once per workspace.     
18

  
0 19

  

Also available in: Unified diff