Revision 38757

View differences:

tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/distribution/distribution.xml
1
<assembly>
2
</assembly>
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Tue Aug 14 13:07:23 CEST 2012
3
buildNumber=31
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/.project
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.gvsig.newlayer.app</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
	</buildSpec>
9
	<natures>
10
	</natures>
11
</projectDescription>
0 12

  
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Tue Aug 14 13:07:24 CEST 2012
3
buildNumber=31
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/src/test/resources/README.txt
1
Put into this folder the resources needed by your test classes.
2

  
3
This folder is added to the Tests classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, in this folder you can find an example of log4j configuration,
7
prepared to log messages through the console, so logging works when you
8
run your tests classes.
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	org.gvsig.tools packages.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.tools">
23
		<priority value="DEBUG" />
24
	</category>
25
	<category name="org.gvsig.newlayer">
26
		<priority value="DEBUG" />
27
	</category>
28

  
29
	<!-- 
30
	By default, show only logging messages of INFO level or higher, 
31
	through the previously configured CONSOLE appender. 
32
	-->
33
	<root>
34
		<priority value="INFO" />
35
		<appender-ref ref="CONSOLE" />
36
	</root>
37
</log4j:configuration>
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.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.newlayer.app.extension.NewLayerExtension"
8
			description=""
9
			active="true"
10
			priority="1">
11
			<menu text="View/new_layer"
12
				position="650200000"
13
				action-command="NewLayer"/>				
14
		</extension>		
15
		<!-- <extension class-name="org.gvsig.newlayer.app.extension.ExporttoTableExtension"
16
            description=""
17
            active="true"
18
            priority="1">
19
            <menu text="Tabla/new_layer"
20
                position="50"
21
                action-command="NewLayer"/>             
22
        </extension> -->
23
        <extension class-name="org.gvsig.newlayer.app.extension.NewLayerPreferencesExtension"
24
            description=""
25
            active="true"
26
            priority="1">
27
        </extension>          
28
	</extensions>
29
</plugin-config>
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.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
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/src/main/resources/org/gvsig/newlayer/app/extension/i18n/text.properties
1
add_table_to_project=Desea a?adir la tabla al proyecto?
2
add_table=A?adir tabla
3
newlayer_preferences=Nueva capa
4
newlayer_preferences_panel_description=Marque los formatos de nueva capa que quiera activar o desactivar
5
_New_layer_wizard=Asistente para nueva capa
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/src/main/resources/org/gvsig/newlayer/app/extension/i18n/text_en.properties
1
add_table_to_project=Add the table to the project?
2
add_table=Add table
3
newlayer_preferences=New layer
4
newlayer_preferences_panel_description=Enable or disable new layer formats
5
_New_layer_wizard=New layer wizard
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/src/main/resources/plugin-persistence.def
1
<?xml version="1.0"?>
2
<!--
3
Definitions of plugin persistence org.gvsig.newlayer.app.extension.  
4
 -->
5
<definitions>
6
  <version>1.0.0</version>
7
  <classes>
8
    <class name="org.gvsig.newlayer.app.extension">
9
      <description>Persistence of the NewLayer plugin</description>
10
      <fields>
11
        <field name="enabledProviders" type="Set" classOfItems="java.lang.String" mandatory="false">
12
          <description>List of new layer provider names enabled by the user</description>
13
        </field>
14
        <field name="disabledProviders" type="Set" classOfItems="java.lang.String" mandatory="false">
15
          <description>List of new layer to provider names disabled by the user</description>
16
        </field>
17
      </fields>
18
    </class>
19
  </classes>
20
</definitions>  
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/src/main/java/org/gvsig/newlayer/app/extension/package.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.newlayer package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>NewLayer gvSIG extension</p>
11
	
12
	<p>
13
	Shows NewLayer into gvSIG.
14
	</p>
