Commit ad6b3268 authored by Matija Obreza's avatar Matija Obreza
Browse files

Cleanup, license information

parent 9906ef18
......@@ -34,7 +34,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@Scope("request")
@RequestMapping("/sel/")
@RequestMapping("/sel")
public class SelectionController extends BaseController {
@Autowired
......@@ -43,7 +43,7 @@ public class SelectionController extends BaseController {
@Autowired
private GenesysService genesysService;
@RequestMapping
@RequestMapping("/")
public String view(ModelMap model, @RequestParam(value = "page", required = false, defaultValue = "1") int page) {
model.addAttribute("pagedData", genesysService.listAccessions(selectionBean.copy(), new PageRequest(page - 1, 50, new Sort("accessionName"))));
......@@ -53,13 +53,13 @@ public class SelectionController extends BaseController {
return "/selection/index";
}
@RequestMapping("order")
@RequestMapping("/order")
public String order(ModelMap model) {
// TODO
return "/todo";
}
@RequestMapping("add/{id}")
@RequestMapping("/add/{id}")
public String add(ModelMap model, @PathVariable("id") long accessionId) {
selectionBean.add(accessionId);
return "redirect:/sel/#a" + accessionId;
......@@ -82,19 +82,19 @@ public class SelectionController extends BaseController {
return "redirect:/sel/";
}
@RequestMapping("remove/{id}")
@RequestMapping("/remove/{id}")
public String remove(ModelMap model, @PathVariable("id") long accessionId) {
selectionBean.remove(accessionId);
return "redirect:/sel/";
}
@RequestMapping("clear")
@RequestMapping("/clear")
public String remove(ModelMap model) {
selectionBean.clear();
return "redirect:/sel/";
}
@RequestMapping(value = "json", method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE })
@RequestMapping(value = "/json", method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
public JsonResponse jsonOp(@RequestBody JsonAction action) {
_logger.info("Selection action " + action.action + ": " + action.id);
......
package org.genesys2.server.servlet.controller;
/**
* Copyright 2013 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package org.genesys2.server.servlet.controller.rest;
import java.io.Serializable;
import java.security.Principal;
......@@ -10,6 +26,7 @@ import java.util.Map;
import org.genesys2.server.ServiceEndpoints;
import org.genesys2.server.exception.AuthorizationException;
import org.genesys2.server.exception.NoSuchTokenException;
import org.genesys2.server.servlet.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
......
/**
* Copyright 2013 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package org.genesys2.server.servlet.controller.rest;
import org.genesys2.server.ServiceEndpoints;
......
/**
* Copyright 2013 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package org.genesys2.server.test;
import static org.junit.Assert.assertEquals;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment