Revision 34607
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
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/xsd/maven-4.0.0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.installer</artifactId> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<version>1.0.0-SNAPSHOT</version> |
|
8 |
<name>org.gvsig.installer</name> |
|
9 |
<description>Project to create installers or install plugins in gvSIG</description> |
|
10 |
<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.installer/${pom.version}</url> |
|
11 |
<parent> |
|
12 |
<groupId>org.gvsig</groupId> |
|
13 |
<artifactId>gvsig-base-library-pom</artifactId> |
|
14 |
<version>2.0-SNAPSHOT</version> |
|
15 |
</parent> |
|
16 |
|
|
17 |
<scm> |
|
18 |
<connection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-desktop/branches/v2_0_0_prep/extensions/org.gvsig.installer</connection> |
|
19 |
<developerConnection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-desktop/branches/v2_0_0_prep/extensions/org.gvsig.installer</developerConnection> |
|
20 |
<url>https://forge.osor.eu/plugins/scmsvn/viewcvs.php/branches/v2_0_0_prep/extensions/org.gvsig.installer/?root=gvsig-desktop</url> |
|
21 |
</scm> |
|
22 |
|
|
23 |
<developers> |
|
24 |
<developer> |
|
25 |
<id>jjdelcerro</id> |
|
26 |
<name>Joaquín José del Cerro</name> |
|
27 |
<email>jjdelcerro@gvsig.org</email> |
|
28 |
<roles> |
|
29 |
<role>Architect</role> |
|
30 |
</roles> |
|
31 |
</developer> |
|
32 |
<developer> |
|
33 |
<id>jpiera</id> |
|
34 |
<name>Jorge Piera Llodrá</name> |
|
35 |
<email>jpiera@gvsig.org</email> |
|
36 |
<roles> |
|
37 |
<role>Architect</role> |
|
38 |
<role>Developer</role> |
|
39 |
</roles> |
|
40 |
</developer> |
|
41 |
<developer> |
|
42 |
<id>cordinyana</id> |
|
43 |
<name>Cèsar Ordiñana</name> |
|
44 |
<email>cordinyana@disid.com</email> |
|
45 |
<roles> |
|
46 |
<role>Architect</role> |
|
47 |
<role>Developer</role> |
|
48 |
</roles> |
|
49 |
</developer> |
|
50 |
</developers> |
|
51 |
|
|
52 |
<distributionManagement> |
|
53 |
<site> |
|
54 |
<id>gvsig-repository</id> |
|
55 |
<url>scp://shell.forge.osor.eu/home/groups/gvsig-desktop/www/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.installer/${pom.version}</url> |
|
56 |
</site> |
|
57 |
</distributionManagement> |
|
58 |
<repositories> |
|
59 |
<repository> |
|
60 |
<id>gvsig-public-http-repository</id> |
|
61 |
<name>gvSIG maven public HTTP repository</name> |
|
62 |
<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository</url> |
|
63 |
<releases> |
|
64 |
<enabled>true</enabled> |
|
65 |
<updatePolicy>daily</updatePolicy> |
|
66 |
<checksumPolicy>warn</checksumPolicy> |
|
67 |
</releases> |
|
68 |
<snapshots> |
|
69 |
<enabled>true</enabled> |
|
70 |
<updatePolicy>daily</updatePolicy> |
|
71 |
<checksumPolicy>warn</checksumPolicy> |
|
72 |
</snapshots> |
|
73 |
</repository> |
|
74 |
</repositories> |
|
75 |
<properties> |
|
76 |
<build-dir>${basedir}/../build</build-dir> |
|
77 |
</properties> |
|
78 |
<build> |
|
79 |
<plugins> |
|
80 |
<plugin> |
|
81 |
<groupId>org.apache.maven.plugins</groupId> |
|
82 |
<artifactId>maven-release-plugin</artifactId> |
|
83 |
<configuration> |
|
84 |
<tagBase>https://svn.forge.osor.eu/svn/gvsig-desktop/tags</tagBase> |
|
85 |
</configuration> |
|
86 |
</plugin> |
|
87 |
</plugins> |
|
88 |
</build> |
|
89 |
<dependencyManagement> |
|
90 |
<dependencies> |
|
91 |
<dependency> |
|
92 |
<groupId>org.gvsig</groupId> |
|
93 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
94 |
<version>2.1.0-SNAPSHOT</version> |
|
95 |
</dependency> |
|
96 |
<dependency> |
|
97 |
<groupId>org.gvsig</groupId> |
|
98 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
99 |
<version>2.1.0-SNAPSHOT</version> |
|
100 |
<classifier>tests</classifier> |
|
101 |
<scope>test</scope> |
|
102 |
</dependency> |
|
103 |
<dependency> |
|
104 |
<groupId>org.gvsig</groupId> |
|
105 |
<artifactId>org.gvsig.i18n</artifactId> |
|
106 |
<version>2.0-SNAPSHOT</version> |
|
107 |
</dependency> |
|
108 |
<dependency> |
|
109 |
<groupId>org.gvsig</groupId> |
|
110 |
<artifactId>org.gvsig.ui</artifactId> |
|
111 |
<version>2.0-SNAPSHOT</version> |
|
112 |
</dependency> |
|
113 |
</dependencies> |
|
114 |
</dependencyManagement> |
|
115 |
|
|
116 |
<modules> |
|
117 |
<module>org.gvsig.installer.lib</module> |
|
118 |
<module>org.gvsig.installer.prov</module> |
|
119 |
<module>org.gvsig.installer.swing</module> |
|
120 |
<module>org.gvsig.installer.main</module> |
|
121 |
<module>org.gvsig.installer.maven</module> |
|
122 |
</modules> |
|
123 |
</project> |
|
0 | 124 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/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 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
2 |
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.installer.main</artifactId> |
|
5 |
<packaging>jar</packaging> |
|
6 |
<name>org.gvsig.installer.main</name> |
|
7 |
<parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.installer</artifactId> |
|
10 |
<version>1.0.0-SNAPSHOT</version> |
|
11 |
</parent> |
|
12 |
<dependencies> |
|
13 |
<dependency> |
|
14 |
<groupId>org.gvsig</groupId> |
|
15 |
<artifactId>org.gvsig.installer.lib.api</artifactId> |
|
16 |
<version>1.0.0-SNAPSHOT</version> |
|
17 |
</dependency> |
|
18 |
<dependency> |
|
19 |
<groupId>org.gvsig</groupId> |
|
20 |
<artifactId>org.gvsig.installer.lib.spi</artifactId> |
|
21 |
<version>1.0.0-SNAPSHOT</version> |
|
22 |
</dependency> |
|
23 |
<dependency> |
|
24 |
<groupId>org.gvsig</groupId> |
|
25 |
<artifactId>org.gvsig.installer.lib.impl</artifactId> |
|
26 |
<version>1.0.0-SNAPSHOT</version> |
|
27 |
<!-- The scope is not runtime because there is an utility that uses the Compress class directly |
|
28 |
It will be runtime the day that the API supports this functionality |
|
29 |
<scope>runtime</scope> |
|
30 |
--> |
|
31 |
</dependency> |
|
32 |
<dependency> |
|
33 |
<groupId>org.gvsig</groupId> |
|
34 |
<artifactId>org.gvsig.installer.prov.plugin</artifactId> |
|
35 |
<version>1.0.0-SNAPSHOT</version> |
|
36 |
</dependency> |
|
37 |
<dependency> |
|
38 |
<groupId>org.gvsig</groupId> |
|
39 |
<artifactId>org.gvsig.installer.swing.api</artifactId> |
|
40 |
<version>1.0.0-SNAPSHOT</version> |
|
41 |
</dependency> |
|
42 |
<dependency> |
|
43 |
<groupId>org.gvsig</groupId> |
|
44 |
<artifactId>org.gvsig.ui</artifactId> |
|
45 |
</dependency> |
|
46 |
<dependency> |
|
47 |
<groupId>org.gvsig</groupId> |
|
48 |
<artifactId>org.gvsig.installer.swing.impl</artifactId> |
|
49 |
<version>1.0.0-SNAPSHOT</version> |
|
50 |
<scope>runtime</scope> |
|
51 |
</dependency> |
|
52 |
</dependencies> |
|
53 |
<properties> |
|
54 |
<build-dir>${basedir}/../../build</build-dir> |
|
55 |
</properties> |
|
56 |
</project> |
|
0 | 57 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/org.gvsig.wcs | ||
---|---|---|
1 |
# |
|
2 |
#Wed Apr 28 12:13:53 CEST 2010 |
|
3 |
version=1.0.0 |
|
4 |
oficial=true |
|
5 |
name=myplugin |
|
6 |
type=plugin |
|
7 |
description=Test |
|
8 |
code=org.gvsig.wcs |
|
9 |
state=RC1 |
|
10 |
build=1 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/org.gvsig.plugin2 | ||
---|---|---|
1 |
# |
|
2 |
#Wed Apr 28 12:22:40 CEST 2010 |
|
3 |
version=1.0.0 |
|
4 |
oficial=true |
|
5 |
name=myplugin |
|
6 |
type=plugin |
|
7 |
description=Test |
|
8 |
code=org.gvsig.myplugin2 |
|
9 |
state=RC1 |
|
10 |
build=1 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/org.gvsig.plugin3 | ||
---|---|---|
1 |
# |
|
2 |
#Wed Apr 28 12:10:48 CEST 2010 |
|
3 |
version=1.0.0 |
|
4 |
oficial=false |
|
5 |
name=myplugin |
|
6 |
type=plugin |
|
7 |
description=Test |
|
8 |
code=org.gvsig.plugin3 |
|
9 |
state=RC1 |
|
10 |
build=1 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/utils/CreateBoundleFrame.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.main.utils; |
|
29 |
|
|
30 |
import java.awt.HeadlessException; |
|
31 |
import java.awt.event.ActionEvent; |
|
32 |
import java.awt.event.ActionListener; |
|
33 |
import java.awt.event.WindowEvent; |
|
34 |
import java.awt.event.WindowListener; |
|
35 |
import java.io.File; |
|
36 |
import java.io.FileOutputStream; |
|
37 |
import java.util.ArrayList; |
|
38 |
import java.util.List; |
|
39 |
|
|
40 |
import javax.swing.JFrame; |
|
41 |
import javax.swing.JOptionPane; |
|
42 |
|
|
43 |
import org.gvsig.gui.beans.openfile.FileTextField; |
|
44 |
import org.gvsig.installer.lib.impl.utils.Compress; |
|
45 |
|
|
46 |
/** |
|
47 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
48 |
*/ |
|
49 |
public class CreateBoundleFrame extends JFrame implements WindowListener, |
|
50 |
ActionListener { |
|
51 |
|
|
52 |
/** |
|
53 |
* |
|
54 |
*/ |
|
55 |
private static final long serialVersionUID = -2128261599641241144L; |
|
56 |
private javax.swing.JButton executeButton; |
|
57 |
private javax.swing.JLabel inputLabel; |
|
58 |
private FileTextField inputText; |
|
59 |
private javax.swing.JLabel jLabel2; |
|
60 |
private FileTextField outputText; |
|
61 |
|
|
62 |
public CreateBoundleFrame() throws HeadlessException { |
|
63 |
super(); |
|
64 |
initializeComponents(); |
|
65 |
this.addWindowListener(this); |
|
66 |
executeButton.addActionListener(this); |
|
67 |
} |
|
68 |
|
|
69 |
private void initializeComponents() { |
|
70 |
java.awt.GridBagConstraints gridBagConstraints; |
|
71 |
|
|
72 |
inputLabel = new javax.swing.JLabel(); |
|
73 |
executeButton = new javax.swing.JButton(); |
|
74 |
inputText = new FileTextField(); |
|
75 |
outputText = new FileTextField(); |
|
76 |
jLabel2 = new javax.swing.JLabel(); |
|
77 |
|
|
78 |
setLayout(new java.awt.GridBagLayout()); |
|
79 |
|
|
80 |
inputLabel.setText("Input directory"); |
|
81 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
82 |
gridBagConstraints.gridx = 0; |
|
83 |
gridBagConstraints.gridy = 0; |
|
84 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
|
85 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); |
|
86 |
add(inputLabel, gridBagConstraints); |
|
87 |
|
|
88 |
executeButton.setText("Execute"); |
|
89 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
90 |
gridBagConstraints.gridx = 1; |
|
91 |
gridBagConstraints.gridy = 2; |
|
92 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
|
93 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); |
|
94 |
add(executeButton, gridBagConstraints); |
|
95 |
|
|
96 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
97 |
gridBagConstraints.gridx = 1; |
|
98 |
gridBagConstraints.gridy = 0; |
|
99 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
100 |
gridBagConstraints.ipadx = 67; |
|
101 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
|
102 |
gridBagConstraints.weightx = 1.0; |
|
103 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); |
|
104 |
add(inputText, gridBagConstraints); |
|
105 |
|
|
106 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
107 |
gridBagConstraints.gridx = 1; |
|
108 |
gridBagConstraints.gridy = 1; |
|
109 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
110 |
gridBagConstraints.ipadx = 67; |
|
111 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
|
112 |
gridBagConstraints.weightx = 1.0; |
|
113 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); |
|
114 |
add(outputText, gridBagConstraints); |
|
115 |
|
|
116 |
jLabel2.setText("Output"); |
|
117 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
118 |
gridBagConstraints.gridx = 0; |
|
119 |
gridBagConstraints.gridy = 1; |
|
120 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
|
121 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); |
|
122 |
add(jLabel2, gridBagConstraints); |
|
123 |
|
|
124 |
} |
|
125 |
|
|
126 |
public void windowActivated(WindowEvent arg0) { |
|
127 |
// TODO Auto-generated method stub |
|
128 |
|
|
129 |
} |
|
130 |
|
|
131 |
public void windowClosed(WindowEvent arg0) { |
|
132 |
System.exit(0); |
|
133 |
|
|
134 |
} |
|
135 |
|
|
136 |
public void windowClosing(WindowEvent arg0) { |
|
137 |
// TODO Auto-generated method stub |
|
138 |
|
|
139 |
} |
|
140 |
|
|
141 |
public void windowDeactivated(WindowEvent arg0) { |
|
142 |
// TODO Auto-generated method stub |
|
143 |
|
|
144 |
} |
|
145 |
|
|
146 |
public void windowDeiconified(WindowEvent arg0) { |
|
147 |
// TODO Auto-generated method stub |
|
148 |
|
|
149 |
} |
|
150 |
|
|
151 |
public void windowIconified(WindowEvent arg0) { |
|
152 |
// TODO Auto-generated method stub |
|
153 |
|
|
154 |
} |
|
155 |
|
|
156 |
public void windowOpened(WindowEvent arg0) { |
|
157 |
// TODO Auto-generated method stub |
|
158 |
|
|
159 |
} |
|
160 |
|
|
161 |
public void actionPerformed(ActionEvent arg0) { |
|
162 |
File inputDirectory = inputText.getSelectedFile(); |
|
163 |
File outputFile = outputText.getSelectedFile(); |
|
164 |
|
|
165 |
if (!inputDirectory.exists()) { |
|
166 |
JOptionPane |
|
167 |
.showMessageDialog(this, "Input directory doesn't exist"); |
|
168 |
return; |
|
169 |
} |
|
170 |
|
|
171 |
if (outputFile.exists()) { |
|
172 |
outputFile.delete(); |
|
173 |
} |
|
174 |
|
|
175 |
Compress compress = new Compress(); |
|
176 |
try { |
|
177 |
File[] files = inputDirectory.listFiles(); |
|
178 |
List<File> filesArray = new ArrayList<File>(); |
|
179 |
List<String> fileNamesArray = new ArrayList<String>(); |
|
180 |
for (int i = 0; i < files.length; i++) { |
|
181 |
if (!files[i].getName().toUpperCase().equals(".SVN")) { |
|
182 |
filesArray.add(files[i]); |
|
183 |
fileNamesArray.add(files[i].getName()); |
|
184 |
} |
|
185 |
} |
|
186 |
compress.compressPluginsAsPackageSet(filesArray, fileNamesArray, |
|
187 |
new FileOutputStream(outputFile)); |
|
188 |
} catch (Exception e) { |
|
189 |
JOptionPane.showMessageDialog(this, e.toString()); |
|
190 |
} |
|
191 |
} |
|
192 |
} |
|
0 | 193 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/utils/CreateBundleLauncher.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.main.utils; |
|
29 |
|
|
30 |
/** |
|
31 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
32 |
*/ |
|
33 |
public class CreateBundleLauncher { |
|
34 |
|
|
35 |
public static void main(String[] args) { |
|
36 |
new CreateBundleLauncher(); |
|
37 |
} |
|
38 |
|
|
39 |
public CreateBundleLauncher() { |
|
40 |
super(); |
|
41 |
CreateBoundleFrame createBoundleFrame = new CreateBoundleFrame(); |
|
42 |
createBoundleFrame.setBounds(0, 0, 500, 150); |
|
43 |
createBoundleFrame.setVisible(true); |
|
44 |
} |
|
45 |
|
|
46 |
} |
|
0 | 47 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/utils/FrameWizardListener.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.main.utils; |
|
29 |
|
|
30 |
import javax.swing.JFrame; |
|
31 |
|
|
32 |
import org.gvsig.installer.swing.api.wizard.InstallerWizardActionListener; |
|
33 |
import org.gvsig.installer.swing.api.wizard.InstallerWizardPanel; |
|
34 |
|
|
35 |
/** |
|
36 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
37 |
*/ |
|
38 |
public class FrameWizardListener implements InstallerWizardActionListener { |
|
39 |
|
|
40 |
private JFrame frame = null; |
|
41 |
|
|
42 |
public FrameWizardListener(JFrame frame) { |
|
43 |
super(); |
|
44 |
this.frame = frame; |
|
45 |
} |
|
46 |
|
|
47 |
public void cancel(InstallerWizardPanel installerWizard) { |
|
48 |
frame.setVisible(false); |
|
49 |
System.exit(0); |
|
50 |
|
|
51 |
} |
|
52 |
|
|
53 |
public void finish(InstallerWizardPanel installerWizard) { |
|
54 |
frame.setVisible(false); |
|
55 |
System.exit(0); |
|
56 |
} |
|
57 |
|
|
58 |
} |
|
0 | 59 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/execution/InstallPackageServiceFrame.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.main.execution; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
|
|
32 |
import javax.swing.JFrame; |
|
33 |
|
|
34 |
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException; |
|
35 |
import org.gvsig.installer.main.utils.FrameWizardListener; |
|
36 |
import org.gvsig.installer.swing.api.SwingInstallerLocator; |
|
37 |
import org.gvsig.installer.swing.api.execution.InstallPackageWizard; |
|
38 |
import org.gvsig.installer.swing.api.execution.InstallPackageWizardException; |
|
39 |
import org.gvsig.tools.locator.LocatorException; |
|
40 |
|
|
41 |
/** |
|
42 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
43 |
*/ |
|
44 |
public class InstallPackageServiceFrame extends JFrame { |
|
45 |
|
|
46 |
private static final long serialVersionUID = -5107758157530922356L; |
|
47 |
private InstallPackageWizard installerExecutionWizard; |
|
48 |
|
|
49 |
public InstallPackageServiceFrame(File applicationFolder, |
|
50 |
File pluginsFolder, File installFolder) throws LocatorException, |
|
51 |
InstallPackageWizardException { |
|
52 |
super(); |
|
53 |
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
54 |
installerExecutionWizard = |
|
55 |
SwingInstallerLocator.getSwingInstallerManager() |
|
56 |
.createInstallPackageWizard(applicationFolder, pluginsFolder, |
|
57 |
installFolder); |
|
58 |
installerExecutionWizard |
|
59 |
.setWizardActionListener(new FrameWizardListener(this)); |
|
60 |
this.add(installerExecutionWizard); |
|
61 |
pack(); |
|
62 |
} |
|
63 |
|
|
64 |
public void installFromDefaultDirectory() |
|
65 |
throws InstallPackageServiceException { |
|
66 |
installerExecutionWizard.installFromDefaultDirectory(); |
|
67 |
} |
|
68 |
|
|
69 |
} |
|
0 | 70 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/execution/InstallPackageWizardFromDefaultDirectoryLauncher.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.main.execution; |
|
29 |
|
|
30 |
import java.io.IOException; |
|
31 |
|
|
32 |
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException; |
|
33 |
import org.gvsig.installer.main.DefaultLauncher; |
|
34 |
import org.gvsig.installer.main.MainInstallerLibrary; |
|
35 |
import org.gvsig.installer.swing.api.execution.InstallPackageWizardException; |
|
36 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
37 |
import org.gvsig.tools.locator.LocatorException; |
|
38 |
|
|
39 |
/** |
|
40 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
41 |
*/ |
|
42 |
public class InstallPackageWizardFromDefaultDirectoryLauncher extends |
|
43 |
DefaultLauncher { |
|
44 |
|
|
45 |
public static void main(String[] args) throws LocatorException, |
|
46 |
InstallPackageServiceException, InstallPackageWizardException, |
|
47 |
IOException { |
|
48 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
49 |
MainInstallerLibrary mainInstallerLibrary = new MainInstallerLibrary(); |
|
50 |
mainInstallerLibrary.initialize(); |
|
51 |
mainInstallerLibrary.postInitialize(); |
|
52 |
|
|
53 |
new InstallPackageWizardFromDefaultDirectoryLauncher(); |
|
54 |
} |
|
55 |
|
|
56 |
public InstallPackageWizardFromDefaultDirectoryLauncher() |
|
57 |
throws LocatorException, InstallPackageWizardException, |
|
58 |
InstallPackageServiceException, IOException { |
|
59 |
|
|
60 |
InstallPackageServiceFrame frame = |
|
61 |
new InstallPackageServiceFrame(getApplicationFolder(), |
|
62 |
getPluginsFolder(), getInstallFolder()); |
|
63 |
frame.installFromDefaultDirectory(); |
|
64 |
frame.setVisible(true); |
|
65 |
} |
|
66 |
} |
|
0 | 67 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/execution/InstallPackageWizardLauncher.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.main.execution; |
|
29 |
|
|
30 |
import java.io.IOException; |
|
31 |
|
|
32 |
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException; |
|
33 |
import org.gvsig.installer.main.DefaultLauncher; |
|
34 |
import org.gvsig.installer.main.MainInstallerLibrary; |
|
35 |
import org.gvsig.installer.swing.api.execution.InstallPackageWizardException; |
|
36 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
37 |
import org.gvsig.tools.locator.LocatorException; |
|
38 |
|
|
39 |
/** |
|
40 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
41 |
*/ |
|
42 |
public class InstallPackageWizardLauncher extends DefaultLauncher { |
|
43 |
|
|
44 |
public static void main(String[] args) throws LocatorException, |
|
45 |
InstallPackageServiceException, InstallPackageWizardException, |
|
46 |
IOException { |
|
47 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
48 |
MainInstallerLibrary mainInstallerLibrary = new MainInstallerLibrary(); |
|
49 |
mainInstallerLibrary.initialize(); |
|
50 |
mainInstallerLibrary.postInitialize(); |
|
51 |
|
|
52 |
new InstallPackageWizardLauncher(); |
|
53 |
} |
|
54 |
|
|
55 |
public InstallPackageWizardLauncher() throws LocatorException, |
|
56 |
InstallPackageWizardException, InstallPackageServiceException, |
|
57 |
IOException { |
|
58 |
|
|
59 |
InstallPackageServiceFrame frame = |
|
60 |
new InstallPackageServiceFrame(getApplicationFolder(), |
|
61 |
getPluginsFolder(), getInstallFolder()); |
|
62 |
frame.setVisible(true); |
|
63 |
} |
|
64 |
} |
|
0 | 65 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/creation/MakePluginPackageFrame.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.main.creation; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
|
|
32 |
import javax.swing.JFrame; |
|
33 |
|
|
34 |
import org.gvsig.installer.main.utils.FrameWizardListener; |
|
35 |
import org.gvsig.installer.swing.api.SwingInstallerLocator; |
|
36 |
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizard; |
|
37 |
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizardException; |
|
38 |
import org.gvsig.tools.locator.LocatorException; |
|
39 |
|
|
40 |
/** |
|
41 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
42 |
*/ |
|
43 |
public class MakePluginPackageFrame extends JFrame { |
|
44 |
|
|
45 |
private static final long serialVersionUID = 4144834319158286247L; |
|
46 |
private MakePluginPackageWizard installerCreationWizard; |
|
47 |
|
|
48 |
public MakePluginPackageFrame(File applicationFolder, File pluginsFolder, |
|
49 |
File installFolder) throws LocatorException, |
|
50 |
MakePluginPackageWizardException { |
|
51 |
super(); |
|
52 |
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
53 |
installerCreationWizard = |
|
54 |
SwingInstallerLocator.getSwingInstallerManager() |
|
55 |
.createMakePluginPackageWizard(applicationFolder, |
|
56 |
pluginsFolder, installFolder); |
|
57 |
installerCreationWizard |
|
58 |
.setWizardActionListener(new FrameWizardListener(this)); |
|
59 |
this.add(installerCreationWizard); |
|
60 |
pack(); |
|
61 |
} |
|
62 |
|
|
63 |
} |
|
0 | 64 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/creation/MakePluginPackageWizardLauncher.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.main.creation; |
|
29 |
|
|
30 |
import java.io.IOException; |
|
31 |
|
|
32 |
import org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException; |
|
33 |
import org.gvsig.installer.main.DefaultLauncher; |
|
34 |
import org.gvsig.installer.main.MainInstallerLibrary; |
|
35 |
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizardException; |
|
36 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
37 |
import org.gvsig.tools.locator.LocatorException; |
|
38 |
|
|
39 |
/** |
|
40 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
41 |
*/ |
|
42 |
public class MakePluginPackageWizardLauncher extends DefaultLauncher { |
|
43 |
|
|
44 |
public static void main(String[] args) throws LocatorException, |
|
45 |
MakePluginPackageWizardException, IOException, |
|
46 |
MakePluginPackageServiceException { |
|
47 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
48 |
MainInstallerLibrary mainInstallerLibrary = new MainInstallerLibrary(); |
|
49 |
mainInstallerLibrary.initialize(); |
|
50 |
mainInstallerLibrary.postInitialize(); |
|
51 |
|
|
52 |
new MakePluginPackageWizardLauncher(); |
|
53 |
} |
|
54 |
|
|
55 |
public MakePluginPackageWizardLauncher() throws LocatorException, |
|
56 |
MakePluginPackageWizardException, IOException, |
|
57 |
MakePluginPackageServiceException { |
|
58 |
|
|
59 |
MakePluginPackageFrame frame = |
|
60 |
new MakePluginPackageFrame(getApplicationFolder(), |
|
61 |
getPluginsFolder(), getInstallFolder()); |
|
62 |
frame.setVisible(true); |
|
63 |
} |
|
64 |
|
|
65 |
} |
|
0 | 66 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/DefaultLauncher.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.main; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
import java.io.FileInputStream; |
|
32 |
import java.io.FileOutputStream; |
|
33 |
import java.io.IOException; |
|
34 |
import java.io.InputStream; |
|
35 |
import java.io.OutputStream; |
|
36 |
|
|
37 |
/** |
|
38 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
39 |
*/ |
|
40 |
public class DefaultLauncher { |
|
41 |
|
|
42 |
private File appFolder; |
|
43 |
|
|
44 |
public File getApplicationFolder() throws IOException { |
|
45 |
if (appFolder == null) { |
|
46 |
File templateFile = |
|
47 |
new File(getClass().getClassLoader().getResource("application") |
|
48 |
.getFile()); |
|
49 |
appFolder = |
|
50 |
new File(System.getProperty("java.io.tmpdir") + File.separator |
|
51 |
+ "tmp_gvsig_installer"); |
|
52 |
|
|
53 |
copy(templateFile, appFolder); |
|
54 |
} |
|
55 |
|
|
56 |
return appFolder; |
|
57 |
} |
|
58 |
|
|
59 |
public File getPluginsFolder() throws IOException { |
|
60 |
return new File(appFolder, "plugins"); |
|
61 |
} |
|
62 |
|
|
63 |
public File getInstallFolder() throws IOException { |
|
64 |
return new File(appFolder, "install"); |
|
65 |
} |
|
66 |
|
|
67 |
public void copy(File sourceLocation, File targetLocation) |
|
68 |
throws IOException { |
|
69 |
if (sourceLocation.isDirectory()) { |
|
70 |
if (!targetLocation.exists()) { |
|
71 |
targetLocation.mkdir(); |
|
72 |
} |
|
73 |
|
|
74 |
String[] children = sourceLocation.list(); |
|
75 |
for (int i = 0; i < children.length; i++) { |
|
76 |
copy(new File(sourceLocation, children[i]), new File( |
|
77 |
targetLocation, children[i])); |
|
78 |
} |
|
79 |
} else { |
|
80 |
targetLocation.getParentFile().mkdirs(); |
|
81 |
|
|
82 |
InputStream in = new FileInputStream(sourceLocation); |
|
83 |
OutputStream out = new FileOutputStream(targetLocation); |
|
84 |
|
|
85 |
// Copy the bits from instream to outstream |
|
86 |
byte[] buf = new byte[1024]; |
|
87 |
int len; |
|
88 |
while ((len = in.read(buf)) > 0) { |
|
89 |
out.write(buf, 0, len); |
|
90 |
} |
|
91 |
in.close(); |
|
92 |
out.close(); |
|
93 |
} |
|
94 |
} |
|
95 |
} |
|
0 | 96 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/MainInstallerLibrary.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.main; |
|
29 |
|
|
30 |
import org.gvsig.tools.library.AbstractLibrary; |
|
31 |
import org.gvsig.tools.library.LibraryException; |
|
32 |
|
|
33 |
/** |
|
34 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
35 |
*/ |
|
36 |
public class MainInstallerLibrary extends AbstractLibrary { |
|
37 |
|
|
38 |
public MainInstallerLibrary() { |
|
39 |
super(MainInstallerLibrary.class, TYPE.IMPL); |
|
40 |
} |
|
41 |
|
|
42 |
@Override |
|
43 |
protected void doInitialize() throws LibraryException { |
|
44 |
|
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
protected void doPostInitialize() throws LibraryException { |
|
49 |
|
|
50 |
} |
|
51 |
} |
|
0 | 52 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/resources/application/gvSIG/extensiones/org.gvsig.plugin2/package.info | ||
---|---|---|
1 |
code=org.gvsig.myplugin2 |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=2019019 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
|
9 |
state=devel |
|
10 |
operating-system=all |
|
11 |
architecture=all |
|
12 |
gvSIG-version=2.0.0 |
|
13 |
java-versiona-version=j1_5 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/resources/application/gvSIG/extensiones/org.gvsig.plugin3/package.info | ||
---|---|---|
1 |
code=org.gvsig.plugin3 |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=2019019 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
|
9 |
state=devel |
|
10 |
operating-system=all |
|
11 |
architecture=all |
|
12 |
gvSIG-version=2.0.0 |
|
13 |
java-versiona-version=j1_5 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/resources/application/gvSIG/extensiones/org.gvsig.plugin1/package.info | ||
---|---|---|
1 |
code=org.gvsig.myplugin |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=2019019 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
|
9 |
state=devel |
|
10 |
operating-system=all |
|
11 |
architecture=all |
|
12 |
gvSIG-version=2.0.0 |
|
13 |
java-versiona-version=j1_5 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.spi/src/main/java/org/gvsig/installer/lib/spi/InstallerProviderLocator.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.lib.spi; |
|
29 |
|
|
30 |
import org.gvsig.tools.locator.BaseLocator; |
|
31 |
import org.gvsig.tools.locator.Locator; |
|
32 |
import org.gvsig.tools.locator.LocatorException; |
|
33 |
|
|
34 |
/** |
|
35 |
* This Locator provides the entry point for the gvSIG |
|
36 |
* {@link InstallerProviderManager} |
|
37 |
* |
|
38 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
39 |
*/ |
|
40 |
public class InstallerProviderLocator extends BaseLocator { |
|
41 |
|
|
42 |
private static final String LOCATOR_NAME = "Installer.provider.locator"; |
|
43 |
public static final String PROVIDER_MANAGER_NAME = |
|
44 |
"Installer.provider.manager"; |
|
45 |
public static final String PROVIDER_MANAGER_DESCRIPTION = |
|
46 |
"Installer Manager"; |
|
47 |
|
|
48 |
/** |
|
49 |
* Unique instance. |
|
50 |
*/ |
|
51 |
private static final InstallerProviderLocator instance = |
|
52 |
new InstallerProviderLocator(); |
|
53 |
|
|
54 |
/** |
|
55 |
* Return the singleton instance. |
|
56 |
* |
|
57 |
* @return the singleton instance |
|
58 |
*/ |
|
59 |
public static InstallerProviderLocator getInstance() { |
|
60 |
return instance; |
|
61 |
} |
|
62 |
|
|
63 |
/** |
|
64 |
* Return the Locator's name |
|
65 |
* |
|
66 |
* @return a String with the Locator's name |
|
67 |
*/ |
|
68 |
@Override |
|
69 |
public String getLocatorName() { |
|
70 |
return LOCATOR_NAME; |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* Return a reference to InstallerProviderManager. |
|
75 |
* |
|
76 |
* @return a reference to InstallerProviderManager |
|
77 |
* @throws LocatorException |
|
78 |
* if there is no access to the class or the class cannot be |
|
79 |
* instantiated |
|
80 |
* @see Locator#get(String) |
|
81 |
*/ |
|
82 |
public static InstallerProviderManager getProviderManager() |
|
83 |
throws LocatorException { |
|
84 |
return (InstallerProviderManager) getInstance().get( |
|
85 |
PROVIDER_MANAGER_NAME); |
|
86 |
} |
|
87 |
|
|
88 |
/** |
|
89 |
* Registers the Class implementing the InstallerProviderManager interface. |
|
90 |
* |
|
91 |
* @param clazz |
|
92 |
* implementing the InstallerProviderManager interface |
|
93 |
*/ |
|
94 |
public static void registerInstallerProviderManager( |
|
95 |
Class<? extends InstallerProviderManager> clazz) { |
|
96 |
getInstance().register(PROVIDER_MANAGER_NAME, |
|
97 |
PROVIDER_MANAGER_DESCRIPTION, clazz); |
|
98 |
} |
|
99 |
|
|
100 |
} |
|
0 | 101 |
tags/v2_0_0_Build_2024/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.spi/src/main/java/org/gvsig/installer/lib/spi/InstallPackageProviderServices.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 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.lib.spi; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
import java.io.IOException; |
|
32 |
import java.io.InputStream; |
|
33 |
import java.io.OutputStream; |
|
34 |
import java.net.URL; |
|
35 |
import java.util.List; |
|
36 |
import java.util.Map; |
|
37 |
|
|
38 |
import org.gvsig.installer.lib.api.PackageInfo; |
|
39 |
import org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException; |
|
40 |
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException; |
|
41 |
import org.gvsig.tools.service.spi.ProviderServices; |
|
42 |
|
|
43 |
/** |
|
44 |
* Services that can be used by the providers to create or exceute the bundle. |
|
45 |
* It |
|
46 |
* contains methods to compress and to decompress files and methods to |
|
47 |
* read an install a package file from a directory. |
|
48 |
* |
|
49 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
50 |
*/ |
|
51 |
public interface InstallPackageProviderServices extends ProviderServices { |
|
52 |
|
|
53 |
/** |
|
54 |
* It decompress an input stream and write it on a directory. |
|
55 |
* |
|
56 |
* @param is |
|
57 |
* The input stream to decompress |
|
58 |
* @param outputDirectory |
|
59 |
* . |
|
60 |
* The output directory. |
|
61 |
* @throws InstallPackageServiceException |
|
62 |
* If there is a problem decompressing the stream. |
|
63 |
*/ |
|
64 |
public void decompress(InputStream is, File outputDirectory) |
|
65 |
throws InstallPackageServiceException; |
|
66 |
|
|
67 |
/** |
|
68 |
* Compress a folder as a zipped package set in the given outputstream with |
|
69 |
* a concrete name. |
|
70 |
* |
|
71 |
* @param folder |
|
72 |
* the folder to compress. |
|
73 |
* @param fileName |
|
74 |
* name of the zip entry that has the output file. |
|
75 |
* The name that have to have |
|
76 |
* @param os |
|
77 |
* output stream to write the output. |
|
78 |
* @throws MakePluginPackageServiceException |
|
79 |
* if there is any problem compressing. |
|
80 |
*/ |
|
81 |
public void compressPackageSet(File folder, String fileName, OutputStream os) |
|
82 |
throws MakePluginPackageServiceException; |
|
83 |
|
|
84 |
/** |
|
85 |
* Compress a plugin folder using the plugin's name as a package. |
|
86 |
* |
|
87 |
* @param folder |
|
88 |
* the directory to compress. |
|
89 |
* @param os |
|
90 |
* output stream to write the output. |
|
91 |
* @throws MakePluginPackageServiceException |
|
92 |
* if there is any problem compressing. |
|
93 |
*/ |
|
94 |
public void compressPackage(File folder, OutputStream os) |
|
95 |
throws MakePluginPackageServiceException; |
|
96 |
|
|
97 |
/** |
|
98 |
* Compress a plugin folder using the plugin's name as a package, only |
|
99 |
* with the files needed by the package index. |
|
100 |
* |
|
101 |
* @param folder |
|
102 |
* the directory to compress. |
|
103 |
* @param os |
|
104 |
* output stream to write the output. |
|
105 |
* @throws MakePluginPackageServiceException |
|
106 |
* if there is any problem compressing. |
|
107 |
*/ |
|
108 |
public void compressPackageIndex(File folder, OutputStream os) |
|
109 |
throws MakePluginPackageServiceException; |
|
110 |
|
|
111 |
/** |
|
112 |
* Reads the package.info file from a directory a fills the the properties |
|
113 |
* of the {@link PackageInfo} object. |
|
114 |
* |
|
115 |
* @param directory |
|
116 |
* the root directory that contains the installinfo file |
|
117 |
* @param installInfo |
|
118 |
* the installinfo file that has to be filled. |
|
119 |
* @throws InstallerInfoFileException. |
|
120 |
* if there is any problem reading the file |
|
121 |
*/ |
|
122 |
public void readPackageInfo(File directory, PackageInfo installerInfo) |
|
123 |
throws InstallerInfoFileException; |
|
124 |
|
|
125 |
/** |
|
126 |
* Reads the package.info file from a package set and fills the the |
|
127 |
* properties of the {@link PackageInfo} objects. |
|
128 |
* |
|
129 |
* @param is |
|
130 |
* the input stream of a bundle. |
|
131 |
* @param packageInfos |
|
132 |
* a list of the information of the packages to install. |
|
133 |
* @param zipEntriesMap |
|
134 |
* a map to retrieve the zipEntry for every package. This |
|
135 |
* information is necessary to |
|
136 |
* select the plugin to decompress. |
|
137 |
* @throws InstallPackageServiceException |
|
138 |
* if there is a problem reading the bundle. |
Also available in: Unified diff