Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
8e6d33a7
Commit
8e6d33a7
authored
Feb 12, 2016
by
Matija Obreza
Browse files
Fixed URL shortener bug: 'columns' cookie is no longer required
parent
bbfd3c93
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/servlet/controller/ExplorerController.java
View file @
8e6d33a7
...
...
@@ -166,7 +166,7 @@ public class ExplorerController extends BaseController implements InitializingBe
public
String
viewFiltered
(
HttpServletResponse
response
,
ModelMap
model
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"filter"
,
required
=
true
,
defaultValue
=
"{}"
)
String
jsonFilter
,
@RequestParam
(
value
=
"columns"
,
required
=
true
,
defaultValue
=
""
)
String
[]
columns
,
@CookieValue
(
value
=
"columns"
,
defaultValue
=
""
)
String
[]
cookieColumns
)
throws
IOException
{
@CookieValue
(
value
=
"columns"
,
required
=
false
)
String
[]
cookieColumns
)
throws
IOException
{
String
[]
selectedFilters
=
null
;
...
...
@@ -206,7 +206,7 @@ public class ExplorerController extends BaseController implements InitializingBe
if
(
_logger
.
isDebugEnabled
())
{
_logger
.
debug
(
"Got: "
+
accessions
);
}
model
.
addAttribute
(
"availableColumns"
,
validDisplayColumns
);
model
.
addAttribute
(
"selectedColumns"
,
cleanupDisplayColumns
(
columns
,
cookieColumns
,
response
));
...
...
@@ -578,8 +578,8 @@ public class ExplorerController extends BaseController implements InitializingBe
}
@RequestMapping
(
value
=
"/explore/overview"
)
public
String
overview
(
ModelMap
model
,
@RequestParam
(
value
=
"filter"
,
required
=
false
,
defaultValue
=
"{}"
)
String
jsonFilter
)
throws
IOException
,
SearchException
{
public
String
overview
(
ModelMap
model
,
@RequestParam
(
value
=
"filter"
,
required
=
false
,
defaultValue
=
"{}"
)
String
jsonFilter
)
throws
IOException
,
SearchException
{
AppliedFilters
appliedFilters
=
mapper
.
readValue
(
jsonFilter
,
AppliedFilters
.
class
);
String
[]
selectedFilters
=
appliedFilters
.
getFilterNames
();
...
...
@@ -639,14 +639,19 @@ public class ExplorerController extends BaseController implements InitializingBe
@RequestMapping
(
value
=
"/explore/shorten-url"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@ResponseBody
public
Object
getBriefURL
(
@RequestParam
(
value
=
"filter"
,
required
=
false
,
defaultValue
=
""
)
String
jsonFilter
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@CookieValue
(
value
=
"columns"
)
String
columns
)
throws
IOException
,
URISyntaxException
{
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@CookieValue
(
required
=
false
,
value
=
"columns"
)
String
columns
)
throws
IOException
,
URISyntaxException
{
AppliedFilters
appliedFilters
=
mapper
.
readValue
(
jsonFilter
,
AppliedFilters
.
class
);
URI
longUrl
=
new
URIBuilder
(
baseUrl
).
setPath
(
"/explore"
).
addParameter
(
"filter"
,
appliedFilters
.
toString
())
.
addParameter
(
"page"
,
Integer
.
toString
(
page
)).
addParameter
(
"columns"
,
columns
).
build
();
URIBuilder
uriBuilder
=
new
URIBuilder
(
baseUrl
).
setPath
(
"/explore"
).
addParameter
(
"filter"
,
appliedFilters
.
toString
()).
addParameter
(
"page"
,
Integer
.
toString
(
page
));
if
(
StringUtils
.
isNotBlank
(
columns
))
{
uriBuilder
.
addParameter
(
"columns"
,
columns
);
}
URI
longUrl
=
uriBuilder
.
build
();
final
String
shortenedUrl
=
urlShortenerService
.
shortenUrl
(
longUrl
.
toURL
());
return
new
Object
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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