Revision 38692
tags/v2_0_0_Build_2050/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_2050/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_2050/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 = new File(getClass().getClassLoader() |
|
47 |
.getResource("application").getFile()); |
|
48 |
appFolder = new File(System.getProperty("java.io.tmpdir") |
|
49 |
+ File.separator + "tmp_gvsig_installer"); |
|
50 |
|
|
51 |
copy(templateFile, appFolder); |
|
52 |
} |
|
53 |
|
|
54 |
return appFolder; |
|
55 |
} |
|
56 |
|
|
57 |
public File getPluginsFolder() throws IOException { |
|
58 |
return new File(appFolder, "plugins"); |
|
59 |
} |
|
60 |
|
|
61 |
public File getInstallFolder() throws IOException { |
|
62 |
return new File(appFolder, "install"); |
|
63 |
} |
|
64 |
|
|
65 |
public void copy(File sourceLocation, File targetLocation) |
|
66 |
throws IOException { |
|
67 |
if (sourceLocation.isDirectory()) { |
|
68 |
if (!targetLocation.exists()) { |
|
69 |
targetLocation.mkdir(); |
|
70 |
} |
|
71 |
|
|
72 |
String[] children = sourceLocation.list(); |
|
73 |
for (int i = 0; i < children.length; i++) { |
|
74 |
copy(new File(sourceLocation, children[i]), new File( |
|
75 |
targetLocation, children[i])); |
|
76 |
} |
|
77 |
} else { |
|
78 |
targetLocation.getParentFile().mkdirs(); |
|
79 |
|
|
80 |
InputStream in = new FileInputStream(sourceLocation); |
|
81 |
OutputStream out = new FileOutputStream(targetLocation); |
|
82 |
|
|
83 |
// Copy the bits from instream to outstream |
|
84 |
byte[] buf = new byte[1024]; |
|
85 |
int len; |
|
86 |
while ((len = in.read(buf)) > 0) { |
|
87 |
out.write(buf, 0, len); |
|
88 |
} |
|
89 |
in.close(); |
|
90 |
out.close(); |
|
91 |
} |
|
92 |
} |
|
93 |
} |
|
0 | 94 |
tags/v2_0_0_Build_2050/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_2050/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_2050/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_2050/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.AbstractInstallPackageWizard; |
|
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 AbstractInstallPackageWizard installerExecutionWizard; |
|
48 |
|
|
49 |
public InstallPackageServiceFrame(File applicationFolder, File installFolder) |
|
50 |
throws LocatorException, InstallPackageWizardException { |
|
51 |
super(); |
|
52 |
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
53 |
installerExecutionWizard = SwingInstallerLocator |
|
54 |
.getSwingInstallerManager().createInstallPackageWizard( |
|
55 |
applicationFolder, installFolder); |
|
56 |
installerExecutionWizard |
|
57 |
.setWizardActionListener(new FrameWizardListener(this)); |
|
58 |
this.add(installerExecutionWizard); |
|
59 |
pack(); |
|
60 |
} |
|
61 |
|
|
62 |
public void installFromDefaultDirectory() |
|
63 |
throws InstallPackageServiceException { |
|
64 |
installerExecutionWizard.installFromDefaultDirectory(); |
|
65 |
} |
|
66 |
|
|
67 |
} |
|
0 | 68 |
tags/v2_0_0_Build_2050/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.swing.api.execution.InstallPackageWizardException; |
|
35 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
36 |
import org.gvsig.tools.locator.LocatorException; |
|
37 |
|
|
38 |
/** |
|
39 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
40 |
*/ |
|
41 |
public class InstallPackageWizardFromDefaultDirectoryLauncher extends |
|
42 |
DefaultLauncher { |
|
43 |
|
|
44 |
public static void main(String[] args) throws LocatorException, |
|
45 |
InstallPackageServiceException, InstallPackageWizardException, |
|
46 |
IOException { |
|
47 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
48 |
new InstallPackageWizardFromDefaultDirectoryLauncher(); |
|
49 |
} |
|
50 |
|
|
51 |
public InstallPackageWizardFromDefaultDirectoryLauncher() |
|
52 |
throws LocatorException, InstallPackageWizardException, |
|
53 |
InstallPackageServiceException, IOException { |
|
54 |
|
|
55 |
InstallPackageServiceFrame frame = new InstallPackageServiceFrame( |
|
56 |
getApplicationFolder(), getInstallFolder()); |
|
57 |
frame.installFromDefaultDirectory(); |
|
58 |
frame.setVisible(true); |
|
59 |
} |
|
60 |
} |
|
0 | 61 |
tags/v2_0_0_Build_2050/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.swing.api.execution.InstallPackageWizardException; |
|
35 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
36 |
import org.gvsig.tools.locator.LocatorException; |
|
37 |
|
|
38 |
/** |
|
39 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
40 |
*/ |
|
41 |
public class InstallPackageWizardLauncher extends DefaultLauncher { |
|
42 |
|
|
43 |
public static void main(String[] args) throws LocatorException, |
|
44 |
InstallPackageServiceException, InstallPackageWizardException, |
|
45 |
IOException { |
|
46 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
47 |
new InstallPackageWizardLauncher(); |
|
48 |
} |
|
49 |
|
|
50 |
public InstallPackageWizardLauncher() throws LocatorException, |
|
51 |
InstallPackageWizardException, InstallPackageServiceException, |
|
52 |
IOException { |
|
53 |
|
|
54 |
InstallPackageServiceFrame frame = new InstallPackageServiceFrame( |
|
55 |
getApplicationFolder(), getInstallFolder()); |
|
56 |
frame.setVisible(true); |
|
57 |
} |
|
58 |
} |
|
0 | 59 |
tags/v2_0_0_Build_2050/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.swing.api.creation.MakePluginPackageWizardException; |
|
35 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
36 |
import org.gvsig.tools.locator.LocatorException; |
|
37 |
|
|
38 |
/** |
|
39 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
40 |
*/ |
|
41 |
public class MakePluginPackageWizardLauncher extends DefaultLauncher { |
|
42 |
|
|
43 |
public static void main(String[] args) throws LocatorException, |
|
44 |
MakePluginPackageWizardException, IOException, |
|
45 |
MakePluginPackageServiceException { |
|
46 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
47 |
new MakePluginPackageWizardLauncher(); |
|
48 |
} |
|
49 |
|
|
50 |
public MakePluginPackageWizardLauncher() throws LocatorException, |
|
51 |
MakePluginPackageWizardException, IOException, |
|
52 |
MakePluginPackageServiceException { |
|
53 |
|
|
54 |
MakePluginPackageFrame frame = new MakePluginPackageFrame( |
|
55 |
getApplicationFolder(), getInstallFolder()); |
|
56 |
frame.setVisible(true); |
|
57 |
} |
|
58 |
|
|
59 |
} |
|
0 | 60 |
tags/v2_0_0_Build_2050/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 installFolder) |
|
49 |
throws LocatorException, MakePluginPackageWizardException { |
|
50 |
super(); |
|
51 |
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
52 |
installerCreationWizard = SwingInstallerLocator |
|
53 |
.getSwingInstallerManager().createMakePluginPackageWizard( |
|
54 |
applicationFolder, installFolder); |
|
55 |
installerCreationWizard |
|
56 |
.setWizardActionListener(new FrameWizardListener(this)); |
|
57 |
this.add(installerCreationWizard); |
|
58 |
pack(); |
|
59 |
} |
|
60 |
|
|
61 |
} |
|
0 | 62 |
tags/v2_0_0_Build_2050/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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<artifactId>org.gvsig.installer.main</artifactId> |
|
4 |
<packaging>jar</packaging> |
|
5 |
<name>org.gvsig.installer.main</name> |
|
6 |
<parent> |
|
7 |
<groupId>org.gvsig</groupId> |
|
8 |
<artifactId>org.gvsig.installer</artifactId> |
|
9 |
<version>1.0.1-SNAPSHOT</version> |
|
10 |
</parent> |
|
11 |
<dependencies> |
|
12 |
<dependency> |
|
13 |
<groupId>org.gvsig</groupId> |
|
14 |
<artifactId>org.gvsig.installer.lib.api</artifactId> |
|
15 |
<version>1.0.1-SNAPSHOT</version> |
|
16 |
<scope>compile</scope> |
|
17 |
</dependency> |
|
18 |
<dependency> |
|
19 |
<groupId>org.gvsig</groupId> |
|
20 |
<artifactId>org.gvsig.installer.lib.spi</artifactId> |
|
21 |
<version>1.0.1-SNAPSHOT</version> |
|
22 |
<scope>compile</scope> |
|
23 |
</dependency> |
|
24 |
<dependency> |
|
25 |
<groupId>org.gvsig</groupId> |
|
26 |
<artifactId>org.gvsig.installer.lib.impl</artifactId> |
|
27 |
<version>1.0.1-SNAPSHOT</version> |
|
28 |
<!-- The scope is not runtime because there is an utility that uses the Compress class directly |
|
29 |
It will be runtime the day that the API supports this functionality |
|
30 |
--> |
|
31 |
<scope>compile</scope> |
|
32 |
</dependency> |
|
33 |
<dependency> |
|
34 |
<groupId>org.gvsig</groupId> |
|
35 |
<artifactId>org.gvsig.installer.prov.plugin</artifactId> |
|
36 |
<version>1.0.1-SNAPSHOT</version> |
|
37 |
</dependency> |
|
38 |
<dependency> |
|
39 |
<groupId>org.gvsig</groupId> |
|
40 |
<artifactId>org.gvsig.installer.swing.api</artifactId> |
|
41 |
<version>1.0.1-SNAPSHOT</version> |
|
42 |
<scope>compile</scope> |
|
43 |
</dependency> |
|
44 |
<dependency> |
|
45 |
<groupId>org.gvsig</groupId> |
|
46 |
<artifactId>org.gvsig.installer.swing.impl</artifactId> |
|
47 |
<version>1.0.1-SNAPSHOT</version> |
|
48 |
</dependency> |
|
49 |
<dependency> |
|
50 |
<groupId>org.gvsig</groupId> |
|
51 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
52 |
<scope>compile</scope> |
|
53 |
</dependency> |
|
54 |
<dependency> |
|
55 |
<groupId>org.gvsig</groupId> |
|
56 |
<artifactId>org.gvsig.ui</artifactId> |
|
57 |
<scope>compile</scope> |
|
58 |
</dependency> |
|
59 |
</dependencies> |
|
60 |
</project> |
|
0 | 61 |
tags/v2_0_0_Build_2050/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 |
|
0 | 11 |
tags/v2_0_0_Build_2050/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 = "Installer.provider.manager"; |
|
44 |
public static final String PROVIDER_MANAGER_DESCRIPTION = "Installer Manager"; |
|
45 |
|
|
46 |
/** |
|
47 |
* Unique instance. |
|
48 |
*/ |
|
49 |
private static final InstallerProviderLocator instance = new InstallerProviderLocator(); |
|
50 |
|
|
51 |
/** |
|
52 |
* Return the singleton instance. |
|
53 |
* |
|
54 |
* @return the singleton instance |
|
55 |
*/ |
|
56 |
public static InstallerProviderLocator getInstance() { |
|
57 |
return instance; |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* Return the Locator's name |
|
62 |
* |
|
63 |
* @return a String with the Locator's name |
|
64 |
*/ |
|
65 |
@Override |
|
66 |
public String getLocatorName() { |
|
67 |
return LOCATOR_NAME; |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* Return a reference to InstallerProviderManager. |
|
72 |
* |
|
73 |
* @return a reference to InstallerProviderManager |
|
74 |
* @throws LocatorException |
|
75 |
* if there is no access to the class or the class cannot be |
|
76 |
* instantiated |
|
77 |
* @see Locator#get(String) |
|
78 |
*/ |
|
79 |
public static InstallerProviderManager getProviderManager() |
|
80 |
throws LocatorException { |
|
81 |
return (InstallerProviderManager) getInstance().get( |
|
82 |
PROVIDER_MANAGER_NAME); |
|
83 |
} |
|
84 |
|
|
85 |
/** |
|
86 |
* Registers the Class implementing the InstallerProviderManager interface. |
|
87 |
* |
|
88 |
* @param clazz |
|
89 |
* implementing the InstallerProviderManager interface |
|
90 |
*/ |
|
91 |
public static void registerInstallerProviderManager( |
|
92 |
Class<? extends InstallerProviderManager> clazz) { |
|
93 |
getInstance().register(PROVIDER_MANAGER_NAME, |
|
94 |
PROVIDER_MANAGER_DESCRIPTION, clazz); |
|
95 |
} |
|
96 |
|
|
97 |
} |
|
0 | 98 |
tags/v2_0_0_Build_2050/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.InputStream; |
|
32 |
import java.io.OutputStream; |
|
33 |
import java.util.List; |
|
34 |
import java.util.Map; |
|
35 |
|
|
36 |
import org.gvsig.installer.lib.api.PackageInfo; |
|
37 |
import org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException; |
|
38 |
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException; |
|
39 |
import org.gvsig.tools.service.spi.ProviderServices; |
|
40 |
|
|
41 |
/** |
|
42 |
* Services that can be used by the providers to create or exceute the bundle. |
|
43 |
* It contains methods to compress and to decompress files and methods to read |
|
44 |
* an install a package file from a directory. |
|
45 |
* |
|
46 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
47 |
*/ |
|
48 |
public interface InstallPackageProviderServices extends ProviderServices { |
|
49 |
|
|
50 |
/** |
|
51 |
* It decompress an input stream and write it on a directory. |
|
52 |
* |
|
53 |
* @param is |
|
54 |
* The input stream to decompress |
|
55 |
* @param outputDirectory |
|
56 |
* . The output directory. |
|
57 |
* @throws InstallPackageServiceException |
|
58 |
* If there is a problem decompressing the stream. |
|
59 |
*/ |
|
60 |
public void decompress(InputStream is, File outputDirectory) |
|
61 |
throws InstallPackageServiceException; |
|
62 |
|
|
63 |
/** |
|
64 |
* Compress a folder as a zipped package set in the given outputstream with |
|
65 |
* a concrete name. |
|
66 |
* |
|
67 |
* @param folder |
|
68 |
* the folder to compress. |
|
69 |
* @param fileName |
|
70 |
* name of the zip entry that has the output file. The name that |
|
71 |
* have to have |
|
72 |
* @param os |
|
73 |
* output stream to write the output. |
|
74 |
* @throws MakePluginPackageServiceException |
|
75 |
* if there is any problem compressing. |
|
76 |
*/ |
|
77 |
public void compressPackageSet(File folder, String fileName, OutputStream os) |
|
78 |
throws MakePluginPackageServiceException; |
|
79 |
|
|
80 |
/** |
|
81 |
* Compress a plugin folder using the plugin's name as a package. |
|
82 |
* |
|
83 |
* @param folder |
|
84 |
* the directory to compress. |
|
85 |
* @param os |
|
86 |
* output stream to write the output. |
|
87 |
* @throws MakePluginPackageServiceException |
|
88 |
* if there is any problem compressing. |
|
89 |
*/ |
|
90 |
public void compressPackage(File folder, OutputStream os) |
|
91 |
throws MakePluginPackageServiceException; |
|
92 |
|
|
93 |
/** |
|
94 |
* Compress a plugin folder using the plugin's name as a package, only with |
|
95 |
* the files needed by the package index. |
|
96 |
* |
|
97 |
* @param folder |
|
98 |
* the directory to compress. |
|
99 |
* @param os |
|
100 |
* output stream to write the output. |
|
101 |
* @throws MakePluginPackageServiceException |
|
102 |
* if there is any problem compressing. |
|
103 |
*/ |
|
104 |
public void compressPackageIndex(File folder, OutputStream os) |
|
105 |
throws MakePluginPackageServiceException; |
|
106 |
|
|
107 |
/** |
|
108 |
* Reads the package.info file from a directory a fills the the properties |
|
109 |
* of the {@link PackageInfo} object. |
|
110 |
* |
|
111 |
* @param directory |
|
112 |
* the root directory that contains the installinfo file |
|
113 |
* @param installInfo |
|
114 |
* the installinfo file that has to be filled. |
|
115 |
* @throws InstallerInfoFileException. if there is any problem reading the |
|
116 |
* file |
|
117 |
*/ |
|
118 |
public void readPackageInfo(File directory, PackageInfo installerInfo) |
|
119 |
throws InstallerInfoFileException; |
|
120 |
|
|
121 |
/** |
|
122 |
* Reads the package.info file from a package set and fills the the |
|
123 |
* properties of the {@link PackageInfo} objects. |
|
124 |
* |
|
125 |
* @param is |
|
126 |
* the input stream of a bundle. |
|
127 |
* @param packageInfos |
|
128 |
* a list of the information of the packages to install. |
|
129 |
* @param zipEntriesMap |
|
130 |
* a map to retrieve the zipEntry for every package. This |
|
131 |
* information is necessary to select the plugin to decompress. |
|
132 |
* @throws InstallPackageServiceException |
|
133 |
* if there is a problem reading the bundle. |
|
134 |
*/ |
|
135 |
public void readPackageSetInfo(InputStream is, |
|
136 |
List<PackageInfo> packageInfos, |
|
137 |
Map<PackageInfo, String> zipEntriesMap) |
|
138 |
throws InstallPackageServiceException; |
|
139 |
|
|
140 |
/** |
|
141 |
* Reads the package.info file from a bundle fills the the properties of the |
|
142 |
* {@link PackageInfo} objects. |
|
143 |
* |
|
144 |
* @param is |
|
145 |
* the input stream of a bundle. |
|
146 |
* @param packageInfos |
|
147 |
* a list of the information of the packages to install. |
|
148 |
* @param zipEntriesMap |
|
149 |
* a map to retrieve the zipEntry for every package. This |
|
150 |
* information is necessary to select the plugin to decompress. |
|
151 |
* @throws InstallPackageServiceException |
|
152 |
* if there is a problem reading the bundle. |
|
153 |
*/ |
|
154 |
public void readPackageInfo(InputStream is, List<PackageInfo> packageInfos, |
|
155 |
Map<PackageInfo, String> zipEntriesMap, String name) |
|
156 |
throws InstallPackageServiceException; |
|
157 |
|
|
158 |
/** |
|
159 |
* Writes the package.info file in a concrete directory. |
|
160 |
* |
|
161 |
* @param directory |
|
162 |
* the directory. |
|
163 |
* @param packageInfo |
|
164 |
* the information to write. |
|
165 |
* @throws InstallerInfoFileException |
|
166 |
* if there is any problem writing the package.info file. |
|
167 |
*/ |
|
168 |
public void writePackageInfo(File directory, PackageInfo packageInfo) |
|
169 |
throws InstallerInfoFileException; |
|
170 |
|
|
171 |
/** |
|
172 |
* Writes the package.info file in a concrete directory to be used in a |
|
173 |
* package index. |
|
174 |
* |
|
175 |
* @param directory |
|
176 |
* the directory. |
|
177 |
* @param packageInfo |
|
178 |
* the information to write. |
|
179 |
* @throws InstallerInfoFileException |
|
180 |
* if there is any problem writing the package.info file. |
|
181 |
*/ |
|
182 |
public void writePackageInfoForIndex(File directory, PackageInfo packageInfo) |
|
183 |
throws InstallerInfoFileException; |
|
184 |
|
|
185 |
/** |
|
186 |
* It search a package inside an installer file by the zip name and returns |
|
187 |
* the stream in this position ready to decompres. |
|
188 |
* |
|
189 |
* @param is |
|
190 |
* the input stream of a bundle. |
|
191 |
* @param zipEntry |
|
192 |
* the name of the zip entry. |
|
193 |
* @return the input stream ready to install. |
|
194 |
* @throws InstallPackageServiceException |
|
195 |
* if there is a problem reading the stream |
|
196 |
*/ |
|
197 |
public InputStream searchPackage(InputStream is, String zipEntry) |
|
198 |
throws InstallPackageServiceException; |
|
199 |
|
|
200 |
/** |
|
201 |
* It reads a compressed file and retrieve the package information. |
|
202 |
* |
|
203 |
* @param is |
|
204 |
* the compressed file |
|
205 |
* @return the information of the package |
|
206 |
* @throws InstallPackageServiceException |
|
207 |
* if there is a problem decompressing the file. |
|
208 |
*/ |
|
209 |
public PackageInfo readCompressedPackageInfo(InputStream is) |
|
210 |
throws InstallPackageServiceException; |
|
211 |
|
|
212 |
public List<String> getDefaultSelectedPackagesIDs(); |
|
213 |
|
|
214 |
} |
|
0 | 215 |
tags/v2_0_0_Build_2050/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.spi/src/main/java/org/gvsig/installer/lib/spi/InstallerProviderManager.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.installer.lib.api.PackageInfo; |
|
31 |
import org.gvsig.installer.lib.spi.execution.InstallPackageProvider; |
|
32 |
import org.gvsig.tools.service.ServiceException; |
|
33 |
import org.gvsig.tools.service.spi.ProviderManager; |
|
34 |
|
|
35 |
/** |
|
36 |
* <p> |
|
37 |
* The installation process install packages in gvSIG. These packages has a |
|
38 |
* type, that can be a plugin, theme, translation, etc. For every type of |
|
39 |
* package the installation process needs a provider for installing the |
|
40 |
* packages. |
|
41 |
* </p> |
|
42 |
* <p> |
|
43 |
* All the packages to install have to have some install properties defined by |
|
44 |
* the {@link PackageInfo} class. This class is just a set of properties and |
|
45 |
* there is a property named <b>type</b> that can be retrieved by the |
|
46 |
* {@link PackageInfo#getType()} method that defines the package type. This |
|
47 |
* property is used to create a {@link InstallPackageProvider} that is used to |
|
48 |
* install the selected package. |
|
49 |
* </p> |
|
50 |
* <p> |
|
51 |
* This manager provides the functionality to register and to create a providers |
|
52 |
* for every package. |
|
53 |
* </p> |
|
54 |
* |
|
55 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
56 |
*/ |
|
57 |
public interface InstallerProviderManager extends ProviderManager { |
|
58 |
|
|
59 |
/** |
|
60 |
* Creates a new provider to execute an installer to add a new package in |
|
61 |
* gvSIG. |
|
62 |
* |
|
63 |
* @param providerName |
|
64 |
* the provider name used on the registration of the provider. |
|
65 |
* This name is the type attribute defined by {@link PackageInfo} |
|
66 |
* . |
|
67 |
* @return a provider that can be used to install a package. |
|
68 |
* @throws ServiceException |
|
69 |
* if the provider doesn't exist or if there is a problem |
|
70 |
* creating the provider. |
|
71 |
*/ |
|
72 |
public InstallPackageProvider createExecutionProvider(String providerName) |
|
73 |
throws ServiceException; |
|
74 |
|
|
75 |
/** |
|
76 |
* Creates the services that be used for the providers to execute or create |
|
77 |
* a new bundle. |
|
78 |
* |
|
79 |
* @return the services used to create or execute an bundle. |
|
80 |
*/ |
|
81 |
public InstallPackageProviderServices createInstallerProviderServices(); |
|
82 |
|
|
83 |
/** |
|
84 |
* Returns the name to use for the package info file. |
|
85 |
* |
|
86 |
* @return the name of the package info file |
|
87 |
*/ |
|
88 |
public String getPackageInfoFileName(); |
|
89 |
} |
|
0 | 90 |
tags/v2_0_0_Build_2050/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.spi/src/main/java/org/gvsig/installer/lib/spi/execution/InstallPackageProvider.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.execution; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
import java.io.IOException; |
|
32 |
import java.io.InputStream; |
|
33 |
|
|
34 |
import org.gvsig.installer.lib.api.PackageInfo; |
|
35 |
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException; |
|
36 |
|
|
37 |
/** |
|
38 |
* <p> |
|
39 |
* Provider that manage the installation process of a concrete package. There is |
|
40 |
* a different provider for each package type that is supported. The provider |
|
41 |
* just have a method to install the package in gvSIG |
|
42 |
* </p> |
|
43 |
* |
|
44 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
45 |
*/ |
|
46 |
public interface InstallPackageProvider { |
|
47 |
|
|
48 |
/** |
|
49 |
* This method install a package in a valid gvSIG directory. |
|
50 |
* |
|
51 |
* @param applicationDirectory |
|
52 |
* the directory where gvSIG is located. |
|
53 |
* @param inputStream |
|
54 |
* the stream that contains the package information. |
|
55 |
* @param taskStatus |
|
56 |
* @throws InstallPackageServiceException |
|
57 |
* if there is a problem reading the stream or installing the |
|
58 |
* package. |
|
59 |
*/ |
|
60 |
public void install(File applicationDirectory, InputStream inputStream, |
|
61 |
PackageInfo packageInfo) throws InstallPackageServiceException; |
|
62 |
|
|
63 |
public void installLater(File applicationDirectory, |
|
64 |
InputStream inputStream, PackageInfo packageInfo) |
|
65 |
throws InstallPackageServiceException, IOException; |
|
66 |
|
|
67 |
} |
|
0 | 68 |
tags/v2_0_0_Build_2050/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.spi/src/main/java/org/gvsig/installer/lib/spi/InstallerInfoFileException.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.installer.lib.api.creation.MakePluginPackageServiceException; |
|
31 |
import org.gvsig.tools.exception.BaseException; |
|
32 |
|
|
33 |
/** |
|
34 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
35 |
*/ |
|
36 |
public class InstallerInfoFileException extends |
|
37 |
MakePluginPackageServiceException { |
|
38 |
|
|
39 |
private static final long serialVersionUID = -5388898489108649788L; |
|
40 |
|
|
41 |
private static final String KEY = "install_infofile_exception"; |
Also available in: Unified diff