Skip to content

Commit

Permalink
url improved
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed Apr 27, 2016
1 parent a6e3a60 commit 97dd1f9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/impl/java/org/wyona/yanel/impl/workflow/EmailAction.java
Expand Up @@ -115,6 +115,19 @@ protected String getSubject(WorkflowableV1 workflowable, Workflow workflow, Stri
*/
protected String getText(WorkflowableV1 workflowable, Workflow workflow, String revision) throws WorkflowException {
Resource resource = (Resource) workflowable;
return "Please review the workflow state change of the resource: " + resource.getPath();
String url = removeQueryString(org.wyona.yanel.servlet.Utils.getRequestURLQS(resource.getRealm(), resource.getEnvironment().getRequest(), resource.getPath(), false));
return "Please review the workflow state change of the resource: " + url;
}

/**
* @url URL which might contain a query string, e.g. 'http://127.0.0.1:8080/yanel/test/index.html?param=value'
* @return URL without query string, e.g. 'http://127.0.0.1:8080/yanel/test/index.html'
*/
private static String removeQueryString(String url) {
if (url.indexOf("?") > 0) {
return url.substring(0, url.indexOf("?"));
} else {
return url;
}
}
}

0 comments on commit 97dd1f9

Please sign in to comment.