Revision 3517
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.api/src/main/java/org/gvsig/vcsgis/swing/VCSGisSwingManager.java | ||
---|---|---|
69 | 69 |
public String getHTMLColoredForEntity(VCSGisWorkspaceEntity entity, String name); |
70 | 70 |
|
71 | 71 |
public VCSGisJCreateResourceTable createResourceTablePanel(); |
72 |
|
|
73 |
public VCSGisJLogout createLogoutPanel(); |
|
72 | 74 |
|
73 | 75 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.api/src/main/java/org/gvsig/vcsgis/swing/VCSGisJLogout.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
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, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.swing; |
|
23 |
|
|
24 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
|
25 |
|
|
26 |
/** |
|
27 |
* |
|
28 |
* @author gvSIG Team |
|
29 |
*/ |
|
30 |
public interface VCSGisJLogout extends VCSGisPanel { |
|
31 |
|
|
32 |
public VCSGisWorkspace getWorkspace(); |
|
33 |
|
|
34 |
public void logout(); |
|
35 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/VCSGisSwingManagerImpl.java | ||
---|---|---|
43 | 43 |
import org.gvsig.vcsgis.swing.VCSGisJImportHistory; |
44 | 44 |
import org.gvsig.vcsgis.swing.VCSGisJInitServer; |
45 | 45 |
import org.gvsig.vcsgis.swing.VCSGisJInitWorkspace; |
46 |
import org.gvsig.vcsgis.swing.VCSGisJLogout; |
|
46 | 47 |
import org.gvsig.vcsgis.swing.VCSGisJRegisterWorkspace; |
47 | 48 |
import org.gvsig.vcsgis.swing.VCSGisJRevisions; |
48 | 49 |
import org.gvsig.vcsgis.swing.VCSGisJShowServerTableForm; |
... | ... | |
58 | 59 |
import org.gvsig.vcsgis.swing.impl.initserver.VCSGisJInitServerImpl; |
59 | 60 |
import org.gvsig.vcsgis.swing.impl.initworkspace.VCSGisJInitWorkspaceImpl; |
60 | 61 |
import org.gvsig.vcsgis.swing.impl.loggin.VCSGisUserIdentificationRequesterDialog; |
62 |
import org.gvsig.vcsgis.swing.impl.logout.VCSGisJLogoutImpl; |
|
61 | 63 |
import org.gvsig.vcsgis.swing.impl.registerWorkspace.VCSGisJRegisterWorkspaceImpl; |
62 | 64 |
import org.gvsig.vcsgis.swing.impl.resourceTable.VCSGisJCreateResourceTableImpl; |
63 | 65 |
import org.gvsig.vcsgis.swing.impl.revisions.VCSGisJRevisionsImpl; |
... | ... | |
190 | 192 |
public VCSGisJCreateResourceTable createResourceTablePanel() { |
191 | 193 |
return new VCSGisJCreateResourceTableImpl(); |
192 | 194 |
} |
195 |
|
|
196 |
@Override |
|
197 |
public VCSGisJLogout createLogoutPanel() { |
|
198 |
return new VCSGisJLogoutImpl(); |
|
199 |
} |
|
193 | 200 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/logout/VCSGisJLogoutView.java | ||
---|---|---|
1 |
package org.gvsig.vcsgis.swing.impl.logout; |
|
2 |
|
|
3 |
import com.jeta.open.i18n.I18NUtils; |
|
4 |
import com.jgoodies.forms.layout.CellConstraints; |
|
5 |
import com.jgoodies.forms.layout.FormLayout; |
|
6 |
import java.awt.BorderLayout; |
|
7 |
import java.awt.ComponentOrientation; |
|
8 |
import java.awt.Container; |
|
9 |
import java.awt.Dimension; |
|
10 |
import javax.swing.Box; |
|
11 |
import javax.swing.ImageIcon; |
|
12 |
import javax.swing.JButton; |
|
13 |
import javax.swing.JComboBox; |
|
14 |
import javax.swing.JFrame; |
|
15 |
import javax.swing.JLabel; |
|
16 |
import javax.swing.JPanel; |
|
17 |
import javax.swing.border.EmptyBorder; |
|
18 |
|
|
19 |
|
|
20 |
public class VCSGisJLogoutView extends JPanel |
|
21 |
{ |
|
22 |
JLabel lblWorkspace = new JLabel(); |
|
23 |
JComboBox cboWorkspaces = new JComboBox(); |
|
24 |
JButton btnInitWorkspace = new JButton(); |
|
25 |
|
|
26 |
/** |
|
27 |
* Default constructor |
|
28 |
*/ |
|
29 |
public VCSGisJLogoutView() |
|
30 |
{ |
|
31 |
initializePanel(); |
|
32 |
} |
|
33 |
|
|
34 |
/** |
|
35 |
* Adds fill components to empty cells in the first row and first column of the grid. |
|
36 |
* This ensures that the grid spacing will be the same as shown in the designer. |
|
37 |
* @param cols an array of column indices in the first row where fill components should be added. |
|
38 |
* @param rows an array of row indices in the first column where fill components should be added. |
|
39 |
*/ |
|
40 |
void addFillComponents( Container panel, int[] cols, int[] rows ) |
|
41 |
{ |
|
42 |
Dimension filler = new Dimension(10,10); |
|
43 |
|
|
44 |
boolean filled_cell_11 = false; |
|
45 |
CellConstraints cc = new CellConstraints(); |
|
46 |
if ( cols.length > 0 && rows.length > 0 ) |
|
47 |
{ |
|
48 |
if ( cols[0] == 1 && rows[0] == 1 ) |
|
49 |
{ |
|
50 |
/** add a rigid area */ |
|
51 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); |
|
52 |
filled_cell_11 = true; |
|
53 |
} |
|
54 |
} |
|
55 |
|
|
56 |
for( int index = 0; index < cols.length; index++ ) |
|
57 |
{ |
|
58 |
if ( cols[index] == 1 && filled_cell_11 ) |
|
59 |
{ |
|
60 |
continue; |
|
61 |
} |
|
62 |
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); |
|
63 |
} |
|
64 |
|
|
65 |
for( int index = 0; index < rows.length; index++ ) |
|
66 |
{ |
|
67 |
if ( rows[index] == 1 && filled_cell_11 ) |
|
68 |
{ |
|
69 |
continue; |
|
70 |
} |
|
71 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); |
|
72 |
} |
|
73 |
|
|
74 |
} |
|
75 |
|
|
76 |
/** |
|
77 |
* Helper method to load an image file from the CLASSPATH |
|
78 |
* @param imageName the package and name of the file to load relative to the CLASSPATH |
|
79 |
* @return an ImageIcon instance with the specified image file |
|
80 |
* @throws IllegalArgumentException if the image resource cannot be loaded. |
|
81 |
*/ |
|
82 |
public ImageIcon loadImage( String imageName ) |
|
83 |
{ |
|
84 |
try |
|
85 |
{ |
|
86 |
ClassLoader classloader = getClass().getClassLoader(); |
|
87 |
java.net.URL url = classloader.getResource( imageName ); |
|
88 |
if ( url != null ) |
|
89 |
{ |
|
90 |
ImageIcon icon = new ImageIcon( url ); |
|
91 |
return icon; |
|
92 |
} |
|
93 |
} |
|
94 |
catch( Exception e ) |
|
95 |
{ |
|
96 |
e.printStackTrace(); |
|
97 |
} |
|
98 |
throw new IllegalArgumentException( "Unable to load image: " + imageName ); |
|
99 |
} |
|
100 |
|
|
101 |
/** |
|
102 |
* Method for recalculating the component orientation for |
|
103 |
* right-to-left Locales. |
|
104 |
* @param orientation the component orientation to be applied |
|
105 |
*/ |
|
106 |
public void applyComponentOrientation( ComponentOrientation orientation ) |
|
107 |
{ |
|
108 |
// Not yet implemented... |
|
109 |
// I18NUtils.applyComponentOrientation(this, orientation); |
|
110 |
super.applyComponentOrientation(orientation); |
|
111 |
} |
|
112 |
|
|
113 |
public JPanel createPanel() |
|
114 |
{ |
|
115 |
JPanel jpanel1 = new JPanel(); |
|
116 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE"); |
|
117 |
CellConstraints cc = new CellConstraints(); |
|
118 |
jpanel1.setLayout(formlayout1); |
|
119 |
|
|
120 |
lblWorkspace.setName("lblWorkspace"); |
|
121 |
lblWorkspace.setText("_Workspace"); |
|
122 |
jpanel1.add(lblWorkspace,cc.xy(2,2)); |
|
123 |
|
|
124 |
cboWorkspaces.setName("cboWorkspaces"); |
|
125 |
jpanel1.add(cboWorkspaces,cc.xy(4,2)); |
|
126 |
|
|
127 |
btnInitWorkspace.setActionCommand("..."); |
|
128 |
btnInitWorkspace.setName("btnInitWorkspace"); |
|
129 |
btnInitWorkspace.setOpaque(false); |
|
130 |
btnInitWorkspace.setText("..."); |
|
131 |
EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2); |
|
132 |
btnInitWorkspace.setBorder(emptyborder1); |
|
133 |
jpanel1.add(btnInitWorkspace,cc.xy(6,2)); |
|
134 |
|
|
135 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7 },new int[]{ 1,2,3 }); |
|
136 |
return jpanel1; |
|
137 |
} |
|
138 |
|
|
139 |
/** |
|
140 |
* Initializer |
|
141 |
*/ |
|
142 |
protected void initializePanel() |
|
143 |
{ |
|
144 |
setLayout(new BorderLayout()); |
|
145 |
add(createPanel(), BorderLayout.CENTER); |
|
146 |
} |
|
147 |
|
|
148 |
|
|
149 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/logout/VCSGisJLogoutImpl.java | ||
---|---|---|
1 |
/* |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2020 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
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, see <https://www.gnu.org/licenses/>. |
|
18 |
* |
|
19 |
* For any additional information, do not hesitate to contact us |
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
21 |
*/ |
|
22 |
package org.gvsig.vcsgis.swing.impl.logout; |
|
23 |
|
|
24 |
import java.awt.Dimension; |
|
25 |
import javax.swing.JComponent; |
|
26 |
import javax.swing.event.ChangeEvent; |
|
27 |
import org.gvsig.tools.swing.api.Component; |
|
28 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
29 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
|
30 |
import org.gvsig.tools.swing.api.pickercontroller.PickerController; |
|
31 |
import org.gvsig.tools.swing.api.task.TaskStatusSwingManager; |
|
32 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
33 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
34 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
|
35 |
import org.gvsig.vcsgis.swing.VCSGisJLogout; |
|
36 |
import org.gvsig.vcsgis.swing.VCSGisSwingLocator; |
|
37 |
import org.gvsig.vcsgis.swing.VCSGisSwingManager; |
|
38 |
import org.gvsig.vcsgis.swing.VCSGisSwingServices; |
|
39 |
import org.slf4j.LoggerFactory; |
|
40 |
|
|
41 |
/** |
|
42 |
* |
|
43 |
* @author gvSIG Team |
|
44 |
*/ |
|
45 |
public class VCSGisJLogoutImpl extends VCSGisJLogoutView |
|
46 |
implements |
|
47 |
Component |
|
48 |
, VCSGisJLogout |
|
49 |
{ |
|
50 |
|
|
51 |
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(VCSGisJLogoutImpl.class); |
|
52 |
|
|
53 |
private Dialog dialog; |
|
54 |
|
|
55 |
private PickerController<VCSGisWorkspace> workspacePicker; |
|
56 |
|
|
57 |
public VCSGisJLogoutImpl() { |
|
58 |
translate(); |
|
59 |
|
|
60 |
initComponents(); |
|
61 |
} |
|
62 |
|
|
63 |
private void initComponents() { |
|
64 |
TaskStatusSwingManager taskStatusManager = ToolsSwingLocator.getTaskStatusSwingManager(); |
|
65 |
VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
|
66 |
VCSGisSwingServices services = swingManager.getDefaultServices(); |
|
67 |
|
|
68 |
this.workspacePicker = swingManager.createWorkspacePickerController( |
|
69 |
cboWorkspaces, |
|
70 |
btnInitWorkspace |
|
71 |
); |
|
72 |
|
|
73 |
this.workspacePicker.addChangeListener((ChangeEvent e) -> { |
|
74 |
doChangeWorkspace(); |
|
75 |
}); |
|
76 |
|
|
77 |
this.setPreferredSize(new Dimension(300, 300)); |
|
78 |
|
|
79 |
} |
|
80 |
|
|
81 |
@Override |
|
82 |
public JComponent asJComponent() { |
|
83 |
return this; |
|
84 |
} |
|
85 |
|
|
86 |
|
|
87 |
@Override |
|
88 |
public void setDialog(Dialog dialog) { |
|
89 |
this.dialog = dialog; |
|
90 |
} |
|
91 |
|
|
92 |
private void doChangeWorkspace() { |
|
93 |
VCSGisWorkspace ws = this.getWorkspace(); |
|
94 |
if( this.dialog!=null ) { |
|
95 |
this.dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, ws!=null); |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
99 |
@Override |
|
100 |
public VCSGisWorkspace getWorkspace() { |
|
101 |
return this.workspacePicker.get(); |
|
102 |
} |
|
103 |
|
|
104 |
private void translate() { |
|
105 |
ToolsSwingManager swingManager = ToolsSwingLocator.getToolsSwingManager(); |
|
106 |
swingManager.translate(this.lblWorkspace); |
|
107 |
} |
|
108 |
|
|
109 |
@Override |
|
110 |
public void logout() { |
|
111 |
VCSGisWorkspace ws = this.getWorkspace(); |
|
112 |
if( ws==null ) { |
|
113 |
return; |
|
114 |
} |
|
115 |
ws.logout(); |
|
116 |
} |
|
117 |
|
|
118 |
@Override |
|
119 |
public boolean isProcessing() { |
|
120 |
return false; |
|
121 |
} |
|
122 |
|
|
123 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/logout/VCSGisJLogoutView.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<object classname="com.jeta.forms.store.memento.FormPackage"> |
|
4 |
<at name="fileversion"> |
|
5 |
<object classname="com.jeta.forms.store.memento.FormsVersion2"> |
|
6 |
<at name="major">2</at> |
|
7 |
<at name="minor">0</at> |
|
8 |
<at name="sub">0</at> |
|
9 |
</object> |
|
10 |
</at> |
|
11 |
<at name="form"> |
|
12 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
13 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
14 |
<at name="cellconstraints"> |
|
15 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
16 |
<at name="column">1</at> |
|
17 |
<at name="row">1</at> |
|
18 |
<at name="colspan">1</at> |
|
19 |
<at name="rowspan">1</at> |
|
20 |
<at name="halign">default</at> |
|
21 |
<at name="valign">default</at> |
|
22 |
<at name="insets" object="insets">0,0,0,0</at> |
|
23 |
</object> |
|
24 |
</at> |
|
25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
26 |
</super> |
|
27 |
<at name="id">/home/jjdelcerro/datos/devel/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/logout/VCSGisJLogoutView.xml</at> |
|
28 |
<at name="path">src/main/java/org/gvsig/vcsgis/swing/impl/logout/VCSGisJLogoutView.xml</at> |
|
29 |
<at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE</at> |
|
30 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE</at> |
|
31 |
<at name="components"> |
|
32 |
<object classname="java.util.LinkedList"> |
|
33 |
<item > |
|
34 |
<at name="value"> |
|
35 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
36 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
37 |
<at name="cellconstraints"> |
|
38 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
39 |
<at name="column">2</at> |
|
40 |
<at name="row">2</at> |
|
41 |
<at name="colspan">1</at> |
|
42 |
<at name="rowspan">1</at> |
|
43 |
<at name="halign">default</at> |
|
44 |
<at name="valign">default</at> |
|
45 |
<at name="insets" object="insets">0,0,0,0</at> |
|
46 |
</object> |
|
47 |
</at> |
|
48 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
49 |
</super> |
|
50 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
51 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
52 |
<at name="beanproperties"> |
|
53 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
54 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
55 |
<at name="properties"> |
|
56 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
57 |
<at name="border"> |
|
58 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
59 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
60 |
<at name="name">border</at> |
|
61 |
</super> |
|
62 |
<at name="borders"> |
|
63 |
<object classname="java.util.LinkedList"> |
|
64 |
<item > |
|
65 |
<at name="value"> |
|
66 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
67 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
68 |
<at name="name">border</at> |
|
69 |
</super> |
|
70 |
</object> |
|
71 |
</at> |
|
72 |
</item> |
|
73 |
</object> |
|
74 |
</at> |
|
75 |
</object> |
|
76 |
</at> |
|
77 |
<at name="name">lblWorkspace</at> |
|
78 |
<at name="width">85</at> |
|
79 |
<at name="text">_Workspace</at> |
|
80 |
<at name="fill"> |
|
81 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
82 |
<at name="name">fill</at> |
|
83 |
</object> |
|
84 |
</at> |
|
85 |
<at name="height">15</at> |
|
86 |
</object> |
|
87 |
</at> |
|
88 |
</object> |
|
89 |
</at> |
|
90 |
</object> |
|
91 |
</at> |
|
92 |
</item> |
|
93 |
<item > |
|
94 |
<at name="value"> |
|
95 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
96 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
97 |
<at name="cellconstraints"> |
|
98 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
99 |
<at name="column">4</at> |
|
100 |
<at name="row">2</at> |
|
101 |
<at name="colspan">1</at> |
|
102 |
<at name="rowspan">1</at> |
|
103 |
<at name="halign">default</at> |
|
104 |
<at name="valign">default</at> |
|
105 |
<at name="insets" object="insets">0,0,0,0</at> |
|
106 |
</object> |
|
107 |
</at> |
|
108 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
109 |
</super> |
|
110 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
111 |
<at name="beanclass">javax.swing.JComboBox</at> |
|
112 |
<at name="beanproperties"> |
|
113 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
114 |
<at name="classname">javax.swing.JComboBox</at> |
|
115 |
<at name="properties"> |
|
116 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
117 |
<at name="border"> |
|
118 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
119 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
120 |
<at name="name">border</at> |
|
121 |
</super> |
|
122 |
<at name="borders"> |
|
123 |
<object classname="java.util.LinkedList"> |
|
124 |
<item > |
|
125 |
<at name="value"> |
|
126 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
127 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
128 |
<at name="name">border</at> |
|
129 |
</super> |
|
130 |
</object> |
|
131 |
</at> |
|
132 |
</item> |
|
133 |
</object> |
|
134 |
</at> |
|
135 |
</object> |
|
136 |
</at> |
|
137 |
<at name="name">cboWorkspaces</at> |
|
138 |
<at name="width">741</at> |
|
139 |
<at name="items"> |
|
140 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
141 |
<at name="name">items</at> |
|
142 |
</object> |
|
143 |
</at> |
|
144 |
<at name="height">24</at> |
|
145 |
</object> |
|
146 |
</at> |
|
147 |
</object> |
|
148 |
</at> |
|
149 |
</object> |
|
150 |
</at> |
|
151 |
</item> |
|
152 |
<item > |
|
153 |
<at name="value"> |
|
154 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
155 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
156 |
<at name="cellconstraints"> |
|
157 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
158 |
<at name="column">6</at> |
|
159 |
<at name="row">2</at> |
|
160 |
<at name="colspan">1</at> |
|
161 |
<at name="rowspan">1</at> |
|
162 |
<at name="halign">default</at> |
|
163 |
<at name="valign">default</at> |
|
164 |
<at name="insets" object="insets">0,0,0,0</at> |
|
165 |
</object> |
|
166 |
</at> |
|
167 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
168 |
</super> |
|
169 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
170 |
<at name="beanclass">javax.swing.JButton</at> |
|
171 |
<at name="beanproperties"> |
|
172 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
173 |
<at name="classname">javax.swing.JButton</at> |
|
174 |
<at name="properties"> |
|
175 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
176 |
<at name="border"> |
|
177 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
178 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
179 |
<at name="name">border</at> |
|
180 |
</super> |
|
181 |
<at name="borders"> |
|
182 |
<object classname="java.util.LinkedList"> |
|
183 |
<item > |
|
184 |
<at name="value"> |
|
185 |
<object classname="com.jeta.forms.store.properties.EmptyBorderProperty"> |
|
186 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
187 |
<at name="name">border</at> |
|
188 |
</super> |
|
189 |
<at name="top">2</at> |
|
190 |
<at name="left">2</at> |
|
191 |
<at name="bottom">2</at> |
|
192 |
<at name="right">2</at> |
|
193 |
</object> |
|
194 |
</at> |
|
195 |
</item> |
|
196 |
</object> |
|
197 |
</at> |
|
198 |
</object> |
|
199 |
</at> |
|
200 |
<at name="actionCommand">...</at> |
|
201 |
<at name="opaque">false</at> |
|
202 |
<at name="name">btnInitWorkspace</at> |
|
203 |
<at name="width">19</at> |
|
204 |
<at name="text">...</at> |
|
205 |
<at name="height">19</at> |
|
206 |
</object> |
|
207 |
</at> |
|
208 |
</object> |
|
209 |
</at> |
|
210 |
</object> |
|
211 |
</at> |
|
212 |
</item> |
|
213 |
</object> |
|
214 |
</at> |
|
215 |
<at name="properties"> |
|
216 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
217 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
|
218 |
<at name="properties"> |
|
219 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
220 |
<at name="border"> |
|
221 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
222 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
223 |
<at name="name">border</at> |
|
224 |
</super> |
|
225 |
<at name="borders"> |
|
226 |
<object classname="java.util.LinkedList"/> |
|
227 |
</at> |
|
228 |
</object> |
|
229 |
</at> |
|
230 |
<at name="name"/> |
|
231 |
<at name="fill"> |
|
232 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
233 |
<at name="name">fill</at> |
|
234 |
</object> |
|
235 |
</at> |
|
236 |
<at name="scollBars"> |
|
237 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
238 |
<at name="name">scollBars</at> |
|
239 |
<at name="verticalpolicy">21</at> |
|
240 |
<at name="horizontalpolicy">31</at> |
|
241 |
<at name="border"> |
|
242 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
243 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
244 |
<at name="name">border</at> |
|
245 |
</super> |
|
246 |
<at name="borders"> |
|
247 |
<object classname="java.util.LinkedList"> |
|
248 |
<item > |
|
249 |
<at name="value"> |
|
250 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
251 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
252 |
<at name="name">border</at> |
|
253 |
</super> |
|
254 |
</object> |
|
255 |
</at> |
|
256 |
</item> |
|
257 |
</object> |
|
258 |
</at> |
|
259 |
</object> |
|
260 |
</at> |
|
261 |
</object> |
|
262 |
</at> |
|
263 |
</object> |
|
264 |
</at> |
|
265 |
</object> |
|
266 |
</at> |
|
267 |
<at name="cellpainters"> |
|
268 |
<object classname="com.jeta.forms.store.support.Matrix"> |
|
269 |
<at name="rows"> |
|
270 |
<object classname="[Ljava.lang.Object;" size="3"> |
|
271 |
<at name="item" index="0"> |
|
272 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
273 |
</at> |
|
274 |
<at name="item" index="1"> |
|
275 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
276 |
</at> |
|
277 |
<at name="item" index="2"> |
|
278 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
279 |
</at> |
|
280 |
</object> |
|
281 |
</at> |
|
282 |
</object> |
|
283 |
</at> |
|
284 |
<at name="rowgroups"> |
|
285 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
286 |
<at name="groups"> |
|
287 |
<object classname="java.util.HashMap"/> |
|
288 |
</at> |
|
289 |
</object> |
|
290 |
</at> |
|
291 |
<at name="colgroups"> |
|
292 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
293 |
<at name="groups"> |
|
294 |
<object classname="java.util.HashMap"/> |
|
295 |
</at> |
|
296 |
</object> |
|
297 |
</at> |
|
298 |
</object> |
|
299 |
</at> |
|
300 |
</object> |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/checkoutDataModel/VCSGisJCheckoutDataModelImpl.java | ||
---|---|---|
36 | 36 |
import javax.swing.SwingUtilities; |
37 | 37 |
import javax.swing.event.ChangeEvent; |
38 | 38 |
import org.apache.commons.lang3.StringUtils; |
39 |
import org.gvsig.fmap.dal.BaseStoresRepository; |
|
40 |
import org.gvsig.fmap.dal.DALLocator; |
|
41 |
import org.gvsig.fmap.dal.DataManager; |
|
42 |
import org.gvsig.fmap.dal.OpenDataStoreParameters; |
|
43 |
import org.gvsig.fmap.dal.StoresRepository; |
|
39 | 44 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
40 | 45 |
import org.gvsig.tools.ToolsLocator; |
41 | 46 |
import org.gvsig.tools.dispose.DisposeUtils; |
... | ... | |
253 | 258 |
|
254 | 259 |
List<VCSGisEntity> entities = entitySelector.getCheckedEntities(); |
255 | 260 |
final VCSGisWorkspace workspace = this.getWorkspace(); |
261 |
final String dataModelName = this.getDataModel(); |
|
256 | 262 |
|
257 | 263 |
if (workspace != null && entities != null && entities.size()>0) { |
258 | 264 |
List<String> entityCodes = new ArrayList<>(); |
... | ... | |
278 | 284 |
VCSGisEntity lEntity = workspace.getEntity(entity.getEntityCode()); |
279 | 285 |
workspace.getExplorer().setCustomResources(entity.getEntityName(), lEntity.getResources()); |
280 | 286 |
} |
287 |
registerStoresRepository(workspace, dataModelName, entities); |
|
281 | 288 |
postCheckout(res, entities); |
282 | 289 |
} |
283 | 290 |
showMessage(i18n.getTranslation("_Ended_process"), null); |
... | ... | |
318 | 325 |
} |
319 | 326 |
this.doUpdateComponents(); |
320 | 327 |
} |
321 |
|
|
328 |
|
|
329 |
private void registerStoresRepository(VCSGisWorkspace workspace, String name, List<VCSGisEntity> entities) { |
|
330 |
DataManager dataManager = DALLocator.getDataManager(); |
|
331 |
BaseStoresRepository modelRepository = new BaseStoresRepository(name); |
|
332 |
for (VCSGisEntity entity : entities) { |
|
333 |
OpenDataStoreParameters params = workspace.createOpenStoreParameters(entity.getEntityName()); |
|
334 |
modelRepository.add(entity.getEntityName(), params); |
|
335 |
} |
|
336 |
StoresRepository globalRepository = dataManager.getStoresRepository(); |
|
337 |
globalRepository.addRepository(modelRepository); |
|
338 |
} |
|
339 |
|
|
322 | 340 |
private void showMessage(String message, String toolTipText) { |
323 | 341 |
if( notInSwingThreadInvokeLater(() -> {showMessage(message, toolTipText);}) ) { |
324 | 342 |
return; |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/VCSGisSwingCommons.java | ||
---|---|---|
26 | 26 |
import java.awt.Component; |
27 | 27 |
import java.awt.Font; |
28 | 28 |
import java.awt.font.TextAttribute; |
29 |
import java.util.HashMap; |
|
30 |
import java.util.List; |
|
29 | 31 |
import java.util.Map; |
30 | 32 |
import java.util.Set; |
31 | 33 |
import javax.swing.JOptionPane; |
32 | 34 |
import javax.swing.SwingUtilities; |
33 | 35 |
import org.apache.commons.lang3.StringUtils; |
36 |
import org.gvsig.fmap.dal.AbstractStoresRepository; |
|
37 |
import org.gvsig.fmap.dal.BaseStoresRepository; |
|
38 |
import org.gvsig.fmap.dal.DALLocator; |
|
39 |
import org.gvsig.fmap.dal.DataManager; |
|
40 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
41 |
import org.gvsig.fmap.dal.OpenDataStoreParameters; |
|
42 |
import org.gvsig.fmap.dal.StoresRepository; |
|
34 | 43 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
35 | 44 |
import org.gvsig.fmap.geom.Geometry; |
36 | 45 |
import org.gvsig.fmap.geom.GeometryUtils; |
... | ... | |
39 | 48 |
import org.gvsig.tools.i18n.I18nManager; |
40 | 49 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
41 | 50 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
51 |
import org.gvsig.tools.util.UnmodifiableBasicSet; |
|
52 |
import org.gvsig.tools.util.UnmodifiableBasicSetAdapter; |
|
53 |
import org.gvsig.vcsgis.lib.VCSGisEntity; |
|
42 | 54 |
import org.gvsig.vcsgis.lib.VCSGisLocator; |
43 | 55 |
import org.gvsig.vcsgis.lib.VCSGisManager; |
44 | 56 |
import static org.gvsig.vcsgis.lib.VCSGisManager.ERR_AUTHENTICATION_EXPIRED; |
... | ... | |
54 | 66 |
import static org.gvsig.vcsgis.lib.VCSGisManager.STATE_LOCAL_UNMODIFIED; |
55 | 67 |
import static org.gvsig.vcsgis.lib.VCSGisManager.STATE_REPOSITORY_NEW; |
56 | 68 |
import org.gvsig.vcsgis.lib.VCSGisRuntimeException; |
69 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
|
57 | 70 |
import org.gvsig.vcsgis.swing.VCSGisSwingLocator; |
58 | 71 |
import org.gvsig.vcsgis.swing.VCSGisSwingManager; |
59 | 72 |
|
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/java/org/gvsig/vcsgis/app/VCSGisExtension.java | ||
---|---|---|
52 | 52 |
import org.gvsig.vcsgis.swing.VCSGisJImportHistory; |
53 | 53 |
import org.gvsig.vcsgis.swing.VCSGisJInitServer; |
54 | 54 |
import org.gvsig.vcsgis.swing.VCSGisJInitWorkspace; |
55 |
import org.gvsig.vcsgis.swing.VCSGisJLogout; |
|
55 | 56 |
import org.gvsig.vcsgis.swing.VCSGisJShowServerTableForm; |
56 | 57 |
import org.gvsig.vcsgis.swing.VCSGisSwingLocator; |
57 | 58 |
import org.gvsig.vcsgis.swing.VCSGisSwingManager; |
... | ... | |
151 | 152 |
case "tools-vcsgis-create-resource-table": |
152 | 153 |
showCreateResourceTableDialog(); |
153 | 154 |
break; |
155 |
case "tools-vcsgis-logout": |
|
156 |
showLogoutDialog(); |
|
157 |
break; |
|
154 | 158 |
case "tools-vcsgis-checkout-datamodel": |
155 | 159 |
showCheckoutDataModelDialog(); |
156 | 160 |
break; |
... | ... | |
443 | 447 |
dialog.show(); |
444 | 448 |
} |
445 | 449 |
|
446 |
// private void showCheckoutDataModelDialog2() { |
|
447 |
// VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
|
448 |
// |
|
449 |
// VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog( |
|
450 |
// "Checkout data model", |
|
451 |
// swingManager.createCheckoutDataModelPanel(), |
|
452 |
// "_VCS_Checkout_DataModel", |
|
453 |
// "_VCS_Checkout_DataModel", |
|
454 |
// "_VCS_Checkout_DataModel", |
|
455 |
// () -> { |
|
456 |
// I18nManager i18n = ToolsLocator.getI18nManager(); |
|
457 |
// ThreadSafeDialogsManager dialogsManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
458 |
// VCSGisJCheckoutDataModel checkoutDataModelPanel = (VCSGisJCheckoutDataModel) this.dialogsHelper.getDialog("CheckoutDataModel").getPanel(); |
|
459 |
// int r = checkoutDataModelPanel.checkout(); |
|
460 |
// if (r != 0) { |
|
461 |
// String dataModel = checkoutDataModelPanel.getDataModel(); |
|
462 |
// dialogsManager.messageDialog( |
|
463 |
// i18n.getTranslation( |
|
464 |
// "_Failed_checkout_of_{0}", |
|
465 |
// new String[]{dataModel} |
|
466 |
// ), |
|
467 |
// i18n.getTranslation("_CheckoutDataModel"), |
|
468 |
// JOptionPane.WARNING_MESSAGE |
|
469 |
// ); |
|
470 |
// } |
|
471 |
// } |
|
472 |
// ); |
|
473 |
// dialog.show(); |
|
474 |
// } |
|
475 |
|
|
450 |
private void showLogoutDialog() { |
|
451 |
VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
|
452 |
|
|
453 |
VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog( |
|
454 |
"Logout", |
|
455 |
swingManager.createLogoutPanel(), |
|
456 |
"_VCS_Logout", |
|
457 |
"_Logout_the_current_user_from_a_VCSGis_working_copy", |
|
458 |
"_Accept", |
|
459 |
() -> { |
|
460 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
461 |
VCSGisJLogout panel = (VCSGisJLogout) this.dialogsHelper.getDialog("Logout").getPanel(); |
|
462 |
panel.logout(); |
|
463 |
} |
|
464 |
); |
|
465 |
dialog.setAutoclose(true); |
|
466 |
dialog.show(); |
|
467 |
} |
|
468 |
|
|
476 | 469 |
private void showCheckoutDataModelDialog() { |
477 | 470 |
VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
478 | 471 |
|
479 |
final VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog(
|
|
480 |
"Checkout data model",
|
|
472 |
VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog( |
|
473 |
"CheckoutDataModel",
|
|
481 | 474 |
swingManager.createCheckoutDataModelPanel(), |
482 |
"_VCS_Checkout_DataModel" |
|
475 |
"_VCS_Checkout_DataModel", |
|
476 |
"_VCS_Checkout_DataModel", |
|
477 |
"_VCS_Checkout_DataModel", |
|
478 |
() -> { |
|
479 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
480 |
ThreadSafeDialogsManager dialogsManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
481 |
VCSGisJCheckoutDataModel checkoutDataModelPanel = (VCSGisJCheckoutDataModel) this.dialogsHelper.getDialog("CheckoutDataModel").getPanel(); |
|
482 |
int r = checkoutDataModelPanel.checkout(); |
|
483 |
if (r != 0) { |
|
484 |
String dataModel = checkoutDataModelPanel.getDataModel(); |
|
485 |
dialogsManager.messageDialog( |
|
486 |
i18n.getTranslation( |
|
487 |
"_Failed_checkout_of_{0}", |
|
488 |
new String[]{dataModel} |
|
489 |
), |
|
490 |
i18n.getTranslation("_CheckoutDataModel"), |
|
491 |
JOptionPane.WARNING_MESSAGE |
|
492 |
); |
|
493 |
} |
|
494 |
} |
|
483 | 495 |
); |
484 | 496 |
dialog.show(); |
485 | 497 |
} |
486 |
|
|
487 |
|
|
498 |
|
|
488 | 499 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
181 | 181 |
icon="" |
182 | 182 |
accelerator="" |
183 | 183 |
/> |
184 |
|
|
185 |
<action |
|
186 |
name="tools-vcsgis-logout" |
|
187 |
label="_VCS_Logout_from_working_copy" |
|
188 |
tooltip="_Logout_from_working_copy" |
|
189 |
position="900700104" |
|
190 |
action-command="tools-vcsgis-logout" |
|
191 |
icon="" |
|
192 |
accelerator="" |
|
193 |
/> |
|
184 | 194 |
|
185 | 195 |
<menu text="tools/_VCSGis/_Administration/_VCS_Initialize_repository" name="tools-vcsgis-init-server" /> |
186 | 196 |
<menu text="tools/_VCSGis/_Administration/_VCS_Register_workspace" name="tools-vcsgis-register-workspace" /> |
... | ... | |
191 | 201 |
<menu text="tools/_VCSGis/_VCS_Add_to_workspace" name="tools-vcsgis-add-to-workspace" /> |
192 | 202 |
<menu text="tools/_VCSGis/_VCS_Checkout" name="tools-vcsgis-checkout" /> |
193 | 203 |
<menu text="tools/_VCSGis/_VCS_Export" name="tools-vcsgis-export" /> |
204 |
<menu text="tools/_VCSGis/_VCS_Import_history" name="tools-vcsgis-import-history" /> |
|
205 |
<menu text="tools/_VCSGis/_VCS_Show_revisions" name="tools-vcsgis-show-revisions" /> |
|
206 |
<menu text="tools/_VCSGis/_VCS_logout" name="tools-vcsgis-logout" /> |
|
194 | 207 |
<menu text="tools/_VCSGis/_VCS_Show_changes" name="tools-vcsgis-showchanges" /> |
195 |
<menu text="tools/_VCSGis/_VCS_Show_revisions" name="tools-vcsgis-show-revisions" /> |
|
196 |
<menu text="tools/_VCSGis/_VCS_Import_history" name="tools-vcsgis-import-history" /> |
|
197 | 208 |
<menu text="tools/_VCSGis/_VCS_Checkout_DataModel" name="tools-vcsgis-checkout-datamodel" /> |
198 | 209 |
|
199 | 210 |
<tool-bar name="vcsgis" position="900700300"> |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/workspace/VCSGisWorkspace.java | ||
---|---|---|
27 | 27 |
import java.util.List; |
28 | 28 |
import org.apache.commons.lang3.mutable.MutableLong; |
29 | 29 |
import org.apache.commons.lang3.mutable.MutableObject; |
30 |
import org.gvsig.fmap.dal.OpenDataStoreParameters; |
|
30 | 31 |
import org.gvsig.fmap.dal.feature.Feature; |
31 | 32 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
32 | 33 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
... | ... | |
232 | 233 |
public int authenticate(String userId, String password, SimpleTaskStatus status); |
233 | 234 |
|
234 | 235 |
public boolean authenticate(SimpleTaskStatus status); |
236 |
|
|
237 |
public void logout(); |
|
238 |
|
|
239 |
public OpenDataStoreParameters createOpenStoreParameters(String tableName); |
|
235 | 240 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.impl/src/main/java/org/gvsig/vcsgis/lib/workspace/VCSGisWorkspaceImpl.java | ||
---|---|---|
26 | 26 |
import org.gvsig.fmap.dal.DALLocator; |
27 | 27 |
import org.gvsig.fmap.dal.DataManager; |
28 | 28 |
import org.gvsig.fmap.dal.DataTransaction; |
29 |
import org.gvsig.fmap.dal.OpenDataStoreParameters; |
|
29 | 30 |
import org.gvsig.fmap.dal.exception.DataException; |
30 | 31 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
31 | 32 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
... | ... | |
614 | 615 |
} |
615 | 616 |
|
616 | 617 |
@Override |
618 |
public OpenDataStoreParameters createOpenStoreParameters(String tableName) { |
|
619 |
try { |
|
620 |
JDBCStoreParameters params = this.wsexplorer.get(tableName); |
|
621 |
return params; |
|
622 |
} catch (Exception ex) { |
|
623 |
LOGGER.trace("can't create open store parameters from '" + this.getMessageLabel() + "'.", ex); |
|
624 |
return null; |
|
625 |
} |
|
626 |
} |
|
627 |
|
|
628 |
@Override |
|
617 | 629 |
public String createUniqueCode() { |
618 | 630 |
return this.codeGenerator.generateCode(); |
619 | 631 |
} |
... | ... | |
3522 | 3534 |
} |
3523 | 3535 |
return new ArrayList<>(dataModels); |
3524 | 3536 |
} |
3537 |
|
|
3538 |
@Override |
|
3539 |
public void logout() { |
|
3540 |
VarsTable varsTable = new VarsTable(); |
|
3541 |
varsTable.delete(this,"USER"); |
|
3542 |
varsTable.delete(this,"AUTHENTICATIONTOKEN"); |
|
3543 |
this.currentUserCode = null; |
|
3544 |
this.authenticationToken = null; |
|
3545 |
} |
|
3525 | 3546 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.impl/src/main/java/org/gvsig/vcsgis/lib/workspace/tables/VarsTable.java | ||
---|---|---|
10 | 10 |
import org.gvsig.tools.dataTypes.DataTypes; |
11 | 11 |
import org.gvsig.tools.dispose.DisposeUtils; |
12 | 12 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
13 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspaceImpl; |
|
13 | 14 |
|
14 | 15 |
/** |
15 | 16 |
* |
... | ... | |
101 | 102 |
} |
102 | 103 |
} |
103 | 104 |
|
105 |
public void delete(VCSGisWorkspace workspace, String name) { |
|
106 |
FeatureStore store = null; |
|
107 |
try { |
|
108 |
store = workspace.getFeatureStore(TABLE_NAME); |
|
109 |
store.edit(FeatureStore.MODE_FULLEDIT); |
|
110 |
store.delete("\""+VAR_NAME+"\"='" + name + "'"); |
|
111 |
store.finishEditing(); |
|
112 |
} catch (Exception ex) { |
|
113 |
LOGGER.warn("Can't delete value for '" + name + "'.", ex); |
|
114 |
} finally { |
|
115 |
if( store!=null && (store.isAppending() || store.isEditing()) ) { |
|
116 |
store.cancelEditingQuietly(); |
|
117 |
} |
|
118 |
DisposeUtils.disposeQuietly(store); |
|
119 |
} |
|
120 |
} |
|
121 |
|
|
104 | 122 |
public static final FeatureType featureType() { |
105 | 123 |
DataManager dataManager = DALLocator.getDataManager(); |
106 | 124 |
EditableFeatureType ft = dataManager.createFeatureType(); |
Also available in: Unified diff