15

  
16
</body>
17
</html>
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/src/main/java/org/gvsig/newlayer/app/extension/preferences/NewLayerPreferencesPage.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
package org.gvsig.newlayer.app.extension.preferences;
23

  
24
import java.util.HashSet;
25
import java.util.List;
26
import java.util.Set;
27

  
28
import javax.swing.ImageIcon;
29
import javax.swing.JLabel;
30
import javax.swing.JPanel;
31

  
32
import org.gvsig.andami.IconThemeHelper;
33
import org.gvsig.andami.PluginsLocator;
34
import org.gvsig.andami.preferences.AbstractPreferencePage;
35
import org.gvsig.andami.preferences.StoreException;
36
import org.gvsig.i18n.Messages;
37
import org.gvsig.newlayer.NewLayerLocator;
38
import org.gvsig.newlayer.NewLayerManager;
39
import org.gvsig.newlayer.NewLayerProviderFactory;
40
import org.gvsig.newlayer.app.extension.NewLayerPreferencesExtension;
41
import org.gvsig.newlayer.preferences.NewLayerPreferencesComponent;
42
import org.gvsig.tools.dynobject.DynObject;
43

  
44
/**
45
 * NewLayer related preferences page.
46
 * 
47
 * @author gvSIG Team
48
 * @version $Id$
49
 */
50
public class NewLayerPreferencesPage extends AbstractPreferencePage {
51

  
52
    private static final long serialVersionUID = -5751805016601819817L;
53

  
54
//    private ImageIcon icon;
55

  
56
    private NewLayerManager manager;
57

  
58
    private NewLayerPreferencesComponent preferences;
59

  
60
    /**
61
     * Constructor.
62
     */
63
    public NewLayerPreferencesPage() {
64
//        icon = PluginServices.getIconTheme().get("newlayer-properties");
65

  
66
        manager = NewLayerLocator.getManager();
67
        addComponent(new JLabel(
68
            Messages.getText("newlayer_preferences_panel_description")));
69
        preferences = manager.createNewLayerProvidersPreferences();
70
        addComponent(preferences.asJComponent());
71

  
72
        // setParentID("org.gvsig.app.gui.preferencespage.ViewPage");
73
    }
74

  
75
    public String getID() {
76
        return getClass().getName();
77
    }
78

  
79
    public String getTitle() {
80
        return Messages.getText("newlayer_preferences");
81
    }
82

  
83
    public JPanel getPanel() {
84
        return this;
85
    }
86

  
87
    public void initializeValues() {
88
        // Nothing to do
89
    }
90

  
91
    public void initializeDefaults() {
92
        preferences.initializeDefaults();
93
    }
94

  
95
    public ImageIcon getIcon() {
96
        return IconThemeHelper.getImageIcon("newlayer-preferences");
97
    }
98

  
99
    public boolean isValueChanged() {
100
        return preferences.isValueChanged();
101
    }
102

  
103
    @Override
104
    public void storeValues() throws StoreException {
105
        // Update manager values
106
        List<NewLayerProviderFactory> providers = manager.getProviders();
107
        Set<NewLayerProviderFactory> disabledProviders =
108
            preferences.getDisabledProviders();
109
        Set<String> enabledNames = new HashSet<String>();
110
        Set<String> disabledNames =
111
            new HashSet<String>(disabledProviders.size());
112
        for (int i = 0; i < providers.size(); i++) {
113
            NewLayerProviderFactory provider = providers.get(i);
114
            boolean disabled = disabledProviders.contains(provider);
115
            provider.setEnabled(!disabled);
116
            if (disabled) {
117
                disabledNames.add(provider.getName());
118
            } else {
119
                enabledNames.add(provider.getName());
120
            }
121
        }
122
        // Persist them
123
        DynObject preferences =
124
            PluginsLocator.getManager()
125
                .getPlugin("org.gvsig.newlayer.app.extension")
126
                .getPluginProperties();
127
        preferences.setDynValue(
128
            NewLayerPreferencesExtension.PREFERENCE_ENABLED_PROVIDERS,
129
            enabledNames);
130
        preferences.setDynValue(
131
            NewLayerPreferencesExtension.PREFERENCE_DISABLED_PROVIDERS,
132
            disabledNames);
133
    }
134

  
135
    @Override
136
    public void setChangesApplied() {
137
        preferences.setChangesApplied();
138
    }
139

  
140
}
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/src/main/java/org/gvsig/newlayer/app/extension/NewLayerExtension.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
package org.gvsig.newlayer.app.extension;
23

  
24
import org.gvsig.andami.plugins.Extension;
25
import org.gvsig.app.ApplicationLocator;
26
import org.gvsig.app.ApplicationManager;
27
import org.gvsig.app.project.documents.view.ViewDocument;
28
import org.gvsig.app.project.documents.view.ViewManager;
29
import org.gvsig.i18n.Messages;
30
import org.gvsig.newlayer.NewLayerLocator;
31
import org.gvsig.newlayer.NewLayerManager;
32
import org.gvsig.newlayer.NewLayerService;
33
import org.gvsig.newlayer.NewLayerWizard;
34
import org.gvsig.tools.swing.api.ToolsSwingLocator;
35
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
36

  
37
/**
38
 * @author gvSIG Team
39
 * @version $Id$
40
 * 
41
 */
42
public class NewLayerExtension extends Extension {
43
	
44
	private ViewDocument view = null;
45

  
46
	public void initialize() {
47
		
48
	}
49

  
50
	@Override
51
	public void postInitialize() {
52
		super.postInitialize();
53
	}
54

  
55
	public void execute(String actionCommand) {
56
		
57
		ApplicationManager application = ApplicationLocator.getManager();
58
		ViewDocument view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME);
59

  
60
		if (view != null) {
61
			NewLayerManager manager = NewLayerLocator.getManager();
62
			NewLayerService service = manager.createNewLayerService(view.getMapContext());
63
			NewLayerWizard wizard = manager.createNewLayerWizard(service);
64
			
65
			WindowManager windowMgr = ToolsSwingLocator.getWindowManager();
66
			windowMgr.showWindow(
67
			    wizard,
68
			    Messages.getText("_New_layer_wizard"),
69
			    WindowManager.MODE.DIALOG);
70
		}
71
	}
72

  
73
	public boolean isEnabled() {
74
		
75
		ApplicationManager application = ApplicationLocator.getManager();
76
		view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME);
77
		return (view != null);
78
		
79
	}
80

  
81
	public boolean isVisible() {
82
		
83
		ApplicationManager application = ApplicationLocator.getManager();
84
		view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME);
85
		return (view != null);
86
		
87
	}
88
	
89
	public ViewDocument getView() {
90
		return view;
91
	}
92
	
93
}
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.app.extension/src/main/java/org/gvsig/newlayer/app/extension/NewLayerPreferencesExtension.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
package org.gvsig.newlayer.app.extension;
23

  
24
import java.util.Iterator;
25
import java.util.Locale;
26
import java.util.Set;
27

  
28
import org.slf4j.Logger;
29
import org.slf4j.LoggerFactory;
30

  
31
import org.gvsig.andami.IconThemeHelper;
32
import org.gvsig.andami.PluginServices;
33
import org.gvsig.andami.plugins.Extension;
34
import org.gvsig.i18n.Messages;
35
import org.gvsig.newlayer.NewLayerLocator;
36
import org.gvsig.newlayer.NewLayerManager;
37
import org.gvsig.newlayer.NewLayerProviderFactory;
38
import org.gvsig.newlayer.app.extension.preferences.NewLayerPreferencesPage;
39
import org.gvsig.tools.ToolsLocator;
40
import org.gvsig.tools.dynobject.DynObject;
41
import org.gvsig.tools.extensionpoint.ExtensionPoint;
42
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
43
import org.gvsig.tools.service.ServiceException;
44

  
45
/**
46
 * Andami extension to register the NewLayer preferences panel.
47
 * 
48
 * @author gvSIG Team
49
 * @version $Id$
50
 */
