فهرست منبع

Merge branch 'mappings' of UV-APPS/UV_SAIC_GUI into master

Mario Martínez Hernández 1 ماه پیش
والد
کامیت
a871e222f3

+ 1 - 1
src/main/java/es/uv/saic/web/CalendarController.java

@@ -61,7 +61,7 @@ public class CalendarController {
 
 	// POST para instanciar un proceso desde el calendario
 	@ResponseBody
-	@PostMapping("/instantiate")
+	@PostMapping("/calendar/instantiate")
 	public List<String> instantiate(Model model, Authentication auth, @RequestParam("id") Integer id,
 			@RequestParam("idProces") Integer idProces, @RequestParam("centres") List<Integer> centres,
 			@RequestParam("titulacions") List<Integer> titulacions) throws IOException, ParseException {	

+ 2 - 2
src/main/java/es/uv/saic/web/DownloadController.java

@@ -110,7 +110,7 @@ public class DownloadController {
 	 * @param idtascai Optional ID of the task instance for context
 	 * @param response HttpServletResponse
 	 */
-	@PostMapping(value="/pdf/preview")
+	@PostMapping(value="/download/pdf/preview")
 	@ResponseBody
 	public byte[] downloadTemplatePdf(Model model,
 			@RequestParam("content") String content, @RequestParam("idtascai") Optional<BigInteger> idtascai) throws IOException, InterruptedException {
@@ -118,7 +118,7 @@ public class DownloadController {
 		return dc.downloadTemplatePdf(pdf);
 	}
 
-	@GetMapping(value="/test/template2/{titulacio}/{centre}/{evidencia}/{curs}/{tipusTasca}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
+	@GetMapping(value="/download/test/template2/{titulacio}/{centre}/{evidencia}/{curs}/{tipusTasca}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
 	@ResponseBody
 	public ResponseEntity<Resource> testTemplate(Model model, @PathVariable("titulacio") Integer idTitulacio, @PathVariable("centre") Integer idCentre,
 			@PathVariable("evidencia") String evidencia, @PathVariable("curs") Integer curs, @PathVariable("tipusTasca") Integer tipusTasca) throws IOException, XDocReportException {

+ 5 - 4
src/main/java/es/uv/saic/web/OrganController.java

@@ -10,6 +10,7 @@ import org.springframework.security.core.Authentication;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 
@@ -122,7 +123,7 @@ public class OrganController {
 		return "components/selector_centres";
 	}
 
-	@PostMapping("/new/centre")
+	@PutMapping("/organ/centre")
 	@ResponseBody
 	public void createNewCentre(Model model, Authentication auth,
 			@RequestParam("codiCentro") Integer codigo,
@@ -132,7 +133,7 @@ public class OrganController {
 		oc.createNewCentre(codigo, nomCas, nomVal, ruct);
 	}
 
-	@PostMapping("/new/titulacion")	
+	@PutMapping("/organ/titulacion")	
 	@ResponseBody
 	public void createNewTitulacion(Model model, Authentication auth,
 			@RequestParam("codiTit") Integer codigo,
@@ -144,7 +145,7 @@ public class OrganController {
 		oc.createNewTitulacion(codigo ,idCentro, nomCas, nomVal, ruct, ambit);
 	}
 
-	@PostMapping("/update/centre")
+	@PostMapping("/organ/centre")
 	@ResponseBody
 	public Integer updateCentre(Model model, Authentication auth, 
 			@RequestParam("lugar") Integer lugar,
@@ -157,7 +158,7 @@ public class OrganController {
 		return ruct;
 	}
 	
-	@PostMapping("/update/titulacion")
+	@PostMapping("/organ/titulacion")
 	@ResponseBody
 	public Integer updateTitulacion(Model model, Authentication auth, 
 			@RequestParam("lugar") Integer lugar,

+ 2 - 2
src/main/java/es/uv/saic/web/ProceduresController.java

@@ -262,7 +262,7 @@ public class ProceduresController {
 	}
 
     // POST que se utiliza para conseguir los cursos a partir de la titulación
-	@PostMapping("/search/years")
+	@PostMapping("/procedure/search/years")
 	public String getYearsByCenterTitulation(Model model, Authentication auth, 
 			@RequestParam(name="centers[]", required=false) List<Integer> centres,
 			@RequestParam("titulations[]") List<Integer> titulacions) throws IOException {		
@@ -279,7 +279,7 @@ public class ProceduresController {
 	}
 
     // POST que se utiliza para conseguir los procedimiento que se han llevado a cabo por cursos y por titulación
-	@PostMapping("/search/procedures")
+	@PostMapping("/procedure/search/procedures")
 	public String getProceduresByCenterTitulationYear(Model model, Authentication auth,
 			@RequestParam(name="centers[]", required=false) List<Integer> centres,
 			@RequestParam("years[]") List<Integer> cursos,

+ 2 - 2
src/main/java/es/uv/saic/web/TascaController.java

@@ -19,7 +19,7 @@ public class TascaController {
     @Autowired
     private TascaClient tc;
 
-    @PostMapping("/search/evidences")
+    @PostMapping("/tasca/search/evidences")
 	public String getEvidencesByCenterTitulationYear(Model model, Authentication auth,
 			@RequestParam(name="centers[]", required=false) List<Integer> centres,
 			@RequestParam("years[]") List<Integer> cursos,
@@ -36,7 +36,7 @@ public class TascaController {
 	}
 
     //NO se usa
-	@PostMapping("/find/templates")
+	@PostMapping("/tasca/find/templates")
 	public String findTemplates(Model model, Authentication auth, @RequestParam("procedure") Integer idProces, 
 			@RequestParam("center") String idCentre, @RequestParam("titulation") String idTitulacio) throws IOException {	
 		model.addAttribute("evs", tc.getEvidencesByProcedure(idProces));

+ 1 - 1
src/main/java/es/uv/saic/web/UsuariController.java

@@ -18,7 +18,7 @@ public class UsuariController {
     @Autowired
     private UsuariClient us;
 
-    @GetMapping("/newUserrole")
+    @GetMapping("/user/form")
 	public String newUserRoleForm(Model model, Authentication auth) throws IOException {	
 		List<UsuariDTO> users = us.findAllUsers();
 		List<RolDTO> roles = us.findAllRols();

+ 1 - 1
src/main/resources/templates/adminCalendar.html

@@ -519,7 +519,7 @@
 				titulacions: $('#etitulacionsSelector').val().toString()
 			}
 			$('#editInstanceModal').modal('toggle');
-			$.post("/instantiate", params, function(data){ 
+			$.post("/calendar/instantiate", params, function(data){ 
 				$('#resultsInstanceModal').modal('toggle');
 				data.forEach(function(d){
 					var t = d.replace('[OK]', '<span style="color:green">[OK]</span>').replace('[ERROR]', '<span style="color:firebrick">[ERROR]</span>')

+ 1 - 1
src/main/resources/templates/adminTemplateEditor.html

@@ -352,7 +352,7 @@
 		}
 		
 		function print_to_pdf(content){
-			$('<form id="tmpDownloadForm" method="post" action="/pdf/preview" target="_blank">' +
+			$('<form id="tmpDownloadForm" method="post" action="/download/pdf/preview" target="_blank">' +
 			  	'<textarea id="tmpDownloadContent" type="hidden" name="content">' +
 			  		tinymce.activeEditor.getContent() +
 			  	'</textarea>' +

+ 1 - 1
src/main/resources/templates/adminTemplateTest.html

@@ -135,7 +135,7 @@
 		});
 		
 		function print_to_pdf(content){
-			$('<form id="tmpDownloadForm" method="post" action="/pdf/preview" target="_blank">' +
+			$('<form id="tmpDownloadForm" method="post" action="/download/pdf/preview" target="_blank">' +
 			  	'<textarea id="tmpDownloadContent" type="hidden" name="content">' +
 			  		tinymce.activeEditor.getContent() +
 			  	'</textarea>' +

+ 1 - 1
src/main/resources/templates/adminTemplates.html

@@ -132,7 +132,7 @@
 		
 		function loadTemplates(){
 			var params = {'procedure':$('#proceduresSelector').val(), 'center':$('#centersSelector').val(), 'titulation':$('#titulationsSelector').val()};
-			$.post("/find/templates", params, function(data){ 
+			$.post("/tasca/find/templates", params, function(data){ 
 				$("#templates_container").html(data);
 			});
 		}

+ 2 - 2
src/main/resources/templates/adminTemplates2.html

@@ -163,11 +163,11 @@
 			//var params = {'procedure':$('#proceduresSelector').val(), 'center':$('#centersSelector').val(), 'titulation':$('#titulationsSelector').val()};
 // 			var params = {'center':$('#centersSelector').val(), 'titulation':$('#titulationsSelector').val(),
 // 					      'curs':$('#proceduresSelector').val(), };
-// 			$.post("/find/templates", params, function(data){ 
+// 			$.post("/tasca/find/templates", params, function(data){ 
 // 				$("#templates_container").html(data);
 // 			});
 
-			var url = "/test/template2/"+$('#titulationsSelector').val()+"/"+$('#centersSelector').val();
+			var url = "/download/test/template2/"+$('#titulationsSelector').val()+"/"+$('#centersSelector').val();
 			url += "/"+$('#evSelector').val()+"/"+$('#cursSelector').val()+"/"+$('#taskSelector').val();
 			window.open(url, '_blank').focus();
 			

+ 1 - 1
src/main/resources/templates/dashboardCentre.html

@@ -577,7 +577,7 @@
         		console.log("Enviando estos datos:", datosCargados);
 				
 				$.ajax({
-					url: '/update/centre',
+					url: '/organ/centre',
 					type: 'POST',
 					data: new FormData(this),
 					processData: false,

+ 1 - 1
src/main/resources/templates/dashboardTitulacio.html

@@ -1068,7 +1068,7 @@
 				const datosCargados = Object.fromEntries(new FormData(this));
 
 				$.ajax({
-					url: '/update/titulacion',
+					url: '/organ/titulacion',
 					type: 'POST',
 					data: new FormData(this),
 					processData: false,

+ 2 - 2
src/main/resources/templates/dashboardUniversitat.html

@@ -548,13 +548,13 @@
 				e.preventDefault();
 
 				var type = $('#typeSelector').val();
-        		var endpoint = (type === 'centro') ? '/new/centre' : '/new/titulacion';
+        		var endpoint = (type === 'centro') ? '/organ/centre' : '/organ/titulacion';
 
 				var formData = new FormData(this);
 
 				$.ajax({
 					url: endpoint,
-					type: 'POST',
+					type: 'PUT',
 					data: formData,
 					processData: false,
   			        contentType: false,

+ 1 - 1
src/main/resources/templates/procedure.html

@@ -808,7 +808,7 @@
 	}
 	
 	function print_to_pdf(content){
-		$('<form id="tmpDownloadForm" method="post" action="/pdf/preview" target="_blank">' +
+		$('<form id="tmpDownloadForm" method="post" action="/download/pdf/preview" target="_blank">' +
 			'<input type="text" name="idtascai" value="'+$('input[name="taskid"]').val()+'" />' +
 		  	'<textarea id="tmpDownloadContent" type="hidden" name="content">' +
 		  		tinymce.activeEditor.getContent() +

+ 6 - 6
src/main/resources/templates/supervision.html

@@ -104,18 +104,18 @@
 				$("#titulationsSelector").html(data).selectpicker('refresh'); 
 				$('#titulationsSelector').selectpicker('val', /*[[${restore.titulacions}]]*/);
 				var params = (($('#centersSelector')) ? {'centers[]':$('#centersSelector').val(), 'titulations[]':$('#titulationsSelector').val()} : {'titulations[]':$('#titulationsSelector').val()});
-				$.post("/search/years", params, function(data){ 
+				$.post("/procedure/search/years", params, function(data){ 
 					$("#yearsSelector").html(data).selectpicker('refresh'); 
 					$('#yearsSelector').selectpicker('val', /*[[${restore.cursos}]]*/);	
 					var params = (($('#centersSelector')) ? {'centers[]':$('#centersSelector').val(), 'titulations[]':$('#titulationsSelector').val(), 'years[]':$('#yearsSelector').val()} : {'titulations[]':$('#titulationsSelector').val(), 'years[]':$('#yearsSelector').val()});
 					if($('#typeSelector').val() == 'evidences'){ 
-						$.post("/search/evidences", params, function(data){ 
+						$.post("/tasca/search/evidences", params, function(data){ 
 							$("#evidencesSelector").html(data).selectpicker('refresh');
 							$('#evidencesSelector').selectpicker('val', /*[[${restore.evidencies}]]*/);
 						}); 
 					}
 					else { 
-						$.post("/search/procedures", params, function(data){ 
+						$.post("/procedure/search/procedures", params, function(data){ 
 							$("#proceduresSelector").html(data).selectpicker('refresh'); 
 							$('#proceduresSelector').selectpicker('val', /*[[${restore.procediments}]]*/);
 						}); 
@@ -147,13 +147,13 @@
 		
 		function complete_years(){
 			var params = (($('#centersSelector')) ? {'centers[]':$('#centersSelector').val(), 'titulations[]':$('#titulationsSelector').val()} : {'titulations[]':$('#titulationsSelector').val()});
-			$.post("/search/years", params, function(data){ $("#yearsSelector").html(data).selectpicker('refresh'); });
+			$.post("/procedure/search/years", params, function(data){ $("#yearsSelector").html(data).selectpicker('refresh'); });
 		}
 		
 		function complete_procedures(){
 			var params = (($('#centersSelector')) ? {'centers[]':$('#centersSelector').val(), 'titulations[]':$('#titulationsSelector').val(), 'years[]':$('#yearsSelector').val()} : {'titulations[]':$('#titulationsSelector').val(), 'years[]':$('#yearsSelector').val()});
-			if($('#typeSelector').val() == 'evidences'){ $.post("/search/evidences", params, function(data){ $("#evidencesSelector").html(data).selectpicker('refresh'); }); }
-			else { $.post("/search/procedures", params, function(data){ $("#proceduresSelector").html(data).selectpicker('refresh'); }); }
+			if($('#typeSelector').val() == 'evidences'){ $.post("/tasca/search/evidences", params, function(data){ $("#evidencesSelector").html(data).selectpicker('refresh'); }); }
+			else { $.post("/procedure/search/procedures", params, function(data){ $("#proceduresSelector").html(data).selectpicker('refresh'); }); }
 		}
 		
 		function change_type(){

+ 1 - 1
src/main/resources/templates/testerTemplateEditor.html

@@ -339,7 +339,7 @@
 		}
 		
 		function print_to_pdf(content){
-			$('<form id="tmpDownloadForm" method="post" action="/pdf/preview" target="_blank">' +
+			$('<form id="tmpDownloadForm" method="post" action="/download/pdf/preview" target="_blank">' +
 			  	'<textarea id="tmpDownloadContent" type="hidden" name="content">' +
 			  		tinymce.activeEditor.getContent() +
 			  	'</textarea>' +