Revision 192

View differences:

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

  
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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
	<modelVersion>4.0.0</modelVersion>
5
	<groupId>org.gvsig</groupId>
6
	<artifactId>org.gvsig.scripting.app</artifactId>
7
	<packaging>pom</packaging>
8
	<version>1.0.0-SNAPSHOT</version>
9
	<name>org.gvsig.scripting.app</name>
10
	<description>Extension of the fortunecookies example project</description>
11
	<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.scripting/${pom.version}</url>
12
	<parent>
13
		<groupId>org.gvsig</groupId>
14
		<artifactId>org.gvsig.maven.base.extension.pom</artifactId>
15
		<version>1.0.4</version>
16
	</parent>
17

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

  
24
	<developers>
25
		<developer>
26
			<id>jjdelcerro</id>
27
			<name>Joaqu?n Jos? del Cerro</name>
28
			<email>jjdelcerro@gvsig.org</email>
29
			<roles>
30
				<role>Architect</role>
31
				<role>Developer</role>
32
			</roles>
33
		</developer>
34
		<developer>
35
			<id>jbadia</id>
36
			<name>Jos? Bad?a</name>
37
			<email>badia_jos@gva.es</email>
38
			<roles>
39
				<role>Developer</role>
40
			</roles>
41
		</developer>
42
	</developers>
43
	
44
	<distributionManagement>
45
		<site>
46
			<id>gvsig-repository</id>
47
			<url>scp://shell.forge.osor.eu/home/groups/gvsig-desktop/www/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.scripting/${pom.version}</url>
48
		</site>
49
	</distributionManagement>
50
	<repositories>
51
		<repository>
52
			<id>gvsig-public-http-repository</id>
53
			<name>gvSIG maven public HTTP repository</name>
54
			<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository</url>
55
			<releases>
56
				<enabled>true</enabled>
57
				<updatePolicy>daily</updatePolicy>
58
				<checksumPolicy>warn</checksumPolicy>
59
			</releases>
60
			<snapshots>
61
				<enabled>true</enabled>
62
				<updatePolicy>daily</updatePolicy>
63
				<checksumPolicy>warn</checksumPolicy>
64
			</snapshots>
65
		</repository>
66
	</repositories>	
67
	<build>
68
		<plugins>
69
			<plugin>
70
				<groupId>org.apache.maven.plugins</groupId>
71
				<artifactId>maven-release-plugin</artifactId>
72
				<configuration>
73
					<tagBase>https://svn.forge.osor.eu/svn/gvsig-fortunecookies/org.gvsig.scripting/library/tags</tagBase>
74
				</configuration>
75
			</plugin>
76
		</plugins>
77
	</build>
78
	<dependencies>
79
		<dependency>
80
			<groupId>org.gvsig</groupId>
81
			<artifactId>org.gvsig.andami</artifactId>
82
			<version>2.0-SNAPSHOT</version>
83
		</dependency>
84
		<dependency>
85
			<groupId>org.gvsig</groupId>
86
			<artifactId>org.gvsig.tools.lib</artifactId>
87
			<version>2.1.0-SNAPSHOT</version>
88
		</dependency>	
89
		<dependency>
90
	      <groupId>org.gvsig</groupId>
91
	      <artifactId>org.gvsig.about.api</artifactId>
92
	      <version>1.0-SNAPSHOT</version>
93
	    </dependency>
94
		<dependency>
95
	      <groupId>org.gvsig</groupId>
96
	      <artifactId>org.gvsig.scripting.lib.api</artifactId>
97
	      <version>1.0-SNAPSHOT</version>
98
	    </dependency>
99
	    <dependency>
100
	      <groupId>org.gvsig</groupId>
101
	      <artifactId>org.gvsig.scripting.swing.api</artifactId>
102
	      <version>1.0-SNAPSHOT</version>
103
	    </dependency>
104
	    <dependency>
105
	      <groupId>org.gvsig</groupId>
106
	      <artifactId>org.gvsig.scripting.lib.impl</artifactId>
107
	      <version>1.0-SNAPSHOT</version>
108
	    </dependency>
109
	    <dependency>
110
	      <groupId>org.gvsig</groupId>
111
	      <artifactId>org.gvsig.scripting.swing.impl</artifactId>
112
	      <version>1.0-SNAPSHOT</version>
113
	    </dependency>
114
	</dependencies>
115
	
116
  <modules>
117
    <module>org.gvsig.scripting.app.extension</module>
118
  </modules>
119

  
120
</project>
0 121

  
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

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

  
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
	<dependencySets>
15
		<dependencySet>
16
			<outputDirectory>${extension.install.dir.name}/${library-dir}
17
			</outputDirectory>
18
			<includes>
19
				<include>org.gvsig:org.gvsig.scripting.app.extension</include>
20
				<include>org.ini4j:ini4j</include>
21
				<include>rhino:js</include>
22
				<include>thinlet:thinlet</include>
23
				<include>org.python:jython</include>
24
				<include>org.apache.bsf:bsf-all</include>
25
				<include>org.gvsig:org.gvsig.about.api</include>
26
				<include>org.gvsig:org.gvsig.scripting.thing</include>
27
				<include>org.gvsig:org.gvsig.scripting.lib.api</include>
28
				<include>org.gvsig:org.gvsig.scripting.swing.api</include>
29
				<include>org.gvsig:org.gvsig.scripting.lib.impl</include>
30
				<include>org.gvsig:org.gvsig.scripting.swing.impl</include>
31
			</includes>
32
		</dependencySet>
33
	</dependencySets>
34
</assembly>
0 35

  
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

  
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

  
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
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
import org.gvsig.tools.dynobject.DynObject;
34
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
35
import org.gvsig.tools.service.ServiceException;
36

  
37
public class ScriptingExtension extends Extension {
38

  
39
	static ScriptingUIManager uimanager;
40
		
41
	public void execute(String actionCommand) {
42

  
43
		org.apache.log4j.BasicConfigurator.configure();
44

  
45
		new DefaultLibrariesInitializer().fullInitialize();
46
				
47
		//  Asignamos el locator e iniciamos la instancia
48
		uimanager = ScriptingSwingLocator.getUIManager();
49
		final ScriptingManager manager = uimanager.getManager();
50
		
51
		// Ejemplo de mecanismo de registro de paquetes para la Browser del Sistema
52
		/*URL u = Main.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts/");
53
		File f = new File(u.getPath());
54
		manager.registerSystemFolder("Tests", f);
55
		
56

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

  
103
		frame.setContentPane(panel);
104

  
105
		//Display the window.
106
		frame.pack();
107
		frame.setVisible(true);
108
	}
109
	
110
	
111
	public void initialize() {
112
		// Do nothing
113

  
114
	}
115

  
116
	public boolean isEnabled() {
117
		return true;
118
	}
119

  
120
	public boolean isVisible() {
121
		return true;
122
	}
123

  
124
}
0 125

  
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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
	<modelVersion>4.0.0</modelVersion>
5
	<groupId>org.gvsig</groupId>
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

  
15
</project>
0 16

  

Also available in: Unified diff