Skip to content

Commit

Permalink
Merge pull request #40 from karutaproject/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
nobry committed May 24, 2016
2 parents 7fe2613 + bbdb393 commit ad22cd7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 26 deletions.
4 changes: 2 additions & 2 deletions WebContent/version
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<versions>
<version id='backend'>
<number>2.0.0.0</number>
<date>2016-05-02</date>
<number>2.0.0.1</number>
<date>2016-05-24</date>
</version>
<version id='fileserver'>
<number>1.2.0.0</number>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>karuta</groupId>
<artifactId>karuta-backend</artifactId>
<version>2.0.0.0</version>
<version>2.0.0.1</version>
<packaging>war</packaging>
<name>karuta-backend</name>
<properties>
Expand Down
12 changes: 7 additions & 5 deletions src/com/portfolio/rest/RestServicePortfolio.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/com/portfolio/security/LTIServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void init()
try
{
ConfigUtils.loadConfigFile(sc.getServletContext());
loadRoleMapAttributes(application);
// loadRoleMapAttributes(application);
}
catch( Exception e ){ e.printStackTrace(); }
}
Expand Down Expand Up @@ -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);
Expand Down
13 changes: 9 additions & 4 deletions tomcat/karuta-backend_config/configKaruta.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# =========================================

### Messaging type
#notification=email
notification=sakai
notification=email
#notification=sakai

# ==== When notification = sakai ====
# Just changing SERVER should be sufficient
Expand Down Expand Up @@ -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
12 changes: 0 additions & 12 deletions tomcat/karuta-backend_config/roleMap.properties

This file was deleted.

0 comments on commit ad22cd7

Please sign in to comment.