diff --git a/WebContent/version b/WebContent/version index 1a17c0c..8d078db 100644 --- a/WebContent/version +++ b/WebContent/version @@ -1,8 +1,8 @@ - 2.0.0.0 - 2016-05-02 + 2.0.0.1 + 2016-05-24 1.2.0.0 diff --git a/pom.xml b/pom.xml index 89d8895..a792e34 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 karuta karuta-backend - 2.0.0.0 + 2.0.0.1 war karuta-backend diff --git a/src/com/portfolio/rest/RestServicePortfolio.java b/src/com/portfolio/rest/RestServicePortfolio.java index 7773bb2..d70c32f 100644 --- a/src/com/portfolio/rest/RestServicePortfolio.java +++ b/src/com/portfolio/rest/RestServicePortfolio.java @@ -1648,7 +1648,7 @@ else if( "".equals(returnValue) ) **/ @Path("/portfolios/copy/{portfolio-id}") @POST - public String postCopyPortfolio(@CookieParam("user") String user, @CookieParam("credential") String token, @QueryParam("group") int groupId, @Context ServletConfig sc,@Context HttpServletRequest httpServletRequest, @PathParam("portfolio-id") String portfolioId , @QueryParam("sourcecode") String srccode, @QueryParam("targetcode") String tgtcode, @QueryParam("owner") String setowner ) + public Response postCopyPortfolio(@CookieParam("user") String user, @CookieParam("credential") String token, @QueryParam("group") int groupId, @Context ServletConfig sc,@Context HttpServletRequest httpServletRequest, @PathParam("portfolio-id") String portfolioId , @QueryParam("sourcecode") String srccode, @QueryParam("targetcode") String tgtcode, @QueryParam("owner") String setowner ) { String value = "Instanciate: "+portfolioId; @@ -1664,16 +1664,18 @@ public String postCopyPortfolio(@CookieParam("user") String user, @CookieParam(" /// Check if code exist, find a suitable one otherwise. Eh. String newcode = tgtcode; - int num = 0; c = SqlUtils.getConnection(servContext); - while( dataProvider.isCodeExist(c, newcode) ) - newcode = tgtcode+" ("+ num++ +")"; + if( dataProvider.isCodeExist(c, newcode) ) + { + return Response.status(Status.CONFLICT).entity("code exist").build(); + } + tgtcode = newcode; String returnValue = dataProvider.postCopyPortfolio(c, new MimeType("text/xml"),portfolioId, srccode, tgtcode, ui.userId, setOwner ).toString(); logRestRequest(httpServletRequest, value+" to: "+returnValue, returnValue, Status.OK.getStatusCode()); - return returnValue; + return Response.status(Status.OK).entity(returnValue).build(); } catch(Exception ex) { diff --git a/src/com/portfolio/security/LTIServlet.java b/src/com/portfolio/security/LTIServlet.java index d9bda2d..52b850c 100644 --- a/src/com/portfolio/security/LTIServlet.java +++ b/src/com/portfolio/security/LTIServlet.java @@ -87,7 +87,7 @@ public void init() try { ConfigUtils.loadConfigFile(sc.getServletContext()); - loadRoleMapAttributes(application); +// loadRoleMapAttributes(application); } catch( Exception e ){ e.printStackTrace(); } } @@ -245,7 +245,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) return; } - loadRoleMapAttributes(application); +// loadRoleMapAttributes(application); connexion = SqlUtils.getConnection(session.getServletContext()); String userId = getOrCreateUser(payload, cookies, connexion, outTrace); diff --git a/tomcat/karuta-backend_config/configKaruta.properties b/tomcat/karuta-backend_config/configKaruta.properties index 4d58873..70923e3 100644 --- a/tomcat/karuta-backend_config/configKaruta.properties +++ b/tomcat/karuta-backend_config/configKaruta.properties @@ -3,8 +3,8 @@ # ========================================= ### Messaging type -#notification=email -notification=sakai +notification=email +#notification=sakai # ==== When notification = sakai ==== # Just changing SERVER should be sufficient @@ -59,5 +59,10 @@ fileserver=http://localhost:8080/karuta-fileserver directkey=directkey # ==== LTI configuration ===== -basiclti.provider.KARUTA.secret=asdf1234 -lti_redirect_location=/karuta/karuta/htm/list.htm +### Uncomment and configure when you want to use LTI +#basiclti.provider.KARUTA.secret=asdf1234 + +### Redirection for Karuta 1.2.x +#lti_redirect_location=/karuta/karuta/htm/list.htm +### Redirection for Karuta 2.x +lti_redirect_location=/karuta/karuta/htm/karuta.htm diff --git a/tomcat/karuta-backend_config/roleMap.properties b/tomcat/karuta-backend_config/roleMap.properties deleted file mode 100644 index e084649..0000000 --- a/tomcat/karuta-backend_config/roleMap.properties +++ /dev/null @@ -1,12 +0,0 @@ -Participant=etudiant -access=etudiant -maintain=designer -Student=etudiant -Teacher=evaluateur -Instructor=evaluateur -Evaluator=evaluateur -Coordinator=concepteur -CIG_Coordinator=concepteur -Learner=etudiant -Instructor,urn:lti:sysrole:ims/lis/Administrator=admin -Instructor,Administrator,urn:lti:instrole:ims/lis/Administrator,urn:lti:sysrole:ims/lis/Administrator=admin