Skip to content

Commit

Permalink
UP-5013: Several admin tools (framework portlets) return HTTP 405, Me…
Browse files Browse the repository at this point in the history
…thod Not Allowed
  • Loading branch information
drewwills committed May 11, 2018
1 parent 895c0cb commit 5708818
Show file tree
Hide file tree
Showing 37 changed files with 393 additions and 306 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import java.util.Map;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.webflow.execution.FlowExecutionOutcome;
import org.springframework.webflow.mvc.portlet.AbstractFlowHandler;

Expand All @@ -28,7 +28,7 @@
* flows that require different handling on different outcomes.
*/
public class MultiOutcomeParamaterizableFlowHandler extends AbstractFlowHandler {
protected final Log logger = LogFactory.getLog(this.getClass());
protected final Logger logger = LoggerFactory.getLogger(getClass());

private String flowId = "view";
private Map<String, String> redirectOnEnds;
Expand All @@ -37,7 +37,8 @@ public class MultiOutcomeParamaterizableFlowHandler extends AbstractFlowHandler
public Map<String, String> getRedirectOnEnds() {
return this.redirectOnEnds;
}
/** @param redirectOnEnd The location to redirect to at the end of the flow */

/** @param redirectOnEnds The locations to redirect to at the end of the flow */
public void setRedirectOnEnds(Map<String, String> redirectOnEnds) {
this.redirectOnEnds = redirectOnEnds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
--%>
<%@ include file="/WEB-INF/jsp/include.jsp"%>

<portlet:actionURL var="newSearchUrl">
<portlet:renderURL var="newSearchUrl">
<portlet:param name="execution" value="${flowExecutionKey}" />
<portlet:param name="_eventId" value="personLookup" />
</portlet:actionURL>
</portlet:renderURL>
<portlet:actionURL var="attributeSwapUrl">
<portlet:param name="execution" value="${flowExecutionKey}" />
</portlet:actionURL>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
--%>
<%@ include file="/WEB-INF/jsp/include.jsp" %>

<portlet:actionURL var="flushAllUrl">
<portlet:renderURL var="flushAllUrl">
<portlet:param name="execution" value="${flowExecutionKey}" />
<portlet:param name="_eventId" value="flush-all"/>
</portlet:actionURL>
</portlet:renderURL>

<!-- Portlet -->
<div class="fl-widget portlet cache-mgr view-list" role="section">
Expand All @@ -35,7 +35,7 @@
<a class="button btn btn-primary" href="${flushAllUrl}"><span><spring:message code="empty.all.caches" />&nbsp;&nbsp;<i class="fa fa-refresh"></i></span></a>
</div>
</div> <!-- end: portlet-titlebar -->

<!-- Portlet Content -->
<div class="fl-widget-content content portlet-content" role="main">
<!-- Portlet Section -->
Expand All @@ -45,10 +45,10 @@
<spring:message code="available.caches"/>
</h3>
</div>

<div class="content">
<p class="note" role="note"><spring:message code="select.cache.to.view.stats.and.clear.content"/></p>

<table class="portlet-table table-hover cache-table table table-condensed table-striped">
<thead>
<tr>
Expand All @@ -61,27 +61,27 @@
<c:forEach items="${statisticsMap}" var="statisticsEntry">
<tr class="cache-member">
<td class="cache-name">
<portlet:actionURL var="viewStatsUrl">
<portlet:renderURL var="viewStatsUrl">
<portlet:param name="cacheName" value="${statisticsEntry.key}"/>
<portlet:param name="execution" value="${flowExecutionKey}" />
<portlet:param name="_eventId" value="view-statistics"/>
</portlet:actionURL>
</portlet:renderURL>
<a href="${viewStatsUrl}">${fn:escapeXml(statisticsEntry.key)}</a>
</td>
<td class="cache-used">
<span><fmt:formatNumber value="${statisticsEntry.value.usage}" pattern="00%" /> </span>
<span><fmt:formatNumber value="${statisticsEntry.value.usage}" pattern="00%" /> </span>
<small>(${fn:escapeXml(statisticsEntry.value.size)} / ${fn:escapeXml(statisticsEntry.value.maxSize)})</small>
</td>
<td class="cache-effectiveness">
<span><fmt:formatNumber value="${statisticsEntry.value.effectiveness}" pattern="00%" /> </span>
<small>(${fn:escapeXml(statisticsEntry.value.hits)} <spring:message code="hits"/>, ${fn:escapeXml(statisticsEntry.value.misses)} <spring:message code="misses"/>)</small>
</td>
<td class="cache-flush">
<portlet:actionURL var="flushUrl">
<portlet:renderURL var="flushUrl">
<portlet:param name="cacheName" value="${statisticsEntry.key}"/>
<portlet:param name="_eventId" value="flush"/>
<portlet:param name="execution" value="${flowExecutionKey}" />
</portlet:actionURL>
</portlet:renderURL>
<a href="${flushUrl}"><spring:message code="flush"/></a>
</td>
</tr>
Expand All @@ -90,5 +90,5 @@
</div>
</div>
</div>
</div>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
--%>
<%@ include file="/WEB-INF/jsp/include.jsp" %>
<portlet:actionURL var="flushUrl">
<portlet:renderURL var="flushUrl">
<portlet:param name="_eventId" value="flush"/>
<portlet:param name="execution" value="${flowExecutionKey}" />
</portlet:actionURL>
<portlet:actionURL var="homeUrl">
</portlet:renderURL>
<portlet:renderURL var="homeUrl">
<portlet:param name="_eventId" value="cache-list"/>
<portlet:param name="execution" value="${flowExecutionKey}" />
</portlet:actionURL>
</portlet:renderURL>

<!-- Portlet -->
<div class="fl-widget portlet cache-mgr view-statistics" role="section">
<!-- Portlet Titlebar -->
Expand All @@ -37,8 +37,8 @@
</div> <!-- end: portlet-titlebar -->

<!-- Portlet Content -->
<div class="fl-widget-content content portlet-content" role="main">
<div class="fl-widget-content content portlet-content">

<table class="portlet-table table table-hover">
<thead>
<tr><th><spring:message code="cache.property"/></th><th><spring:message code="value"/></th></tr>
Expand Down Expand Up @@ -73,7 +73,7 @@
</tr>
</tbody>
</table>

</div>
</div>

Expand All @@ -82,7 +82,7 @@
<a class="button btn primary" href="${ flushUrl }"><spring:message code="empty.cache"/></a>
<a class="button btn" href="${ homeUrl }"><spring:message code="cancel"/></a>
</div>

</div>
</div>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
<spring:message code="create.new.user"/>
</c:when>
<c:otherwise>
<portlet:actionURL var="userUrl">
<portlet:renderURL var="userUrl">
<portlet:param name="execution" value="${flowExecutionKey}" />
<portlet:param name="_eventId" value="finish"/>
</portlet:actionURL>
<a href="${ userUrl }">${ fn:escapeXml(accountForm.username )}</a> >
</portlet:renderURL>
<a href="${ userUrl }">${ fn:escapeXml(accountForm.username )}</a> &gt;
<spring:message code="edit.user"/>
</c:otherwise>
</c:choose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
<%@ include file="/WEB-INF/jsp/include.jsp" %>

<c:set var="n"><portlet:namespace/></c:set>
<portlet:actionURL var="groupUrl">
<portlet:renderURL var="groupUrl">
<portlet:param name="execution" value="${flowExecutionKey}" />
<portlet:param name="_eventId" value="group"/>
</portlet:actionURL>
</portlet:renderURL>

<portlet:actionURL var="editUrl" escapeXml="false">
<portlet:renderURL var="editUrl" escapeXml="false">
<portlet:param name="execution" value="${flowExecutionKey}" />
<portlet:param name="_eventId" value="editPermission"/>
<portlet:param name="owner" value="OWNER"/>
<portlet:param name="activity" value="ACTIVITY"/>
<portlet:param name="target" value="TARGET"/>
</portlet:actionURL>
</portlet:renderURL>

<style>
#${n}permissionBrowser .dataTables_filter, #${n}permissionBrowser .first.paginate_button, #${n}permissionBrowser .last.paginate_button{
Expand Down Expand Up @@ -108,7 +108,7 @@ PORTLET DEVELOPMENT STANDARDS AND GUIDELINES
<!-- Portlet Titlebar -->
<div class="fl-widget-titlebar portlet-titlebar" role="sectionhead">
<h2 class="title" role="heading">
<a href="${ groupUrl }">${ fn:escapeXml(group.name )}</a> >
<a href="${ groupUrl }">${ fn:escapeXml(group.name )}</a> >
<spring:message code="permissions"/>
</h2>
</div> <!-- end: portlet-titlebar -->
Expand Down Expand Up @@ -163,7 +163,7 @@ PORTLET DEVELOPMENT STANDARDS AND GUIDELINES
</div>
</div>
</div>
</div>
</div>
</div>
</div>

Expand Down Expand Up @@ -224,7 +224,7 @@ up.jQuery(function() {
}
// Created as its own
// Created as its own
var initializeTable = function(tableName) {
var config = null;
if (tableName == "principal") {
Expand All @@ -251,7 +251,7 @@ up.jQuery(function() {
},
aoColumns: [
{ mData: 'ownerName', sType: 'html', sWidth: '25%' }, // Owner
{ mData: 'principalName', sType: 'html', sWidth: '25%', bVisible: config.showPrincipal }, // Principal
{ mData: 'principalName', sType: 'html', sWidth: '25%', bVisible: config.showPrincipal }, // Principal
{ mData: 'activityName', sType: 'html', sWidth: '25%' }, // Activity
{ mData: 'targetName', sType: 'html', bSearchable: false, sWidth: '25%', bVisible: config.showTarget }, // Target
{ mData: 'targetName', sType: 'html', bSearchable: false, sWidth: '25%' } // Edit Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@

<c:set var="n"><portlet:namespace/></c:set>

<portlet:actionURL var="choosePrinicipalsUrl">
<portlet:renderURL var="choosePrinicipalsUrl">
<portlet:param name="execution" value="${flowExecutionKey}" />
<portlet:param name="_eventId" value="choosePrinicipals"/>
</portlet:actionURL>
<portlet:actionURL var="formUrl">
<portlet:param name="execution" value="${flowExecutionKey}" />
</portlet:actionURL>
</portlet:renderURL>

<!--
PORTLET DEVELOPMENT STANDARDS AND GUIDELINES
Expand Down Expand Up @@ -80,9 +77,9 @@ PORTLET DEVELOPMENT STANDARDS AND GUIDELINES
<form method="POST" id="${n}editPermissionForm" action="javascript:;">

<ul id="assignments"></ul>

</form>

</div> <!-- end: portlet-content -->

</div> <!-- end: portlet -->
Expand All @@ -97,13 +94,13 @@ up.jQuery(function() {
var inheritRegex = /INHERIT_/;
var addAssignments = function(assignments, list) {
$(assignments).each(function(idx, assignment) {
// determine the current select menu option
var type = assignment.type;
if (type.match(inheritRegex)) {
type = "INHERIT";
}
// determine the text for the inherit option
var inheritText;
if (assignment.type == 'INHERIT_GRANT') {
Expand All @@ -113,7 +110,7 @@ up.jQuery(function() {
} else {
inheritText = "<spring:message code="inherit"/>";
}
// build up the markup
var li = $(document.createElement("li"));
var span = $(document.createElement("span")).addClass("assignment-wrapper")
Expand All @@ -139,19 +136,19 @@ up.jQuery(function() {
});
};
var updatePermission = function(principal, type) {
$("#assignments").html("");
$.get(
"<c:url value="/api/updatePermission"/>",
{
"<c:url value="/api/updatePermission"/>",
{
principal: principal,
assignment: type,
owner: '${ owner.fname }',
activity: '${ activity.fname }',
target: '${ target.key }',
principals: principals
},
function(data) {
allAssignments = data.assignments;
Expand All @@ -160,11 +157,11 @@ up.jQuery(function() {
"json"
);
};
var renderPermissionMap = function() {
$("#assignments").html("");
$.get(
"<c:url value="/api/permissionAssignmentMap"/>",
"<c:url value="/api/permissionAssignmentMap"/>",
{
owner: '${ owner.fname }',
activity: '${ activity.fname }',
Expand All @@ -178,7 +175,7 @@ up.jQuery(function() {
"json"
);
};
$(document).ready(renderPermissionMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
</div>
<!--content-->
<div class="content">
<form action="${submitUrl}" method="post">
<form action="${submitUrl}" method="POST">
<div id="${n}selectionBasket" class="selection-basket">
<ul>
<c:choose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
--%>
<%@ include file="/WEB-INF/jsp/include.jsp"%>

<portlet:actionURL var="loginUrl">
<portlet:renderURL var="loginUrl">
<portlet:param name="execution" value="${flowExecutionKey}" />
<portlet:param name="_eventId" value="finish"/>
</portlet:actionURL>
</portlet:renderURL>
<c:set var="n"><portlet:namespace/></c:set>

<!-- Portlet -->
Expand All @@ -34,19 +34,19 @@
<h2 class="title" role="heading"><spring:message code="reset.email.sent"/></h2>
</div>

<div class="fl-widget-content content portlet-content" role="main" data-role="content">
<div class="fl-widget-content content portlet-content" data-role="content">

<!-- Portlet Section -->
<div class="portlet-section" role="region">

<div class="portlet-section-body">
<p><spring:message code="password.reset.instructions.have.been.sent.to.your.email.address"/></p>

<p><a href="${ loginUrl }"><spring:message code="return.to.log.in.form"/></a></p>
</div>

</div>

</div>

</div>
</div>
Loading

0 comments on commit 5708818

Please sign in to comment.