51
public class NewLayerPreferencesExtension extends Extension {
52

  
53
    private static final Logger LOG = LoggerFactory
54
        .getLogger(NewLayerPreferencesExtension.class);
55

  
56
    /**
57
     * The name of the preferences property with the names of the hidden
58
     * NewLayerSwingProviderFactory.
59
     */
60
    public static final String PREFERENCE_DISABLED_PROVIDERS =
61
        "disabledProviders";
62
    public static final String PREFERENCE_ENABLED_PROVIDERS =
63
        "enabledProviders";
64

  
65
    public void initialize() {
66
        if (!Messages.hasLocales()) {
67
            Messages.addLocale(Locale.getDefault());
68
        }
69
        Messages.addResourceFamily(
70
            "org.gvsig.newlayer.app.extension.i18n.text",
71
            NewLayerPreferencesExtension.class.getClassLoader(),
72
            NewLayerPreferencesExtension.class.getClass().getName());
73

  
74
        NewLayerManager providerManager = NewLayerLocator.getManager();
75
        // Load from preferences the list of NewLayer Providers to ignore.
76
        DynObject preferences = this.getPlugin().getPluginProperties();
77
        @SuppressWarnings("unchecked")
78
        Set<String> disabledProviders =
79
            (Set<String>) preferences
80
                .getDynValue(PREFERENCE_DISABLED_PROVIDERS);
81
        if (disabledProviders != null) {
82
            for (Iterator<String> iterator = disabledProviders.iterator(); iterator
83
                .hasNext();) {
84
                NewLayerProviderFactory factory;
85
                String providerName = null;
86
                try {
87
                    providerName = iterator.next();
88
                    factory =
89
                        providerManager
90
                            .getNewLayerProviderFactory(providerName);
91
                    providerManager.enableProvider(factory, Boolean.FALSE);
92
                } catch (ServiceException e) {
93
                    LOG.warn("Disabled NewLayer provider " + providerName
94
                        + " is not available", e);
95
                }
96
            }
97
        }
98
        @SuppressWarnings("unchecked")
99
        Set<String> enabledProviders =
100
            (Set<String>) preferences.getDynValue(PREFERENCE_ENABLED_PROVIDERS);
101
        if (enabledProviders != null) {
102
            for (Iterator<String> iterator = enabledProviders.iterator(); iterator
103
                .hasNext();) {
104
                NewLayerProviderFactory factory;
105
                String providerName = null;
106
                try {
107
                    providerName = iterator.next();
108
                    factory =
109
                        providerManager
110
                            .getNewLayerProviderFactory(providerName);
111
                    providerManager.enableProvider(factory, Boolean.TRUE);
112
                } catch (ServiceException e) {
113
                    LOG.warn("Enabled NewLayer provider " + providerName
114
                        + " is not available", e);
115
                }
116
            }
117
        }
118

  
119
        // Register preferences page
120
        ExtensionPointManager extensionPoints =
121
            ToolsLocator.getExtensionPointManager();
122
        ExtensionPoint ep = extensionPoints.add("AplicationPreferences", "");
123

  
124
        IconThemeHelper.registerIcon("preferences", "newlayer-preferences", this);
125
        
126
        ep.append("NewLayerPreferencesPage", "", new NewLayerPreferencesPage());
127
    }
128

  
129
    public void execute(String actionCommand) {
130
        // Nothing to do
131
    }
132

  
133
    public boolean isEnabled() {
134
        return true;
135
    }
136

  
137
    public boolean isVisible() {
138
        return false;
139
    }
140

  
141
}
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.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/maven-v4_0_0.xsd">
5
	<modelVersion>4.0.0</modelVersion>
6
	<artifactId>org.gvsig.newlayer.app.extension</artifactId>
7
	<packaging>jar</packaging>
8
	<name>Tools: New layer</name>
9
	<parent>
10
		<groupId>org.gvsig</groupId>
11
		<artifactId>org.gvsig.newlayer.app</artifactId>
12
		<version>1.0.0-SNAPSHOT</version>
13
	</parent>
14

  
15
	<dependencies>
16
        <dependency>
17
            <groupId>org.gvsig</groupId>
18
            <artifactId>org.gvsig.andami</artifactId>
19
            <scope>compile</scope>
20
        </dependency>
21
		<dependency>
22
			<groupId>org.gvsig</groupId>
23
			<artifactId>org.gvsig.i18n</artifactId>
24
            <scope>compile</scope>
25
		</dependency>
26
		<dependency>
27
			<groupId>org.gvsig</groupId>
28
			<artifactId>org.gvsig.tools.lib</artifactId>
29
			<scope>compile</scope>
30
		</dependency>		
31
		<dependency>
32
			<groupId>org.gvsig</groupId>
33
			<artifactId>org.gvsig.tools.swing.api</artifactId>
34
			<scope>compile</scope>
35
		</dependency>		
36
		<dependency>
37
			<groupId>org.gvsig</groupId>
38
			<artifactId>org.gvsig.ui</artifactId>
39
			<scope>compile</scope>
40
		</dependency>		
41
		<dependency>
42
            <groupId>org.gvsig</groupId>
43
            <artifactId>org.gvsig.projection</artifactId>
44
            <scope>compile</scope>
45
        </dependency>
46
        <dependency>
47
            <groupId>org.gvsig</groupId>
48
            <artifactId>org.gvsig.fmap.mapcontext</artifactId>
49
            <scope>compile</scope>
50
        </dependency>
51
        <dependency>
52
            <groupId>org.gvsig</groupId>
53
            <artifactId>org.gvsig.fmap.dal</artifactId>
54
            <scope>compile</scope>
55
        </dependency>
56
		<dependency>
57
			<groupId>org.gvsig</groupId>
58
			<artifactId>org.gvsig.newlayer.lib.api</artifactId>
59
            <scope>compile</scope>
60
		</dependency>
61
		<dependency>
62
			<groupId>org.gvsig</groupId>
63
			<artifactId>org.gvsig.newlayer.lib.impl</artifactId>
64
            <scope>runtime</scope>
65
		</dependency>
66
	    <dependency>
67
            <groupId>org.gvsig</groupId>
68
            <artifactId>org.gvsig.newlayer.prov.generic</artifactId>
69
            <scope>runtime</scope>
70
        </dependency>
71
        <dependency>
72
            <groupId>org.gvsig</groupId>
73
            <artifactId>org.gvsig.newlayer.prov.file</artifactId>
74
            <scope>runtime</scope>
75
        </dependency>
76
        <dependency>
77
            <groupId>org.gvsig</groupId>
78
            <artifactId>org.gvsig.newlayer.prov.shape</artifactId>
79
            <scope>runtime</scope>
80
        </dependency>
81
        <dependency>
82
            <groupId>org.gvsig</groupId>
83
            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
84
            <scope>compile</scope>
85
        </dependency>   
86
        <dependency>
87
            <groupId>org.gvsig</groupId>
88
            <artifactId>org.gvsig.app</artifactId>
89
            <scope>compile</scope>
90
        </dependency>   
91
	</dependencies>
92
	<profiles>
93
		<profile>
94
			<id>gvsig-install</id>
95
			<activation>
96
				<activeByDefault>true</activeByDefault>
97
			</activation>
98
			<properties>
99
				<!--
100
					Default gvSIG installation folder relative to the current workspace
101
				-->
102
				<gvsig.install.dir>${basedir}/../../build/product</gvsig.install.dir>
103
			</properties>
104
		</profile>
105
	</profiles>
106
	<properties>
107
        <package.info.categories>View,Table,Vector</package.info.categories>
108
	</properties>
109
	
110
</project>
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.app/org.gvsig.newlayer.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}</outputDirectory>
18
        </file>
19
    </files>	
20
	<dependencySets>
21
		<dependencySet>
22
			<outputDirectory>${extension.install.dir.name}/${library-dir}
23
			</outputDirectory>
24
			<includes>
25
				<include>org.gvsig:org.gvsig.newlayer.app.extension</include>
26
				<include>org.gvsig:org.gvsig.newlayer.lib.api</include>
27
				<include>org.gvsig:org.gvsig.newlayer.lib.impl</include>
28
				<include>org.gvsig:org.gvsig.newlayer.prov.generic</include>
29
				<include>org.gvsig:org.gvsig.newlayer.prov.file</include>
30
				<include>org.gvsig:org.gvsig.newlayer.prov.shape</include>
31
			</includes>
32
		</dependencySet>
33
	</dependencySets>
34
</assembly>
0 35

  
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.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" value="${org.gvsig.initial.build.basedir}/.." />
6
	<property name="build.basedir" value="${workspace.basedir}/org.gvsig.maven.base.build" description="Eclipse workspace location" />
7
	<property name="build.jar.version" value="1.0.8-SNAPSHOT" />
8
	<property name="build.jar.file" value="org.gvsig.maven.base.build-${build.jar.version}.jar" />
9

  
10
	<property name="ant.libs.dir" location="${build.basedir}" description="Additional ant tasks libs folder" />
11

  
12
	<target name="check-maven-base-build-available">
13
		<available file="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" property="maven-base-build-available" />
14
	</target>
15

  
16
	<target name="get-maven-base-build-local" depends="check-maven-base-build-available" if="maven-base-build-available">
17
		<!-- Unzip de build jar file from the maven repository into the workspace root folder -->
18
		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
19
			<zipfileset src="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}">
20
				<patternset>
21
					<exclude name="META-INF/**" />
22
				</patternset>
23
			</zipfileset>
24
		</copy>
25
	</target>
26

  
27
	<target name="get-maven-base-build-remote" depends="check-maven-base-build-available" unless="maven-base-build-available">
28
		<mkdir dir="target" />
29

  
30
		<!-- Download the build jar file -->
31
		<get src="http://devel.gvsig.org/m2repo/j2se/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" dest="target/${build.jar.file}" verbose="true" />
32

  
33
		<!-- Unzip de build jar file into the workspace root folder -->
34
		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
35
			<zipfileset src="target/${build.jar.file}">
