Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
Uploader
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Uploader
Commits
70299bde
Commit
70299bde
authored
Apr 15, 2015
by
mobreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
geneses-client-api updated, resolving issues
parent
0c78af81
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
14 deletions
+27
-14
anno-gui/src/main/java/org/genesys2/anno/gui/SettingsDialog.java
...i/src/main/java/org/genesys2/anno/gui/SettingsDialog.java
+4
-4
anno-gui/src/main/java/org/genesys2/anno/gui/SheetDisplay.java
...gui/src/main/java/org/genesys2/anno/gui/SheetDisplay.java
+2
-1
anno-gui/src/main/java/org/genesys2/anno/gui/SpringConfig.java
...gui/src/main/java/org/genesys2/anno/gui/SpringConfig.java
+21
-9
No files found.
anno-gui/src/main/java/org/genesys2/anno/gui/SettingsDialog.java
View file @
70299bde
...
...
@@ -231,7 +231,7 @@ public class SettingsDialog extends Dialog {
try
{
String
res
=
genesysClient
.
me
();
System
.
err
.
println
(
"/me: "
+
res
);
oauthSettings
.
setAccessToken
(
genesysClient
.
get
AccessToken
().
get
Token
());
oauthSettings
.
setAccessToken
(
genesysClient
.
get
Tokens
().
getAccess
Token
());
SwtUtil
.
showMessageBox
(
getParent
(),
"OAuth"
,
"Tokens are up to date."
);
...
...
@@ -241,7 +241,7 @@ public class SettingsDialog extends Dialog {
+
oauthSettings
.
getServerUrl
()
+
"\n\n"
+
e
.
getMessage
());
}
catch
(
OAuthAuthenticationException
e
)
{
_log
.
warn
(
e
.
getMessage
());
String
authorizationUrl
=
genesysClient
.
getAuthorizationUrl
(
null
);
String
authorizationUrl
=
genesysClient
.
getAuthorizationUrl
();
VerifierDialog
vd
=
new
VerifierDialog
(
getParent
(),
SWT
.
NONE
);
String
verifierCode
=
vd
.
open
(
authorizationUrl
);
...
...
@@ -250,8 +250,8 @@ public class SettingsDialog extends Dialog {
_log
.
info
(
"Got verifier code: "
+
verifierCode
);
try
{
genesysClient
.
authenticate
(
verifierCode
);
oauthSettings
.
setAccessToken
(
genesysClient
.
get
AccessToken
().
get
Token
());
oauthSettings
.
setRefreshToken
(
genesysClient
.
get
RefreshToken
().
get
Token
());
oauthSettings
.
setAccessToken
(
genesysClient
.
get
Tokens
().
getAccess
Token
());
oauthSettings
.
setRefreshToken
(
genesysClient
.
get
Tokens
().
getRefresh
Token
());
}
catch
(
Throwable
e1
)
{
_log
.
error
(
e1
.
getMessage
(),
e1
);
SwtUtil
.
showMessageBox
(
getParent
(),
"OAuth error"
,
e1
.
getMessage
());
...
...
anno-gui/src/main/java/org/genesys2/anno/gui/SheetDisplay.java
View file @
70299bde
...
...
@@ -102,7 +102,8 @@ public class SheetDisplay extends Composite {
@Autowired
private
ColumnDefs
columnDefs
;
private
static
final
ObjectMapper
mapper
=
new
ObjectMapper
();
@Autowired
private
ObjectMapper
mapper
;
private
static
class
ContentProvider
implements
IStructuredContentProvider
{
@Override
...
...
anno-gui/src/main/java/org/genesys2/anno/gui/SpringConfig.java
View file @
70299bde
...
...
@@ -18,6 +18,7 @@ import org.genesys2.anno.parser.XlsxDataSourceParser;
import
org.genesys2.anno.reader.JDBCRowReader
;
import
org.genesys2.anno.util.ConnectionUtils
;
import
org.genesys2.client.oauth.GenesysClient
;
import
org.genesys2.client.oauth.GenesysTokens
;
import
org.genesys2.client.oauth.api.GenesysApi
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.config.ConfigurableBeanFactory
;
...
...
@@ -30,6 +31,8 @@ import org.springframework.context.annotation.Scope;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.Resource
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
/**
* Main Spring configuration
*
...
...
@@ -51,10 +54,10 @@ public class SpringConfig {
return
dataSourceLoader
;
}
@Bean
public
JdbcDrivers
jdbcDrivers
()
{
return
new
JdbcDrivers
();
}
@Bean
public
JdbcDrivers
jdbcDrivers
()
{
return
new
JdbcDrivers
();
}
@Bean
public
ExecutorService
getExecutorService
()
{
...
...
@@ -91,8 +94,9 @@ public class SpringConfig {
@Bean
@Scope
(
ConfigurableBeanFactory
.
SCOPE_PROTOTYPE
)
public
SheetDisplay
sheetDisplay
(
IDataSource
dataSource
,
IDataSourceSheet
dataSourceSheet
,
Composite
parent
,
TreeViewer
treeViewer
,
int
style
)
{
return
new
SheetDisplay
(
dataSource
,
dataSourceSheet
,
parent
,
treeViewer
,
style
);
public
SheetDisplay
sheetDisplay
(
IDataSource
dataSource
,
IDataSourceSheet
dataSourceSheet
,
Composite
parent
,
TreeViewer
treeViewer
,
int
style
)
{
return
new
SheetDisplay
(
dataSource
,
dataSourceSheet
,
parent
,
treeViewer
,
style
);
}
@Bean
...
...
@@ -152,13 +156,19 @@ public class SpringConfig {
return
extraClassLoader
;
}
@Bean
public
ObjectMapper
objectMapper
()
{
return
new
ObjectMapper
();
}
@Bean
public
static
PropertyPlaceholderConfigurer
propertyPlaceholderConfigurer
()
{
final
PropertyPlaceholderConfigurer
propertyPlaceholderConfigurer
=
new
PropertyPlaceholderConfigurer
();
// Need to ignore "genesys.properties" if not found
propertyPlaceholderConfigurer
.
setIgnoreResourceNotFound
(
true
);
propertyPlaceholderConfigurer
.
setLocations
(
new
Resource
[]
{
new
ClassPathResource
(
"genesys.properties"
),
new
ClassPathResource
(
"local.properties"
)
});
propertyPlaceholderConfigurer
.
setLocations
(
new
Resource
[]
{
new
ClassPathResource
(
"genesys.properties"
),
new
ClassPathResource
(
"local.properties"
)
});
return
propertyPlaceholderConfigurer
;
}
...
...
@@ -168,8 +178,10 @@ public class SpringConfig {
GenesysClient
genesysClient
=
new
GenesysClient
();
genesysClient
.
setGenesysApi
(
new
GenesysApi
());
genesysClient
.
setBaseUrl
(
oauthSettings
.
getServerUrl
());
genesysClient
.
setAccessToken
(
oauthSettings
.
getAccessToken
());
genesysClient
.
setRefreshToken
(
oauthSettings
.
getRefreshToken
());
GenesysTokens
genesysTokens
=
new
GenesysTokens
();
genesysTokens
.
setAccessToken
(
oauthSettings
.
getAccessToken
());
genesysTokens
.
setRefreshToken
(
oauthSettings
.
getRefreshToken
());
genesysClient
.
setTokens
(
genesysTokens
);
genesysClient
.
connect
(
oauthSettings
.
getClientKey
(),
oauthSettings
.
getClientSecret
(),
"oob"
);
return
genesysClient
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment