Revision 47828
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.app/org.gvsig.downloader.app.scribejava/buildNumber.properties | ||
---|---|---|
1 |
#Fri Jun 14 08:43:36 CEST 2024 |
|
2 |
buildNumber=1 |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.app/org.gvsig.downloader.app.scribejava/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 gvSIG |
|
2 |
Association. This program is free software; you can redistribute it and/or modify |
|
3 |
it under the terms of the GNU General Public License as published by the Free Software |
|
4 |
Foundation; either version 3 of the License, or (at your option) any later version. |
|
5 |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
6 |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
7 |
PURPOSE. See the GNU General Public License for more details. You should have received |
|
8 |
a copy of the GNU General Public License along with this program; if not, write to |
|
9 |
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
|
10 |
USA. For any additional information, do not hesitate to contact us at info AT gvsig.com, |
|
11 |
or visit our website www.gvsig.com. --> |
|
12 |
<assembly> |
|
13 |
<id>gvsig-plugin-package</id> |
|
14 |
<formats> |
|
15 |
<format>zip</format> |
|
16 |
</formats> |
|
17 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
18 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
19 |
<files> |
|
20 |
<file> |
|
21 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
22 |
<outputDirectory>lib</outputDirectory> |
|
23 |
</file> |
|
24 |
<file> |
|
25 |
<source>target/package.info</source> |
|
26 |
</file> |
|
27 |
</files> |
|
28 |
|
|
29 |
<fileSets> |
|
30 |
<fileSet> |
|
31 |
<directory>src/main/resources-plugin</directory> |
|
32 |
<outputDirectory>.</outputDirectory> |
|
33 |
</fileSet> |
|
34 |
</fileSets> |
|
35 |
|
|
36 |
|
|
37 |
<dependencySets> |
|
38 |
<dependencySet> |
|
39 |
<useProjectArtifact>false</useProjectArtifact> |
|
40 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
41 |
<outputDirectory>lib</outputDirectory> |
|
42 |
<includes> |
|
43 |
<include>org.gvsig:org.gvsig.downloader.swing.scribejava</include> |
|
44 |
<include>com.github.scribejava:scribejava-apis</include> |
|
45 |
<include>com.github.scribejava:scribejava-core</include> |
|
46 |
<include>com.github.scribejava:scribejava-java8</include> |
|
47 |
<include>com.fasterxml.jackson.core:jackson-databind</include> |
|
48 |
<include>com.fasterxml.jackson.core:jackson-annotations</include> |
|
49 |
<include>com.fasterxml.jackson.core:jackson-core</include> |
|
50 |
|
|
51 |
|
|
52 |
</includes> |
|
53 |
</dependencySet> |
|
54 |
</dependencySets> |
|
55 |
|
|
56 |
</assembly> |
|
57 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.app/org.gvsig.downloader.app.scribejava/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
1 |
#Translations for language [es] |
|
2 |
#Thu Nov 20 10:10:09 CET 2014 |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.app/org.gvsig.downloader.app.scribejava/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
1 |
#Translations for language [en] |
|
2 |
#Thu Nov 20 10:10:15 CET 2014 |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.app/org.gvsig.downloader.app.scribejava/src/main/resources-plugin/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2014 gvSIG |
|
3 |
Association. This program is free software; you can redistribute it and/or modify |
|
4 |
it under the terms of the GNU General Public License as published by the Free Software |
|
5 |
Foundation; either version 3 of the License, or (at your option) any later version. |
|
6 |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
7 |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
8 |
PURPOSE. See the GNU General Public License for more details. You should have received |
|
9 |
a copy of the GNU General Public License along with this program; if not, write to |
|
10 |
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
|
11 |
USA. For any additional information, do not hesitate to contact us at info AT gvsig.com, |
|
12 |
or visit our website www.gvsig.com. --> |
|
13 |
<plugin-config> |
|
14 |
<depends plugin-name="org.gvsig.app.mainplugin" /> |
|
15 |
<depends plugin-name="org.gvsig.downloader.app.mainplugin" /> |
|
16 |
|
|
17 |
<resourceBundle name="text" /> |
|
18 |
<libraries library-dir="lib" /> |
|
19 |
<extensions> |
|
20 |
<extension class-name="org.gvsig.andami.plugins.Extension.LibraryExtension" |
|
21 |
description="" active="true" priority="1"> |
|
22 |
|
|
23 |
</extension> |
|
24 |
</extensions> |
|
25 |
</plugin-config> |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.app/org.gvsig.downloader.app.scribejava/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/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.downloader.app</artifactId> |
|
6 |
<version>2.0.451-SNAPSHOT</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.downloader.app.scribejava</artifactId> |
|
9 |
<name>${project.artifactId}</name> |
|
10 |
<dependencies> |
|
11 |
<dependency> |
|
12 |
<groupId>org.gvsig</groupId> |
|
13 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
14 |
<scope>compile</scope> |
|
15 |
</dependency> |
|
16 |
<dependency> |
|
17 |
<groupId>org.gvsig</groupId> |
|
18 |
<artifactId>org.gvsig.andami</artifactId> |
|
19 |
<scope>compile</scope> |
|
20 |
</dependency> |
|
21 |
<dependency> |
|
22 |
<groupId>org.gvsig</groupId> |
|
23 |
<artifactId>org.gvsig.downloader.lib.api</artifactId> |
|
24 |
<scope>compile</scope> |
|
25 |
</dependency> |
|
26 |
<dependency> |
|
27 |
<groupId>org.gvsig</groupId> |
|
28 |
<artifactId>org.gvsig.downloader.swing.api</artifactId> |
|
29 |
<scope>compile</scope> |
|
30 |
</dependency> |
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
<dependency> |
|
36 |
<groupId>org.gvsig</groupId> |
|
37 |
<artifactId>org.gvsig.downloader.swing.scribejava</artifactId> |
|
38 |
<scope>runtime</scope> |
|
39 |
</dependency> |
|
40 |
<dependency> |
|
41 |
<groupId>com.github.scribejava</groupId> |
|
42 |
<artifactId>scribejava-core</artifactId> |
|
43 |
<scope>runtime</scope> |
|
44 |
</dependency> |
|
45 |
<dependency> |
|
46 |
<groupId>com.github.scribejava</groupId> |
|
47 |
<artifactId>scribejava-apis</artifactId> |
|
48 |
<scope>runtime</scope> |
|
49 |
</dependency> |
|
50 |
<dependency> |
|
51 |
<groupId>com.github.scribejava</groupId> |
|
52 |
<artifactId>scribejava-java8</artifactId> |
|
53 |
<scope>runtime</scope> |
|
54 |
</dependency> |
|
55 |
<dependency> |
|
56 |
<groupId>com.fasterxml.jackson.core</groupId> |
|
57 |
<artifactId>jackson-databind</artifactId> |
|
58 |
<scope>runtime</scope> |
|
59 |
</dependency> |
|
60 |
<dependency> |
|
61 |
<groupId>com.fasterxml.jackson.core</groupId> |
|
62 |
<artifactId>jackson-annotations</artifactId> |
|
63 |
<scope>runtime</scope> |
|
64 |
</dependency> |
|
65 |
<dependency> |
|
66 |
<groupId>com.fasterxml.jackson.core</groupId> |
|
67 |
<artifactId>jackson-core</artifactId> |
|
68 |
<scope>runtime</scope> |
|
69 |
</dependency> |
|
70 |
|
|
71 |
</dependencies> |
|
72 |
|
|
73 |
<properties> |
|
74 |
<gvsig.package.info.state>devel</gvsig.package.info.state> |
|
75 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
76 |
<gvsig.package.info.dependencies>required: org.gvsig.downloader.app.mainplugin -ge 1.0.0</gvsig.package.info.dependencies> |
|
77 |
<gvsig.package.info.categories /> |
|
78 |
<gvsig.package.info.name>Downloader Manager keycloak support</gvsig.package.info.name> |
|
79 |
<gvsig.package.info.description>Downloader Manager keycloak support</gvsig.package.info.description> |
|
80 |
<gvsig.package.info.owner>gvSIG Association</gvsig.package.info.owner> |
|
81 |
<gvsig.package.info.javaVM>j1_8</gvsig.package.info.javaVM> |
|
82 |
</properties> |
|
83 |
|
|
84 |
</project> |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.app/pom.xml | ||
---|---|---|
12 | 12 |
|
13 | 13 |
<modules> |
14 | 14 |
<module>org.gvsig.downloader.app.mainplugin</module> |
15 |
<module>org.gvsig.downloader.app.scribejava</module> |
|
15 | 16 |
</modules> |
16 | 17 |
</project> |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.app/org.gvsig.downloader.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 | 1 |
#Sun Jun 16 20:01:05 CEST 2024 |
2 |
buildNumber=162 |
|
2 |
buildNumber=1 |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.impl/src/main/java/org/gvsig/downloader/lib/impl/types/httpbasic/DownloaderHTTPBasicCredentials.java | ||
---|---|---|
22 | 22 |
private final String userid; |
23 | 23 |
private final String password; |
24 | 24 |
|
25 |
public DownloaderHTTPBasicCredentials(String baseUrl, String userid, String password) {
|
|
26 |
super(HTTPBASIC_AUTHENTICATION_NAME, baseUrl);
|
|
25 |
public DownloaderHTTPBasicCredentials(String serviceUrl, String userid, String password) {
|
|
26 |
super(HTTPBASIC_AUTHENTICATION_NAME, serviceUrl);
|
|
27 | 27 |
this.userid = userid; |
28 | 28 |
this.password = password; |
29 | 29 |
} |
... | ... | |
38 | 38 |
return this.userid; |
39 | 39 |
} |
40 | 40 |
|
41 |
@Override |
|
42 |
public String toString() { |
|
43 |
return "USER: "+this.getUserid()+"; AUTHORIZATION: "+this.getAuthorizationToken(); |
|
44 |
} |
|
45 |
|
|
46 | 41 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.impl/src/main/java/org/gvsig/downloader/lib/impl/types/httpbasic/DownloaderHTTPBasicAuthenticationRequester.java | ||
---|---|---|
75 | 75 |
LoginDialog logginDialog = new LoginDialog(); |
76 | 76 |
logginDialog.addActionListener((ActionEvent e) -> { |
77 | 77 |
credentials = new DownloaderHTTPBasicCredentials( |
78 |
this.getConfig().getBaseUrl(),
|
|
78 |
this.getConfig().getServiceUrl(),
|
|
79 | 79 |
logginDialog.getName(), |
80 | 80 |
logginDialog.getPassword() |
81 | 81 |
); |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.impl/src/main/java/org/gvsig/downloader/lib/impl/DownloaderManagerImpl.java | ||
---|---|---|
69 | 69 |
return t; |
70 | 70 |
} |
71 | 71 |
|
72 |
private String getUrlWithoutQuery(URL url) { |
|
73 |
try { |
|
74 |
URL x = new URL(url.getProtocol(), url.getHost(), url.getPath()); |
|
75 |
return x.toExternalForm(); |
|
76 |
} catch(Exception ex) { |
|
77 |
return null; |
|
78 |
} |
|
79 |
} |
|
80 |
|
|
81 |
private String getUrlWithoutQuery(String url) { |
|
82 |
try { |
|
83 |
return this.getUrlWithoutQuery(new URL(url)); |
|
84 |
} catch(Exception ex) { |
|
85 |
return null; |
|
86 |
} |
|
87 |
} |
|
88 |
|
|
72 | 89 |
@Override |
73 | 90 |
public void addOrReplaceCredentials(DownloaderCredentials credentials) { |
74 |
this.credentials.put(credentials.getBaseUrl(), credentials); |
|
91 |
if( credentials == null ) { |
|
92 |
LOG.warn("Invalid credentials (null)."); |
|
93 |
return; |
|
94 |
} |
|
95 |
String url = this.getUrlWithoutQuery(credentials.getServiceUrl()); |
|
96 |
if( url == null ) { |
|
97 |
LOG.warn("Invalid URL '"+credentials.getServiceUrl()+"'"); |
|
98 |
return; |
|
99 |
} |
|
100 |
this.credentials.put(url, credentials); |
|
75 | 101 |
} |
76 | 102 |
|
77 | 103 |
@Override |
78 | 104 |
public void removeCredentials(DownloaderCredentials credentials) { |
79 |
this.credentials.remove(credentials.getBaseUrl()); |
|
105 |
if( credentials == null ) { |
|
106 |
return; |
|
107 |
} |
|
108 |
String x = credentials.getServiceUrl(); |
|
109 |
if( x == null ) { |
|
110 |
return; |
|
111 |
} |
|
112 |
this.credentials.remove(x); |
|
80 | 113 |
} |
81 | 114 |
|
82 | 115 |
@Override |
116 |
public DownloaderCredentials getCredentials(URL url) { |
|
117 |
return this.getCredentials(url.toExternalForm()); |
|
118 |
} |
|
119 |
|
|
120 |
@Override |
|
121 |
public DownloaderCredentials getCredentials(String url) { |
|
122 |
for (DownloaderCredentials theCredentials : this.credentials.values()) { |
|
123 |
if( StringUtils.startsWith(url, theCredentials.getServiceUrl()) ) { |
|
124 |
return theCredentials; |
|
125 |
} |
|
126 |
} |
|
127 |
return null; |
|
128 |
} |
|
129 |
|
|
130 |
@Override |
|
83 | 131 |
public void registerAuthenticationConfigurationService(DownloaderAuthenticationConfig config ) { |
84 | 132 |
authenticationConfigurationServices.put(config.getKey(), config); |
85 | 133 |
} |
... | ... | |
97 | 145 |
@Override |
98 | 146 |
public DownloaderAuthenticationConfig getAuthenticationConfigurationService(String baseUrl) { |
99 | 147 |
for (DownloaderAuthenticationConfig config : this.authenticationConfigurationServices.values()) { |
100 |
if( StringUtils.startsWith(baseUrl, config.getBaseUrl()) ) {
|
|
148 |
if( StringUtils.startsWith(baseUrl, config.getServiceUrl()) ) {
|
|
101 | 149 |
return config; |
102 | 150 |
} |
103 | 151 |
} |
... | ... | |
119 | 167 |
return this.credentials.values(); |
120 | 168 |
} |
121 | 169 |
|
122 |
@Override |
|
123 |
public DownloaderCredentials getCredentials(URL url) { |
|
124 |
for (DownloaderCredentials theCredentials : this.credentials.values()) { |
|
125 |
if( StringUtils.startsWith(url.toString(), theCredentials.getBaseUrl()) ) { |
|
126 |
return theCredentials; |
|
127 |
} |
|
128 |
} |
|
170 |
public DownloaderAuthenticationConfig requestAutenticationConfig(URL url) { // TODO: falta por implementar |
|
129 | 171 |
return null; |
130 | 172 |
} |
131 | 173 |
|
132 |
public DownloaderAuthenticationConfig requestAutenticationConfig(URL url) { // TODO: falta por implementar |
|
133 |
return null; |
|
174 |
@Override |
|
175 |
public DownloaderAuthenticationFactory getDownloaderAuthenticationFactory(String providerName) { |
|
176 |
return this.authenticationTypes.get(providerName); |
|
134 | 177 |
} |
135 | 178 |
|
136 | 179 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.impl/src/main/java/org/gvsig/downloader/lib/impl/SEAuthDownloaderTask.java | ||
---|---|---|
353 | 353 |
} |
354 | 354 |
|
355 | 355 |
private Executor getExecutorUI() { |
356 |
return this.downloader.getExecutorUI(); |
|
356 |
// return this.downloader.getExecutorUI(); |
|
357 |
return null; |
|
357 | 358 |
} |
358 | 359 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.api/src/main/java/org/gvsig/downloader/DownloaderManager.java | ||
---|---|---|
40 | 40 |
|
41 | 41 |
public Collection<DownloaderAuthenticationConfig> getAuthenticationConfigurationServices(); |
42 | 42 |
|
43 |
public DownloaderAuthenticationFactory getDownloaderAuthenticationFactory(String providerName); |
|
44 |
|
|
43 | 45 |
public Collection<DownloaderAuthenticationFactory> getAuthenticationTypes(); |
44 | 46 |
|
45 | 47 |
public Collection<DownloaderCredentials> getCredentials(); |
46 | 48 |
|
47 | 49 |
public DownloaderCredentials getCredentials(URL url); |
48 | 50 |
|
51 |
public DownloaderCredentials getCredentials(String url); |
|
52 |
|
|
49 | 53 |
public void removeCredentials(DownloaderCredentials credentials); |
50 | 54 |
|
51 | 55 |
public void removeAuthenticationConfigurationService(DownloaderAuthenticationConfig config); |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.api/src/main/java/org/gvsig/downloader/spi/AbstractDownloaderCredentials.java | ||
---|---|---|
5 | 5 |
*/ |
6 | 6 |
package org.gvsig.downloader.spi; |
7 | 7 |
|
8 |
import org.apache.commons.lang3.builder.ToStringBuilder; |
|
9 |
import org.apache.commons.lang3.builder.ToStringStyle; |
|
8 | 10 |
import org.gvsig.downloader.DownloaderCredentials; |
9 | 11 |
|
10 | 12 |
/** |
... | ... | |
15 | 17 |
implements DownloaderCredentials |
16 | 18 |
{ |
17 | 19 |
|
18 |
private final String providerName;
|
|
19 |
private final String baseUrl;
|
|
20 |
protected final String providerName;
|
|
21 |
protected final String serviceUrl;
|
|
20 | 22 |
|
21 |
protected AbstractDownloaderCredentials(String providerName, String baseUrl) {
|
|
23 |
protected AbstractDownloaderCredentials(String providerName, String serviceUrl) {
|
|
22 | 24 |
this.providerName = providerName; |
23 |
this.baseUrl = baseUrl;
|
|
25 |
this.serviceUrl = serviceUrl;
|
|
24 | 26 |
} |
25 | 27 |
|
26 | 28 |
@Override |
... | ... | |
29 | 31 |
} |
30 | 32 |
|
31 | 33 |
@Override |
32 |
public String getBaseUrl() {
|
|
33 |
return this.baseUrl;
|
|
34 |
public String getServiceUrl() {
|
|
35 |
return this.serviceUrl;
|
|
34 | 36 |
} |
35 |
|
|
37 |
|
|
38 |
@Override |
|
39 |
public String toString() { |
|
40 |
ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE); |
|
41 |
builder.append("serviceUrl", this.getServiceUrl()); |
|
42 |
builder.append("user", this.getUserid()); |
|
43 |
builder.append("autorization", this.getAuthorizationToken()); |
|
44 |
return builder.build(); |
|
45 |
} |
|
36 | 46 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.api/src/main/java/org/gvsig/downloader/spi/AbstractDownloaderAuthenticationRequester.java | ||
---|---|---|
16 | 16 |
implements DownloaderAuthenticationRequester |
17 | 17 |
{ |
18 | 18 |
|
19 |
private final DownloaderAuthenticationConfig config;
|
|
19 |
protected final DownloaderAuthenticationConfig config;
|
|
20 | 20 |
|
21 | 21 |
protected AbstractDownloaderAuthenticationRequester(DownloaderAuthenticationConfig config) { |
22 | 22 |
this.config = config; |
... | ... | |
34 | 34 |
|
35 | 35 |
@Override |
36 | 36 |
public String toString() { |
37 |
return "(BaseURL = '"+this.config.getBaseUrl()+"')";
|
|
37 |
return "(BaseURL = '"+this.config.getServiceUrl()+"')";
|
|
38 | 38 |
} |
39 | 39 |
|
40 | 40 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.api/src/main/java/org/gvsig/downloader/spi/AbstractDownloaderAuthenticationConfig.java | ||
---|---|---|
5 | 5 |
*/ |
6 | 6 |
package org.gvsig.downloader.spi; |
7 | 7 |
|
8 |
import javax.json.JsonObject; |
|
9 |
import org.apache.commons.lang3.StringUtils; |
|
8 | 10 |
import org.gvsig.downloader.DownloaderAuthenticationConfig; |
9 | 11 |
import org.gvsig.downloader.DownloaderAuthenticationFactory; |
10 | 12 |
import org.gvsig.downloader.DownloaderAuthenticationRequester; |
11 | 13 |
import org.gvsig.downloader.DownloaderLocator; |
14 |
import org.gvsig.downloader.DownloaderManager; |
|
15 |
import org.gvsig.json.Json; |
|
16 |
import org.gvsig.json.JsonObjectBuilder; |
|
12 | 17 |
|
13 | 18 |
/** |
14 | 19 |
* |
... | ... | |
18 | 23 |
implements DownloaderAuthenticationConfig |
19 | 24 |
{ |
20 | 25 |
|
21 |
private String providerName;
|
|
22 |
private DownloaderAuthenticationFactory factory;
|
|
23 |
private String baseUrl;
|
|
26 |
protected String providerName;
|
|
27 |
protected DownloaderAuthenticationFactory factory;
|
|
28 |
protected String serviceUrl;
|
|
24 | 29 |
|
25 |
protected AbstractDownloaderAuthenticationConfig(DownloaderAuthenticationFactory factory, String baseUrl) {
|
|
30 |
protected AbstractDownloaderAuthenticationConfig(DownloaderAuthenticationFactory factory, String serviceUrl) {
|
|
26 | 31 |
this.factory = factory; |
27 |
this.baseUrl = baseUrl;
|
|
32 |
this.serviceUrl = serviceUrl;
|
|
28 | 33 |
this.providerName = factory.getProviderName(); |
29 | 34 |
} |
30 | 35 |
|
... | ... | |
46 | 51 |
} |
47 | 52 |
|
48 | 53 |
@Override |
49 |
public String getBaseUrl() {
|
|
50 |
return this.baseUrl;
|
|
54 |
public String getServiceUrl() {
|
|
55 |
return this.serviceUrl;
|
|
51 | 56 |
} |
52 | 57 |
|
53 | 58 |
@Override |
... | ... | |
70 | 75 |
return null; |
71 | 76 |
} |
72 | 77 |
|
78 |
@Override |
|
79 |
public void fromJson(JsonObject json) { |
|
80 |
DownloaderManager manager = DownloaderLocator.getDownloaderManager(); |
|
81 |
|
|
82 |
// if( json.containsKey("type") ) { |
|
83 |
// String url = json.getString(CONFIG_URLONLINE_NAME,null); |
|
84 |
// if( url!=null ) { |
|
85 |
// this.urlOnline = url; |
|
86 |
// } |
|
87 |
// } else { |
|
88 |
this.serviceUrl = json.getString(CONFIG_SERVICEURL_NAME,null); |
|
89 |
// } |
|
90 |
String providerName = json.getString(CONFIG_PROVIDERNAME_NAME, null); |
|
91 |
if( providerName != null ) { |
|
92 |
if( !StringUtils.equalsIgnoreCase(this.providerName, providerName) ) { |
|
93 |
throw new IllegalArgumentException("this json can't be restored in a config of '"+this.providerName+"' (need a '"+providerName+"')"); |
|
94 |
} |
|
95 |
} |
|
96 |
if( this.factory == null ) { |
|
97 |
this.factory = manager.getDownloaderAuthenticationFactory(this.providerName); |
|
98 |
} |
|
99 |
} |
|
100 |
|
|
101 |
@Override |
|
102 |
public JsonObjectBuilder toJsonBuilder() { |
|
103 |
JsonObjectBuilder builder = Json.createObjectBuilder(); |
|
104 |
builder.add(CONFIG_PROVIDERNAME_NAME, this.getFactory().getProviderName()); |
|
105 |
// builder.add("urlOnline",this.getUrlOnline()); |
|
106 |
|
|
107 |
return builder; |
|
108 |
} |
|
109 |
|
|
73 | 110 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.api/src/main/java/org/gvsig/downloader/DownloaderCredentials.java | ||
---|---|---|
15 | 15 |
|
16 | 16 |
public String getAuthorizationToken(); |
17 | 17 |
|
18 |
public String getBaseUrl();
|
|
18 |
public String getServiceUrl();
|
|
19 | 19 |
|
20 | 20 |
public String getUserid(); |
21 | 21 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.api/src/main/java/org/gvsig/downloader/DownloaderLocator.java | ||
---|---|---|
66 | 66 |
return instance; |
67 | 67 |
} |
68 | 68 |
|
69 |
public static DownloaderManager getOnlineManager() { |
|
70 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
|
71 |
} |
|
72 |
|
|
69 | 73 |
/** |
70 | 74 |
* Returns the Locator's name |
71 | 75 |
* |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.lib/org.gvsig.downloader.lib.api/src/main/java/org/gvsig/downloader/DownloaderAuthenticationConfig.java | ||
---|---|---|
1 | 1 |
package org.gvsig.downloader; |
2 | 2 |
|
3 |
import org.gvsig.json.SupportJson; |
|
4 |
|
|
3 | 5 |
/** |
4 | 6 |
* |
5 | 7 |
* @author jjdelcerro |
6 | 8 |
*/ |
7 |
public interface DownloaderAuthenticationConfig extends org.gvsig.tools.lang.Cloneable { |
|
9 |
public interface DownloaderAuthenticationConfig |
|
10 |
extends |
|
11 |
org.gvsig.tools.lang.Cloneable, |
|
12 |
SupportJson |
|
13 |
{ |
|
8 | 14 |
|
15 |
public static final String CONFIG_PROVIDERNAME_NAME = "factory"; |
|
16 |
public static final String CONFIG_SERVICEURL_NAME = "serviceUrl"; |
|
17 |
|
|
9 | 18 |
public String getProviderName(); |
10 | 19 |
|
11 | 20 |
public DownloaderAuthenticationFactory getFactory(); |
12 | 21 |
|
13 |
public String getBaseUrl();
|
|
22 |
public String getServiceUrl();
|
|
14 | 23 |
|
15 | 24 |
public String getKey(); |
16 | 25 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.impl/src/main/java/org/gvsig/downloader/swing/impl/config/DownloaderConfigServicePanel.java | ||
---|---|---|
129 | 129 |
|
130 | 130 |
public void put(DownloaderAuthenticationConfig config) { |
131 | 131 |
this.config = (DownloaderAuthenticationConfig) CloneableUtils.cloneQuietly(config); |
132 |
this.txtServiceURL.setText(this.config.getBaseUrl());
|
|
132 |
this.txtServiceURL.setText(this.config.getServiceUrl());
|
|
133 | 133 |
ListElement.setSelected(cboAuthenticationType, this.config.getFactory()); |
134 | 134 |
this.doUpdateComponents(); |
135 | 135 |
} |
... | ... | |
154 | 154 |
if( this.config==null || !StringUtils.equalsIgnoreCase(authenticationType.getProviderName(), this.config.getProviderName())) { |
155 | 155 |
this.config = authenticationType.create(url); |
156 | 156 |
} |
157 |
if( !StringUtils.equals(this.config.getBaseUrl(),url) ) {
|
|
157 |
if( !StringUtils.equals(this.config.getServiceUrl(),url) ) {
|
|
158 | 158 |
this.config = authenticationType.create(url); |
159 | 159 |
} |
160 | 160 |
setDirty(false); |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.impl/src/main/java/org/gvsig/downloader/swing/impl/config/DownloaderConfigPanelImpl.java | ||
---|---|---|
84 | 84 |
DownloaderAuthenticationConfig service = this.services.get(rowIndex); |
85 | 85 |
switch(columnIndex) { |
86 | 86 |
case 0: |
87 |
return service.getBaseUrl();
|
|
87 |
return service.getServiceUrl();
|
|
88 | 88 |
case 1: |
89 | 89 |
return service.getFactory().getProviderName(); |
90 | 90 |
default: |
... | ... | |
147 | 147 |
DownloaderCredentials credentials = this.credentials.get(rowIndex); |
148 | 148 |
switch(columnIndex) { |
149 | 149 |
case 0: |
150 |
return credentials.getBaseUrl();
|
|
150 |
return credentials.getServiceUrl();
|
|
151 | 151 |
case 1: |
152 | 152 |
return credentials.getProviderName(); |
153 | 153 |
default: |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/pom.xml | ||
---|---|---|
11 | 11 |
<modules> |
12 | 12 |
<module>org.gvsig.downloader.swing.api</module> |
13 | 13 |
<module>org.gvsig.downloader.swing.impl</module> |
14 |
<module>org.gvsig.downloader.swing.scribejava</module> |
|
14 | 15 |
</modules> |
15 | 16 |
</project> |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.api/src/main/java/org/gvsig/downloader/swing/DownloaderSwingLibrary.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.downloader.swing; |
24 | 24 |
|
25 |
import org.gvsig.downloader.DownloaderLibrary; |
|
25 | 26 |
import org.gvsig.tools.ToolsLibrary; |
26 | 27 |
import org.gvsig.tools.library.AbstractLibrary; |
27 | 28 |
import org.gvsig.tools.library.LibraryException; |
... | ... | |
36 | 37 |
@Override |
37 | 38 |
protected void doInitialize() throws LibraryException { |
38 | 39 |
registerAsAPI(DownloaderSwingLibrary.class); |
40 |
require(DownloaderLibrary.class); |
|
39 | 41 |
require(ToolsLibrary.class); |
40 | 42 |
} |
41 | 43 |
|
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/resources/log4j.properties | ||
---|---|---|
1 |
log4j.rootLogger=INFO, stdout |
|
2 |
|
|
3 |
log4j.appender.stdout=org.apache.log4j.ConsoleAppender |
|
4 |
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout |
|
5 |
|
|
6 |
# Pattern to output the caller's file name and line number. |
|
7 |
log4j.appender.stdout.layout.ConversionPattern=%5p %r [%t] (%F:%L) - %m%n |
|
8 |
|
|
9 |
log4j.logger.org.gvsig.andami.plugins=INFO |
|
10 |
log4j.logger.org.gvsig.tools=INFO |
|
11 |
log4j.logger.org.gvsig.tools.dataTypes=INFO |
|
12 |
log4j.logger.org.gvsig.tools.library=INFO |
|
13 |
log4j.logger.org.gvsig.tools.persistence=INFO |
|
14 |
log4j.logger.org.gvsig.i18n.Messages=INFO |
|
15 |
log4j.logger.org.gvsig.installer.lib.impl.DefaultDependenciesCalculator=INFO |
|
16 |
log4j.logger.org.gvsig.tools.dispose.impl.AbstractDisposable=INFO |
|
17 |
|
|
18 |
# |
|
19 |
# Dispose del DefaultGraphicLayer |
|
20 |
log4j.logger.org.gvsig.fmap.mapcontext.layers.vectorial.impl.DefaultGraphicLayer=INFO |
|
21 |
|
|
22 |
# |
|
23 |
# JCRS |
|
24 |
log4j.logger.org.gvsig.crs=INFO |
|
25 |
log4j.logger.es.idr.teledeteccion.connection=INFO |
|
26 |
log4j.logger.org.geotools.referencing.operation.projection=INFO |
|
27 |
# |
|
28 |
# JDBC/BBDD |
|
29 |
# Core |
|
30 |
log4j.logger.org.gvsig.fmap.dal.store.jdbc=INFO |
|
31 |
log4j.logger.org.gvsig.fmap.dal.store.jdbc2=INFO |
|
32 |
log4j.logger.org.gvsig.fmap.dal.feature.spi=INFO |
|
33 |
log4j.logger.org.gvsig.fmap.dal.store.jdbc2.JDBCUtils=INFO |
|
34 |
log4j.logger.org.gvsig.fmap.dal.store.jdbc2.spi.JDBCHelperBase=INFO |
|
35 |
# Data providers |
|
36 |
log4j.logger.org.gvsig.fmap.dal.store.h2=INFO |
|
37 |
log4j.logger.org.gvsig.postgresql.dal=INFO |
|
38 |
log4j.logger.org.gvsig.mssqlserver.dal=INFO |
|
39 |
log4j.logger.org.gvsig.mysql.dal=INFO |
|
40 |
log4j.logger.org.gvsig.spatialite.dal=INFO |
|
41 |
log4j.logger.org.gvsig.oracle.dal=INFO |
|
42 |
# Exoport providers |
|
43 |
log4j.logger.org.gvsig.exportto.swing.prov.jdbc=INFO |
|
44 |
log4j.logger.org.gvsig.exportto.swing.prov.h2=INFO |
|
45 |
# |
|
46 |
# shp/dbf driver |
|
47 |
log4j.logger.org.gvsig.fmap.dal.store.shp=INFO |
|
48 |
log4j.logger.org.gvsig.fmap.dal.store.dbf=INFO |
|
49 |
# |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.downloader.swing.scribejava.DownloaderSwingScribejavaLibrary |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/java/org/gvsig/downloader/swing/scribejava/DownloaderSwingScribejavaLibrary.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 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, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.downloader.swing.scribejava; |
|
25 |
|
|
26 |
|
|
27 |
import org.gvsig.downloader.swing.DownloaderSwingLibrary; |
|
28 |
import org.gvsig.downloader.swing.scribejava.keycloak.DownloaderAuthenticationKeycloakFactory; |
|
29 |
import org.gvsig.tools.library.AbstractLibrary; |
|
30 |
import org.gvsig.tools.library.LibraryException; |
|
31 |
|
|
32 |
/** |
|
33 |
* |
|
34 |
* @author jjdelcerro |
|
35 |
*/ |
|
36 |
public class DownloaderSwingScribejavaLibrary extends AbstractLibrary { |
|
37 |
|
|
38 |
@Override |
|
39 |
public void doRegistration() { |
|
40 |
super.doRegistration(); |
|
41 |
this.require(DownloaderSwingLibrary.class); |
|
42 |
} |
|
43 |
|
|
44 |
@Override |
|
45 |
protected void doInitialize() throws LibraryException { |
|
46 |
|
|
47 |
} |
|
48 |
|
|
49 |
@Override |
|
50 |
protected void doPostInitialize() throws LibraryException { |
|
51 |
DownloaderAuthenticationKeycloakFactory.selfRegister(); |
|
52 |
} |
|
53 |
|
|
54 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/java/org/gvsig/downloader/swing/scribejava/keycloak/DownloaderAuthenticationKeycloakFactory.java | ||
---|---|---|
1 |
package org.gvsig.downloader.swing.scribejava.keycloak; |
|
2 |
|
|
3 |
import com.sun.net.httpserver.HttpHandler; |
|
4 |
import com.sun.net.httpserver.HttpServer; |
|
5 |
import java.io.IOException; |
|
6 |
import java.net.InetSocketAddress; |
|
7 |
import org.gvsig.downloader.DownloaderAuthenticationFactory; |
|
8 |
import org.gvsig.downloader.DownloaderLocator; |
|
9 |
import org.gvsig.downloader.DownloaderManager; |
|
10 |
import org.gvsig.downloader.spi.AbstractDownloaderAuthenticationFactory; |
|
11 |
|
|
12 |
/** |
|
13 |
* |
|
14 |
* @author jjdelcerro |
|
15 |
*/ |
|
16 |
public class DownloaderAuthenticationKeycloakFactory |
|
17 |
extends AbstractDownloaderAuthenticationFactory |
|
18 |
implements DownloaderAuthenticationFactory |
|
19 |
{ |
|
20 |
|
|
21 |
public static final String AUTH_MODE_KEYCLOAK = "Keycloak"; |
|
22 |
|
|
23 |
private HttpServer httpserver; |
|
24 |
|
|
25 |
public DownloaderAuthenticationKeycloakFactory() { |
|
26 |
super(AUTH_MODE_KEYCLOAK); |
|
27 |
} |
|
28 |
|
|
29 |
@Override |
|
30 |
public DownloaderAuthenticationKeycloakConfig create(Object... parameters) { |
|
31 |
return new DownloaderAuthenticationKeycloakConfig(this, (String) parameters[0]); |
|
32 |
} |
|
33 |
|
|
34 |
public HttpServer getHttpServer(DownloaderAuthenticationKeycloakConfig config) throws IOException { |
|
35 |
if( this.httpserver == null ) { |
|
36 |
this.httpserver = HttpServer.create(new InetSocketAddress(config.getLocalPort()), 0); |
|
37 |
this.httpserver.setExecutor(null); // creates a default executor |
|
38 |
this.httpserver.start(); |
|
39 |
} |
|
40 |
return this.httpserver; |
|
41 |
} |
|
42 |
|
|
43 |
public void stopHttpServer(int delay) { |
|
44 |
if( this.httpserver!=null ) { |
|
45 |
this.httpserver.stop(0); |
|
46 |
} |
|
47 |
} |
|
48 |
|
|
49 |
public void addCallback(DownloaderAuthenticationKeycloakConfig config, String contextPath, HttpHandler handler ) throws IOException { |
|
50 |
this.getHttpServer(config).createContext(contextPath, handler); |
|
51 |
} |
|
52 |
|
|
53 |
public void removeCallback(DownloaderAuthenticationKeycloakConfig config, String contextPath) throws IOException { |
|
54 |
this.getHttpServer(config).removeContext(contextPath); |
|
55 |
} |
|
56 |
|
|
57 |
public static void selfRegister() { |
|
58 |
DownloaderAuthenticationKeycloakConfig.selfRegister(); |
|
59 |
|
|
60 |
DownloaderManager manager = DownloaderLocator.getDownloaderManager(); |
|
61 |
manager.registerAuthenticationType(new DownloaderAuthenticationKeycloakFactory()); |
|
62 |
} |
|
63 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/java/org/gvsig/downloader/swing/scribejava/keycloak/KeycloakApi2.java | ||
---|---|---|
1 |
package org.gvsig.downloader.swing.scribejava.keycloak; |
|
2 |
|
|
3 |
import com.github.scribejava.apis.openid.OpenIdJsonTokenExtractor; |
|
4 |
import com.github.scribejava.core.builder.api.DefaultApi20; |
|
5 |
import com.github.scribejava.core.extractors.TokenExtractor; |
|
6 |
import com.github.scribejava.core.model.OAuth2AccessToken; |
|
7 |
|
|
8 |
import java.util.concurrent.ConcurrentHashMap; |
|
9 |
import java.util.concurrent.ConcurrentMap; |
|
10 |
import org.apache.commons.lang3.StringUtils; |
|
11 |
|
|
12 |
/* |
|
13 |
* Based on portions of code from ScribeJava (https://github.com/scribejava/scribejava) |
|
14 |
* in module scribejava-apis. |
|
15 |
* https://github.com/scribejava/scribejava/blob/master/scribejava-apis/src/main/java/com/github/scribejava/apis/KeycloakApi.java |
|
16 |
*/ |
|
17 |
public class KeycloakApi2 extends DefaultApi20 { |
|
18 |
|
|
19 |
private static final ConcurrentMap<String, KeycloakApi2> INSTANCES = new ConcurrentHashMap<>(); |
|
20 |
|
|
21 |
private final String baseUrlWithRealm; |
|
22 |
|
|
23 |
protected KeycloakApi2(String baseUrlWithRealm) { |
|
24 |
this.baseUrlWithRealm = baseUrlWithRealm; |
|
25 |
} |
|
26 |
|
|
27 |
public static KeycloakApi2 instance() { |
|
28 |
return instance("http://localhost:8080/", "master"); |
|
29 |
} |
|
30 |
|
|
31 |
public static KeycloakApi2 instance(String baseUrl, String realm) { |
|
32 |
final String defaultBaseUrlWithRealm = composeBaseUrlWithRealm(baseUrl, realm); |
|
33 |
|
|
34 |
//java8: switch to ConcurrentMap::computeIfAbsent |
|
35 |
KeycloakApi2 api = INSTANCES.get(defaultBaseUrlWithRealm); |
|
36 |
if (api == null) { |
|
37 |
api = new KeycloakApi2(defaultBaseUrlWithRealm); |
|
38 |
final KeycloakApi2 alreadyCreatedApi = INSTANCES.putIfAbsent(defaultBaseUrlWithRealm, api); |
|
39 |
if (alreadyCreatedApi != null) { |
|
40 |
return alreadyCreatedApi; |
|
41 |
} |
|
42 |
} |
|
43 |
return api; |
|
44 |
} |
|
45 |
|
|
46 |
protected static String composeBaseUrlWithRealm(String baseUrl, String realm) { |
|
47 |
if( !StringUtils.endsWith(baseUrl, "/") ) { |
|
48 |
baseUrl += "/"; |
|
49 |
} |
|
50 |
if( StringUtils.endsWith(baseUrl, "/realms/") ) { |
|
51 |
baseUrl += realm; |
|
52 |
} else { |
|
53 |
baseUrl += "auth/realms/" + realm; |
|
54 |
} |
|
55 |
// return baseUrl + (baseUrl.endsWith("/") ? "" : "/") + "auth/realms/" + realm; |
|
56 |
return baseUrl; |
|
57 |
} |
|
58 |
|
|
59 |
@Override |
|
60 |
public String getAccessTokenEndpoint() { |
|
61 |
return baseUrlWithRealm + "/protocol/openid-connect/token"; |
|
62 |
} |
|
63 |
|
|
64 |
@Override |
|
65 |
protected String getAuthorizationBaseUrl() { |
|
66 |
return baseUrlWithRealm + "/protocol/openid-connect/auth"; |
|
67 |
} |
|
68 |
|
|
69 |
@Override |
|
70 |
public TokenExtractor<OAuth2AccessToken> getAccessTokenExtractor() { |
|
71 |
return OpenIdJsonTokenExtractor.instance(); |
|
72 |
} |
|
73 |
|
|
74 |
@Override |
|
75 |
public String getRevokeTokenEndpoint() { |
|
76 |
throw new RuntimeException("Not implemented yet"); |
|
77 |
} |
|
78 |
|
|
79 |
public String getUserInfoEndpoint() { |
|
80 |
return baseUrlWithRealm + "/protocol/openid-connect/userinfo"; |
|
81 |
} |
|
82 |
|
|
83 |
public String getLogoutEndpoint(String clientid, String redirect_uri) { |
|
84 |
// String redirect_uri_name = "redirect_uri"; |
|
85 |
String redirect_uri_name = "post_logout_redirect_uri"; |
|
86 |
String logoutUrl = String.format( |
|
87 |
"%s/protocol/openid-connect/logout?%s=%s&client_id=%s", |
|
88 |
this.baseUrlWithRealm, |
|
89 |
redirect_uri_name, |
|
90 |
redirect_uri, |
|
91 |
clientid |
|
92 |
); |
|
93 |
return logoutUrl; |
|
94 |
} |
|
95 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/java/org/gvsig/downloader/swing/scribejava/keycloak/DownloaderKeycloakCredentials.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.downloader.swing.scribejava.keycloak; |
|
7 |
|
|
8 |
import com.github.scribejava.core.model.OAuth2AccessToken; |
|
9 |
import javax.json.JsonObject; |
|
10 |
import org.gvsig.downloader.DownloaderAuthenticationConfig; |
|
11 |
import org.gvsig.downloader.DownloaderCredentials; |
|
12 |
import org.gvsig.downloader.spi.AbstractDownloaderCredentials; |
|
13 |
import org.gvsig.json.Json; |
|
14 |
|
|
15 |
/** |
|
16 |
* |
|
17 |
* @author jjdelcerro |
|
18 |
*/ |
|
19 |
public class DownloaderKeycloakCredentials |
|
20 |
extends AbstractDownloaderCredentials |
|
21 |
implements DownloaderCredentials |
|
22 |
{ |
|
23 |
|
|
24 |
private final OAuth2AccessToken oauthToken; |
|
25 |
private final String userid; |
|
26 |
private long time; |
|
27 |
private JsonObject jsonResponse; |
|
28 |
|
|
29 |
public DownloaderKeycloakCredentials(DownloaderAuthenticationConfig config, OAuth2AccessToken oauthToken, String userid, long time) { |
|
30 |
super(userid, config.getServiceUrl()); |
|
31 |
this.oauthToken = oauthToken; |
|
32 |
this.userid = userid; |
|
33 |
this.time = time; |
|
34 |
this.jsonResponse = null; |
|
35 |
} |
|
36 |
|
|
37 |
public OAuth2AccessToken getToken() { |
|
38 |
return oauthToken; |
|
39 |
} |
|
40 |
|
|
41 |
@Override |
|
42 |
public String getAuthorizationToken() { |
|
43 |
return "Bearer " + oauthToken.getAccessToken(); |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public String getUserid() { |
|
48 |
return userid; |
|
49 |
} |
|
50 |
|
|
51 |
public boolean isAccessTokenExpired() { |
|
52 |
try { |
|
53 |
long now = System.currentTimeMillis(); |
|
54 |
long expires_in = this.getResponseValueInt("expires_in", -1); // secs |
|
55 |
if( expires_in<0 ) { |
|
56 |
return true; |
|
57 |
} |
|
58 |
return time+(expires_in*1000) < now; |
|
59 |
} catch(Exception ex) { |
|
60 |
return true; |
|
61 |
} |
|
62 |
} |
|
63 |
|
|
64 |
public boolean isRefreshTokenExpired() { |
|
65 |
try { |
|
66 |
long now = System.currentTimeMillis(); |
|
67 |
long refresh_expires_in = this.getResponseValueInt("refresh_expires_in", -1); // secs |
|
68 |
if( refresh_expires_in<0 ) { |
|
69 |
return true; |
|
70 |
} |
|
71 |
return time+(refresh_expires_in*1000) < now; |
|
72 |
} catch(Exception ex) { |
|
73 |
return false; |
|
74 |
} |
|
75 |
} |
|
76 |
|
|
77 |
private String getResponseValueString(String name) { |
|
78 |
if( this.jsonResponse == null ) { |
|
79 |
this.jsonResponse = Json.createObject(this.oauthToken.getRawResponse()); |
|
80 |
} |
|
81 |
return this.jsonResponse.getString(name, null); |
|
82 |
} |
|
83 |
|
|
84 |
private int getResponseValueInt(String name, int defaultValue) { |
|
85 |
if( this.jsonResponse == null ) { |
|
86 |
this.jsonResponse = Json.createObject(this.oauthToken.getRawResponse()); |
|
87 |
} |
|
88 |
return this.jsonResponse.getInt(name, defaultValue); |
|
89 |
} |
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/java/org/gvsig/downloader/swing/scribejava/keycloak/callbacks/CallbackAuthorizationHandler.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.downloader.swing.scribejava.keycloak.callbacks; |
|
7 |
|
|
8 |
import com.github.scribejava.core.model.OAuth2AccessToken; |
|
9 |
import com.github.scribejava.core.model.OAuth2Authorization; |
|
10 |
import com.github.scribejava.core.oauth.OAuth20Service; |
|
11 |
import com.sun.net.httpserver.HttpExchange; |
|
12 |
import com.sun.net.httpserver.HttpHandler; |
|
13 |
import java.io.IOException; |
|
14 |
import javax.json.JsonObject; |
|
15 |
import org.gvsig.downloader.swing.scribejava.keycloak.DownloaderAuthenticationKeycloakRequester; |
|
16 |
import org.gvsig.downloader.swing.scribejava.keycloak.DownloaderKeycloakCredentials; |
|
17 |
|
|
18 |
/** |
|
19 |
* |
|
20 |
* @author jjdelcerro |
|
21 |
*/ |
|
22 |
@SuppressWarnings("UseSpecificCatch") |
|
23 |
public class CallbackAuthorizationHandler extends AbstractCallback implements HttpHandler { |
|
24 |
|
|
25 |
|
|
26 |
public CallbackAuthorizationHandler(DownloaderAuthenticationKeycloakRequester identificationRequester, OAuth20Service service, String contextPath) { |
|
27 |
super(identificationRequester, service, contextPath); |
|
28 |
} |
|
29 |
|
|
30 |
@Override |
|
31 |
public void handle(HttpExchange t) throws IOException { |
|
32 |
String requestURL = "Unknown"; |
|
33 |
try { |
|
34 |
long now = System.currentTimeMillis(); |
|
35 |
requestURL = t.getRequestURI().toString(); |
|
36 |
OAuth2Authorization auth = service.extractAuthorization(t.getRequestURI().toString()); |
|
37 |
if (auth.getCode() == null) { |
|
38 |
this.identificationRequester.setCredentials(null); |
|
39 |
response(t, 200, message("Can't autthenticate user\n")); |
|
40 |
return; |
|
41 |
} |
|
42 |
final OAuth2AccessToken accessToken = service.getAccessToken(auth.getCode()); |
|
43 |
this.identificationRequester.setCredentials(new DownloaderKeycloakCredentials(this.getConfig(), accessToken, null, now)); |
|
44 |
|
|
45 |
String userId = null; |
|
46 |
JsonObject userinfo = this.identificationRequester.userInfo(service); |
|
47 |
if (userinfo!=null) { |
|
48 |
userId = userinfo.getString("preferred_username", null); |
|
49 |
// System.out.println("userid: " + userId); |
|
50 |
// System.out.println("name: " + userinfo.getString("name", null)); |
|
51 |
// System.out.println("email: " + userinfo.getString("email", null)); |
|
52 |
// System.out.println("roles: " + userinfo.get("gvsigol_roles").toString()); |
|
53 |
// System.out.println("grupos: " + userinfo.get("groups").toString()); |
|
54 |
} else { |
|
55 |
userId = "unkown"+accessToken.getAccessToken().hashCode(); |
|
56 |
} |
|
57 |
this.identificationRequester.setCredentials(new DownloaderKeycloakCredentials(this.getConfig(),accessToken, userId, now)); |
|
58 |
response(t, 200, |
|
59 |
message_and_close( |
|
60 |
(userId == null)? |
|
61 |
"\n\n\n\n\n\n\n\n\n\n<p align=\"center\">User authenticated</p>\n\n<p align=\"center\"><button type=\"button\" onclick=\"self.close()\">Close this window</button></p>\n\n": |
|
62 |
"\n\n\n\n\n\n\n\n\n\n<p align=\"center\">User " + userId + " authenticated</p>\n\n<p align=\"center\"><button type=\"button\" onclick=\"self.close();\">Close this window</button></p>\n\n" |
|
63 |
) |
|
64 |
); |
|
65 |
} catch (Exception ex) { |
|
66 |
this.identificationRequester.setCredentials(null); |
|
67 |
LOGGER.warn("Can't process callback authorization (contextPath '" + contextPath + "', request URL '" + requestURL + "')", ex); |
|
68 |
responseQuietly(t, 500, message("Can't authenticate user\n" + ex.getMessage())); |
|
69 |
} finally { |
|
70 |
this.stopWaitingForResponse(); |
|
71 |
} |
|
72 |
} |
|
73 |
|
|
74 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/java/org/gvsig/downloader/swing/scribejava/keycloak/callbacks/AbstractCallback.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.downloader.swing.scribejava.keycloak.callbacks; |
|
7 |
|
|
8 |
import com.github.scribejava.core.oauth.OAuth20Service; |
|
9 |
import com.sun.net.httpserver.HttpExchange; |
|
10 |
import java.io.IOException; |
|
11 |
import java.io.OutputStream; |
|
12 |
import org.apache.commons.lang3.StringUtils; |
|
13 |
import org.gvsig.downloader.swing.scribejava.keycloak.DownloaderAuthenticationKeycloakConfig; |
|
14 |
import org.gvsig.downloader.swing.scribejava.keycloak.DownloaderAuthenticationKeycloakFactory; |
|
15 |
import org.gvsig.downloader.swing.scribejava.keycloak.DownloaderAuthenticationKeycloakRequester; |
|
16 |
import org.slf4j.Logger; |
|
17 |
import org.slf4j.LoggerFactory; |
|
18 |
|
|
19 |
/** |
|
20 |
* |
|
21 |
* @author jjdelcerro |
|
22 |
*/ |
|
23 |
@SuppressWarnings("UseSpecificCatch") |
|
24 |
public class AbstractCallback { |
|
25 |
|
|
26 |
protected static final Logger LOGGER = LoggerFactory.getLogger(CallbackAuthorizationHandler.class); |
|
27 |
|
|
28 |
protected final OAuth20Service service; |
|
29 |
protected final DownloaderAuthenticationKeycloakRequester identificationRequester; |
|
30 |
protected final String contextPath; |
|
31 |
protected boolean aborted; |
|
32 |
|
|
33 |
public AbstractCallback(DownloaderAuthenticationKeycloakRequester identificationRequester, OAuth20Service service, String contextPath) { |
|
34 |
this.contextPath = contextPath; |
|
35 |
this.service = service; |
|
36 |
this.identificationRequester = identificationRequester; |
|
37 |
this.aborted = false; |
|
38 |
} |
|
39 |
|
|
40 |
protected DownloaderAuthenticationKeycloakConfig getConfig() { |
|
41 |
return this.identificationRequester.getConfig(); |
|
42 |
} |
|
43 |
|
|
44 |
protected void response(HttpExchange t, int code, String body) throws IOException { |
|
45 |
t.sendResponseHeaders(code, body.length()); |
|
46 |
try (final OutputStream os = t.getResponseBody()) { |
|
47 |
os.write(body.getBytes()); |
|
48 |
} |
|
49 |
} |
|
50 |
|
|
51 |
protected void responseQuietly(HttpExchange t, int code, String body) { |
|
52 |
try { |
|
53 |
response(t, code, body); |
|
54 |
} catch (Exception e) { |
|
55 |
// Do nothing |
|
56 |
LOGGER.warn("Can't generate response.", e); |
|
57 |
} |
|
58 |
} |
|
59 |
|
|
60 |
public void remove() throws IOException { |
|
61 |
DownloaderAuthenticationKeycloakConfig config = identificationRequester.getConfig(); |
|
62 |
DownloaderAuthenticationKeycloakFactory factory = config.getFactory(); |
|
63 |
factory.removeCallback(config, contextPath); |
|
64 |
this.aborted = true; |
|
65 |
} |
|
66 |
|
|
67 |
public void stopWaitingForResponse() { |
|
68 |
if (aborted) { |
|
69 |
return; |
|
70 |
} |
|
71 |
this.identificationRequester.stopWaitingForResponse(); |
|
72 |
} |
|
73 |
|
|
74 |
public String message_and_close(String s) { |
|
75 |
StringBuilder builder = new StringBuilder(); |
|
76 |
builder.append("<html>\n"); |
|
77 |
builder.append("<body onload=\"window.close()\">\n"); |
|
78 |
builder.append(StringUtils.replace(s, "\n", "<br>\n")); |
|
79 |
builder.append("</body>\n"); |
|
80 |
builder.append("</html>\n"); |
|
81 |
return builder.toString(); |
|
82 |
} |
|
83 |
|
|
84 |
public String message(String s) { |
|
85 |
StringBuilder builder = new StringBuilder(); |
|
86 |
builder.append("<html>\n"); |
|
87 |
builder.append("<body >\n"); |
|
88 |
builder.append(StringUtils.replace(s, "\n", "<br>\n")); |
|
89 |
builder.append("</body>\n"); |
|
90 |
builder.append("</html>\n"); |
|
91 |
return builder.toString(); |
|
92 |
} |
|
93 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/java/org/gvsig/downloader/swing/scribejava/keycloak/callbacks/CallbackLogoutHandler.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.downloader.swing.scribejava.keycloak.callbacks; |
|
7 |
|
|
8 |
import com.github.scribejava.core.oauth.OAuth20Service; |
|
9 |
import com.sun.net.httpserver.HttpExchange; |
|
10 |
import com.sun.net.httpserver.HttpHandler; |
|
11 |
import java.io.IOException; |
|
12 |
import org.gvsig.downloader.swing.scribejava.keycloak.DownloaderAuthenticationKeycloakRequester; |
|
13 |
|
|
14 |
/** |
|
15 |
* |
|
16 |
* @author jjdelcerro |
|
17 |
*/ |
|
18 |
@SuppressWarnings("UseSpecificCatch") |
|
19 |
public class CallbackLogoutHandler extends AbstractCallback implements HttpHandler { |
|
20 |
|
|
21 |
public CallbackLogoutHandler(DownloaderAuthenticationKeycloakRequester identificationRequester, OAuth20Service service, String contextPath) { |
|
22 |
super(identificationRequester, service, contextPath); |
|
23 |
} |
|
24 |
|
|
25 |
@Override |
|
26 |
public void handle(HttpExchange t) throws IOException { |
|
27 |
String requestURL = "Unknown"; |
|
28 |
try { |
|
29 |
requestURL = t.getRequestURI().toString(); |
|
30 |
// LOGGER.info("Callback logout "+requestURL); |
|
31 |
response(t, 200, |
|
32 |
message_and_close( |
|
33 |
"\n\n\n\n\n\n\n\n\n\n<p align=\"center\">Session closed</p>\n\n<p align=\"center\"><button type=\"button\" onclick=\"self.close()\">Close this window</button></p>\n\n" |
|
34 |
) |
|
35 |
); // +t.getRequestURI().toString()+"\n")); |
|
36 |
} catch (Exception ex) { |
|
37 |
LOGGER.warn("Can't process callback authorization (contextPath '" + contextPath + "', request URL '" + requestURL + "')", ex); |
|
38 |
responseQuietly(t, 500, message("Can't authenticate user<br>\n" + ex.getMessage())); |
|
39 |
} finally { |
|
40 |
this.stopWaitingForResponse(); |
|
41 |
} |
|
42 |
} |
|
43 |
|
|
44 |
|
|
45 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/java/org/gvsig/downloader/swing/scribejava/keycloak/DownloaderAuthenticationKeycloakConfigPanelView.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.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/java/org/gvsig/downloader/swing/scribejava/keycloak/DownloaderAuthenticationKeycloakConfigPanelView.xml</at> |
|
28 |
<at name="path">datos/devel/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.downloader/org.gvsig.downloader.swing/org.gvsig.downloader.swing.scribejava/src/main/java/org/gvsig/downloader/swing/scribejava/keycloak/DownloaderAuthenticationKeycloakConfigPanelView.xml</at> |
|
29 |
<at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,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</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">5</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">lblUrlKeycloak</at> |
|
78 |
<at name="width">77</at> |
|
79 |
<at name="text">_URL_Keycloak</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">16</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">2</at> |
|
100 |
<at name="row">11</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">com.jeta.forms.components.label.JETALabel</at> |
|
112 |
<at name="beanproperties"> |
|
113 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
114 |
<at name="classname">com.jeta.forms.components.label.JETALabel</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">lblRealm</at> |
|
138 |
<at name="width">77</at> |
|
139 |
<at name="text">_Realm</at> |
|
140 |
<at name="fill"> |
|
141 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
142 |
<at name="name">fill</at> |
|
143 |
</object> |
|
144 |
</at> |
|
145 |
<at name="height">16</at> |
|
146 |
</object> |
|
147 |
</at> |
|
148 |
</object> |
|
149 |
</at> |
|
150 |
</object> |
|
151 |
</at> |
|
152 |
</item> |
|
153 |
<item > |
|
154 |
<at name="value"> |
|
155 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
156 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
157 |
<at name="cellconstraints"> |
|
158 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
159 |
<at name="column">2</at> |
|
160 |
<at name="row">13</at> |
|
161 |
<at name="colspan">1</at> |
|
162 |
<at name="rowspan">1</at> |
|
163 |
<at name="halign">default</at> |
|
164 |
<at name="valign">default</at> |
|
165 |
<at name="insets" object="insets">0,0,0,0</at> |
|
166 |
</object> |
|
167 |
</at> |
|
168 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
169 |
</super> |
|
170 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
171 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
172 |
<at name="beanproperties"> |
|
173 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
174 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
175 |
<at name="properties"> |
|
176 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
177 |
<at name="border"> |
|
178 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
179 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
180 |
<at name="name">border</at> |
|
181 |
</super> |
|
182 |
<at name="borders"> |
|
183 |
<object classname="java.util.LinkedList"> |
|
184 |
<item > |
|
185 |
<at name="value"> |
|
186 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
187 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
188 |
<at name="name">border</at> |
|
189 |
</super> |
|
190 |
</object> |
|
191 |
</at> |
Also available in: Unified diff