36
				<patternset>
37
					<exclude name="META-INF/**" />
38
				</patternset>
39
			</zipfileset>
40
		</copy>
41

  
42
	</target>
43
	
44
	<target name="find.depends.natives.file">
45
	    <condition property="depends.natives.file.exists">
46
            <available file="${org.gvsig.initial.build.basedir}/DEPENDS_ON_NATIVE_LIBRARIES"/>
47
	    </condition>	
48
	</target>
49
	
50
	<target name="find.gvsig.platform.properties.file" 
51
			depends="find.depends.natives.file"
52
			if="depends.natives.file.exists">
53
	    <condition property="gvsig.platform.exists">
54
            <available file="${user.home}/.gvsig.platform.properties"/>
55
	    </condition>	
56
	</target>
57
	
58
	<target name="check.gvsig.platform.properties" 
59
			depends="find.gvsig.platform.properties.file">
60
		<fail if="depends.natives.file.exists" unless="gvsig.platform.exists">
61
ERROR!!
62
	
63
You have to define your gvSIG platform properties, 
64
by creating the file: ${user.home}/.gvsig.platform.properties
65
with the following content:
66

  
67
native_platform=linux
68
native_distribution=all
69
native_compiler=gcc4
70
native_arch=i386
71
native_libraryType=dynamic
72
export native_classifier=${native_platform}-${native_distribution}-${native_compiler}-${native_arch}-${native_libraryType}
73

  
74
Replace the fifth initial variables values with the ones appropiate 
75
to your platform.
76
	
77
If you use maven in the command line, you can use the previous file also
78
to define the MAVEN_OPTS environment variable, by adding to your 
79
.bash_rc file something like this:
80

  
81
if [ -f "${HOME}/.gvsig.platform.properties" ]
82
then
83
    . ${HOME}/.gvsig.platform.properties
84
    export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m -Dnative-classifier=${native_classifier}"
85
else
86
    export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m"
87
fi
88

  
89
It will work if you use the bash shell. In any other case or platform, you'll
90
have to define your MAVEN_OPTS environment variable and set the 
91
"native-classifier" parameter directly.
92
		</fail>			
93
	
94
	</target>
95

  
96
	<target name="prepare-workspace" depends="get-maven-base-build-local,get-maven-base-build-remote,check.gvsig.platform.properties">
97

  
98
		<mkdir dir="target" />
99

  
100
		<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug" />
101

  
102
		<!-- Copy the maven launchers to the workspace metadata folder -->
103
		<copy todir="${workspace.basedir}/.metadata">
104
			<fileset dir="${build.basedir}/eclipse-launchers">
105
				<exclude name="**/org.eclipse.jdt.core.prefs" />
106
				<exclude name="**/org.eclipse.core.variables.prefs" />
107
			</fileset>
108
		</copy>
109

  
110
		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" append="true">
111
			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.jdt.core.prefs" />
112
		</concat>
113
		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" append="true">
114
			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.core.variables.prefs" />
115
		</concat>
116

  
117
		<!-- Configure the eclipse workspace -->
118
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace" />
119

  
120
		<!-- Configure the gvSIG profile -->
121
		<ant antfile="${build.basedir}/check-gvsig-profile.xml" />
122

  
123
		<property name="user-settings-file-location" value="${user.home}/.m2/settings.xml" />
124

  
125
		<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
126
			<classpath>
127
				<pathelement location="${ant.libs.dir}/com.oopsconsultancy.xmltask-1.16.1.jar" />
128
			</classpath>
129
		</taskdef>
130

  
131
		<xmltask source="${user-settings-file-location}" dest="${user-settings-file-location}">
132
			<copy path="//:settings/:profiles/:profile[:id/text() = 'gvsig-install']/:properties/:gvsig.install.dir/text()" property="current-gvsig-location" />
133
		</xmltask>
134

  
135
		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
136
		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
137

  
138
		<!-- Compile, install and generate eclipse projects -->
139
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" />
140

  
141
		<echo>INFORMATION!!!</echo>
142
		<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo>
143

  
144
		<!-- TODO: copiar al proyecto de configuraciĆ³n general -->
145
	</target>
146

  
147
	<target name="clean">
148
		<delete dir="target" />
149
	</target>
150
	
151
</project>
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.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
	<artifactId>org.gvsig.newlayer.app</artifactId>
7
	<packaging>pom</packaging>
