Revision 510

View differences:

org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/README.txt
1
===============
2
gvSIG Educa
3
===============
4

  
5
---------------------
6
Portable View
7
---------------------
8

  
9
Description
10
==============
11

  
12
This folder contains the sources of the Portable View functionality.
13

  
14
Requirements
15
==============
16

  
17
* Maven 2.6 or higher
18

  
19
* Java JDK 1.5 or higher
20

  
21
For eclipse
22
-------------
23

  
24
See `developer guide at gvSIG.org <http://www.gvsig.org/plone/projects/gvsig-desktop/docs/devel/gvsig-devel-guide/2-1-0/introduccion>`_ and the file ``REAME-ECLIPSE.txt``
25

  
26

  
27
Contents
28
==========
29

  
30
org.gvsig.educa.portableview.lib
31
---------------------------------
32

  
33
Functionality sources. This project just contain the main process and the logic without any dependency with User Interface.
34

  
35
org.gvsig.educa.portableview.swing
36
-------------------------------------
37

  
38
User Interface components to access a manage the application services.
39

  
40
org.gvsig.educa.portableview.main
41
-----------------------------------
42

  
43
Little test application which allow run the main functionality of application.
44

  
45
See `Execute little test application`_ to know how run it.
46

  
47
pom.xml
48
---------
49

  
50
Maven project definition file
51

  
52
README.rst
53
--------------
54

  
55
This file (in reStructureText format, for more info this format look at `gvSIG portal <https://gvsig.org/web/projects/gvsig-desktop/docs/devel/guia-para-documentar/el-formato-restructuredtext>`_  or at `docUtils reference <http://docutils.sourceforge.net/rst.html>`_)
56

  
57

  
58
Compilation
59
================
60

  
61
From shell
62
------------
63

  
64
Execute this command::
65

  
66
    org.gvsig.educa.portableview$ mvn clean install
67

  
68

  
69
From eclipse
70
--------------
71

  
72
See `work in a proyect of the developer guide at gvSIG.org <https://gvsig.org/web/projects/gvsig-desktop/docs/devel/gvsig-devel-guide/2.0.0/trabajar-con-un-proyecto>`_
73

  
74
In some project, could be better use ``mvn eclipse:clean eclipse:eclipse``  than import project as a *Maven project*. Maven plugin of eclipse does not set classpath correctly in some project.
75

  
76

  
77
Packing
78
========
79

  
80
This functionality has no stand-alone packing process.
81

  
82
Version
83
---------------
84

  
85
To changes version number just set in in ``project/version`` tag of *pom.xml* in this folder. Sub-projects will inherit it.
86

  
87
Version polity is the standard in project. Changes in version number:
88

  
89
* third number: Bug fixes and minors improvements. API must have no changes from previous version.
90
* second number: Bug fixes and mayor improvements. API can have minor changes. Previously deprecated classes could be removed. No architectural changes.
91
* first number: Mayor changes.
92

  
93
Create a tag
94
------------------
95

  
96
TODO: use *maven release* plugin
97

  
98
Use svn copy command to copy version in server. Process could be like this:
99

  
100

  
101
#. Check that there ins no changes in workspace::
102

  
103
   svn up ; svn status
104

  
105
#. Check that project compiles and passes all test.
106

  
107
   mvn clean install
108

  
109
#. Update *pom.xml* to set version of tag (usually removing *-SNAPSHOT*)
110
#. create tag folder on server::
111

  
112
   svn mkdir -m "Create {version} tag folder" https://devel.gvsig.org/svn/gvsig-educa/org.gvsig.educa.portablewview/tags/{version}
113

  
114
#. Copy current workcopy to tag folder::
115

  
116
   svn copy -m "Create {version} tag" * https://devel.gvsig.org/svn/gvsig-educa/org.gvsig.educa.portablewview/tags/{version}
117

  
118
#. Update *pom.xml* to next version
119
#. Commit *pom.xml* changes::
120

  
121
   svn commit -m "Set new version {version}-SNAPSHOT" pom.xml
122

  
123

  
124
i18n
125
======
126

  
127
The files for internationalization can be found in this folders:
128

  
129
+ *org.gvsig.educa.portablewview.app.viewer/src/main/resources-plugin*
130
+ *org.gvsig.educa.portablewview.app.editor/src/main/resources-plugin*
131

  
132
The internationalization of this application is based on standard java resource bundle mechanism. So, to add a new language just add the file with the language code to every related folder.
133

  
134
Execute little test application
135
=================================
136

  
137
From shell
138
------------
139

  
140
After compile the application, execute this command::
141

  
142
    org.gvsig.educa.portablewview$ cd org.gvsig.educa.thematicmap.main
