Skip to content

Commit

Permalink
chore(refactor)/formalize the association between portlet ActionURLs …
Browse files Browse the repository at this point in the history
…and HTTP POST
  • Loading branch information
drewwills committed May 2, 2018
1 parent 80a9a41 commit 2b0b1cd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping(value = "/**")
Expand Down Expand Up @@ -108,9 +109,14 @@ public void renderRequest(HttpServletRequest request, HttpServletResponse respon
}
}

@RequestMapping(headers = {"org.apereo.portal.url.UrlType=ACTION"})
/** HTTP POST required for security. */
@RequestMapping(
headers = {"org.apereo.portal.url.UrlType=ACTION"},
method = RequestMethod.POST
)
public void actionRequest(HttpServletRequest request, HttpServletResponse response)
throws IOException {

final IPortalRequestInfo portalRequestInfo =
this.urlSyntaxProvider.getPortalRequestInfo(request);
final IPortletRequestInfo portletRequestInfo =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface IPortalUrlProvider {
* @return The current portal action url builder, null if there is no portal action url builder
* for this requet
*/
public IPortalActionUrlBuilder getPortalActionUrlBuilder(HttpServletRequest request);
IPortalActionUrlBuilder getPortalActionUrlBuilder(HttpServletRequest request);

/**
* Converts a standard {@link IPortalUrlBuilder} to a {@link IPortalActionUrlBuilder}
Expand All @@ -33,7 +33,7 @@ public interface IPortalUrlProvider {
* @param portalUrlBuilder The url builder to convert
* @return A portal action url builder
*/
public IPortalActionUrlBuilder convertToPortalActionUrlBuilder(
IPortalActionUrlBuilder convertToPortalActionUrlBuilder(
HttpServletRequest request, IPortalUrlBuilder portalUrlBuilder);

/**
Expand All @@ -43,7 +43,7 @@ public IPortalActionUrlBuilder convertToPortalActionUrlBuilder(
* @param request The current portal request
* @return Default {@link IPortalUrlBuilder}
*/
public IPortalUrlBuilder getDefaultUrl(HttpServletRequest request);
IPortalUrlBuilder getDefaultUrl(HttpServletRequest request);

/**
* Get a portal URL builder that targets the specified layout node.
Expand All @@ -55,13 +55,9 @@ public IPortalActionUrlBuilder convertToPortalActionUrlBuilder(
* @throws IllegalArgumentException If the specified ID doesn't exist for a folder in the users
* layout.
*/
public IPortalUrlBuilder getPortalUrlBuilderByLayoutNode(
IPortalUrlBuilder getPortalUrlBuilderByLayoutNode(
HttpServletRequest request, String layoutNodeId, UrlType urlType);

// Not implemented until all folders have fnames?
// public IPortalUrlBuilder getPortalUrlBuilderByLayoutFName(HttpServletRequest request, String
// folderFname, UrlType urlType);

/**
* Get a portal URL builder that targets the specified portlet window.
*
Expand All @@ -72,7 +68,7 @@ public IPortalUrlBuilder getPortalUrlBuilderByLayoutNode(
* @throws IllegalArgumentException If the specified ID doesn't exist for a folder in the users
* layout.
*/
public IPortalUrlBuilder getPortalUrlBuilderByPortletWindow(
IPortalUrlBuilder getPortalUrlBuilderByPortletWindow(
HttpServletRequest request, IPortletWindowId portletWindowId, UrlType urlType);

/**
Expand All @@ -85,6 +81,6 @@ public IPortalUrlBuilder getPortalUrlBuilderByPortletWindow(
* @throws IllegalArgumentException If the specified ID doesn't exist for a folder in the users
* layout.
*/
public IPortalUrlBuilder getPortalUrlBuilderByPortletFName(
IPortalUrlBuilder getPortalUrlBuilderByPortletFName(
HttpServletRequest request, String portletFName, UrlType urlType);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.OutputKeys;
Expand Down Expand Up @@ -61,8 +60,7 @@ public void setPipeline(CharacterPipelineComponent pipeline) {
}

@Override
public void renderState(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
public void renderState(HttpServletRequest req, HttpServletResponse res) throws IOException {
// Disable page caching
res.setHeader("pragma", "no-cache");
res.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate");
Expand Down

0 comments on commit 2b0b1cd

Please sign in to comment.