@@ -376,7 +376,24 @@ class PortalController {
376
376
377
377
def url = grailsApplication. config. lists. url
378
378
379
- def r = webService. post(" ${ url} /ws/speciesList/" , json)
379
+ def r
380
+ if (grailsApplication. config. lists. useListWs) {
381
+ // format input
382
+ /*
383
+ {
384
+ "listName": name,
385
+ "listItems": items,
386
+ "description": description,
387
+ "isPrivate": makePrivate,
388
+ "listType": listType
389
+ }
390
+ */
391
+ r = webService. post(" ${ url} /upload" , json, null , ContentType . APPLICATION_JSON , false , true )
392
+
393
+ r = webService. post(" ${ url} /ingest/${ speciesListID} " , json, null , ContentType . APPLICATION_JSON , false , true )
394
+ } else {
395
+ r = webService. post(" ${ url} /ws/speciesList/" , json)
396
+ }
380
397
381
398
if (r == null ) {
382
399
def status = response. setStatus(HttpURLConnection . HTTP_INTERNAL_ERROR )
@@ -400,7 +417,12 @@ class PortalController {
400
417
} else {
401
418
def url = grailsApplication. config. lists. url
402
419
403
- def r = webService. get(" ${ url} /ws/speciesListItems/" + params. id, [:], org.apache.http.entity.ContentType . APPLICATION_JSON , false , true , [:])
420
+ def r
421
+ if (grailsApplication. config. lists. useListWs) {
422
+ r = webService. get(" ${ url} /speciesListItems/" + params. id, [:], org.apache.http.entity.ContentType . APPLICATION_JSON , false , true , [:])
423
+ } else {
424
+ r = webService. get(" ${ url} /ws/speciesListItems/" + params. id, [:], org.apache.http.entity.ContentType . APPLICATION_JSON , false , true , [:])
425
+ }
404
426
405
427
if (r == null ) {
406
428
def status = response. setStatus(HttpURLConnection . HTTP_INTERNAL_ERROR )
@@ -424,7 +446,12 @@ class PortalController {
424
446
} else {
425
447
def url = grailsApplication. config. lists. url
426
448
427
- def r = webService. get(" ${ url} /ws/speciesList" , [user : params. user ? userId : null , max: params. max], org.apache.http.entity.ContentType . APPLICATION_JSON , false , true , [:])
449
+ def r
450
+ if (grailsApplication. config. lists. useListWs) {
451
+ r = webService. get(" ${ url} /speciesList/" , [pageSize : params. max, page : params. page ?: 1 ], org.apache.http.entity.ContentType . APPLICATION_JSON , false , true , [:])
452
+ } else {
453
+ r = webService. get(" ${ url} /ws/speciesList" , [user : params. user ? userId : null , max: params. max], org.apache.http.entity.ContentType . APPLICATION_JSON , false , true , [:])
454
+ }
428
455
429
456
if (r == null ) {
430
457
def status = response. setStatus(HttpURLConnection . HTTP_INTERNAL_ERROR )
0 commit comments