public class ToolUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PORTAL_INLINE_EXPERIMENTAL |
static boolean |
PORTAL_INLINE_EXPERIMENTAL_DEFAULT |
| Constructor and Description |
|---|
ToolUtils() |
| Modifier and Type | Method and Description |
|---|---|
static SitePage |
getPageForTool(Site site,
String toolId)
Look through the pages in a site and find the page that corresponds to a tool.
|
static String |
getPageUrl(HttpServletRequest req,
Site site,
SitePage page)
Captures the rules for getting the URL of a page suitable for a GET request
|
static String |
getPageUrl(HttpServletRequest req,
Site site,
SitePage page,
String portalPrefix)
Captures the rules for getting the URL of a page suitable for a GET request
|
static String |
getPageUrl(HttpServletRequest req,
Site site,
SitePage page,
String portalPrefix,
boolean reset,
String effectiveSiteId,
String pageAlias)
Captures the rules for getting the URL of a page suitable for a GET request
|
static String |
getPageUrl(Site site,
SitePage page)
Captures the rules for getting the URL of a page suitable for a GET request (call only from the tool)
|
static String |
getPageUrlForTool(HttpServletRequest req,
Site site,
ToolConfiguration pageTool)
Look through the pages in a site and get the page URL for a tool.
|
static HttpServletRequest |
getRequestFromThreadLocal()
Get the servlet request from thread local - call only after RequestFilter has run
|
static String |
getRequestParameter(String key)
Retriece a request parameter from ThreadLocal (only works after RequestFilter runs)
|
static String |
getToolBaseUrl()
Get the base URL for tools not including the ToolId (only works in tools)
|
static String |
getToolBaseUrl(HttpServletRequest req)
Get the base URL for tools not including the ToolId
|
static String |
getToolBorderlessBaseUrl()
Get the base URL for tools with no "border" - (i.e. within an iframe)
|
static String |
getToolPopupUrl(ToolConfiguration pageTool)
Captures the rules for the various tools and when they want a popup
|
static boolean |
isInlineRequest(HttpServletRequest req)
Determine if this is an inline request.
|
static boolean |
isPortletPlacement(Placement placement)
Determine if a particular placement is a JSR-168 portlet placement
|
public static final String PORTAL_INLINE_EXPERIMENTAL
public static final boolean PORTAL_INLINE_EXPERIMENTAL_DEFAULT
public static boolean isInlineRequest(HttpServletRequest req)
req - The request object. If you have no access to the request object,
you can leave this null and we will try to pull the request
from ThreadLocal - if we fail it is a RunTime exception.public static String getPageUrl(Site site, SitePage page)
site - The site that contains the pagepage - The page URL. If this has a logged in session, we use it to set the
default prefix if available. This will use the default prefix if called
without a session (i.e. through /direct).public static String getPageUrl(HttpServletRequest req, Site site, SitePage page)
req - The request object. If you have no access to the request object,
you can leave this null and we will try to pull the request
from ThreadLocal - if we fail it is a RunTime exception.site - The site that contains the pagepage - The page URL. If this has a logged in session, we use it to set the
default prefix if available. This will use the default prefix if called
without a session (i.e. through /direct).public static String getPageUrl(HttpServletRequest req, Site site, SitePage page, String portalPrefix)
req - The request object.site - The site that contains the pagepage - The pageportalPrefix - The controlling portal. Typically "site". No slashes should be includedpublic static String getPageUrl(HttpServletRequest req, Site site, SitePage page, String portalPrefix, boolean reset, String effectiveSiteId, String pageAlias)
req - The request object. If you have no access to the request object,
you can leave this null and we will try to pull the request
from ThreadLocal - if we fail it is a RunTime exception.site - The site that contains the pagepage - The pageportalPrefix - The controlling portal. Typically "site". No slashes should be includedreset - Should we reset the tool as part of this GET reference (typically true)effectiveSiteId - The effective site IDpageAlias - The alias for the page (typically null)public static String getToolPopupUrl(ToolConfiguration pageTool)
pageTool - The tools configuration object.public static SitePage getPageForTool(Site site, String toolId)
site - The sitetoolId - The placement / tool IDpublic static String getPageUrlForTool(HttpServletRequest req, Site site, ToolConfiguration pageTool)
req - The request object. If you have no access to the request object,
you can leave this null and we will try to pull the request
from ThreadLocal - if we fail it is a RunTime exception.site - The sitepageTool - The placement / tool configurationpublic static boolean isPortletPlacement(Placement placement)
placement - The actual placement.public static String getToolBorderlessBaseUrl()
public static String getToolBaseUrl()
public static String getToolBaseUrl(HttpServletRequest req)
req - The request object. If you have no access to the request object,
you can leave this null and we will try to pull the request
from ThreadLocal - if we fail it is a RunTime exception.public static HttpServletRequest getRequestFromThreadLocal()
Copyright © 2023. All rights reserved.