diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/invite/invite.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/invite/invite.get.html.ftl
deleted file mode 100644
index c5ebe17011..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/invite/invite.get.html.ftl
+++ /dev/null
@@ -1,7 +0,0 @@
-<#if action == "start">
-
Invite to join site ${siteShortName} has been sent to ${inviteeUserName}
-<#elseif action == "cancel">
- Invite with ID ${inviteId} has been cancelled
-<#else>
- Error: unknown invite action ${action}
-#if>
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/invite/inviteresponse.delete.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/invite/inviteresponse.delete.desc.xml
deleted file mode 100644
index 5e999e0e3f..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/invite/inviteresponse.delete.desc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
- Invite reject
- Rejects an invite
- /api/invite/{inviteId}/{inviteTicket}
-
- none
- required
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/invite/inviteresponse.delete.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/invite/inviteresponse.delete.json.ftl
deleted file mode 100644
index c0adf83a3a..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/invite/inviteresponse.delete.json.ftl
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "response" : "${response}",
- "siteShortName" : "${siteShortName}"
-}
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/invite/inviteresponse.put.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/invite/inviteresponse.put.desc.xml
index abcea279d2..9e0ad07ade 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/invite/inviteresponse.put.desc.xml
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/invite/inviteresponse.put.desc.xml
@@ -1,7 +1,7 @@
Invite accept
Accepts an invite
- /api/invite/{inviteId}/{inviteTicket}
+ /api/invite/{inviteId}/{inviteTicket}/{action}
none
required
diff --git a/config/alfresco/web-scripts-application-context.xml b/config/alfresco/web-scripts-application-context.xml
index ee76393ec3..1653837936 100644
--- a/config/alfresco/web-scripts-application-context.xml
+++ b/config/alfresco/web-scripts-application-context.xml
@@ -301,7 +301,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
diff --git a/source/java/org/alfresco/repo/web/scripts/invite/InviteByTicket.java b/source/java/org/alfresco/repo/web/scripts/invite/InviteByTicket.java
index 38f1712a70..5d49dca5c6 100644
--- a/source/java/org/alfresco/repo/web/scripts/invite/InviteByTicket.java
+++ b/source/java/org/alfresco/repo/web/scripts/invite/InviteByTicket.java
@@ -86,17 +86,9 @@ public class InviteByTicket extends DeclarativeWebScript
// initialise model to pass on for template to render
Map model = new HashMap();
- // Extract inviteId and inviteTicket
- String extPath = req.getExtensionPath();
- int separatorIndex = extPath.indexOf('/');
- if (separatorIndex < 0)
- {
- // should not happen as descriptor would not match
- throw new WebScriptException(Status.STATUS_INTERNAL_SERVER_ERROR,
- "Parameters missing");
- }
- String inviteId = extPath.substring(0, separatorIndex);
- String inviteTicket = extPath.substring(separatorIndex + 1);
+ // get inviteId and inviteTicket
+ String inviteId = req.getServiceMatch().getTemplateVars().get("inviteId");
+ String inviteTicket = req.getServiceMatch().getTemplateVars().get("inviteTicket");
// authenticate as system for the rest of the webscript
AuthenticationUtil.setSystemUserAsCurrentUser();
diff --git a/source/java/org/alfresco/repo/web/scripts/invite/InviteResponse.java b/source/java/org/alfresco/repo/web/scripts/invite/InviteResponse.java
index 356e947c9d..dca6952151 100644
--- a/source/java/org/alfresco/repo/web/scripts/invite/InviteResponse.java
+++ b/source/java/org/alfresco/repo/web/scripts/invite/InviteResponse.java
@@ -156,18 +156,6 @@ public class InviteResponse extends DeclarativeWebScript
{
// initialise model to pass on for template to render
Map model = new HashMap();
-
- // Extract inviteId and inviteTicket
- /*String extPath = req.getExtensionPath();
- int separatorIndex = extPath.indexOf('/');
- if (separatorIndex < 0)
- {
- // should not happen as descriptor would not match
- throw new WebScriptException(Status.STATUS_INTERNAL_SERVER_ERROR,
- "Parameters missing");
- }
- String inviteId = extPath.substring(0, separatorIndex);
- String inviteTicket = extPath.substring(separatorIndex + 1);*/
String inviteId = req.getServiceMatch().getTemplateVars().get("inviteId");
String inviteTicket = req.getServiceMatch().getTemplateVars().get("inviteTicket");
@@ -189,12 +177,12 @@ public class InviteResponse extends DeclarativeWebScript
}
// process response
- String method = req.getServiceMatch().getWebScript().getDescription().getMethod();
- if (method.equals("PUT"))
+ String action = req.getServiceMatch().getTemplateVars().get("action");
+ if (action.equals("accept"))
{
acceptInvite(model, inviteId, inviteStartTask);
}
- else if (method.equals("DELETE"))
+ else if (action.equals("reject"))
{
rejectInvite(model, inviteId, inviteStartTask);
}
@@ -202,7 +190,7 @@ public class InviteResponse extends DeclarativeWebScript
{
/* handle unrecognised method */
throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "method " + method + " is not supported by this webscript.");
+ "action " + action + " is not supported by this webscript.");
}
return model;
diff --git a/source/java/org/alfresco/repo/web/scripts/invite/InviteServiceTest.java b/source/java/org/alfresco/repo/web/scripts/invite/InviteServiceTest.java
index 4b53d1d53b..a878ee880d 100644
--- a/source/java/org/alfresco/repo/web/scripts/invite/InviteServiceTest.java
+++ b/source/java/org/alfresco/repo/web/scripts/invite/InviteServiceTest.java
@@ -501,7 +501,7 @@ public class InviteServiceTest extends BaseWebScriptTest
String inviteeUserName = result.getString("inviteeUserName");
// Invitee accepts invitation to a Site from Inviter
- String acceptInviteUrl = URL_INVITE_SERVICE + "/" + inviteId + "/" + inviteTicket;
+ String acceptInviteUrl = URL_INVITE_SERVICE + "/" + inviteId + "/" + inviteTicket + "/accept";
MockHttpServletResponse response = putRequest(acceptInviteUrl,
Status.STATUS_OK, null, null);
@@ -535,9 +535,9 @@ public class InviteServiceTest extends BaseWebScriptTest
String inviteeUserName = result.getString("inviteeUserName");
// Invitee rejects invitation to a Site from Inviter
- String rejectInviteUrl = URL_INVITE_SERVICE + "/" + inviteId + "/" + inviteTicket;
- MockHttpServletResponse response = deleteRequest(rejectInviteUrl,
- Status.STATUS_OK);
+ String rejectInviteUrl = URL_INVITE_SERVICE + "/" + inviteId + "/" + inviteTicket + "/reject";
+ MockHttpServletResponse response = putRequest(rejectInviteUrl,
+ Status.STATUS_OK, null, null);
//
// test that invite represented by invite ID (of invitation started