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
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
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
Genesys Backend
Commits
28815040
Commit
28815040
authored
Jul 22, 2018
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Obsoleted filterByCode methods
parent
7369d070
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
20 deletions
+65
-20
src/main/java/org/genesys/catalog/api/v0/DatasetController.java
...in/java/org/genesys/catalog/api/v0/DatasetController.java
+14
-5
src/main/java/org/genesys/catalog/api/v0/DescriptorController.java
...java/org/genesys/catalog/api/v0/DescriptorController.java
+27
-9
src/main/java/org/genesys/catalog/api/v0/DescriptorListController.java
.../org/genesys/catalog/api/v0/DescriptorListController.java
+1
-0
src/main/java/org/genesys/catalog/api/v0/PartnerController.java
...in/java/org/genesys/catalog/api/v0/PartnerController.java
+23
-6
No files found.
src/main/java/org/genesys/catalog/api/v0/DatasetController.java
View file @
28815040
...
...
@@ -15,6 +15,7 @@
*/
package
org.genesys.catalog.api.v0
;
import
org.apache.commons.lang3.StringUtils
;
import
org.genesys.catalog.api.FilteredPage
;
import
org.genesys.catalog.exceptions.NotFoundElement
;
import
org.genesys.catalog.model.dataset.AccessionIdentifier
;
...
...
@@ -83,9 +84,16 @@ public class DatasetController {
public
FilteredPage
<
Dataset
>
datasetList
(
@RequestParam
(
name
=
"p"
,
required
=
false
,
defaultValue
=
"0"
)
final
int
page
,
@RequestParam
(
name
=
"l"
,
required
=
false
,
defaultValue
=
"50"
)
final
int
pageSize
,
@RequestParam
(
name
=
"d"
,
required
=
false
,
defaultValue
=
"ASC"
)
final
Sort
.
Direction
direction
,
@RequestParam
(
name
=
"s"
,
required
=
false
,
defaultValue
=
"id"
)
final
String
[]
sort
,
@RequestBody
final
DatasetFilter
filter
)
{
@RequestParam
(
name
=
"s"
,
required
=
false
,
defaultValue
=
"id"
)
final
String
[]
sort
,
@RequestParam
(
name
=
"f"
,
required
=
false
)
String
filterCode
,
@RequestBody
DatasetFilter
filter
)
throws
IOException
{
return
new
FilteredPage
<>(
shortFilterService
.
getCode
(
filter
),
filter
,
datasetService
.
listDatasets
(
filter
,
new
PageRequest
(
page
,
Integer
.
min
(
pageSize
,
100
),
direction
,
sort
)));
if
(
StringUtils
.
isNotBlank
(
filterCode
))
{
filter
=
shortFilterService
.
filterByCode
(
filterCode
,
DatasetFilter
.
class
);
}
else
{
filterCode
=
shortFilterService
.
getCode
(
filter
);
}
return
new
FilteredPage
<>(
filterCode
,
filter
,
datasetService
.
listDatasets
(
filter
,
new
PageRequest
(
page
,
Integer
.
min
(
pageSize
,
100
),
direction
,
sort
)));
}
/**
...
...
@@ -98,6 +106,7 @@ public class DatasetController {
* @param filterCode the filter code
* @return the filtered page
* @throws IOException Signals that an I/O exception has occurred.
* @deprecated Use {@link #datasetList(int, int, org.springframework.data.domain.Sort.Direction, String[], String, DatasetFilter)}
*/
@PostMapping
(
value
=
"/list/{filterCode}"
)
public
FilteredPage
<
Dataset
>
datasetListShort
(
@RequestParam
(
name
=
"p"
,
required
=
false
,
defaultValue
=
"0"
)
final
int
page
,
...
...
src/main/java/org/genesys/catalog/api/v0/DescriptorController.java
View file @
28815040
...
...
@@ -15,10 +15,11 @@
*/
package
org.genesys.catalog.api.v0
;
import
com.fasterxml.jackson.annotation.JsonView
;
import
io.swagger.annotations.Api
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.UUID
;
import
org.apache.commons.lang3.StringUtils
;
import
org.genesys.blocks.model.JsonViews
;
import
org.genesys.catalog.api.FilteredPage
;
import
org.genesys.catalog.model.dataset.Dataset
;
...
...
@@ -32,11 +33,19 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.UUID
;
import
com.fasterxml.jackson.annotation.JsonView
;
import
io.swagger.annotations.Api
;
/**
* The Class DescriptorController.
...
...
@@ -78,14 +87,22 @@ public class DescriptorController {
* @param sort the sort
* @param filter the descriptor filter
* @return the page
* @throws IOException
*/
@PostMapping
(
value
=
"/list"
)
public
FilteredPage
<
Descriptor
>
listDescriptorsByFilter
(
@RequestParam
(
name
=
"p"
,
required
=
false
,
defaultValue
=
"0"
)
final
int
page
,
@RequestParam
(
name
=
"l"
,
required
=
false
,
defaultValue
=
"50"
)
final
int
pageSize
,
@RequestParam
(
name
=
"d"
,
required
=
false
,
defaultValue
=
"ASC"
)
final
Sort
.
Direction
direction
,
@RequestParam
(
name
=
"s"
,
required
=
false
,
defaultValue
=
"id"
)
final
String
[]
sort
,
@RequestBody
final
DescriptorFilter
filter
)
{
@RequestParam
(
name
=
"s"
,
required
=
false
,
defaultValue
=
"id"
)
final
String
[]
sort
,
@RequestParam
(
name
=
"f"
,
required
=
false
)
String
filterCode
,
@RequestBody
DescriptorFilter
filter
)
throws
IOException
{
return
new
FilteredPage
<>(
shortFilterService
.
getCode
(
filter
),
filter
,
descriptorService
.
listDescriptors
(
filter
,
new
PageRequest
(
page
,
Integer
.
min
(
pageSize
,
100
),
direction
,
sort
)));
if
(
StringUtils
.
isNotBlank
(
filterCode
))
{
filter
=
shortFilterService
.
filterByCode
(
filterCode
,
DescriptorFilter
.
class
);
}
else
{
filterCode
=
shortFilterService
.
getCode
(
filter
);
}
return
new
FilteredPage
<>(
filterCode
,
filter
,
descriptorService
.
listDescriptors
(
filter
,
new
PageRequest
(
page
,
Integer
.
min
(
pageSize
,
100
),
direction
,
sort
)));
}
/**
...
...
@@ -98,6 +115,7 @@ public class DescriptorController {
* @param filterCode the filter code
* @return the filtered page
* @throws IOException Signals that an I/O exception has occurred.
* @deprecated Use {@link #listDescriptorsByFilter(int, int, org.springframework.data.domain.Sort.Direction, String[], DescriptorFilter)}
*/
@PostMapping
(
value
=
"/list/{filterCode}"
)
public
FilteredPage
<
Descriptor
>
listDescriptorsByShort
(
@RequestParam
(
name
=
"p"
,
required
=
false
,
defaultValue
=
"0"
)
final
int
page
,
...
...
src/main/java/org/genesys/catalog/api/v0/DescriptorListController.java
View file @
28815040
...
...
@@ -202,6 +202,7 @@ public class DescriptorListController {
* @param filterCode the filter code
* @return the filtered page
* @throws IOException Signals that an I/O exception has occurred.
* @deprecated Use {@link #listDescriptorLists(int, int, org.springframework.data.domain.Sort.Direction, String[], String, DescriptorListFilter)}
*/
@PostMapping
(
value
=
"/list/{filterCode}"
)
public
FilteredPage
<
DescriptorList
>
listDescriptorListsByCode
(
@RequestParam
(
name
=
"p"
,
required
=
false
,
defaultValue
=
"0"
)
final
int
page
,
...
...
src/main/java/org/genesys/catalog/api/v0/PartnerController.java
View file @
28815040
...
...
@@ -15,6 +15,10 @@
*/
package
org.genesys.catalog.api.v0
;
import
java.io.IOException
;
import
java.util.UUID
;
import
org.apache.commons.lang3.StringUtils
;
import
org.genesys.catalog.api.FilteredPage
;
import
org.genesys.catalog.model.Partner
;
import
org.genesys.catalog.model.filters.PartnerFilter
;
...
...
@@ -25,13 +29,17 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.swagger.annotations.Api
;
import
java.io.IOException
;
import
java.util.UUID
;
/**
* Rest controller for Partner.
*
...
...
@@ -61,14 +69,22 @@ public class PartnerController {
* @param sort the sort
* @param filter the partner filter
* @return the page
* @throws IOException
*/
@PostMapping
(
value
=
"/list"
)
public
FilteredPage
<
Partner
>
listPartners
(
@RequestParam
(
name
=
"p"
,
required
=
false
,
defaultValue
=
"0"
)
final
int
page
,
@RequestParam
(
name
=
"l"
,
required
=
false
,
defaultValue
=
"50"
)
final
int
pageSize
,
@RequestParam
(
name
=
"d"
,
required
=
false
,
defaultValue
=
"ASC"
)
final
Sort
.
Direction
direction
,
@RequestParam
(
name
=
"s"
,
required
=
false
,
defaultValue
=
"id"
)
final
String
[]
sort
,
@RequestBody
final
PartnerFilter
filter
)
{
@RequestParam
(
name
=
"s"
,
required
=
false
,
defaultValue
=
"id"
)
final
String
[]
sort
,
@RequestParam
(
name
=
"f"
,
required
=
false
)
String
filterCode
,
@RequestBody
PartnerFilter
filter
)
throws
IOException
{
return
new
FilteredPage
<>(
shortFilterService
.
getCode
(
filter
),
filter
,
partnerService
.
listPartners
(
filter
,
new
PageRequest
(
page
,
Integer
.
min
(
pageSize
,
100
),
direction
,
sort
)));
if
(
StringUtils
.
isNotBlank
(
filterCode
))
{
filter
=
shortFilterService
.
filterByCode
(
filterCode
,
PartnerFilter
.
class
);
}
else
{
filterCode
=
shortFilterService
.
getCode
(
filter
);
}
return
new
FilteredPage
<>(
filterCode
,
filter
,
partnerService
.
listPartners
(
filter
,
new
PageRequest
(
page
,
Integer
.
min
(
pageSize
,
100
),
direction
,
sort
)));
}
/**
...
...
@@ -81,6 +97,7 @@ public class PartnerController {
* @param filterCode the filter code
* @return the filtered page
* @throws IOException Signals that an I/O exception has occurred.
* @deprecated Use {@link #listPartners(int, int, org.springframework.data.domain.Sort.Direction, String[], String, PartnerFilter)}
*/
@PostMapping
(
value
=
"/list/{filterCode}"
)
public
FilteredPage
<
Partner
>
listPartners2
(
@RequestParam
(
name
=
"p"
,
required
=
false
,
defaultValue
=
"0"
)
final
int
page
,
...
...
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