143
    org.gvsig.educa.portablewview/org.gvsig.educa.portablewview.main$ mvn exec:java
144

  
145
Form eclipse
146
------------------
147

  
148
Select ``org.gvsig.educa.portableview.main`` project in *Project tree* using *Java perspective*, click with right mouse button and select ``Run as.../Java application``. Select ``Main`` class for project.
149

  
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<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">
3
	<modelVersion>4.0.0</modelVersion>
4
	<artifactId>org.gvsig.educa.portableview.lib.api</artifactId>
5
	<packaging>jar</packaging>
6
	<name>org.gvsig.educa.portableview.lib.api</name>
7
	<parent>
8
		<groupId>org.gvsig</groupId>
9
		<artifactId>org.gvsig.educa.portableview.lib</artifactId>
10
		<version>1.0.45</version>
11
	</parent>
12

  
13
	<build>
14
		<plugins>
15
			<plugin>
16
				<groupId>org.apache.maven.plugins</groupId>
17
				<artifactId>maven-jar-plugin</artifactId>
18
				<configuration>
19
				</configuration>
20
				<executions>
21
					<!-- Generates a jar file only with the test classes -->
22
					<execution>
23
						<goals>
24
							<goal>test-jar</goal>
25
						</goals>
26
					</execution>
27
				</executions>
28
			</plugin>
29
		</plugins>
30
	</build>
31
	<dependencies>
32
		<dependency>
33
			<groupId>org.gvsig</groupId>
34
			<artifactId>org.gvsig.tools.lib</artifactId>
35
		</dependency>
36
		<dependency>
37
			<groupId>org.gvsig</groupId>
38
			<artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
39
		</dependency>
40
	</dependencies>
41
</project>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/test/resources/README.txt
1
====
2
    gvSIG. Desktop Geographic Information System.
3

  
4
    Copyright (C) 2007-2012 gvSIG Association.
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
    For any additional information, do not hesitate to contact us
22
    at info AT gvsig.com, or visit our website www.gvsig.com.
23
====
24

  
25
Put into this folder the resources needed by your classes.
26

  
27
This folder is added to the classpath, so you can load any resources 
28
through the ClassLoader.
29

  
30
By default, in this folder you can find an example of log4j configuration,
31
prepared to log messages through the console, so logging works when you
32
run your classes.
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!--
3

  
4
    gvSIG. Desktop Geographic Information System.
5

  
6
    Copyright (C) 2007-2012 gvSIG Association.
7

  
8
    This program is free software; you can redistribute it and/or
9
    modify it under the terms of the GNU General Public License
10
    as published by the Free Software Foundation; either version 2
11
    of the License, or (at your option) any later version.
12

  
13
    This program is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU General Public License for more details.
17

  
18
    You should have received a copy of the GNU General Public License
19
    along with this program; if not, write to the Free Software
20
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
    MA  02110-1301, USA.
22

  
23
    For any additional information, do not hesitate to contact us
24
    at info AT gvsig.com, or visit our website www.gvsig.com.
25

  
26
-->
27
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
28

  
29
<!-- 
30
Log4J configuration file for unit tests execution.
31
 -->
32
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
33

  
34
	<!-- Appender configuration to show logging messages through the console -->
35
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
36
		<layout class="org.apache.log4j.PatternLayout">
37
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
38
		</layout>
39
	</appender>
40

  
41
	<!-- 
42
	Activate logging messages of DEBUG level of higher only for the
43
	org.gvsig.tools packages.
44
	You can put full classes names or packages instead, to configure
45
	logging for all the classes and subpackages of the package.
46
	-->
47
	<category name="org.gvsig.tools">
48
		<priority value="DEBUG" />
49
	</category>
50
	<category name="org.gvsig.construc">
51
		<priority value="DEBUG" />
52
	</category>
53

  
54
	<!-- 
55
	By default, show only logging messages of INFO level or higher, 
56
	through the previously configured CONSOLE appender. 
57
	-->
58
	<root>
59
		<priority value="INFO" />
60
		<appender-ref ref="CONSOLE" />
61
	</root>
62
</log4j:configuration>
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/PortableViewException.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.educa.portableview;
23

  
24
import org.gvsig.tools.exception.BaseException;
25

  
26
/**
27
 * Generic exception thrown in the PortableView API when the exception or error
28
 * may be dealt by the program or the user of the program which is a client of
29
 * the PortableView API.
30
 *
31
 * @see {@link PortableViewService}
32
 * @see {@link PortableViewManager}
33
 * @author gvSIG team.
34
 * @version $Id$
35
 */