8
	<version>1.0.0-SNAPSHOT</version>
9
	<name>org.gvsig.newlayer.app</name>
10
	<description>Extension of the newlayer example project</description>
11
    <parent>
12
        <groupId>org.gvsig</groupId>
13
        <artifactId>org.gvsig.maven.base.extension.pom</artifactId>
14
        <version>1.0.8-SNAPSHOT</version>
15
    </parent>
16
    <scm>
17
        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/branches/v2_0_0_prep/extensions/org.gvsig.newlayer.app</connection>
18
        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/branches/v2_0_0_prep/extensions/org.gvsig.newlayer.app</developerConnection>
19
        <url>https://devel.gvsig.org/redmine/projects/gvsig-desktop/repository/show/branches/v2_0_0_prep/extensions/org.gvsig.newlayer.app</url>
20
    </scm>
21
    <developers>
22
        <developer>
23
            <id>jpiera</id>
24
            <name>Jorge Piera</name>
25
            <email>jpiera@gvsig.org</email>
26
            <roles>
27
                <role>Architect</role>
28
                <role>Developer</role>
29
            </roles>
30
        </developer>
31
        <developer>
32
            <id>jjdelcerro</id>
33
            <name>Joaqu?n Jos? del Cerro</name>
34
            <email>jjdelcerro@gvsig.org</email>
35
            <roles>
36
                <role>Architect</role>          
37
            </roles>
38
        </developer>        
39
    </developers>
40
	<repositories>
41
		<repository>
42
			<id>gvsig-public-http-repository</id>
43
			<name>gvSIG maven public HTTP repository</name>
44
            <url>http://devel.gvsig.org/m2repo/j2se</url>
45
			<releases>
46
				<enabled>true</enabled>
47
				<updatePolicy>daily</updatePolicy>
48
				<checksumPolicy>warn</checksumPolicy>
49
			</releases>
50
			<snapshots>
51
				<enabled>true</enabled>
52
				<updatePolicy>daily</updatePolicy>
53
				<checksumPolicy>warn</checksumPolicy>
54
			</snapshots>
55
		</repository>
56
	</repositories>
57
	<dependencyManagement>
58
        <dependencies>          
59
            <dependency>
60
                <groupId>org.gvsig</groupId>
61
                <artifactId>org.gvsig.core.maven.dependencies</artifactId>
62
                <version>2.0.1-SNAPSHOT</version>
63
                <type>pom</type>
64
                <scope>import</scope>
65
            </dependency>
66
			<dependency>
67
                <groupId>org.gvsig</groupId>
68
                <artifactId>org.gvsig.app</artifactId>
69
                <version>2.0-SNAPSHOT</version>
70
            </dependency>
71
			<dependency>
72
				<groupId>org.gvsig</groupId>
73
				<artifactId>org.gvsig.newlayer.lib.api</artifactId>
74
				<version>1.0.0-SNAPSHOT</version>
75
			</dependency>
76
			<dependency>
77
				<groupId>org.gvsig</groupId>
78
				<artifactId>org.gvsig.newlayer.lib.impl</artifactId>
79
				<version>1.0.0-SNAPSHOT</version>
80
				<scope>runtime</scope>
81
			</dependency>
82
			<dependency>
83
                <groupId>org.gvsig</groupId>
84
                <artifactId>org.gvsig.newlayer.prov.generic</artifactId>
85
                <version>1.0.0-SNAPSHOT</version>
86
                <scope>runtime</scope>
87
            </dependency> 
88
            <dependency>
89
                <groupId>org.gvsig</groupId>
90
                <artifactId>org.gvsig.newlayer.prov.file</artifactId>
91
                <version>1.0.0-SNAPSHOT</version>
92
                <scope>runtime</scope>
93
            </dependency> 
94
            <dependency>
95
                <groupId>org.gvsig</groupId>
96
                <artifactId>org.gvsig.newlayer.prov.shape</artifactId>
97
                <version>1.0.0-SNAPSHOT</version>
98
                <scope>runtime</scope>
99
            </dependency> 
100
		</dependencies>
101
	</dependencyManagement>
102

  
103
	<modules>
104
		<module>org.gvsig.newlayer.app.extension</module>
105
	</modules>
106
	<properties>
107
		<package.info.state>devel</package.info.state>
108
		<!-- alpha-devel -->
109
	</properties>
110
</project>
tags/v2_0_0_Build_2051/extensions/org.gvsig.newlayer.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