36
public class PortableViewException extends BaseException {
37

  
38
    private static final long serialVersionUID = 6756475060924237176L;
39

  
40
    private static final String MESSAGE =
41
        "An error has been produced in the PortableView library";
42

  
43
    private static final String KEY = "_PortableViewException";
44

  
45
    /**
46
     * Constructor to be used in rare cases, usually you must create a new child
47
     * exception class for each case.
48
     * <strong>Don't use this constructor in child classes.</strong>
49
     */
50
    public PortableViewException() {
51
        super(MESSAGE, KEY, serialVersionUID);
52
    }
53

  
54
    /**
55
     * Constructor to be used in rare cases, usually you must create a new child
56
     * exception class for each case.
57
     * <p>
58
     * <strong>Don't use this constructor in child classes.</strong>
59
     * </p>
60
     *
61
     * @param cause
62
     *            the original cause of the exception
63
     */
64
    public PortableViewException(Exception cause) {
65
        super(MESSAGE, cause, KEY, serialVersionUID);
66
    }
67

  
68
    /**
69
     * @see BaseException#BaseException(String, String, long).
70
     * @param message
71
     *            the default messageFormat to describe the exception
72
     * @param key
73
     *            the key to use to search a localized messageFormnata
74
     * @param code
75
     *            the unique code to identify the exception
76
     */
77
    protected PortableViewException(String message, String key, long code) {
78
        super(message, key, code);
79
    }
80

  
81
    /**
82
     * @see BaseException#BaseException(String, Throwable, String, long).
83
     * @param message
84
     *            the default messageFormat to describe the exception
85
     * @param cause
86
     *            the original cause of the exception
87
     * @param key
88
     *            the key to use to search a localized messageFormnata
89
     * @param code
90
     *            the unique code to identify the exception
91
     */
92
    protected PortableViewException(String message, Throwable cause, String key,
93
        long code) {
94
        super(message, cause, key, code);
95
    }
96
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/PortableViewRuntimeException.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.educa.portableview;
23

  
24
import org.gvsig.tools.exception.BaseRuntimeException;
25

  
26
/**
27
 * Generic exception thrown in the PortableView API when the exception or error
28
 * may be dealt by the program or the user of the program which is a client of
29
 * the PortableView API.
30
 *
31
 * @see {@link PortableViewService}
32
 * @see {@link PortableViewManager}
33
 * @author gvSIG team.
34
 * @version $Id$
35
 */
36
public class PortableViewRuntimeException extends BaseRuntimeException {
37

  
38

  
39
    /**
40
     *
41
     */
42
    private static final long serialVersionUID = -4039843730204021312L;
43

  
44
    private static final String MESSAGE =
45
        "An error has been produced in the PortableView library";
46

  
47
    private static final String KEY = "_PortableViewRuntimeException";
48

  
49
    public PortableViewRuntimeException(String message) {
50
        super(message, KEY, serialVersionUID);
51
    }
52

  
53
    /**
54
     *
55
     * @param cause
56
     *            the original cause of the exception
57
     */
58
    public PortableViewRuntimeException(String message, Exception cause) {
59
        super(message, cause, KEY, serialVersionUID);
60
    }
61

  
62
    /**
63
     *
64
     * @param cause
65
     *            the original cause of the exception
66
     */
67
    public PortableViewRuntimeException(Exception cause) {
68
        super(MESSAGE, cause, KEY, serialVersionUID);
69
    }
70

  
71
    /**
72
     * @see BaseException#BaseException(String, String, long).
73
     * @param message
74
     *            the default messageFormat to describe the exception
75
     * @param key
76
     *            the key to use to search a localized messageFormnata
77
     * @param code
78
     *            the unique code to identify the exception
79
     */
80
    protected PortableViewRuntimeException(String message, String key, long code) {
81
        super(message, key, code);
82
    }
83

  
84
    /**
85
     * @see BaseException#BaseException(String, Throwable, String, long).
86
     * @param message
87
     *            the default messageFormat to describe the exception
88
     * @param cause
89
     *            the original cause of the exception
90
     * @param key
91
     *            the key to use to search a localized messageFormnata
92
     * @param code
93
     *            the unique code to identify the exception
94
     */
95
    protected PortableViewRuntimeException(String message, Throwable cause, String key,
96
        long code) {
97
        super(message, cause, key, code);
98
    }
99
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/PortableViewFileServices.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.educa.portableview;
23

  
24
import java.io.File;
25
import java.io.IOException;
26
import java.util.zip.ZipException;
27

  
28
import org.gvsig.fmap.mapcontext.MapContext;
29
import org.gvsig.tools.persistence.exception.PersistenceException;
30

  
31
/**
32
 * Portable View Utilities related to files
33
 *
34
 * @author gvSIG Team
35
 * @version $Id$
36
 *
37
 */
38
/**
39
 * @author gvSIG Team
40
 * @version $Id$
41
 * 
42
 */
43
public interface PortableViewFileServices {
44

  
45
    /**
46
     * <p>
47
     * Unzip a file into a folder
48
     * </p>
49
     * 
50
     * @param zipFile
51
     * @param outputFloder
52
     *            must exists. WARNING: <b>Contents will be removed before
53
     *            unzip</b>
54
     * @throws IOException
55
     * @throws ZipException
56
     * @throws IllegalArgumentException
57
     *             if zipFile is not a file or outputFloder doesn't exists or is
58
     *             read-only
59
     */
60
    void unzipFile(File zipFile, File outputFloder) throws ZipException,
61
        IOException;
62

  
63
    /**
64
     * <p>
65
     * Create a zip file which will contains all contents of a folder
66
     * </p>
67
     * <p>
68
     * Files will be use relative path to <code>rootFolder</code>
69
     * </p>
70
     * 
71
     * @param rootFolder
72
     *            rootFolder (must be an existing folder)
73
     * @param targetFile
74
     *            final file (must not exists)
75
     * @throws IOException
76
     * @throws IllegalArgumentException
77
     *             if there are any problem in parameters
78
     */
79
    void zipFolder(File rootFolder, File targetFile) throws IOException;
80

  
81
    /**
82
     * Informs if <code>folder</code> is a writable folder( exists & isDir &
83
     * canWrite)
84
     * 
85
     * @param folder
86
     * @return
87
     */
88
    boolean isWritableFolder(File folder);
89

  
90
    /**
91
     * Informs if <code>folder</code> is a readable folder( exists & isDir &
92
     * canRead)
93
     * 
94
     * @param folder
95
     * @return
96
     */
97
    boolean isReadableFolder(File folder);
98

  
99
    /**
100
     * Informs if <code>file</code> is a readable file ( exists & isFile &
101
     * canRead)
102
     * 
103
     * @param file
104
     * @return
105
     */
106
    boolean isReadableFile(File file);
107

  
108
    /**
109
     * <p>
110
     * Look for a folder on a <code>baseFolder</code> starts with
111
     * <code>baseName</code> which is writable.
112
     * </p>
113
     * <p>
114
     * The pattern is: <code>baseFolder/baseName.0000</code> where
115
     * <code>000</code> it's a counter.
116
     * </p>
117
     * 
118
     * @param baseFolder
119
     *            existing and writable folder
120
     * @param baseName
121
     *            start of new folder
122
     * @return new folder
123
     * @throws IllegalArgumentException
124
     *             if base folder is not a writable folder
125
     * @throws IllegalStateException
126
     *             if can't found a suitable folder
127
     */
128
    File getWritableFolder(File baseFolder, String baseName);
129

  
130
    /**
131
     * <p>
132
     * Create a new folder on a <code>baseFolder</code> starts with
133
     * <code>baseName</code> which is new and writable.
134
     * </p>
135
     * <p>
136
     * The pattern is: <code>baseFolder/baseName.0000</code> where
137
     * <code>000</code> it's a counter.
138
     * </p>
139
     * 
140
     * @param baseFolder
141
     *            existing and writable folder
142
     * @param baseName
143
     *            start of new folder
144
     * @return new folder
145
     * @throws IllegalArgumentException
146
     *             if base folder is not a writable folder
147
     * @throws IllegalStateException
148
     *             if can't found a suitable folder
149
     */
150
    File getNewWritableFolder(File baseFolder, String baseName);
151

  
152
    /**
153
     * <p>
154
     * Create {@link File} instance for a new file on a <code>baseFolder</code>
155
     * starts with <code>baseName</code>.
156
     * </p>
157
     * <p>
158
     * The pattern is: <code>baseFolder/baseName.0000.ext</code> where
159
     * <code>000</code> it's a counter.
160
     * </p>
161
     * <p>
162
     * This <b>no create</b> the file into the file system.
163
     * </p>
164
     * 
165
     * @param baseFolder
166
     *            existing and writable folder
167
     * @param name
168
     *            start of new file
169
     * @return new folder
170
     * @throws IllegalArgumentException
171
     *             if base folder is not a writable folder
172
     * @throws IllegalStateException
173
     *             if can't found a suitable folder
174
     */
175
    File getNewFileName(File baseFolder, String name);
176

  
177
    /**
178
     * <p>
179
     * Return <code>path</code> as relative from <code>basePath</code> only if
180
     * <code>basePath</code> is an ancestor of <code>path</code>:
181
     * </p>
182
     * 
183
     * @param path
184
     * @param basePath
185
     * @return
186
     * @see FilenameUtils#getRelativeTo(String, String)
187
     */
188
    File getRelativeTo(File path, File basePath);
189

  
190
    /**
191
     * <p>
192
     * Load a mapContext from a file adjusting file paths which are supposed
193
     * relatives to a folder
194
     * </p>
195
     * 
196
     * @param mapContext
197
     *            persistence file
198
     * @param relativaPathFolder
199
     *            for files refered in mapContext
200
     * @return
201
     * @throws IOException
202
     * @throws PersistenceException
203
     */
204
    MapContext loadMapContext(File mapContext, File relativaPathFolder)
205
        throws IOException, PersistenceException;
206
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/PortableViewLocator.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.educa.portableview;
23

  
24
import org.gvsig.tools.locator.BaseLocator;
25
import org.gvsig.tools.locator.Locator;
26
import org.gvsig.tools.locator.LocatorException;
27

  
28
/**
29
 * This locator is the entry point for the PortableView library, providing
30
 * access to all PortableView services through the {@link PortableViewManager} .
31
 *
32
 * @author gvSIG team
33
 * @version $Id$
34
 */
35
public class PortableViewLocator extends BaseLocator {
36

  
37
    /**
38
     * PortableView manager name.
39
     */
40
    public static final String MANAGER_NAME = "PortableView.manager";
41

  
42
    /**
43
     * PortableView manager description.
44
     */
45
    public static final String MANAGER_DESCRIPTION = "PortableView Manager";
46

  
47
    /**
48
     * PortableView file services name.
49
     */
50
    public static final String FILESERVICES_NAME = "PortableView.fileservices";
51

  
52
    /**
53
     * PortableView file services manager description.
54
     */
55
    public static final String FILESERVICES_DESCRIPTION =
56
        "PortableView File Servides";
57

  
58
    private static final String LOCATOR_NAME = "PortableView.locator";
59

  
60
    /**
61
     * Unique instance.
62
     */
63
    private static final PortableViewLocator INSTANCE = new PortableViewLocator();
64

  
65
    /**
66
     * Return the singleton instance.
67
     *
68
     * @return the singleton instance
69
     */
70
    public static PortableViewLocator getInstance() {
71
        return INSTANCE;
72
    }
73

  
74
    /**
75
     * Return the Locator's name.
76
     *
77
     * @return a String with the Locator's name
78
     */
79
    @Override
80
    public final String getLocatorName() {
81
        return LOCATOR_NAME;
82
    }
83

  
84
    /**
85
     * Return a reference to the PortableViewManager.
86
     *
87
     * @return a reference to the PortableViewManager
88
     * @throws LocatorException
89
     *             if there is no access to the class or the class cannot be
90
     *             instantiated
91
     * @see Locator#get(String)
92
     */
93
    public static PortableViewManager getManager() throws LocatorException {
94
        return (PortableViewManager) getInstance().get(MANAGER_NAME);
95
    }
96

  
97
    /**
98
     * Registers the Class implementing the PortableViewManager interface.
99
     *
100
     * @param clazz
101
     *            implementing the PortableViewManager interface
102
     */
103
    public static void registerManager(Class<? extends PortableViewManager> clazz) {
104
        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
105
    }
106

  
107
    /**
108
     * Return a reference to the PortableViewFileServices.
109
     *
110
     * @return a reference to the PortableViewFileServices
111
     * @throws LocatorException
112
     *             if there is no access to the class or the class cannot be
113
     *             instantiated
114
     * @see Locator#get(String)
115
     */
116
    public static PortableViewFileServices getFileServices()
117
        throws LocatorException {
118
        return (PortableViewFileServices) getInstance().get(FILESERVICES_NAME);
119
    }
120

  
121
    /**
122
     * Registers the Class implementing the PortableViewFileServices interface.
123
     *
124
     * @param clazz
125
     *            implementing the PortableViewFileServices interface
126
     */
127
    public static void registerFileServices(
128
        Class<? extends PortableViewFileServices> clazz) {
129
        getInstance().register(FILESERVICES_NAME, FILESERVICES_DESCRIPTION,
130
            clazz);
131
    }
132

  
133
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/PortableViewLibrary.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.educa.portableview;
23

  
24
import org.gvsig.fmap.dal.DALLibrary;
25
import org.gvsig.fmap.mapcontext.MapContextLibrary;
26
import org.gvsig.tools.library.AbstractLibrary;
27
import org.gvsig.tools.library.LibraryException;
28
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
29

  
30
/**
31
 * Library for API initialization and configuration.
32
 *
33
 * @author gvSIG team
34
 * @version $Id$
35
 */
36
public class PortableViewLibrary extends AbstractLibrary {
37

  
38
    @Override
39
    public void doRegistration() {
40
        registerAsAPI(PortableViewLibrary.class);
41
        require(DALLibrary.class);
42
        require(MapContextLibrary.class);
43

  
44
    }
45

  
46
    @Override
47
    protected void doInitialize() throws LibraryException {
48
        // Do nothing
49
    }
50

  
51
    @Override
52
    protected void doPostInitialize() throws LibraryException {
53
        // Validate there is any implementation registered.
54
        PortableViewManager manager = PortableViewLocator.getManager();
55
        if (manager == null) {
56
            throw new ReferenceNotRegisteredException(
57
                PortableViewLocator.MANAGER_NAME,
58
                PortableViewLocator.getInstance());
59
        }
60
    }
61

  
62
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/map/InvalidPortableViewFormatException.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.educa.portableview.map;
23

  
24
import java.io.File;
25

  
26
import org.gvsig.educa.portableview.PortableViewException;
27

  
28
/**
29
 * Exception Throws when try to open a PortableView file with invalid format
30
 *
31
 * @author gvSIG Team
32
 * @version $Id$
33
 *
34
 */
35
public class InvalidPortableViewFormatException extends PortableViewException {
36

  
37
    /**
38
     *
39
     */
40
    private static final long serialVersionUID = 8895685032043751029L;
41

  
42
    private static final String MESSAGE =
43
        "Invalid format of a PortableView file [%(filePath)]: %(info)";
44

  
45
    private static final String KEY = "_InvalidPortableViewFormatException";
46

  
47
    /**
48
     * Invalid format of a portable view file by unspecified problem
49
     *
50
     * @param mapFile
51
     */
52
    public InvalidPortableViewFormatException(File mapFile) {
53
        this(mapFile, "unspecified problem");
54
    }
55

  
56
    /**
57
     * Invalid format of a portable view file
58
     *
59
     * @param mapFile
60
     * @param message
61
     *            problem description
62
     */
63
    public InvalidPortableViewFormatException(File mapFile, String message) {
64
        super(MESSAGE, KEY, serialVersionUID);
65
        setValue("info", message);
66
        setValue("filePath", mapFile.getAbsolutePath());
67
    }
68

  
69
    /**
70
     * Invalid format of a portable view file
71
     *
72
     * @param mapFile
73
     * @param message
74
     *            problem description
75
     * @param cause
76
     */
77
    public InvalidPortableViewFormatException(File mapFile, String message,
78
        Throwable cause) {
79
        super(MESSAGE, cause, KEY, serialVersionUID);
80
        setValue("info", message);
81
        setValue("filePath", mapFile.getAbsolutePath());
82
    }
83

  
84
    /**
85
     * Invalid format of a portable view file
86
     *
87
     * @param mapFile
88
     */
89
    public InvalidPortableViewFormatException(File mapFile, Throwable cause) {
90
        this(mapFile, "initializing problem", cause);
91
    }
92

  
93
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/map/PortableView.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.educa.portableview.map;
23

  
24
import java.io.IOException;
25

  
26
import org.gvsig.educa.portableview.PortableViewManager;
27
import org.gvsig.fmap.mapcontext.MapContext;
28
import org.gvsig.tools.dispose.Disposable;
29

  
30
/**
31
 * <i>Portable View</i> instance.
32
 * </p>
33
 * This class' instances contains information about a installed <i>Portable
34
 * View</i>
35
 *
36
 * @author <a href="http://www.disid.com">DiSiD Technologies S.L.</a>
37
 * @version $Rev$
38
 * @since {version}
39
 */
40
public interface PortableView extends Disposable {
41

  
42
    /**
43
     * Gets information about this <i>Portable View</i>
44
     *
45
     * @return
46
     */
47
    PortableViewInformation getInformation();
48

  
49
    /**
50
     * Opens this <i>Portable View</i>
51
     * </p>
52
     * This unzip <i>Portable View</i> contents into temporal folder (if it isn't
53
     * created yet)
54
     * and prepares data
55
     * </p>
56
     * unzip folder is defined in {@link PortableViewManager#getTemporalFolder()}
57
     * </p>
58
     *
59
     * @throws InvalidPortableViewFormatException
60
     * @throws CantLoadContextException
61
     * @throws IOException
62
     */
63
    void open() throws InvalidPortableViewFormatException,
64
        CantLoadContextException, IOException;
65

  
66
    /**
67
     * Informs if <i>Portable View</i> it's already opened or not
68
     *
69
     * @return if it's opened
70
     */
71
    boolean isOpen();
72

  
73
    /**
74
     * Unloads all data loaded in memory and cleans its temporal folder
75
     *
76
     * @throws IOException
77
     *             if any problem is found cleaning temporal folder
78
     *
79
     */
80
    void close() throws IOException;
81

  
82
    /**
83
     * Gets MapContext with <i>Portable View</i> representation
84
     *
85
     * @return MapContext instance
86
     * @throws IllegalStateException
87
     *             if {@link #isOpen()} == false
88
     */
89
    MapContext getMapContext();
90

  
91
    /**
92
     * Gets the file which PortableView data
93
     *
94
     * @return
95
     */
96
    String getSourceFilePath();
97

  
98
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/map/CantLoadContextException.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.educa.portableview.map;
23

  
24
import java.io.File;
25

  
26
import org.gvsig.educa.portableview.PortableViewException;
27

  
28
/**
29
 * Exception Throws when try to load the MapContext of a PortableView file
30
 *
31
 * @author gvSIG Team
32
 * @version $Id$
33
 *
34
 */
35
public class CantLoadContextException extends PortableViewException {
36

  
37
    /**
38
     *
39
     */
40
    private static final long serialVersionUID = -6565034273641780414L;
41

  
42
    private static final String MESSAGE =
43
        "Problem loading MapContext file [%(mapContextPath)] of a PortableView file [%(mapPath)]: %(info)";
44

  
45
    private static final String KEY = "_CantLoadContextException";
46

  
47
    /**
48
     * Cannot load mapContext from a Portable view file
49
     *
50
     * @param mapFile
51
     * @param mapContextFile
52
     * @param message
53
     *            problem description
54
     * @param cause
55
     */
56
    public CantLoadContextException(File mapFile, File mapContextFile,
57
        String message, Throwable cause) {
58
        super(MESSAGE, cause, KEY, serialVersionUID);
59
        setValue("info", message);
60
        setValue("mapPath", mapFile.getAbsolutePath());
61
        setValue("mapContextPath", mapContextFile.getAbsolutePath());
62
    }
63

  
64
    /**
65
     * Cannot load mapContext from a Portable view file
66
     *
67
     * @param mapFile
68
     * @param mapContextFile
69
     * @param cause
70
     */
71
    public CantLoadContextException(File mapFile, File mapContextFile,
72
        Throwable cause) {
73
        this(mapFile, mapContextFile, "loading problem", cause);
74
    }
75

  
76
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/map/InvalidInstalledPortableViewException.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.educa.portableview.map;
23

  
24
import java.io.File;
25

  
26
import org.gvsig.educa.portableview.PortableViewException;
27

  
28
/**
29
 * Exception Throws when try to open an installed PortableView folder with
30
 * invalid format (missing package.info file or no match data)
31
 *
32
 * @author gvSIG Team
33
 * @version $Id$
34
 *
35
 */
36
public class InvalidInstalledPortableViewException extends PortableViewException {
37

  
38
    /**
39
     *
40
     */
41
    private static final long serialVersionUID = 1L;
42

  
43
    private static final String MESSAGE =
44
        "Invalid format of an installed PortableView [%(folderPath)]: %(info)";
45

  
46
    private static final String KEY = "_InvalidInstalledPortableViewException";
47

  
48
    /**
49
     * Invalid format of an installed portable view folder by unspecified problem
50
     *
51
     * @param mapFile
52
     */
53
    public InvalidInstalledPortableViewException(File mapFolder) {
54
        this(mapFolder, "unspecified problem");
55
    }
56

  
57
    /**
58
     * Invalid format of a portable view file
59
     *
60
     * @param mapFile
61
     * @param message
62
     *            problem description
63
     */
64
    public InvalidInstalledPortableViewException(File mapFolder, String message) {
65
        super(MESSAGE, KEY, serialVersionUID);
66
        setValue("info", message);
67
        setValue("folderPath", mapFolder.getAbsolutePath());
68
    }
69

  
70
    /**
71
     * Invalid format of a portable view file
72
     *
73
     * @param mapFile
74
     * @param message
75
     *            problem description
76
     * @param cause
77
     */
78
    public InvalidInstalledPortableViewException(File mapFolder, String message,
79
        Throwable cause) {
80
        super(MESSAGE, cause, KEY, serialVersionUID);
81
        setValue("info", message);
82
        setValue("folderPath", mapFolder.getAbsolutePath());
83
    }
84

  
85
    /**
86
     * Invalid format of a portable view file
87
     *
88
     * @param mapFile
89
     */
90
    public InvalidInstalledPortableViewException(File mapFile, Throwable cause) {
91
        this(mapFile, "initializing problem", cause);
92
    }
93

  
94
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/map/PortableViewInformation.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.educa.portableview.map;
23

  
24
import java.util.Date;
25

  
26
import org.cresques.cts.IProjection;
27
import org.omg.CORBA.DynValue;
28

  
29
import org.gvsig.fmap.geom.primitive.Envelope;
30
import org.gvsig.tools.dynobject.DynObject;
31
import org.gvsig.tools.dynobject.DynStruct;
32

  
33
/**
34
 * Information about a <i>Portable View</i>:
35
 * <ul>
36
 * <li>Name and description</li>
37
 * <li>Author</li>
38
 * <li>License</li>
39
 * </ul>
40
 *
41
 * TODO Add more data
42
 *
43
 * @author <a href="http://www.disid.com">DiSiD Technologies S.L.</a>
44
 * @version $Rev$
45
 * @since {version}
46
 */
47
public interface PortableViewInformation {
48

  
49
    public static final String DYN_DEFINITION_NAME = "PortableViewInformation";
50

  
51
    /**
52
     * Gets <i>Portable View</i> identifier
53
     *
54
     * @return
55
     */
56
    String getId();
57

  
58
    /**
59
     * Gets <i>Portable View</i> name
60
     *
61
     * @return
62
     */
63
    String getName();
64

  
65
    /**
66
     * Gets <i>Portable View</i> description
67
     *
68
     * @return
69
     */
70
    String getDescription();
71

  
72
    /**
73
     * Gets <i>Portable View</i> version
74
     *
75
     * @return
76
     */
77
    int getVersion();
78

  
79
    /**
80
     * Gets <i>Portable View</i> build number
81
     *
82
     * @return
83
     */
84
    int getBuildNumber();
85

  
86
    /**
87
     * Gets <i>Portable View</i> creation timestamp
88
     *
89
     * @return
90
     */
91
    Date getCreationTimestamp();
92

  
93
    /**
94
     * Gets full envelope
95
     *
96
     * @return
97
     */
98
    Envelope getFullEnvelope();
99

  
100
    /**
101
     * Returns CRS
102
     *
103
     * @return
104
     */
105
    IProjection getCRS();
106

  
107
    /**
108
     * Returns {@link DynValue} definition
109
     *
110
     * @return
111
     */
112
    DynStruct getDynDefinition();
113

  
114
    /**
115
     * Returns {@link DynObject} description
116
     *
117
     * @return
118
     */
119
    DynObject getDynObject();
120
}
org.gvsig.educa.portableview/tags/org.gvsig.educa.portableview-1.0.45/org.gvsig.educa.portableview.lib/org.gvsig.educa.portableview.lib.api/src/main/java/org/gvsig/educa/portableview/PortableViewManager.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.educa.portableview;
23

  
24
import java.io.File;
25
import java.io.IOException;
26
import java.util.List;
27

  
28
import org.gvsig.educa.portableview.compilation.PortableViewCompilation;
29
import org.gvsig.educa.portableview.compilation.PortableViewCompiler;
30
import org.gvsig.educa.portableview.map.CantLoadContextException;
31
import org.gvsig.educa.portableview.map.InvalidPortableViewFormatException;
32
import org.gvsig.educa.portableview.map.PortableView;
33
import org.gvsig.educa.portableview.map.PortableViewInformation;
34
import org.gvsig.tools.dispose.Disposable;
35

  
36
/**
37
 * Library Manager.
38
 * </p>
39
 * Expose main library's functionalities:
40
 * <ul>
41
 * <li>Set default folders configuration</li>
42
 * <li>Get installed <i>Portable View</i></li>
43
 * <li>Identify and get a <i>Portable View</i> from a file</li>
44
 * <li>Create a new {@link PortableViewCompilation} instance</li>
45
 * <li>Create a new {@link PortableViewCompiler} instance</li>
46
 * </ul>
47
 *
48
 * @author gvSIG team
49
 * @version $Id$
50
 */
51
public interface PortableViewManager extends Disposable {
52

  
53
    public static final String  INSTALLER_PROVIDER_NAME = "PortableView";
54
            
55
    /**
56
     * Gets default folder to locate installed <i>Portable View</i>
57
     *
58
     * @return default installation folder
59
     */
60
    String getInstallationMapFolder();
61

  
62
    /**
63
     * Sets default folder to locate installed <i>Portable View</i>
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff